VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
makVrv::DtLightPointTable Class Reference

Lights Table class, handles loading the light type table default files and keeping track of all the custom light point types that are added when an osgSim light point is replaced with a DtLightPoint. It can load both xml and csv files for the main light point type table.

Public Member Functions

 DtLightPointTable ()
 
virtual ~DtLightPointTable ()
 
virtual bool addLight (DtLightPointType *lightPointType, const std::string &codeStr)
 
virtual DtLightPointTypegetLight (unsigned int code)
 
virtual DtLightPointTypegetLight (const std::string &type)
 
virtual void loadLightTableFromXML (const std::string &fileName)
 
virtual void saveDefaultLightValuesToCSV (const std::string &filename)
 
virtual void loadDefaultLightValuesFromCSV (const std::string &filename)
 
virtual void loadDefaultLightValuesFromXML (const std::string &fileName)
 
virtual void loadTunningLightValuesFromXML (const std::string &fileName)
 
virtual bool isDirty ()
 
virtual void clean ()
 
virtual int maxCode ()
 
virtual void updateLightPointTypeMap ()
 
virtual int getOrCreateLightTypeCode (const DtLightPointType &lp)
 

Protected Types

typedef std::map
< DtLightPointType, unsigned
int
LightPointTypeIntMap
 
typedef std::pair
< DtLightPointType, unsigned
int
LightPointTypeIntPair
 
typedef std::map< unsigned int,
DtLightPointType * > 
IntLightPointTypeMap
 
typedef std::pair< unsigned
int, DtLightPointType * > 
IntLightPointTypePair
 
typedef std::map< const
std::string, unsigned int
StringIntMap
 
typedef std::pair< const
std::string, unsigned int
StringIntPair
 

Protected Member Functions

virtual void loadLightTypeFromXML (xmlNodePtr lightTypeNode, const std::string *parentType)
 
virtual bool compareXmlString (const xmlChar *xmlStr, const char *compareStr)
 

Protected Attributes

IntLightPointTypeMap myLightsTable
 
LightPointTypeIntMap myLightPointTypes
 
boost::atomic< boolmyDirtyFlag
 
int myMaxCode
 
StringIntMap myHierarchyToCodeTable
 

Member Typedef Documentation

typedef std::map< const std::string, unsigned int> makVrv::DtLightPointTable::StringIntMap
protected
typedef std::pair< const std::string, unsigned int> makVrv::DtLightPointTable::StringIntPair
protected

Constructor & Destructor Documentation

makVrv::DtLightPointTable::DtLightPointTable ( )

CTOR.

virtual makVrv::DtLightPointTable::~DtLightPointTable ( )
virtual

Destructor h.

Member Function Documentation

virtual bool makVrv::DtLightPointTable::addLight ( DtLightPointType lightPointType,
const std::string &  codeStr 
)
virtual

add a light type to the table returns true if the light was added or false if it was not added because it is a duplicate if it is a duplicate the hierarchy is added to the hierarchy to type map

virtual DtLightPointType* makVrv::DtLightPointTable::getLight ( unsigned int  code)
virtual

return a pointer to the light associated to the light code (could be null)

virtual DtLightPointType* makVrv::DtLightPointTable::getLight ( const std::string &  type)
virtual

return a pointer to the light associated to the light type (could be null)

virtual void makVrv::DtLightPointTable::loadLightTableFromXML ( const std::string &  fileName)
virtual

Load the Light.xml file This file follows the CDB standard for defining the hierarchy of light point types. Light point type must be defined in this file in order for it to be used in the other files. Also this function should be called before any other load functions.

virtual void makVrv::DtLightPointTable::saveDefaultLightValuesToCSV ( const std::string &  filename)
virtual

Save the current light type values to a CSV file. saves a CSV file which contains the same parameters defined in the Default Values xml file. Format is: Code, Intensity, Red, Green, Blue, Directionality, Horizontal Lobe, Vertical Lobe, Residual Intensity, Frequency, Duty Cycle, Min Pixel Size, Max Pixel Size, Max Visible Distance one light point type per line and all values are separated by commas.

virtual void makVrv::DtLightPointTable::loadDefaultLightValuesFromCSV ( const std::string &  filename)
virtual

Load light type values from a CSV file loads a CSV file which contains the same parameters defined in the Default Values xml file. Format is: Code, Intensity, Red, Green, Blue, Directionality, Horizontal Lobe, Vertical Lobe, Residual Intensity, Frequency, Duty Cycle, Min Pixel Size, Max Pixel Size, Max Visible Distance one light point type per line and all values are separated by commas.

virtual void makVrv::DtLightPointTable::loadDefaultLightValuesFromXML ( const std::string &  fileName)
virtual

Load default values for light type from the Light_DefaultValuesXX.xml follows the CDB standard for the light point values file.

virtual void makVrv::DtLightPointTable::loadTunningLightValuesFromXML ( const std::string &  fileName)
virtual

Load tunning values for light type from the Lights_xxx.xml follows the CDB standard for tunning light point tables. optional file which overrides the light point type values found in the default light values file. Should be called after the default light values file has been loaded.

virtual bool makVrv::DtLightPointTable::isDirty ( )
virtual

dirty flag to know if the table has changed since the last time clean has been called

virtual void makVrv::DtLightPointTable::clean ( )
virtual

reset the dirty flag

virtual int makVrv::DtLightPointTable::maxCode ( )
virtual

get the highest light type value

virtual void makVrv::DtLightPointTable::updateLightPointTypeMap ( )
virtual

Create entries in the light point type map for all the light point types that have been added.

virtual int makVrv::DtLightPointTable::getOrCreateLightTypeCode ( const DtLightPointType lp)
virtual

See if there is a type code for this light point type and assign it one if there is not one yet.

virtual void makVrv::DtLightPointTable::loadLightTypeFromXML ( xmlNodePtr  lightTypeNode,
const std::string *  parentType 
)
protectedvirtual

Load one types of light from the Light.xml (recursive)

virtual bool makVrv::DtLightPointTable::compareXmlString ( const xmlChar xmlStr,
const char compareStr 
)
protectedvirtual

utility function for comparing an xmlStr to a char array.

Member Data Documentation

IntLightPointTypeMap makVrv::DtLightPointTable::myLightsTable
protected

Table of CDB Lights loaded from Light.xml (and complete by either the Light_xxx.xml Tunning file or Light_DefaultValues.xml)

LightPointTypeIntMap makVrv::DtLightPointTable::myLightPointTypes
protected

used when creating additional custom types that are not in the tables that are saved on disk

boost::atomic<bool> makVrv::DtLightPointTable::myDirtyFlag
protected
int makVrv::DtLightPointTable::myMaxCode
protected
StringIntMap makVrv::DtLightPointTable::myHierarchyToCodeTable
protected

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

Document ID: Generated on Wed Mar 27 22:49:11 EDT 2024 from SVN revision 264633
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)