VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Public Types | Static Public Member Functions
DtVrfXmlUtils Class Reference

Public Types

typedef std::list< DtEnvValueSP > DtEnvValueSPList
typedef std::list< DtStringStringVector
typedef std::vector
< DtReaderWriterRegistryData * > 
RegDataVector
typedef std::map< DtString,
DtString
GroupMappings
typedef std::list< DtStringNameList

Static Public Member Functions

static void getObjectElements (DtEnvironmentSP env, DtEnvValueSPList &objectNodes)
 XML Utility Functions.
static DtEnvValueSP findObjectElementByMatchType (DtEnvironmentSP env, const DtObjectType &objType)
 Finds an individual DtXMLSimObject node by object type.
static DtEnvValueSP findObjectElementByObjectType (DtEnvironmentSP env, const DtObjectType &objType)
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 Gets the named attribute from a DtEnvValueSP.
static bool hasAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 Returns true if the attribute exists.
static bool FindAndRemove (DtEnvironmentSP env, const DtString &nodeType, const DtString &paramName, DtEnvValueSP root)
static void remove (DtEnvironmentSP, DtEnvValueSP)
 Removes a value from the environment. Use this routine rather than the VR-Link remove routine.
static DtString getPlatform (DtEnvironmentSP env, DtEnvValueSP root)
 Gets platform attribute from current Node.
static DtString GetObjectValue (DtEnvValueSP root)
static DtEnvValueSP AddElement (DtEnvironmentSP env, const DtString &type, DtEnvValueSP root, const DtString &paramName=DtString::nullString())
static DtEnvValueSP addbooleanElement (DtEnvironmentSP env, DtEnvValueSP root, const DtString &name, bool value)
 Adds a new boolean type to the given root and returns the new value.
static DtEnvValueSP addRealElement (DtEnvironmentSP env, DtEnvValueSP root, const DtString &name, double value)
 Adds a new real type to the given root and returns the new value.
static DtEnvValueSP addBooleanAttribute (DtEnvironmentSP env, DtEnvValueSP root, const DtString &name, bool value)
static DtEnvValueSP addStringElement (DtEnvironmentSP env, DtEnvValueSP root, const DtString &name, const DtString &value)
 Convenience function.
static DtEnvValueSP addStringAttribute (DtEnvironmentSP env, DtEnvValueSP root, const DtString &name, const DtString &value)
static void setObjectType (DtEnvironmentSP env, DtEnvValueSP root, const DtObjectType &t)
static void setMatchType (DtEnvironmentSP env, DtEnvValueSP root, const DtObjectType &t)
static void setPlatform (DtEnvironmentSP env, DtEnvValueSP root, const DtString &t)
static double getDoubleAttribute (DtEnvironmentSP env, DtString attributeName, DtEnvValueSP root)
static void ExtractBindings (DtVariableBindingsList &list, const DtReaderWriter::SearchPaths &searchPaths, DtEnvironmentSP env, DtEnvValueSP node)
 Get all direct child binding nodes.
static DtReaderWriterCreateRwObject (const DtString &rwType)
 Creates an RW object given the type.
static void getOrientation (DtEnvironmentSP env, const DtEnvValueSP parentNode, DtTaitBryan &orientation)
static void CreateVariableBinding (const DtString &bindingType, const DtReaderWriter::SearchPaths &searchPaths, const DtVariableBindingsList &systemBindings, DtRwVariableBindings &newBindings, DtEnvironmentSP env, DtEnvValueSP binding)
 Creates a new variable binding using bindingType.
static void AddSystems (DtComponentSystemDescriptorList &list, const DtVariableBindingsList &variableBindings, DtEnvironmentSP env, DtEnvValueSP *root, const DtReaderWriter::SearchPaths &searchPaths)
 Finds all system nodes, calls addSystem on each one.
static void AddSystem (DtComponentSystemDescriptorList &list, DtEnvironmentSP env, const DtVariableBindingsList &variableBindings, DtEnvValueSP root, const DtReaderWriter::SearchPaths &searchPaths, DtEnvironmentSP parentEnt=DtEnvironmentSP(), DtString systemName="")
 Creates a new DtComponentSystemDescriptor from node.
static DtEnvironmentSP CreateVrfXmlEnvironment ()
static DtEnvironmentSP CreateDtXMLEnvironment (const DtString &dataSourceFilename, bool showConsoleOutput=true)
 Creates a new DtEnvironment object using the data file name.
static DtEnvValueSP GetElementByType (DtEnvironmentSP env, const DtString &type, DtEnvValueSP root)
static DtEnvValueSPList GetElementsByType (DtEnvironmentSP env, const DtString &type, DtEnvValueSP root)
static DtEnvValueSP FindElementByParamName (DtEnvironmentSP env, const DtString &nodeType, const DtString &attributeValue, DtEnvValueSP envValue, bool traverseElements=true)
static DtEnvValueSP FindElementByAttrValue (DtEnvironmentSP env, const DtString &nodeType, const DtString &attributeName, const DtString &attributeValue, DtEnvValueSP envValue, bool traverseElements=true)
static DtReaderWriterRegistryDataDeepFindRw (const DtString &keyword, DtReaderWriterRegistry &registry, StringVector &path)
static bool IsGroupedElement (const DtString &rwName, const DtVrfXmlUtils::GroupMappings &groupedElements, DtString &groupName)
static DtEnvValueSP FindGroupElement (DtEnvironmentSP env, DtEnvValueSP parentNode, const DtString &groupName, bool createIfMissing=true)
static void FindAndRemoveGroupElement (DtEnvironmentSP env, DtEnvValueSP parentNode, const DtString &groupName)
static void IterateOverChildren (DtReaderWriterRegistry &oldRegistry, DtReaderWriterRegistry &newRegistry, DtEnvironmentSP env, DtEnvValueSP root, const GroupMappings &groupedElements, StringVector &path)
static DtEnvValueSP CreateEnvNode (DtEnvironmentSP env, const DtString &name, DtEnvValueSP parent, DtString bindingName="")
static void ExtractVariableBindings (DtRwVariableBindings *variableBindings, DtEnvironmentSP env, DtEnvValueSP parentNode)
static void ExtractSystem (DtReaderWriter *systemObject, DtEnvironmentSP env, DtEnvValueSP simObjectNode)
static void ExtractSystems (DtReaderWriterRegistry &oldRegistry, DtEnvironmentSP env, DtEnvValueSP simObjectNode)
static DtEnvironmentSP CreateVrfXmlEnvironment (const DtString &dataSourceFilename, bool showConsoleOutput=true)
 Creates a new DtEnvironment object using the data file name.
static void WriteXML (DtEnvironmentSP env, DtString filename)
static DtString removeQuotes (const DtString &str)
static DtObjectType getObjectTypeAttr (DtEnvironmentSP env, const DtString &attributeName, DtEnvValueSP root)
 Gets objecttype attribute from current Node.
static DtObjectType getMatchType (DtEnvironmentSP env, DtEnvValueSP root, bool fallbackOnObjectType=true)
static DtObjectType getObjectType (DtEnvironmentSP env, DtEnvValueSP root, bool fallbackOnMatchType=true)
static void getXYZAttrs (DtEnvironmentSP env, const DtEnvValueSP root, double &x, double &y, double &z)
static void WriteVector (DtEnvironmentSP env, DtEnvValueSP root, const DtRwVector *vec, bool writeAsBodyPosition)
static DtString IntToHexString (const int &number)
static DtString XmlBindingCharToMtl (const DtString &str)
 Can't use '$' for variables.
static DtString MtlBindingCharToXml (const DtString &str)
 Can't use '$' for variables.

Member Typedef Documentation

typedef std::list<DtEnvValueSP> DtVrfXmlUtils::DtEnvValueSPList
typedef std::list<DtString> DtVrfXmlUtils::NameList

Member Function Documentation

static void DtVrfXmlUtils::getObjectElements ( DtEnvironmentSP  env,
DtEnvValueSPList objectNodes 
)
static

XML Utility Functions.

Finds all of the DtXMLSimObject nodes in the environment, starting from root.

static DtEnvValueSP DtVrfXmlUtils::findObjectElementByMatchType ( DtEnvironmentSP  env,
const DtObjectType &  objType 
)
static

Finds an individual DtXMLSimObject node by object type.

static DtEnvValueSP DtVrfXmlUtils::findObjectElementByObjectType ( DtEnvironmentSP  env,
const DtObjectType &  objType 
)
static
static DtString DtVrfXmlUtils::getAttribute ( DtEnvironmentSP  env,
const DtString name,
DtEnvValueSP  root 
)
static

Gets the named attribute from a DtEnvValueSP.

Returns "" if the attribute is not found. Note that some attribute names are reserved, and will not work, for example "name" and "type".

static bool DtVrfXmlUtils::hasAttribute ( DtEnvironmentSP  env,
const DtString name,
DtEnvValueSP  root 
)
static

Returns true if the attribute exists.

static bool DtVrfXmlUtils::FindAndRemove ( DtEnvironmentSP  env,
const DtString nodeType,
const DtString paramName,
DtEnvValueSP  root 
)
static
static void DtVrfXmlUtils::remove ( DtEnvironmentSP  ,
DtEnvValueSP   
)
static

Removes a value from the environment. Use this routine rather than the VR-Link remove routine.

static DtString DtVrfXmlUtils::getPlatform ( DtEnvironmentSP  env,
DtEnvValueSP  root 
)
inlinestatic

Gets platform attribute from current Node.

References DtReaderWriter::getAttribute(), and vrfXml::Platform.

static DtString DtVrfXmlUtils::GetObjectValue ( DtEnvValueSP  root)
inlinestatic
static DtEnvValueSP DtVrfXmlUtils::AddElement ( DtEnvironmentSP  env,
const DtString type,
DtEnvValueSP  root,
const DtString paramName = DtString::nullString() 
)
inlinestatic

References vrfXml::ParamName.

static DtEnvValueSP DtVrfXmlUtils::addbooleanElement ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtString name,
bool  value 
)
inlinestatic

Adds a new boolean type to the given root and returns the new value.

References DtXMLBooleanType.

static DtEnvValueSP DtVrfXmlUtils::addRealElement ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtString name,
double  value 
)
inlinestatic

Adds a new real type to the given root and returns the new value.

References DtXMLRealType.

static DtEnvValueSP DtVrfXmlUtils::addBooleanAttribute ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtString name,
bool  value 
)
inlinestatic
static DtEnvValueSP DtVrfXmlUtils::addStringElement ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtString name,
const DtString value 
)
inlinestatic

Convenience function.

Adds a new string type to the given root and returns the new value

References DtXMLStringType.

static DtEnvValueSP DtVrfXmlUtils::addStringAttribute ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtString name,
const DtString value 
)
inlinestatic
static void DtVrfXmlUtils::setObjectType ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtObjectType &  t 
)
inlinestatic

References DtXMLObjectTypeType.

static void DtVrfXmlUtils::setMatchType ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtObjectType &  t 
)
inlinestatic

References vrfXml::MatchType.

static void DtVrfXmlUtils::setPlatform ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtString t 
)
inlinestatic

References vrfXml::Platform.

static double DtVrfXmlUtils::getDoubleAttribute ( DtEnvironmentSP  env,
DtString  attributeName,
DtEnvValueSP  root 
)
inlinestatic

References DtRwReal::getDouble().

static void DtVrfXmlUtils::ExtractBindings ( DtVariableBindingsList list,
const DtReaderWriter::SearchPaths searchPaths,
DtEnvironmentSP  env,
DtEnvValueSP  node 
)
static

Get all direct child binding nodes.

This is non-recursive - for example, if called on the root, it will not get bindings within system nodes.

static DtReaderWriter* DtVrfXmlUtils::CreateRwObject ( const DtString rwType)
inlinestatic

Creates an RW object given the type.

References DtReaderWriterFactory::createItem(), and DtReaderWriter::factory().

static void DtVrfXmlUtils::getOrientation ( DtEnvironmentSP  env,
const DtEnvValueSP  parentNode,
DtTaitBryan &  orientation 
)
inlinestatic

References DtXMLPitch, DtXMLRoll, and DtXMLYaw.

static void DtVrfXmlUtils::CreateVariableBinding ( const DtString bindingType,
const DtReaderWriter::SearchPaths searchPaths,
const DtVariableBindingsList systemBindings,
DtRwVariableBindings newBindings,
DtEnvironmentSP  env,
DtEnvValueSP  binding 
)
static

Creates a new variable binding using bindingType.

Uses the DtXmlRWFactory to assign value from DtEnvValueSP to the new DtReaderWriter object.

static void DtVrfXmlUtils::AddSystems ( DtComponentSystemDescriptorList list,
const DtVariableBindingsList variableBindings,
DtEnvironmentSP  env,
DtEnvValueSP *  root,
const DtReaderWriter::SearchPaths searchPaths 
)
static

Finds all system nodes, calls addSystem on each one.

static void DtVrfXmlUtils::AddSystem ( DtComponentSystemDescriptorList list,
DtEnvironmentSP  env,
const DtVariableBindingsList variableBindings,
DtEnvValueSP  root,
const DtReaderWriter::SearchPaths searchPaths,
DtEnvironmentSP  parentEnt = DtEnvironmentSP(),
DtString  systemName = "" 
)
static

Creates a new DtComponentSystemDescriptor from node.

static DtEnvironmentSP DtVrfXmlUtils::CreateVrfXmlEnvironment ( )
static
static DtEnvironmentSP DtVrfXmlUtils::CreateDtXMLEnvironment ( const DtString dataSourceFilename,
bool  showConsoleOutput = true 
)
static

Creates a new DtEnvironment object using the data file name.

static DtEnvValueSP DtVrfXmlUtils::GetElementByType ( DtEnvironmentSP  env,
const DtString type,
DtEnvValueSP  root 
)
static
static DtEnvValueSPList DtVrfXmlUtils::GetElementsByType ( DtEnvironmentSP  env,
const DtString type,
DtEnvValueSP  root 
)
static
static DtString DtVrfXmlUtils::XmlBindingCharToMtl ( const DtString str)
inlinestatic

Can't use '$' for variables.

so where we would use it, as in filenames with variables, it will be replaced with '@'.

References DtXmlBindingCharToMtl().

static DtString DtVrfXmlUtils::MtlBindingCharToXml ( const DtString str)
inlinestatic

Can't use '$' for variables.

so where we would use it, as in filenames with variables, it will be replaced with '@'.

References DtMtlBindingCharToXml().

static DtEnvValueSP DtVrfXmlUtils::FindElementByParamName ( DtEnvironmentSP  env,
const DtString nodeType,
const DtString attributeValue,
DtEnvValueSP  envValue,
bool  traverseElements = true 
)
inlinestatic

References DtXMLParamName.

static DtEnvValueSP DtVrfXmlUtils::FindElementByAttrValue ( DtEnvironmentSP  env,
const DtString nodeType,
const DtString attributeName,
const DtString attributeValue,
DtEnvValueSP  envValue,
bool  traverseElements = true 
)
static
static DtReaderWriterRegistryData* DtVrfXmlUtils::DeepFindRw ( const DtString keyword,
DtReaderWriterRegistry registry,
StringVector path 
)
static
static bool DtVrfXmlUtils::IsGroupedElement ( const DtString rwName,
const DtVrfXmlUtils::GroupMappings groupedElements,
DtString groupName 
)
static
static DtEnvValueSP DtVrfXmlUtils::FindGroupElement ( DtEnvironmentSP  env,
DtEnvValueSP  parentNode,
const DtString groupName,
bool  createIfMissing = true 
)
static
static void DtVrfXmlUtils::FindAndRemoveGroupElement ( DtEnvironmentSP  env,
DtEnvValueSP  parentNode,
const DtString groupName 
)
static
static void DtVrfXmlUtils::IterateOverChildren ( DtReaderWriterRegistry oldRegistry,
DtReaderWriterRegistry newRegistry,
DtEnvironmentSP  env,
DtEnvValueSP  root,
const GroupMappings groupedElements,
StringVector path 
)
static
static DtEnvValueSP DtVrfXmlUtils::CreateEnvNode ( DtEnvironmentSP  env,
const DtString name,
DtEnvValueSP  parent,
DtString  bindingName = "" 
)
inlinestatic

References DtXMLParamName.

static void DtVrfXmlUtils::ExtractVariableBindings ( DtRwVariableBindings variableBindings,
DtEnvironmentSP  env,
DtEnvValueSP  parentNode 
)
static
static void DtVrfXmlUtils::ExtractSystem ( DtReaderWriter systemObject,
DtEnvironmentSP  env,
DtEnvValueSP  simObjectNode 
)
static
static void DtVrfXmlUtils::ExtractSystems ( DtReaderWriterRegistry oldRegistry,
DtEnvironmentSP  env,
DtEnvValueSP  simObjectNode 
)
static
static DtEnvironmentSP DtVrfXmlUtils::CreateVrfXmlEnvironment ( const DtString dataSourceFilename,
bool  showConsoleOutput = true 
)
static

Creates a new DtEnvironment object using the data file name.

static void DtVrfXmlUtils::WriteXML ( DtEnvironmentSP  env,
DtString  filename 
)
inlinestatic

References vrfXml::SimObject.

static DtString DtVrfXmlUtils::removeQuotes ( const DtString str)
inlinestatic

References DtRemoveQuotes().

static DtObjectType DtVrfXmlUtils::getObjectTypeAttr ( DtEnvironmentSP  env,
const DtString attributeName,
DtEnvValueSP  root 
)
inlinestatic

Gets objecttype attribute from current Node.

static DtObjectType DtVrfXmlUtils::getMatchType ( DtEnvironmentSP  env,
DtEnvValueSP  root,
bool  fallbackOnObjectType = true 
)
inlinestatic
static DtObjectType DtVrfXmlUtils::getObjectType ( DtEnvironmentSP  env,
DtEnvValueSP  root,
bool  fallbackOnMatchType = true 
)
inlinestatic

References DtXMLObjectType.

static void DtVrfXmlUtils::getXYZAttrs ( DtEnvironmentSP  env,
const DtEnvValueSP  root,
double &  x,
double &  y,
double &  z 
)
inlinestatic
static void DtVrfXmlUtils::WriteVector ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtRwVector vec,
bool  writeAsBodyPosition 
)
inlinestatic
static DtString DtVrfXmlUtils::IntToHexString ( const int number)
inlinestatic

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)