This class contains configuration options for SDF output. More...
#include <OutputConfig.hh>
Public Member Functions | |
OutputConfig () | |
Default constructor. More... | |
void | SetToElementUseIncludeTag (bool _useIncludeTag) |
Several DOM classes have ToElement() methods that return an XML Element populated from the contents of the DOM object. More... | |
bool | ToElementUseIncludeTag () const |
Get the policy value about whether tags are reconstituted in ToElement() invocations. More... | |
Static Public Member Functions | |
static OutputConfig & | GlobalConfig () |
Mutable access to a singleton OutputConfig that serves as the global OutputConfig object for all parsing operations that do not specify their own OutputConfig. More... | |
This class contains configuration options for SDF output.
Output configuration can be used to specify how SDF is generated from in-memory represenations, such as the DOM classes.
Example: The default behavior of the ToElement
functions is to use <include>
tags if the tags were present during load. You can choose not to use the <include>
tags using the following snippet.
sdf::v12::OutputConfig::OutputConfig | ( | ) |
Default constructor.
|
static |
Mutable access to a singleton OutputConfig that serves as the global OutputConfig object for all parsing operations that do not specify their own OutputConfig.
void sdf::v12::OutputConfig::SetToElementUseIncludeTag | ( | bool | _useIncludeTag | ) |
Several DOM classes have ToElement() methods that return an XML Element populated from the contents of the DOM object.
When populating the details of a model that was included using the tag, one may wish to retain the exact include tag and URI instead of copying the full details of the included model. This method lets you set this behavior.
[in] | _useIncludeTag | When true, the model's URI is used to create an SDF <include> rather than a <model> . The model's URI must be first set using the Model::SetUri function. If the model's URI is empty, then a <model> element will be generated. The default is true so that URI values are used when ToElement is called from a World object. Make sure to use Model::SetUri even when the model is loaded from an <include> tag since the parser will automatically expand an <include> element to a <model> element. |
bool sdf::v12::OutputConfig::ToElementUseIncludeTag | ( | ) | const |
Get the policy value about whether tags are reconstituted in ToElement() invocations.