A HydroGraph with lazy loading behavior. More...
#include <LazyHydroGraph.h>
Public Member Functions | |
LazyHydroGraph () | |
Creates a new LazyHydroGraph. | |
virtual | ~LazyHydroGraph () |
Deletes this LazyHydroGraph. | |
virtual void | checkParams (int nodes, int curves, int areas, int curveExtremities, int curvePoints, int areaCurves, int subgraphs) |
Checks if the provided params count are correct for this graph. | |
virtual CurvePtr | newCurve (CurvePtr parent, bool setParent) |
Adds a curve to this graph. | |
virtual CurvePtr | newCurve (CurvePtr model, NodePtr start, NodePtr end) |
Adds a curve to this graph. | |
virtual Graph * | createChild () |
Returns a new HydroGraph. | |
virtual void | save (FileWriter *fileWriter, bool saveAreas=true) |
Saves this graph from a basic file. | |
virtual void | indexedSave (FileWriter *fileWriter, bool saveAreas=true) |
Saves this graph from an indexed file. | |
Protected Member Functions | |
virtual CurvePtr | loadCurve (long int offset, CurveId id) |
Loads the Curve corresponding to the given Id. |
A HydroGraph with lazy loading behavior.
See graph::LazyGraph and rivers::HydroGraph.
proland::LazyHydroGraph::LazyHydroGraph | ( | ) |
Creates a new LazyHydroGraph.
virtual proland::LazyHydroGraph::~LazyHydroGraph | ( | ) | [virtual] |
Deletes this LazyHydroGraph.
virtual void proland::LazyHydroGraph::checkParams | ( | int | nodes, | |
int | curves, | |||
int | areas, | |||
int | curveExtremities, | |||
int | curvePoints, | |||
int | areaCurves, | |||
int | subgraphs | |||
) | [virtual] |
Checks if the provided params count are correct for this graph.
A correct amount of parameters may depend on the graph it is used by. For Graph, the amounts must be respectively at least 2, 4, 3, 3, 5, 2, 0. Should be overwritten for graphs containing more data.
virtual Graph* proland::LazyHydroGraph::createChild | ( | ) | [virtual] |
Returns a new HydroGraph.
virtual void proland::LazyHydroGraph::indexedSave | ( | FileWriter * | fileWriter, | |
bool | saveAreas = true | |||
) | [virtual] |
Saves this graph from an indexed file.
Indexed files are used to load LazyGraphs faster. It contains the indexes of each element in the file.
fileWriter | the FileWriter used to save the file | |
saveAreas | if true, will save the subgraphs |
virtual CurvePtr proland::LazyHydroGraph::loadCurve | ( | long int | offset, | |
CurveId | id | |||
) | [protected, virtual] |
Loads the Curve corresponding to the given Id.
The Curve description will be fetched via fileReader at the offset given as parameter.
offset | the offset of this Curve in the file. | |
id | the id of this Curve. |
virtual CurvePtr proland::LazyHydroGraph::newCurve | ( | CurvePtr | model, | |
NodePtr | start, | |||
NodePtr | end | |||
) | [virtual] |
Adds a curve to this graph.
model | a model curve : the new curve will have the same vertices. | |
start | the start node. | |
end | the end node. |
virtual CurvePtr proland::LazyHydroGraph::newCurve | ( | CurvePtr | parent, | |
bool | setParent | |||
) | [virtual] |
Adds a curve to this graph.
parent | the parent curve (NULL if none). | |
setParent | if true, the new curve's parent will be set to the 'parent' parameter. |
virtual void proland::LazyHydroGraph::save | ( | FileWriter * | fileWriter, | |
bool | saveAreas = true | |||
) | [virtual] |
Saves this graph from a basic file.
fileWriter | the FileWriter used to save the file. | |
saveAreas | if true, will save the subgraphs. |