VR-Forces 5.0.2 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
 

Public Member Functions

 TXPParser ()
 
void setArchive (TXPArchive *archive)
 
TXPArchivegetArchive ()
 
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)
 
osg::Group * getCurrTop ()
 
void setPotentionalTileGroup (osg::Group *grp)
 
std::map< int, osg::ref_ptr
< osg::StateSet > > * 
getMaterials ()
 
void loadMaterial (int ix)
 
std::vector< osg::ref_ptr
< osg::StateSet > > * 
getLocalMaterials ()
 
void loadLocalMaterials ()
 
std::map< int, osg::ref_ptr
< osg::Node > > * 
getModels ()
 
bool requestModel (int ix)
 
trpgTileHeadergetTileHeaderRef ()
 
const bool underBillboardSubgraph () const
 
void setUnderBillboardSubgraph (bool b)
 
void setLastBillboardInfo (TXPBillboardInfo &info)
 
void getLastBillboardInfo (TXPBillboardInfo &info)
 
DeferredLightAttributegetLightAttribute (int ix)
 
const bool underLayerSubgraph () const
 
void setUnderLayerSubgraph (bool b)
 
void setLayerGeode (osg::Geode *layer)
 
osg::Geode * getLayerGeode () const
 
unsigned int getNumLayerLavels () const
 
void setMaxAnisotropy (float anisotropy)
 
float getMaxAnisotropy () const
 
double checkAndGetMinRange (double range)
 
double checkAndGetMaxRange (double range)
 
const osg::Vec3 getTileCenter () const
 
void setCurrentNode (osg::Node *node)
 
unsigned int GetNbChildrenRef () const
 
const trpgChildRefGetChildRef (unsigned int idx) const
 
- 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)
 
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 &)
 
virtual bool TokenIsValid (trpgToken)
 

Protected Types

typedef std::map< int,
osg::ref_ptr< osg::StateSet > > * 
MaterialMapType
 
typedef std::map< int,
osg::ref_ptr< osg::Node > > 
OSGModelsMapType
 

Protected Member Functions

virtual ~TXPParser ()
 
void removeEmptyGroups ()
 
bool StartChildren (void *)
 
bool EndChildren (void *)
 
void replaceTileLod (osg::Group *)
 
osg::Geode * createBoundingBox (int x, int y, int lod)
 

Protected Attributes

TXPArchive_archive
 
osg::Group * _currentTop
 
osg::Node * _currentNode
 
osg::ref_ptr< osg::Group > _root
 
std::stack< osg::Group * > _parents
 
std::map< osg::Group *, int_tileGroups
 
MaterialMapType _materialMap
 
std::vector< osg::ref_ptr
< osg::StateSet > > 
_localMaterials
 
OSGModelsMapType_models
 
trpgTileHeader _tileHeader
 
bool _underBillboardSubgraph
 
int _numBillboardLevels
 
TXPBillboardInfo _lastBillboardInfo
 
bool _underLayerSubgraph
 
int _numLayerLevels
 
osg::Geode * _layerGeode
 
float _defaultMaxAnisotropy
 
double _realMinRange
 
double _realMaxRange
 
double _usedMaxRange
 
osg::Vec3 _tileCenter
 
- Protected Attributes inherited from trpgSceneParser
std::vector< void * > parents
 
- Protected Attributes inherited from trpgr_Parser
void * lastObject
 

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 Sun Dec 4 20:22:03 EST 2022 from SVN revision 249613
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)