NLLIGO::CLigoConfig Class Reference

Ligo config file. More...

#include <ligo_config.h>

List of all members.

Public Member Functions

 CLigoConfig ()
virtual ~CLigoConfig ()
bool readConfigFile (const char *fileName, bool parsePrimitiveComboContent)
 Load the config file.
bool readPrimitiveClass (const char *fileName, bool parsePrimitiveComboContent)
 This file will read the file ligo class description file (XML) using the LigoClass as file name.
bool reloadIndexFile (const std::string &indexFileName=std::string())
void resetPrimitiveConfiguration ()
 Reset the primitive configurations.

Public Attributes

Public value



float CellSize
 Size of a cell of the ligoscape in meter.
float Snap
 Snap precision for vertex position checking in meter.
uint ZoneSnapShotRes
 Zone snap shot resolution.
std::string PrimitiveClassFilename
 The ligo class file.

Primitive class accessors



std::map< std::string,
CPrimitiveClass
_PrimitiveClasses
std::vector< std::string > _Contexts
std::map< std::string,
std::string > 
_ContextFilesLookup
std::vector
< CPrimitiveConfigurations
_PrimitiveConfigurations
uint32 _DynamicAliasBitCount
std::string _IndexFileName
 Name of the index file.
std::map< std::string, uint32_StaticAliasFileMapping
uint32 getDynamicAliasSize () const
 Get the dynamic bit size for alias.
uint32 getDynamicAliasMask () const
 Get the dynamic bit mask for alias.
uint32 getStaticAliasSize () const
 Get the static bit size for alias.
uint32 getStaticAliasMask () const
 Get the static bit mask for alias.
uint32 buildAlias (uint32 staticPart, uint32 dynamicPart, bool warnIfOverload=true) const
 Build an alias given a static and dynamic part.
void registerFileToStaticAliasTranslation (const std::string &fileName, uint32 staticPart)
 register filename to static alias translation
virtual uint32 getFileStaticAliasMapping (const std::string &fileName) const
 get the static alias mapping (or 0 if no mapping defined)
const std::string & getFileNameForStaticAlias (uint32 staticAlias) const
 get the filename for a static alias (or empty string for 0)
bool isFileStaticAliasMapped (const std::string &fileName) const
 Check if a file is already mapped.
std::string aliasToString (uint32 fullAlias)
 Build a standard human readable alias string.
uint32 aliasFromString (std::string fullAlias)
 Read a standard human readable alias string.
const CPrimitiveClassgetPrimitiveClass (const NLLIGO::IPrimitive &primitive) const
const CPrimitiveClassgetPrimitiveClass (const char *className) const
NLMISC::CRGBA getPrimitiveColor (const NLLIGO::IPrimitive &primitive)
bool isStaticChild (const NLLIGO::IPrimitive &primitive)
bool isPrimitiveLinked (const NLLIGO::IPrimitive &primitive)
const NLLIGO::IPrimitivegetLinkedPrimitive (const NLLIGO::IPrimitive &primitive) const
const NLLIGO::IPrimitivegetPreviousLinkedPrimitive (const NLLIGO::IPrimitive &primitive) const
bool isPrimitiveDeletable (const NLLIGO::IPrimitive &primitive)
bool canBeChild (const NLLIGO::IPrimitive &child, const NLLIGO::IPrimitive &parent)
bool canBeRoot (const NLLIGO::IPrimitive &primitive)
bool getPropertyString (std::string &result, const char *filename, xmlNodePtr xmlNode, const char *propName)
void syntaxError (const char *filename, xmlNodePtr xmlNode, const char *format,...)
virtual void errorMessage (const char *format,...)
const std::vector< std::string > & getContextString () const
const std::vector
< CPrimitiveConfigurations > & 
getPrimitiveConfiguration () const
void updateDynamicAliasBitCount (uint32 newDynamicAliasBitCount)
bool initPrimitiveClass (const char *filename)

Detailed Description

Ligo config file.

Author:
Cyril 'Hulud' Corvazier
Nevrax France
Date:
2001

Definition at line 46 of file ligo_config.h.


Constructor & Destructor Documentation

NLLIGO::CLigoConfig::CLigoConfig (  ) 

Definition at line 41 of file ligo_config.cpp.

virtual NLLIGO::CLigoConfig::~CLigoConfig (  )  [inline, virtual]

Definition at line 52 of file ligo_config.h.


Member Function Documentation

uint32 NLLIGO::CLigoConfig::aliasFromString ( std::string  fullAlias  ) 

Read a standard human readable alias string.

Definition at line 794 of file ligo_config.cpp.

References getDynamicAliasMask(), getDynamicAliasSize(), and getStaticAliasMask().

std::string NLLIGO::CLigoConfig::aliasToString ( uint32  fullAlias  ) 

Build a standard human readable alias string.

Definition at line 782 of file ligo_config.cpp.

References getDynamicAliasMask(), getDynamicAliasSize(), getStaticAliasMask(), and NLMISC::toString().

uint32 NLLIGO::CLigoConfig::buildAlias ( uint32  staticPart,
uint32  dynamicPart,
bool  warnIfOverload = true 
) const
bool NLLIGO::CLigoConfig::canBeChild ( const NLLIGO::IPrimitive child,
const NLLIGO::IPrimitive parent 
)
bool NLLIGO::CLigoConfig::canBeRoot ( const NLLIGO::IPrimitive primitive  ) 
void NLLIGO::CLigoConfig::errorMessage ( const char *  format,
  ... 
) [virtual]

Definition at line 544 of file ligo_config.cpp.

References nlwarning.

Referenced by readPrimitiveClass(), and syntaxError().

const std::vector< std::string > & NLLIGO::CLigoConfig::getContextString (  )  const

Definition at line 558 of file ligo_config.cpp.

References _Contexts.

uint32 NLLIGO::CLigoConfig::getDynamicAliasMask (  )  const
uint32 NLLIGO::CLigoConfig::getDynamicAliasSize (  )  const
const std::string & NLLIGO::CLigoConfig::getFileNameForStaticAlias ( uint32  staticAlias  )  const

get the filename for a static alias (or empty string for 0)

Definition at line 736 of file ligo_config.cpp.

References _StaticAliasFileMapping.

uint32 NLLIGO::CLigoConfig::getFileStaticAliasMapping ( const std::string &  fileName  )  const [virtual]

get the static alias mapping (or 0 if no mapping defined)

Definition at line 753 of file ligo_config.cpp.

References _StaticAliasFileMapping.

Referenced by NLLIGO::CPrimitives::read(), reloadIndexFile(), and NLLIGO::CPrimitives::serial().

const NLLIGO::IPrimitive * NLLIGO::CLigoConfig::getLinkedPrimitive ( const NLLIGO::IPrimitive primitive  )  const
const NLLIGO::IPrimitive * NLLIGO::CLigoConfig::getPreviousLinkedPrimitive ( const NLLIGO::IPrimitive primitive  )  const
const CPrimitiveClass * NLLIGO::CLigoConfig::getPrimitiveClass ( const char *  className  )  const

Definition at line 598 of file ligo_config.cpp.

References _PrimitiveClasses.

const CPrimitiveClass * NLLIGO::CLigoConfig::getPrimitiveClass ( const NLLIGO::IPrimitive primitive  )  const
NLMISC::CRGBA NLLIGO::CLigoConfig::getPrimitiveColor ( const NLLIGO::IPrimitive primitive  ) 
const std::vector<CPrimitiveConfigurations>& NLLIGO::CLigoConfig::getPrimitiveConfiguration (  )  const [inline]

Definition at line 154 of file ligo_config.h.

References _PrimitiveConfigurations.

bool NLLIGO::CLigoConfig::getPropertyString ( std::string &  result,
const char *  filename,
xmlNodePtr  xmlNode,
const char *  propName 
)
uint32 NLLIGO::CLigoConfig::getStaticAliasMask (  )  const
uint32 NLLIGO::CLigoConfig::getStaticAliasSize (  )  const

Get the static bit size for alias.

Definition at line 668 of file ligo_config.cpp.

References _DynamicAliasBitCount.

bool NLLIGO::CLigoConfig::initPrimitiveClass ( const char *  filename  )  [private]
bool NLLIGO::CLigoConfig::isFileStaticAliasMapped ( const std::string &  fileName  )  const

Check if a file is already mapped.

Definition at line 768 of file ligo_config.cpp.

References _StaticAliasFileMapping.

Referenced by reloadIndexFile().

bool NLLIGO::CLigoConfig::isPrimitiveDeletable ( const NLLIGO::IPrimitive primitive  ) 
bool NLLIGO::CLigoConfig::isPrimitiveLinked ( const NLLIGO::IPrimitive primitive  ) 

Definition at line 326 of file ligo_config.cpp.

References _PrimitiveClasses, and NLLIGO::IPrimitive::getPropertyByName().

bool NLLIGO::CLigoConfig::isStaticChild ( const NLLIGO::IPrimitive primitive  ) 
bool NLLIGO::CLigoConfig::readConfigFile ( const char *  fileName,
bool  parsePrimitiveComboContent 
)

Load the config file.

Can throw some exceptions if file doesn't exist or is malformed.

This file will try to open the file ligo class description file (XML) using the LigoClass as file name. It will try first to load directly the file and then to lookup the file in NLMISC::CPath.

Definition at line 48 of file ligo_config.cpp.

References _Contexts, _PrimitiveClasses, _PrimitiveConfigurations, NLMISC::CConfigFile::CVar::asFloat(), NLMISC::CConfigFile::CVar::asInt(), NLMISC::CConfigFile::CVar::asString(), CellSize, NLMISC::CConfigFile::getVar(), NLMISC::CConfigFile::load(), PrimitiveClassFilename, readPrimitiveClass(), Snap, and ZoneSnapShotRes.

bool NLLIGO::CLigoConfig::readPrimitiveClass ( const char *  fileName,
bool  parsePrimitiveComboContent 
)

This file will read the file ligo class description file (XML) using the LigoClass as file name.

It will try first to load directly the file and then to lookup the file in NLMISC::CPath.

Definition at line 82 of file ligo_config.cpp.

References _ContextFilesLookup, _Contexts, _DynamicAliasBitCount, _PrimitiveClasses, _PrimitiveConfigurations, errorMessage(), file, NLMISC::fromString(), getPropertyString(), NLMISC::CIXml::getRootNode(), NLMISC::CIXml::init(), min, nlassert, nlwarning, NLMISC::CIFile::open(), reloadIndexFile(), syntaxError(), and NLMISC::Exception::what().

Referenced by readConfigFile().

void NLLIGO::CLigoConfig::registerFileToStaticAliasTranslation ( const std::string &  fileName,
uint32  staticPart 
)

register filename to static alias translation

Definition at line 706 of file ligo_config.cpp.

References _StaticAliasFileMapping, getDynamicAliasSize(), getStaticAliasMask(), nlassertex, and nlwarning.

Referenced by reloadIndexFile().

bool NLLIGO::CLigoConfig::reloadIndexFile ( const std::string &  indexFileName = std::string()  ) 
void NLLIGO::CLigoConfig::resetPrimitiveConfiguration (  ) 

Reset the primitive configurations.

Definition at line 610 of file ligo_config.cpp.

References _PrimitiveConfigurations.

void NLLIGO::CLigoConfig::syntaxError ( const char *  filename,
xmlNodePtr  xmlNode,
const char *  format,
  ... 
)
void NLLIGO::CLigoConfig::updateDynamicAliasBitCount ( uint32  newDynamicAliasBitCount  ) 

Definition at line 805 of file ligo_config.cpp.

References _DynamicAliasBitCount, _StaticAliasFileMapping, nlassert, and nlwarning.


Member Data Documentation

std::map<std::string, std::string> NLLIGO::CLigoConfig::_ContextFilesLookup [private]

Definition at line 176 of file ligo_config.h.

Referenced by readPrimitiveClass().

std::vector<std::string> NLLIGO::CLigoConfig::_Contexts [private]

Definition at line 173 of file ligo_config.h.

Referenced by getContextString(), readConfigFile(), and readPrimitiveClass().

std::string NLLIGO::CLigoConfig::_IndexFileName [private]

Name of the index file.

Definition at line 185 of file ligo_config.h.

Referenced by reloadIndexFile().

std::map<std::string, CPrimitiveClass> NLLIGO::CLigoConfig::_PrimitiveClasses [private]
std::map<std::string, uint32> NLLIGO::CLigoConfig::_StaticAliasFileMapping [private]

The ligo class file.

Definition at line 85 of file ligo_config.h.

Referenced by readConfigFile().

Snap precision for vertex position checking in meter.

Definition at line 79 of file ligo_config.h.

Referenced by NLLIGO::CZoneTemplate::build(), NLLIGO::CZoneEdge::build(), NLLIGO::CZoneEdge::isSymetrical(), NLLIGO::CZoneEdge::isTheSame(), and readConfigFile().

Zone snap shot resolution.

Definition at line 82 of file ligo_config.h.

Referenced by readConfigFile().


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

Generated on Thu Jan 7 08:30:16 2010 for NeL by  doxygen 1.6.1