An Area is described by 1 or more curves. More...
#include <LazyArea.h>
Public Member Functions | |
LazyArea (Graph *owner, AreaId id) | |
Creates a new LazyArea. | |
virtual | ~LazyArea () |
Deletes this LazyArea. | |
virtual AreaId | getId () const |
Returns this area's Id. | |
virtual AreaPtr | getParent () const |
Returns the parent Area of this Area. | |
virtual CurvePtr | getCurve (int i) const |
Returns a curve. | |
virtual CurvePtr | getCurve (int i, int &orientation) const |
Returns a curve. | |
virtual int | getCurveCount () const |
Returns the number of curves forming this area. | |
virtual void | setOrientation (int i, int orientation) |
Sets orientation for a given curve. | |
virtual void | invertCurve (CurveId cid) |
Inverts a given curve in this area. | |
virtual void | addCurve (CurveId id, int orientation) |
Adds a curve to this area. | |
Protected Member Functions | |
virtual void | doRelease () |
Calls the LazyGraph::releaseArea() method. | |
Private Member Functions | |
virtual void | setParentId (AreaId id) |
Sets the parent Id. | |
virtual void | switchCurves (int curve1, int curve2) |
Switch 2 curves of this area. | |
virtual void | removeCurve (int index) |
Removes a curve from the curves list. | |
void | loadCurve (CurveId id, int orientation) |
Same as addCurve(), but doesn't notify the Owner Graph about a change. | |
Private Attributes | |
AreaId | parentId |
The parent Area's id. | |
vector< pair< CurveId, int > > | curveIds |
The list of the curves describing this area. |
An Area is described by 1 or more curves.
It may contain a subgraph. This is used to describe pastures, lakes... This is the 'Lazy' version of Areas. Allows real time loading for LazyGraphs. Can be deleted and reloaded at any time depending on the needs.
virtual proland::LazyArea::~LazyArea | ( | ) | [virtual] |
Deletes this LazyArea.
virtual void proland::LazyArea::addCurve | ( | CurveId | id, | |
int | orientation | |||
) | [virtual] |
Adds a curve to this area.
id | the added curve's Id. | |
orientation | the orientation to add the curve. |
Reimplemented from proland::Area.
virtual void proland::LazyArea::doRelease | ( | ) | [protected, virtual] |
Calls the LazyGraph::releaseArea() method.
See Object::doRelease().
virtual CurvePtr proland::LazyArea::getCurve | ( | int | i, | |
int & | orientation | |||
) | const [virtual] |
Returns a curve.
i | the rank of the curve to be returned. | |
orientation | will contain the orientation of the i'th curve in this area. |
Reimplemented from proland::Area.
virtual CurvePtr proland::LazyArea::getCurve | ( | int | i | ) | const [virtual] |
Returns a curve.
i | the rank of the curve to be returned. |
Reimplemented from proland::Area.
virtual int proland::LazyArea::getCurveCount | ( | ) | const [virtual] |
Returns the number of curves forming this area.
Reimplemented from proland::Area.
virtual AreaId proland::LazyArea::getId | ( | ) | const [virtual] |
Returns this area's Id.
For LazyArea, an AreaId is a unique number assigned by the owner Graph, (in opposition to Areas, for which Ids are a direct reference to the Area).
Reimplemented from proland::Area.
virtual AreaPtr proland::LazyArea::getParent | ( | ) | const [virtual] |
Returns the parent Area of this Area.
Should allways return NULL, because LazyGraph are only used on top of the graph, and thus have no parent.
Reimplemented from proland::Area.
virtual void proland::LazyArea::invertCurve | ( | CurveId | cid | ) | [virtual] |
Inverts a given curve in this area.
cid | the curveId of the curve to invert. |
Reimplemented from proland::Area.
void proland::LazyArea::loadCurve | ( | CurveId | id, | |
int | orientation | |||
) | [private] |
Same as addCurve(), but doesn't notify the Owner Graph about a change.
virtual void proland::LazyArea::removeCurve | ( | int | index | ) | [private, virtual] |
Removes a curve from the curves list.
the | index of the curve to remove. |
Reimplemented from proland::Area.
virtual void proland::LazyArea::setOrientation | ( | int | i, | |
int | orientation | |||
) | [virtual] |
Sets orientation for a given curve.
i | rank of the curve to modify. | |
orientation | the new orientation of the curve. |
Reimplemented from proland::Area.
virtual void proland::LazyArea::setParentId | ( | AreaId | id | ) | [private, virtual] |
Sets the parent Id.
See setParent().
id | the new parent's Id. |
Reimplemented from proland::Area.
virtual void proland::LazyArea::switchCurves | ( | int | curve1, | |
int | curve2 | |||
) | [private, virtual] |
Switch 2 curves of this area.
id1 | the first curve's id. | |
id2 | the second curve's id. |
Reimplemented from proland::Area.
vector< pair<CurveId, int> > proland::LazyArea::curveIds [private] |
The list of the curves describing this area.
AreaId proland::LazyArea::parentId [private] |
The parent Area's id.
If parentId == id, there's no parent.