# Home    # nevrax.com   
Nevrax
Nevrax.org
#News
#Mailing-list
#Documentation
#CVS
#Bugs
#License
Docs
 
Documentation  
Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages   Search  

NL3D::CWaterPoolManager Class Reference

This class helps managing various waters pools. More...

#include <water_pool_manager.h>

List of all members.

Public Methods

CWaterHeightMapcreateWaterPool (const CWaterHeightMapBuild &params=CWaterHeightMapBuild())
 create a water pool with the given id and the given parameters. If the pool existed before, its parameter are reset. More...

CWaterHeightMapgetPoolByID (uint32 ID)
 Get a water pool by its ID. If the ID doesn't exist, a new pool is created with default parameters. More...

bool hasPool (uint32 ID) const
 test wether a pool of the given ID exists. More...

void removePool (uint32 ID)
 remove the pool of the given ID. More...

uint getNumPools () const
 Get the number of pools. More...

uint getPoolID (uint i) const
 get the id of the i-th pool (O(n) lookup). More...

void reset ()
 delete all heightmaps. More...

 ~CWaterPoolManager ()
void setBlendFactor (IDriver *drv, float factor)
 Set a blend factor for all pool (more precisely, all models based on a water shape) that have a blend texture for their envmap (to have cycle between night and day for example). More...

void serial (NLMISC::IStream &f) throw (NLMISC::EStream)
 serial the pools data's. More...


Private Types

typedef std::map< uint32,
CWaterHeightMap * > 
TPoolMap
typedef std::vector< CWaterShape * > TWaterShapeVect

Private Methods

 CWaterPoolManager ()
void registerWaterShape (CWaterShape *shape)
 register a water height map. The water height map will be notified when a setBlend is applied. More...

void unRegisterWaterShape (CWaterShape *shape)
bool isWaterShapeObserver (const CWaterShape *shape) const

Private Attributes

TPoolMap _PoolMap
TWaterShapeVect _WaterShapes

Friends

class CWaterShape
CWaterPoolManager & GetWaterPoolManager ()


Detailed Description

This class helps managing various waters pools.

Author:
Nicolas Vizerie , Nevrax France
Date:
2001

Definition at line 48 of file water_pool_manager.h.


Member Typedef Documentation

typedef std::map<uint32, CWaterHeightMap *> NL3D::CWaterPoolManager::TPoolMap [private]
 

Definition at line 106 of file water_pool_manager.h.

typedef std::vector<CWaterShape *> NL3D::CWaterPoolManager::TWaterShapeVect [private]
 

Definition at line 113 of file water_pool_manager.h.


Constructor & Destructor Documentation

NL3D::CWaterPoolManager::~CWaterPoolManager   [inline]
 

Definition at line 92 of file water_pool_manager.h.

References reset.

NL3D::CWaterPoolManager::CWaterPoolManager   [inline, private]
 

Definition at line 105 of file water_pool_manager.h.


Member Function Documentation

CWaterHeightMap * NL3D::CWaterPoolManager::createWaterPool const CWaterHeightMapBuild   params = CWaterHeightMapBuild()
 

create a water pool with the given id and the given parameters. If the pool existed before, its parameter are reset.

Definition at line 93 of file water_pool_manager.cpp.

References _PoolMap, and params.

Referenced by getPoolByID.

uint NL3D::CWaterPoolManager::getNumPools   const
 

Get the number of pools.

Definition at line 178 of file water_pool_manager.cpp.

References _PoolMap.

Referenced by getPoolID.

CWaterHeightMap & NL3D::CWaterPoolManager::getPoolByID uint32    ID
 

Get a water pool by its ID. If the ID doesn't exist, a new pool is created with default parameters.

Definition at line 109 of file water_pool_manager.cpp.

References _PoolMap, and createWaterPool.

uint NL3D::CWaterPoolManager::getPoolID uint    i const
 

get the id of the i-th pool (O(n) lookup).

Definition at line 185 of file water_pool_manager.cpp.

References _PoolMap, getNumPools, and nlassert.

bool NL3D::CWaterPoolManager::hasPool uint32    ID const
 

test wether a pool of the given ID exists.

Definition at line 86 of file water_pool_manager.cpp.

References _PoolMap.

Referenced by removePool.

bool NL3D::CWaterPoolManager::isWaterShapeObserver const CWaterShape   shape const [private]
 

Definition at line 171 of file water_pool_manager.cpp.

References _WaterShapes.

void NL3D::CWaterPoolManager::registerWaterShape CWaterShape   shape [private]
 

register a water height map. The water height map will be notified when a setBlend is applied.

Definition at line 134 of file water_pool_manager.cpp.

References _WaterShapes, and nlassert.

void NL3D::CWaterPoolManager::removePool uint32    ID
 

remove the pool of the given ID.

Definition at line 195 of file water_pool_manager.cpp.

References _PoolMap, hasPool, and nlassert.

void NL3D::CWaterPoolManager::reset  
 

delete all heightmaps.

Definition at line 123 of file water_pool_manager.cpp.

References _PoolMap.

Referenced by ~CWaterPoolManager.

void NL3D::CWaterPoolManager::serial NLMISC::IStream   f throw (NLMISC::EStream)
 

serial the pools data's.

Definition at line 204 of file water_pool_manager.cpp.

References id.

void NL3D::CWaterPoolManager::setBlendFactor IDriver   drv,
float    factor
 

Set a blend factor for all pool (more precisely, all models based on a water shape) that have a blend texture for their envmap (to have cycle between night and day for example).

Parameters:
factor  The blend factor which range from 0 to 1

Definition at line 152 of file water_pool_manager.cpp.

References _WaterShapes, and nlassert.

void NL3D::CWaterPoolManager::unRegisterWaterShape CWaterShape   shape [private]
 

Definition at line 142 of file water_pool_manager.cpp.

References _WaterShapes.


Friends And Related Function Documentation

friend class CWaterShape [friend]
 

Definition at line 103 of file water_pool_manager.h.

CWaterPoolManager& GetWaterPoolManager   [friend]
 

Definition at line 78 of file water_pool_manager.cpp.


Member Data Documentation

TPoolMap NL3D::CWaterPoolManager::_PoolMap [private]
 

Definition at line 107 of file water_pool_manager.h.

Referenced by createWaterPool, getNumPools, getPoolByID, getPoolID, hasPool, removePool, and reset.

TWaterShapeVect NL3D::CWaterPoolManager::_WaterShapes [private]
 

Definition at line 114 of file water_pool_manager.h.

Referenced by isWaterShapeObserver, registerWaterShape, setBlendFactor, and unRegisterWaterShape.


The documentation for this class was generated from the following files: