VR-Forces 4.6 Class Documentation
 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. More...

Public Member Functions

 DtLightPointTable ()
 CTOR.
virtual ~DtLightPointTable ()
 Destructor h.
virtual bool addLight (DtLightPointType *lightPointType, const std::string &codeStr)
 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 DtLightPointTypegetLight (unsigned int code)
 return a pointer to the light associated to the light code (could be null)
virtual DtLightPointTypegetLight (const std::string &type)
 return a pointer to the light associated to the light type (could be null)
virtual void loadLightTableFromXML (const std::string &fileName)
 Load the Light.xml file This file follows the CDB standard for defining the hierarchy of light point types.
virtual void saveDefaultLightValuesToCSV (const std::string &filename)
 Save the current light type values to a CSV file.
virtual void loadDefaultLightValuesFromCSV (const std::string &filename)
 Load light type values from a CSV file loads a CSV file which contains the same parameters defined in the Default Values xml file.
virtual void loadDefaultLightValuesFromXML (const std::string &fileName)
 Load default values for light type from the Light_DefaultValuesXX.xml follows the CDB standard for the light point values file.
virtual void loadTunningLightValuesFromXML (const std::string &fileName)
 Load tunning values for light type from the Lights_xxx.xml follows the CDB standard for tunning light point tables.
virtual bool isDirty ()
 dirty flag to know if the table has changed since the last time clean has been called
virtual void clean ()
 reset the dirty flag
virtual int maxCode ()
 get the highest light type value
virtual void updateLightPointTypeMap ()
 Create entries in the light point type map for all the light point types that have been added.
int getOrCreateLightTypeCode (const DtLightPointType &lp)
 See if there is a type code for this light point type and assign it one if there is not one yet.

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)
 Load one types of light from the Light.xml (recursive)
bool compareXmlString (const xmlChar *xmlStr, const char *compareStr)
 utility function for comparing an xmlStr to a char array.

Protected Attributes

IntLightPointTypeMap myLightsTable
 Table of CDB Lights loaded from Light.xml (and complete by either the Light_xxx.xml Tunning file or Light_DefaultValues.xml)
LightPointTypeIntMap myLightPointTypes
 used when creating additional custom types that are not in the tables that are saved on disk
bool myDirtyFlag
int myMaxCode
StringIntMap myHierarchyToCodeTable

Detailed Description

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.

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.

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

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)

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

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

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 Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)