Functions | |
| void | DigitalSpaces::ProcessXMLNodeForStrings (DIXMLNode1 *rootNode, const std::map< std::string, std::string > &sourceToReplacementMap) |
| Function to process through a tree of XML Nodes, look for the specified strings in text elements and attribute strings. | |
| Variant | DigitalSpaces::GetVariantFromXML (DIXMLElement1 *) |
| A function that can take a DIXMLElement1 and convert it into a Variant. | |
| SettingMap | DigitalSpaces::GetSettingMapFromXML (DIXMLNode1 *) |
| A function that can take an XML element, look for <setting name=""> nodes, then get Variant values for their children (using GetVariantFromXML). | |
| void | DigitalSpaces::FillInSettingNode (DIXMLNode1 *iNode, const SettingMap &settings) |
| Using the value of the settings parameter, add child nodes to iNode. | |
| Wml::Vector3f | DigitalSpaces::_readVector (DigitalSpaces::DIXMLNode1 *xmlNode) |
| Convenince override of _readVector( DIXMLElement1* ). | |
| Wml::Vector3f | DigitalSpaces::_readVector (DigitalSpaces::DIXMLElement1 *xmlElem) |
| Extract Vector data from a xml element. | |
| Wml::Quaternionf | DigitalSpaces::_readQuaternion (DigitalSpaces::DIXMLNode1 *xmlNode) |
| Convenince override of _readQuaternion( DIXMLElement1* ). | |
| Wml::Quaternionf | DigitalSpaces::_readQuaternion (DigitalSpaces::DIXMLElement1 *xmlElem) |
| Extract Quaternion data from a xml element. | |
| Wml::Vector4f | DigitalSpaces::_readColour (DigitalSpaces::DIXMLNode1 *xmlNode) |
| Convenince override of _readColour( DIXMLElement1* ). | |
| Wml::Vector4f | DigitalSpaces::_readColour (DigitalSpaces::DIXMLElement1 *xmlElem) |
| Extract colour data from a xml element. | |
| std::string | DigitalSpaces::_readName (DigitalSpaces::DIXMLNode1 *xmlNode) |
| Convenince override of _readName( DIXMLElement1* ). | |
| std::string | DigitalSpaces::_readName (DigitalSpaces::DIXMLElement1 *xmlElem) |
| Reads or generates a name for an element from "name" attribute. | |
| std::string | DigitalSpaces::_autoName () |
| Create an automatically generated name. | |
| bool | DigitalSpaces::_readBool (const char *string) |
| Checks if a string contains a representation of true, otherwise returns false. | |
| std::string DigitalSpaces::_autoName | ( | ) |
Create an automatically generated name.
This should be unique. Uses an incrementing base 36 number.
| bool DigitalSpaces::_readBool | ( | const char * | string | ) |
Checks if a string contains a representation of true, otherwise returns false.
Values that will return true are:
| Wml::Vector4f DigitalSpaces::_readColour | ( | DigitalSpaces::DIXMLElement1 * | xmlElem | ) |
Extract colour data from a xml element.
The implementation does not check that xmlElem is in fact a <colour> element. The attributes extracted are case sensitive. The acceptable attributes are:
<colour r="1.0" g="1.0" b="1.0" /> <colour r="1.0" g="1.0" b="1.0" a="1.0" />
The acceptable values range from 0.0 to 1.0.
| Wml::Vector4f DigitalSpaces::_readColour | ( | DigitalSpaces::DIXMLNode1 * | xmlNode | ) |
Convenince override of _readColour( DIXMLElement1* ).
| std::string DigitalSpaces::_readName | ( | DigitalSpaces::DIXMLElement1 * | xmlElem | ) |
Reads or generates a name for an element from "name" attribute.
If the provided element does not have a name attribute, a response from _autoName is returned.
| std::string DigitalSpaces::_readName | ( | DigitalSpaces::DIXMLNode1 * | xmlNode | ) |
Convenince override of _readName( DIXMLElement1* ).
| Wml::Quaternionf DigitalSpaces::_readQuaternion | ( | DigitalSpaces::DIXMLElement1 * | xmlElem | ) |
Extract Quaternion data from a xml element.
The implementation does not check that xmlElem is in fact a <quaternion> element. The attributes extracted are case sensitive. The acceptable attributes are:
<quaternion w="1.0" x="0.0" y="0.0" z="0.0" /> <quaternion qw="1.0" qx="0.0" qy="0.0" qz="0.0" /> <quaternion axisx="0.0" axisy="3.141592" axisz="0.0" /> <quaternion anglex="0" angley="1.0" anglez="0.0" angle="3.141592" />
The third form provides rotation around the Euler axis (X, Y, Z). The rotation is measured in radians. See http://www.gamasutra.com/features/19980703/quaternions_01.htm (Listing 3) for an explanation of how this is converted to a quaternion.
The forth form specifies a vector and a rotation around that vector. The rotation is measured in radians.
| Wml::Quaternionf DigitalSpaces::_readQuaternion | ( | DigitalSpaces::DIXMLNode1 * | xmlNode | ) |
Convenince override of _readQuaternion( DIXMLElement1* ).
| Wml::Vector3f DigitalSpaces::_readVector | ( | DigitalSpaces::DIXMLElement1 * | xmlElem | ) |
Extract Vector data from a xml element.
The implementation does not check that xmlElem is in fact a <vector> element. The attributes extracted are case sensitive. The acceptable attributes are:
<vector x="0.0" y="0.0" z="0.0" />
| Wml::Vector3f DigitalSpaces::_readVector | ( | DigitalSpaces::DIXMLNode1 * | xmlNode | ) |
Convenince override of _readVector( DIXMLElement1* ).
| void DigitalSpaces::FillInSettingNode | ( | DIXMLNode1 * | iNode, | |
| const SettingMap & | settings | |||
| ) |
Using the value of the settings parameter, add child nodes to iNode.
This is the inverse of GetSettingMapFromXML.
| SettingMap DigitalSpaces::GetSettingMapFromXML | ( | DIXMLNode1 * | ) |
A function that can take an XML element, look for <setting name=""> nodes, then get Variant values for their children (using GetVariantFromXML).
This is stored in a map, with the value of name as the key.
<settings> <setting name="Key1"> <float val="0.0"/> </setting> <setting name="Key2"> <string val="Key2Value" /> </setting> </settings>
| Variant DigitalSpaces::GetVariantFromXML | ( | DIXMLElement1 * | ) |
A function that can take a DIXMLElement1 and convert it into a Variant.
This accepts:
| void DigitalSpaces::ProcessXMLNodeForStrings | ( | DIXMLNode1 * | rootNode, | |
| const std::map< std::string, std::string > & | sourceToReplacementMap | |||
| ) |
Function to process through a tree of XML Nodes, look for the specified strings in text elements and attribute strings.
| rootNode | The XML Node to start the recusrive search from. | |
| sourceToReplacementMap | A map where the keys are the text values to be replaced, and the keys are the values to replace them with. |
1.5.6