proland::LazyHydroGraph Class Reference
[graph]

A HydroGraph with lazy loading behavior. More...

#include <LazyHydroGraph.h>

List of all members.

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.

Detailed Description

A HydroGraph with lazy loading behavior.

See graph::LazyGraph and rivers::HydroGraph.

Author:
Antoine Begault

Constructor & Destructor Documentation

proland::LazyHydroGraph::LazyHydroGraph (  ) 

Creates a new LazyHydroGraph.

virtual proland::LazyHydroGraph::~LazyHydroGraph (  )  [virtual]

Deletes this LazyHydroGraph.


Member Function Documentation

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.

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

Parameters:
offset the offset of this Curve in the file.
id the id of this Curve.
Returns:
the loaded Curve.
virtual CurvePtr proland::LazyHydroGraph::newCurve ( CurvePtr  model,
NodePtr  start,
NodePtr  end 
) [virtual]

Adds a curve to this graph.

Parameters:
model a model curve : the new curve will have the same vertices.
start the start node.
end the end node.
Returns:
the new curve.
virtual CurvePtr proland::LazyHydroGraph::newCurve ( CurvePtr  parent,
bool  setParent 
) [virtual]

Adds a curve to this graph.

Parameters:
parent the parent curve (NULL if none).
setParent if true, the new curve's parent will be set to the 'parent' parameter.
Returns:
the new curve.
virtual void proland::LazyHydroGraph::save ( FileWriter *  fileWriter,
bool  saveAreas = true 
) [virtual]

Saves this graph from a basic file.

Parameters:
fileWriter the FileWriter used to save the file.
saveAreas if true, will save the subgraphs.

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