proland::CurveDataFactory Class Reference
[producer]

CurveData Factory. More...

#include <CurveDataFactory.h>

Inheritance diagram for proland::CurveDataFactory:
proland::GraphListener proland::ElevationGraphLayer proland::RoadOrthoLayer proland::RoadElevationLayer proland::WaterElevationLayer

List of all members.

Public Member Functions

 CurveDataFactory ()
 Creates a new CurveDataFactory.
 CurveDataFactory (ptr< TileProducer > producer)
 Creates a new CurveDataFactory.
virtual ~CurveDataFactory ()
 Deletes this CurveDataFactory.
virtual CurveDatanewCurveData (CurveId id, CurvePtr flattenCurve)
 Returns a new CurveData, whose type depends on the class that implements CurveDataFactory.
virtual void graphChanged ()
 See GraphListener::graphChanged().
CurveDatagetCurveData (CurvePtr c)
 Returns the CurveData corresponding to the given Curve.
void putCurveData (CurveId id)
 Releases the CurveData corresponding to the given CurveId.
CurveDatafindCurveData (CurvePtr c)
 Returns the CurveData corresponding to the given Curve.
void releaseCurveData (int level, int tx, int ty)
 Releases every used CurveData corresponding to a given tile.
void addUsedCurveDatas (int level, int tx, int ty, set< CurveId > curveDatas)
 Adds a list of Curves used by a tile of this factory.
void clear ()
 Deletes every CurveData.

Protected Member Functions

void init (ptr< TileProducer > producer)
 Initializes CurveDataFactory fields.

Protected Attributes

ptr< TileProducer > producer
 The GraphProducer used to generate Curves and their flattened version.
map< CurveId, CurveData * > curveDatas
 List of every CurveData and their associated CurveId.
map< CurveData *, int > usedDataCount
 Reference count for each CurveData.
map< TileCache::Tile::Id, set
< CurveId > > 
usedDatas
 Maps every tile to the CurveDatas it uses.

Detailed Description

CurveData Factory.

Handles creation, access and destruction of CurveDatas, and allows to instantiate different types of CurveData.

Author:
Antoine Begault

Constructor & Destructor Documentation

proland::CurveDataFactory::CurveDataFactory (  ) 

Creates a new CurveDataFactory.

proland::CurveDataFactory::CurveDataFactory ( ptr< TileProducer >  producer  ) 

Creates a new CurveDataFactory.

Parameters:
producer the GraphProducer used to generate Curves and their flattened version.
virtual proland::CurveDataFactory::~CurveDataFactory (  )  [virtual]

Deletes this CurveDataFactory.


Member Function Documentation

void proland::CurveDataFactory::addUsedCurveDatas ( int  level,
int  tx,
int  ty,
set< CurveId curveDatas 
)

Adds a list of Curves used by a tile of this factory.

They will require a call to releaseCurveData.

Parameters:
level level of the Tile.
x x coordinate of the Tile.
y y coordinate of the Tile.
curveDatas list of Ids corresponding to the used CurveData.
void proland::CurveDataFactory::clear (  ) 

Deletes every CurveData.

CurveData* proland::CurveDataFactory::findCurveData ( CurvePtr  c  ) 

Returns the CurveData corresponding to the given Curve.

Doesn't change the reference count.

Parameters:
c a Curve.
CurveData* proland::CurveDataFactory::getCurveData ( CurvePtr  c  ) 

Returns the CurveData corresponding to the given Curve.

Handles a count of references.

Parameters:
c a Curve.
virtual void proland::CurveDataFactory::graphChanged (  )  [virtual]
void proland::CurveDataFactory::init ( ptr< TileProducer >  producer  )  [protected]

Initializes CurveDataFactory fields.

Parameters:
producer the GraphProducer used to generate Curves and their flattened version.
virtual CurveData* proland::CurveDataFactory::newCurveData ( CurveId  id,
CurvePtr  flattenCurve 
) [virtual]

Returns a new CurveData, whose type depends on the class that implements CurveDataFactory.

Parameters:
id the CurveId of the described Curve.
flattenCurve flattened version of the described Curve.

Reimplemented in proland::RoadElevationLayer, and proland::WaterElevationLayer.

void proland::CurveDataFactory::putCurveData ( CurveId  id  ) 

Releases the CurveData corresponding to the given CurveId.

The reference count is decreased, and if it is equal to zero, the CurveData is deleted. It will then call GraphProducer::putFlattenCurve().

Parameters:
id the CurveId of an existing CurveData.
void proland::CurveDataFactory::releaseCurveData ( int  level,
int  tx,
int  ty 
)

Releases every used CurveData corresponding to a given tile.

Parameters:
level level of the Tile.
x x coordinate of the Tile.
y y coordinate of the Tile.

Member Data Documentation

List of every CurveData and their associated CurveId.

ptr<TileProducer> proland::CurveDataFactory::producer [protected]

The GraphProducer used to generate Curves and their flattened version.

Reference count for each CurveData.

map<TileCache::Tile::Id, set<CurveId> > proland::CurveDataFactory::usedDatas [protected]

Maps every tile to the CurveDatas it uses.


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