VR-Forces 4.1.1 Class Documentation
List of all members | Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Private Attributes
txp::TXPParser Class Reference
Inheritance diagram for txp::TXPParser:
Inheritance graph
[legend]

Classes

struct  TXPBillboardInfo
 TXP Billboard info. More...

Public Member Functions

 TXPParser ()
void setArchive (TXPArchive *archive)
 Sets the archive to be parsed.
TXPArchivegetArchive ()
 Gets the archive.
osg::Group * parseScene (trpgReadBuffer &buf, std::map< int, osg::ref_ptr< osg::StateSet > > &materials, std::map< int, osg::ref_ptr< osg::Node > > &models, double realMinRange, double realMaxRange, double usedMaxRange)
 Scene parser.
osg::Group * getCurrTop ()
 Returns the current Top Group.
void setPotentionalTileGroup (osg::Group *grp)
 Sets the group as potentional tile group.
std::map< int, osg::ref_ptr
< osg::StateSet > > * 
getMaterials ()
 Return the current material list (passed in to ParseScene())
void loadMaterial (int ix)
 Ensure material is loaded.
std::vector< osg::ref_ptr
< osg::StateSet > > * 
getLocalMaterials ()
 New to TerraPage 2.0 - local materials.
void loadLocalMaterials ()
 Load local materials.
std::map< int, osg::ref_ptr
< osg::Node > > * 
getModels ()
 Return the current model list.
bool requestModel (int ix)
 Request a model to be load.
trpgTileHeadergetTileHeaderRef ()
 Return a reference to the tile header (after a tile has been read)
const bool underBillboardSubgraph () const
 Returns true if we are under billboard subgraph.
void setUnderBillboardSubgraph (bool b)
 Sets if we are under billboard subgraph.
void setLastBillboardInfo (TXPBillboardInfo &info)
 Sets info for the last billboard parsed.
void getLastBillboardInfo (TXPBillboardInfo &info)
 Gets info for the last billboard parsed.
DeferredLightAttributegetLightAttribute (int ix)
 Gets light attrib.
const bool underLayerSubgraph () const
 Returns if we are under layer subgraph.
void setUnderLayerSubgraph (bool b)
 Sets if we are under layer subgraph.
void setLayerGeode (osg::Geode *layer)
 Set the current layer geode.
osg::Geode * getLayerGeode () const
 Returns the current layer geode.
unsigned int getNumLayerLavels () const
void setMaxAnisotropy (float anisotropy)
 default value to use when setting up textures.
float getMaxAnisotropy () const
double checkAndGetMinRange (double range)
 We need to change the LOD ranges within tiles since we have done it for the PagedLODs representing tiles.
double checkAndGetMaxRange (double range)
const osg::Vec3 getTileCenter () const
 gets tile center, from the top lod node
void setCurrentNode (osg::Node *node)
unsigned int GetNbChildrenRef () const
 After parsing this will return the number of trpgChildRef node found.
const trpgChildRefGetChildRef (unsigned int idx) const
 This will return the trpgChildRef node pointer associated with the index.
- Public Member Functions inherited from trpgSceneParser
 trpgSceneParser (void)
virtual ~trpgSceneParser (void)
- Public Member Functions inherited from trpgr_Parser
 trpgr_Parser (void)
virtual ~trpgr_Parser (void)
bool isValid (void) const
virtual void AddCallback (trpgToken, trpgr_Callback *, bool destroy=true)
 Add and remove token callbacks.
virtual void AddCallback (trpgToken, trpgReadWriteable *)
virtual const trpgr_CallbackGetCallback (trpgToken tok) const
virtual trpgr_CallbackGetCallback (trpgToken tok)
virtual void RemoveCallback (trpgToken)
virtual void SetDefaultCallback (trpgr_Callback *, bool destroy=true)
virtual bool Parse (trpgReadBuffer &)
 Parse a read buffer.
virtual bool TokenIsValid (trpgToken)

Protected Types

typedef std::map< int,
osg::ref_ptr< osg::StateSet > > * 
MaterialMapType
 Materials.
typedef std::map< int,
osg::ref_ptr< osg::Node > > 
OSGModelsMapType
 Model list.

Protected Member Functions

virtual ~TXPParser ()
void removeEmptyGroups ()
 Removes any empty groups and LODs.
bool StartChildren (void *)
 Called on start children.
bool EndChildren (void *)
 Called on end children.
void replaceTileLod (osg::Group *)
 Replace the tile lod to regular group.
osg::Geode * createBoundingBox (int x, int y, int lod)
 TEMP.

Protected Attributes

TXPArchive_archive
 THE archive.
osg::Group * _currentTop
 Current parent.
osg::Node * _currentNode
 Current node.
osg::ref_ptr< osg::Group > _root
 The root of the tile.
std::stack< osg::Group * > _parents
 Parents list.
std::map< osg::Group *, int > _tileGroups
 Potentional Tile groups.
MaterialMapType _materialMap
std::vector< osg::ref_ptr
< osg::StateSet > > 
_localMaterials
 Local materials.
OSGModelsMapType_models
trpgTileHeader _tileHeader
 Tile header.
bool _underBillboardSubgraph
 true if we are under billboard subgraph
int _numBillboardLevels
 Number of levels below the billboard node.
TXPBillboardInfo _lastBillboardInfo
 Last billboard we parsed.
bool _underLayerSubgraph
 true if we are under layer subgraph
int _numLayerLevels
 Numbers of levels below layer subgraph.
osg::Geode * _layerGeode
 Our Layer Geode.
float _defaultMaxAnisotropy
 default value to use when setting up textures.
double _realMinRange
 LOD ranges to be used when parsing tiles.
double _realMaxRange
double _usedMaxRange
osg::Vec3 _tileCenter
 tile center
- Protected Attributes inherited from trpgSceneParser
std::vector< void * > parents
 List of objects whose children we're working on.
- Protected Attributes inherited from trpgr_Parser
void * lastObject
 Check token validity.

Private Attributes

childRefRead_childRefCB

Member Typedef Documentation

typedef std::map<int,osg::ref_ptr<osg::StateSet> >* txp::TXPParser::MaterialMapType
protected

Materials.

typedef std::map<int,osg::ref_ptr<osg::Node> > txp::TXPParser::OSGModelsMapType
protected

Model list.

Constructor & Destructor Documentation

txp::TXPParser::TXPParser ( )
virtual txp::TXPParser::~TXPParser ( )
protectedvirtual

Member Function Documentation

void txp::TXPParser::setArchive ( TXPArchive archive)
inline

Sets the archive to be parsed.

References _archive.

TXPArchive* txp::TXPParser::getArchive ( )
inline

Gets the archive.

References _archive.

osg::Group* txp::TXPParser::parseScene ( trpgReadBuffer buf,
std::map< int, osg::ref_ptr< osg::StateSet > > &  materials,
std::map< int, osg::ref_ptr< osg::Node > > &  models,
double  realMinRange,
double  realMaxRange,
double  usedMaxRange 
)

Scene parser.

osg::Group* txp::TXPParser::getCurrTop ( )
inline

Returns the current Top Group.

References _currentTop, and _root.

void txp::TXPParser::setPotentionalTileGroup ( osg::Group *  grp)
inline

Sets the group as potentional tile group.

References _tileGroups.

std::map<int,osg::ref_ptr<osg::StateSet> >* txp::TXPParser::getMaterials ( )
inline

Return the current material list (passed in to ParseScene())

References _materialMap.

void txp::TXPParser::loadMaterial ( int  ix)
inline

Ensure material is loaded.

References _archive, and txp::TXPArchive::loadMaterial().

std::vector<osg::ref_ptr<osg::StateSet> >* txp::TXPParser::getLocalMaterials ( )
inline

New to TerraPage 2.0 - local materials.

References _localMaterials.

void txp::TXPParser::loadLocalMaterials ( )

Load local materials.

std::map<int,osg::ref_ptr<osg::Node> >* txp::TXPParser::getModels ( )
inline

Return the current model list.

References _models.

bool txp::TXPParser::requestModel ( int  ix)

Request a model to be load.

trpgTileHeader* txp::TXPParser::getTileHeaderRef ( )
inline

Return a reference to the tile header (after a tile has been read)

References _tileHeader.

const bool txp::TXPParser::underBillboardSubgraph ( ) const
inline

Returns true if we are under billboard subgraph.

References _underBillboardSubgraph.

void txp::TXPParser::setUnderBillboardSubgraph ( bool  b)
inline

Sets if we are under billboard subgraph.

References _underBillboardSubgraph.

void txp::TXPParser::setLastBillboardInfo ( TXPBillboardInfo info)
inline

Sets info for the last billboard parsed.

References _lastBillboardInfo.

void txp::TXPParser::getLastBillboardInfo ( TXPBillboardInfo info)
inline

Gets info for the last billboard parsed.

References _lastBillboardInfo.

DeferredLightAttribute& txp::TXPParser::getLightAttribute ( int  ix)

Gets light attrib.

const bool txp::TXPParser::underLayerSubgraph ( ) const
inline

Returns if we are under layer subgraph.

References _underLayerSubgraph.

void txp::TXPParser::setUnderLayerSubgraph ( bool  b)
inline

Sets if we are under layer subgraph.

References _underLayerSubgraph.

void txp::TXPParser::setLayerGeode ( osg::Geode *  layer)
inline

Set the current layer geode.

References _layerGeode.

osg::Geode* txp::TXPParser::getLayerGeode ( ) const
inline

Returns the current layer geode.

References _layerGeode.

unsigned int txp::TXPParser::getNumLayerLavels ( ) const
inline

References _numLayerLevels.

void txp::TXPParser::setMaxAnisotropy ( float  anisotropy)
inline

default value to use when setting up textures.

References _defaultMaxAnisotropy.

float txp::TXPParser::getMaxAnisotropy ( ) const
inline

References _defaultMaxAnisotropy.

double txp::TXPParser::checkAndGetMinRange ( double  range)
inline

We need to change the LOD ranges within tiles since we have done it for the PagedLODs representing tiles.

References _realMinRange.

double txp::TXPParser::checkAndGetMaxRange ( double  range)
inline

References _realMaxRange, and _usedMaxRange.

const osg::Vec3 txp::TXPParser::getTileCenter ( ) const
inline

gets tile center, from the top lod node

References _tileCenter.

void txp::TXPParser::setCurrentNode ( osg::Node *  node)
inline

References _currentNode.

unsigned int txp::TXPParser::GetNbChildrenRef ( ) const

After parsing this will return the number of trpgChildRef node found.

const trpgChildRef* txp::TXPParser::GetChildRef ( unsigned int  idx) const

This will return the trpgChildRef node pointer associated with the index.

Will return 0 if index is out of bound

void txp::TXPParser::removeEmptyGroups ( )
protected

Removes any empty groups and LODs.

bool txp::TXPParser::StartChildren ( void *  )
protectedvirtual

Called on start children.

Reimplemented from trpgSceneParser.

bool txp::TXPParser::EndChildren ( void *  )
protectedvirtual

Called on end children.

Reimplemented from trpgSceneParser.

void txp::TXPParser::replaceTileLod ( osg::Group *  )
protected

Replace the tile lod to regular group.

osg::Geode* txp::TXPParser::createBoundingBox ( int  x,
int  y,
int  lod 
)
protected

TEMP.

Member Data Documentation

TXPArchive* txp::TXPParser::_archive
protected

THE archive.

Referenced by getArchive(), loadMaterial(), and setArchive().

osg::Group* txp::TXPParser::_currentTop
protected

Current parent.

Referenced by getCurrTop().

osg::Node* txp::TXPParser::_currentNode
protected

Current node.

Referenced by setCurrentNode().

osg::ref_ptr<osg::Group> txp::TXPParser::_root
protected

The root of the tile.

Referenced by getCurrTop().

std::stack<osg::Group*> txp::TXPParser::_parents
protected

Parents list.

std::map<osg::Group*,int> txp::TXPParser::_tileGroups
protected

Potentional Tile groups.

Referenced by setPotentionalTileGroup().

MaterialMapType txp::TXPParser::_materialMap
protected

Referenced by getMaterials().

std::vector<osg::ref_ptr<osg::StateSet> > txp::TXPParser::_localMaterials
protected

Local materials.

Referenced by getLocalMaterials().

OSGModelsMapType* txp::TXPParser::_models
protected

Referenced by getModels().

trpgTileHeader txp::TXPParser::_tileHeader
protected

Tile header.

Referenced by getTileHeaderRef().

bool txp::TXPParser::_underBillboardSubgraph
protected

true if we are under billboard subgraph

Referenced by setUnderBillboardSubgraph(), and underBillboardSubgraph().

int txp::TXPParser::_numBillboardLevels
protected

Number of levels below the billboard node.

TXPBillboardInfo txp::TXPParser::_lastBillboardInfo
protected

Last billboard we parsed.

Referenced by getLastBillboardInfo(), and setLastBillboardInfo().

bool txp::TXPParser::_underLayerSubgraph
protected

true if we are under layer subgraph

Referenced by setUnderLayerSubgraph(), and underLayerSubgraph().

int txp::TXPParser::_numLayerLevels
protected

Numbers of levels below layer subgraph.

Referenced by getNumLayerLavels().

osg::Geode* txp::TXPParser::_layerGeode
protected

Our Layer Geode.

Referenced by getLayerGeode(), and setLayerGeode().

float txp::TXPParser::_defaultMaxAnisotropy
protected

default value to use when setting up textures.

Referenced by getMaxAnisotropy(), and setMaxAnisotropy().

double txp::TXPParser::_realMinRange
protected

LOD ranges to be used when parsing tiles.

Referenced by checkAndGetMinRange().

double txp::TXPParser::_realMaxRange
protected

Referenced by checkAndGetMaxRange().

double txp::TXPParser::_usedMaxRange
protected

Referenced by checkAndGetMaxRange().

osg::Vec3 txp::TXPParser::_tileCenter
protected

tile center

Referenced by getTileCenter().

childRefRead* txp::TXPParser::_childRefCB
private

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

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)