VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties 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)
 
static DtEnvValueSP addObjectElement (DtEnvironmentSP env, DtObjectType objType, DtObjectType matchType, DtString platform, DtString parentFile="")
 
static DtEnvValueSP findObjectElementByMatchType (DtEnvironmentSP env, const DtObjectType &objType)
 
static DtEnvValueSP findObjectElementByObjectType (DtEnvironmentSP env, const DtObjectType &objType)
 
static DtString getAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 
static bool hasAttribute (DtEnvironmentSP env, const DtString &name, DtEnvValueSP root)
 
static bool FindAndRemove (DtEnvironmentSP env, const DtString &nodeType, const DtString &paramName, DtEnvValueSP root)
 
static void remove (DtEnvironmentSP, DtEnvValueSP)
 
static DtEnvValueSP getTagByAttribute (DtEnvironmentSP env, DtEnvValueSP simObjectNode, DtString attr)
 
static DtEnvValueSP getSystemByAttribute (DtEnvironmentSP env, DtEnvValueSP simObjectNode, DtString sysName)
 
static DtString getPlatform (DtEnvironmentSP env, DtEnvValueSP root)
 
static DtString getParentFile (DtEnvironmentSP env, DtEnvValueSP root)
 
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)
 
static DtEnvValueSP addRealElement (DtEnvironmentSP env, DtEnvValueSP root, const DtString &name, double value)
 
static DtEnvValueSP addIntegerElement (DtEnvironmentSP env, DtEnvValueSP root, const DtString &name, double 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)
 
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 std::list< DtObjectTypeadditionalMatchTypes (DtEnvironmentSP env, DtEnvValueSP root)
 
static void setAdditionalMatchTypes (DtEnvironmentSP env, DtEnvValueSP root, const std::list< DtObjectType > &types)
 
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)
 
static DtReaderWriterCreateRwObject (const DtString &rwType)
 
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)
 
static void AddSystems (DtComponentSystemDescriptorList &list, const DtVariableBindingsList &variableBindings, DtEnvironmentSP env, DtEnvValueSP *root, const DtReaderWriter::SearchPaths &searchPaths)
 
static void AddSystem (DtComponentSystemDescriptorList &list, DtEnvironmentSP env, const DtVariableBindingsList &variableBindings, DtEnvValueSP root, const DtReaderWriter::SearchPaths &searchPaths, DtEnvironmentSP parentEnt=DtEnvironmentSP(), DtString systemName="")
 
static DtEnvironmentSP CreateVrfXmlEnvironment ()
 
static DtEnvironmentSP CreateDtXMLEnvironment (const DtString &dataSourceFilename, bool showConsoleOutput=true)
 
static DtEnvValueSP GetElementByType (DtEnvironmentSP env, const DtString &type, DtEnvValueSP root)
 
static DtEnvValueSPList GetElementsByType (DtEnvironmentSP env, const DtString &type, DtEnvValueSP root)
 
static std::set< DtStringgetVariableTypesFromEnvironment (DtEnvValueSP)
 
static DtEnvValueSP FindElementByParamName (DtEnvironmentSP env, const DtString &nodeType, const DtString &attributeValue, DtEnvValueSP envValue, bool traverseElements=true)
 
static DtEnvValueSP FindElementBySystemName (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 DtEnvironmentSP sortEnvironment (DtEnvironmentSP)
 
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)
 
static void addParentToXmlEnvironment (DtEnvironmentSP env, const DtString &dataSourceFilename, const DtReaderWriter::SearchPaths, bool showConsoleOutput=true)
 
static void addParentToXmlEnvironment (DtEnvironmentSP env, const DtString &dataSourceFilename, const DtReaderWriter::SearchPaths, std::vector< DtString > &tagsAlreadySeen, bool showConsoleOutput=true)
 
static void WriteXML (DtEnvironmentSP env, DtString filename)
 
static DtString removeQuotes (const DtString &str)
 
static DtObjectType getObjectTypeAttr (DtEnvironmentSP env, const DtString &attributeName, DtEnvValueSP root)
 
static DtObjectType getMatchType (DtEnvironmentSP env, DtEnvValueSP root, bool fallbackOnObjectType=true)
 
static std::list< DtObjectTypegetMatchTypes (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)
 
static DtString MtlBindingCharToXml (const DtString &str)
 

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::addObjectElement ( DtEnvironmentSP  env,
DtObjectType  objType,
DtObjectType  matchType,
DtString  platform,
DtString  parentFile = "" 
)
static
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 DtEnvValueSP DtVrfXmlUtils::getTagByAttribute ( DtEnvironmentSP  env,
DtEnvValueSP  simObjectNode,
DtString  attr 
)
static
static DtEnvValueSP DtVrfXmlUtils::getSystemByAttribute ( DtEnvironmentSP  env,
DtEnvValueSP  simObjectNode,
DtString  sysName 
)
static
static DtString DtVrfXmlUtils::getPlatform ( DtEnvironmentSP  env,
DtEnvValueSP  root 
)
inlinestatic

Gets platform attribute from current Node.

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

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

Gets parent file attribute from current Node.

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

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::addIntegerElement ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtString name,
double  value 
)
inlinestatic

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

References DtXMLIntType.

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
static void DtVrfXmlUtils::setMatchType ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const DtObjectType t 
)
inlinestatic
static std::list<DtObjectType> DtVrfXmlUtils::additionalMatchTypes ( DtEnvironmentSP  env,
DtEnvValueSP  root 
)
static
static void DtVrfXmlUtils::setAdditionalMatchTypes ( DtEnvironmentSP  env,
DtEnvValueSP  root,
const std::list< DtObjectType > &  types 
)
static
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 std::set<DtString> DtVrfXmlUtils::getVariableTypesFromEnvironment ( DtEnvValueSP  )
static

returns a list of all the tag types that exist in the XML environment. The passed in pointer is assumed to be a simObject node

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

References DtXMLParamName.

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

References vrfXml::SystemName.

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 DtEnvironmentSP DtVrfXmlUtils::sortEnvironment ( DtEnvironmentSP  )
static

Given the environment, will sort (recursively) all objects in the environment by their main type, and, depending on that main type a sub key (systemName, paramName, etc). It will return a newly allocated environment that represents the sorted environment.

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::addParentToXmlEnvironment ( DtEnvironmentSP  env,
const DtString dataSourceFilename,
const DtReaderWriter::SearchPaths  ,
bool  showConsoleOutput = true 
)
static

Creates a new DtEnvironment object using a data file name and merges it into an existing DtEnvironment, ignoring any tags that already exist.

static void DtVrfXmlUtils::addParentToXmlEnvironment ( DtEnvironmentSP  env,
const DtString dataSourceFilename,
const DtReaderWriter::SearchPaths  ,
std::vector< DtString > &  tagsAlreadySeen,
bool  showConsoleOutput = true 
)
static
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 std::list<DtObjectType> DtVrfXmlUtils::getMatchTypes ( DtEnvironmentSP  env,
DtEnvValueSP  root,
bool  fallbackOnObjectType = true 
)
static
static DtObjectType DtVrfXmlUtils::getObjectType ( DtEnvironmentSP  env,
DtEnvValueSP  root,
bool  fallbackOnMatchType = true 
)
inlinestatic
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 Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)