A HydroCurve with lazy loading behavior. More...
#include <LazyHydroCurve.h>
Public Member Functions | |
LazyHydroCurve (Graph *owner, CurveId id) | |
Creates a new LazyHydroCurve. | |
LazyHydroCurve (Graph *owner, CurveId id, NodeId s, NodeId e) | |
Creates a new LazyHydroCurve. | |
virtual | ~LazyHydroCurve () |
Deletes this LazyHydroCurve. | |
virtual CurveId | getId () const |
Returns this curve's Id For LazyHydroCurve, a CurveId is a unique number, assigned by the owner Graph, (in opposition to Curves, for which Ids are a direct reference to the Curve). | |
virtual CurvePtr | getParent () const |
Returns this curve's parent. | |
virtual NodePtr | getStart () const |
Returns the starting Node. | |
virtual NodePtr | getEnd () const |
Returns the ending Node. | |
virtual void | addVertex (NodeId id, bool isEnd=1) |
Adds a vertex to the curve. | |
virtual void | loadVertex (NodeId id, bool isEnd=1) |
Adds a vertex to the curve. | |
virtual void | addVertex (float x, float y, float s, bool isControl) |
Adds a vertex to the curve. | |
virtual void | addVertex (vec2d pt, int rank, bool isControl) |
Adds a vertex to the curve. | |
virtual void | addVertex (const vec2d &p, float s, float l, bool isControl) |
Adds a vertex to the curve. | |
virtual void | addVertex (const Vertex &pt) |
Adds a vertex to the curve. | |
virtual void | addVertices (const vector< vec2d > &v) |
Adds a list of vertex to the curve. | |
virtual void | removeVertex (int i) |
Remove the i'th vertex from the list. | |
virtual void | setIsControl (int i, bool c) |
Sets the state of a Vertex. | |
virtual void | setS (int i, float s) |
Changes the S coordinate of a Vertex. | |
virtual void | setXY (int i, const vec2d &p) |
Sets the XY coords of a vertex. | |
virtual void | setWidth (float width) |
Sets this curve's width. | |
virtual void | setType (int type) |
Sets this curve's type. | |
void | loadVertex (float x, float y, float s, bool isControl) |
Adds a vertex to the curve. | |
virtual void | clear () |
Removes the references to this curve from its nodes. | |
virtual void | invert () |
Changes the orientation of this curve. | |
virtual void | addArea (AreaId a) |
Adds an area to the curve. | |
void | loadArea (AreaId a) |
Adds an area to the curve. | |
Protected Member Functions | |
virtual void | doRelease () |
Calls the LazyGraph::releaseCurve() method. | |
Private Member Functions | |
virtual void | removeArea (AreaId a) |
Removes an area from the curve. | |
virtual void | setParentId (CurveId id) |
Sets the parent Id. | |
Private Attributes | |
CurveId | parentId |
The parent Area's id. | |
NodeId | startId |
The start NodeId. | |
NodeId | endId |
The end NodeId. |
A HydroCurve with lazy loading behavior.
See graph::LazyCurve and rivers::HydroCurve.
proland::LazyHydroCurve::LazyHydroCurve | ( | Graph * | owner, | |
CurveId | id | |||
) |
Creates a new LazyHydroCurve.
owner | the graph containing this curve. | |
id | this curve's id (determined by LazyGraph). |
proland::LazyHydroCurve::LazyHydroCurve | ( | Graph * | owner, | |
CurveId | id, | |||
NodeId | s, | |||
NodeId | e | |||
) |
Creates a new LazyHydroCurve.
owner | the graph containing this curve. | |
c | the parent curve, from which this curve was clipped. | |
s | the start node. | |
e | the end node. |
virtual proland::LazyHydroCurve::~LazyHydroCurve | ( | ) | [virtual] |
Deletes this LazyHydroCurve.
virtual void proland::LazyHydroCurve::addArea | ( | AreaId | a | ) | [virtual] |
Adds an area to the curve.
2 Areas can be stored (one for each side of the curve).
a | the id of the area to add. |
virtual void proland::LazyHydroCurve::addVertex | ( | const Vertex & | pt | ) | [virtual] |
Adds a vertex to the curve.
pt | a model Vertex, from which the values will be copied. |
virtual void proland::LazyHydroCurve::addVertex | ( | const vec2d & | p, | |
float | s, | |||
float | l, | |||
bool | isControl | |||
) | [virtual] |
Adds a vertex to the curve.
p | a vector containing the x&y coordinates of the vertex. | |
s | the s coordinate. | |
l | the l coordinate. | |
isControl | if true, the vertex will be a control point of this curve. |
virtual void proland::LazyHydroCurve::addVertex | ( | vec2d | pt, | |
int | rank, | |||
bool | isControl | |||
) | [virtual] |
Adds a vertex to the curve.
rank | where to insert the Vertex. | |
x | Xcoord. | |
y | Ycoord. | |
s | pseudo curvilinear value. | |
isControl | if true, the vertex will be a control point of this curve. |
virtual void proland::LazyHydroCurve::addVertex | ( | float | x, | |
float | y, | |||
float | s, | |||
bool | isControl | |||
) | [virtual] |
Adds a vertex to the curve.
x | Xcoord. | |
y | Ycoord. | |
s | pseudo curvilinear value. | |
isControl | if true, the vertex will be a control point of this curve. |
virtual void proland::LazyHydroCurve::addVertex | ( | NodeId | id, | |
bool | isEnd = 1 | |||
) | [virtual] |
Adds a vertex to the curve.
id | a NodeId. Will be stored in start if start == NULL, else in end. | |
isEnd | determines if the node is the end node. if false, it will change this->start; if true && start != NULL, this->end. Default is true. |
virtual void proland::LazyHydroCurve::addVertices | ( | const vector< vec2d > & | v | ) | [virtual] |
Adds a list of vertex to the curve.
v | the list of vertices. |
virtual void proland::LazyHydroCurve::clear | ( | ) | [virtual] |
Removes the references to this curve from its nodes.
virtual void proland::LazyHydroCurve::doRelease | ( | ) | [protected, virtual] |
Calls the LazyGraph::releaseCurve() method.
See Object::doRelease().
virtual NodePtr proland::LazyHydroCurve::getEnd | ( | ) | const [virtual] |
Returns the ending Node.
virtual CurveId proland::LazyHydroCurve::getId | ( | ) | const [virtual] |
Returns this curve's Id For LazyHydroCurve, a CurveId is a unique number, assigned by the owner Graph, (in opposition to Curves, for which Ids are a direct reference to the Curve).
virtual CurvePtr proland::LazyHydroCurve::getParent | ( | ) | const [virtual] |
Returns this curve's parent.
Should allways return NULL, because LazyGraph are only used on top of the graph, and thus have no parent.
virtual NodePtr proland::LazyHydroCurve::getStart | ( | ) | const [virtual] |
Returns the starting Node.
virtual void proland::LazyHydroCurve::invert | ( | ) | [virtual] |
Changes the orientation of this curve.
void proland::LazyHydroCurve::loadArea | ( | AreaId | a | ) |
Adds an area to the curve.
2 Areas can be stored (one for each side of the curve).
a | the id of the area to add. |
void proland::LazyHydroCurve::loadVertex | ( | float | x, | |
float | y, | |||
float | s, | |||
bool | isControl | |||
) |
Adds a vertex to the curve.
x | Xcoord. | |
y | Ycoord. | |
s | pseudo curvilinear value. | |
isControl | if true, the vertex will be a control point of this curve. |
virtual void proland::LazyHydroCurve::loadVertex | ( | NodeId | id, | |
bool | isEnd = 1 | |||
) | [virtual] |
Adds a vertex to the curve.
id | a NodeId. Will be stored in start if start == NULL, else in end. | |
isEnd | determines if the node is the end node. if false, it will change this->start; if true && start != NULL, this->end. Default is true. |
virtual void proland::LazyHydroCurve::removeArea | ( | AreaId | a | ) | [private, virtual] |
Removes an area from the curve.
a | the id of the area to remove. |
virtual void proland::LazyHydroCurve::removeVertex | ( | int | i | ) | [virtual] |
Remove the i'th vertex from the list.
i | the rank of the vertex to remove. |
virtual void proland::LazyHydroCurve::setIsControl | ( | int | i, | |
bool | c | |||
) | [virtual] |
Sets the state of a Vertex.
i | the rank of the vertex to change. | |
c | whether the vertex must be a control point or not. |
virtual void proland::LazyHydroCurve::setParentId | ( | CurveId | id | ) | [private, virtual] |
Sets the parent Id.
See setParent().
id | a curve's Id. |
virtual void proland::LazyHydroCurve::setS | ( | int | i, | |
float | s | |||
) | [virtual] |
Changes the S coordinate of a Vertex.
i | the rank of the vertex to edit. | |
s | the new S coordinate. |
virtual void proland::LazyHydroCurve::setType | ( | int | type | ) | [virtual] |
Sets this curve's type.
type | type of the curve. |
virtual void proland::LazyHydroCurve::setWidth | ( | float | width | ) | [virtual] |
Sets this curve's width.
width | width of the curve. |
virtual void proland::LazyHydroCurve::setXY | ( | int | i, | |
const vec2d & | p | |||
) | [virtual] |
Sets the XY coords of a vertex.
i | the rank of the vertex to move. | |
p | the new positions. |
NodeId proland::LazyHydroCurve::endId [private] |
The end NodeId.
CurveId proland::LazyHydroCurve::parentId [private] |
The parent Area's id.
If parentId == id, there's no parent.
NodeId proland::LazyHydroCurve::startId [private] |
The start NodeId.