proland::LazyHydroCurve Class Reference
[graph]

A HydroCurve with lazy loading behavior. More...

#include <LazyHydroCurve.h>

Inheritance diagram for proland::LazyHydroCurve:
proland::HydroCurve

List of all members.

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.

Detailed Description

A HydroCurve with lazy loading behavior.

See graph::LazyCurve and rivers::HydroCurve.

Author:
Antoine Begault

Constructor & Destructor Documentation

proland::LazyHydroCurve::LazyHydroCurve ( Graph *  owner,
CurveId  id 
)

Creates a new LazyHydroCurve.

Parameters:
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.

Parameters:
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.


Member Function Documentation

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).

Parameters:
a the id of the area to add.
virtual void proland::LazyHydroCurve::addVertex ( const Vertex &  pt  )  [virtual]

Adds a vertex to the curve.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
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).

Parameters:
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.

Parameters:
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.

Parameters:
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.

Parameters:
a the id of the area to remove.
virtual void proland::LazyHydroCurve::removeVertex ( int  i  )  [virtual]

Remove the i'th vertex from the list.

Parameters:
i the rank of the vertex to remove.
virtual void proland::LazyHydroCurve::setIsControl ( int  i,
bool  c 
) [virtual]

Sets the state of a Vertex.

Parameters:
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().

Parameters:
id a curve's Id.
virtual void proland::LazyHydroCurve::setS ( int  i,
float  s 
) [virtual]

Changes the S coordinate of a Vertex.

Parameters:
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.

Parameters:
type type of the curve.
virtual void proland::LazyHydroCurve::setWidth ( float  width  )  [virtual]

Sets this curve's width.

Parameters:
width width of the curve.
virtual void proland::LazyHydroCurve::setXY ( int  i,
const vec2d &  p 
) [virtual]

Sets the XY coords of a vertex.

Parameters:
i the rank of the vertex to move.
p the new positions.

Member Data Documentation

The end NodeId.

The parent Area's id.

If parentId == id, there's no parent.

The start NodeId.


Generated on Sat May 12 09:42:58 2012 for proland by  doxygen 1.6.1