H3D API
2.4.1
|
Namespaces | |
Convert | |
The Convert namespace contains help functions for parsing a string and converting it to a X3D field value. | |
Classes | |
class | DEFNodesBase |
Base class that adds functionallity needed for reference count debugging. More... | |
class | InvalidNodeType |
An exception for errors when the Node type is not what was expected. More... | |
class | NoSuchDEFName |
An exception for errors when the DEF name does not exist in the DEF nodes structure. More... | |
class | DEFNodes |
Provides a mapping between defined DEF names in X3D and the nodes they refer to. More... | |
class | IStreamInputSource |
This class is a derivative of the standard Xerxes C InputSource class. More... | |
class | IStreamInputStream |
This class implements the BinInputStream interface to read from a istream. More... | |
class | XMLParseError |
An exception for errors occuring while parsing an X3D XML file. More... | |
class | X3DSAX2Handlers |
This class implements the SAX2 ContentHandler and ErrorHandler interface in order to build an H3D scenegraph from a X3D XML file. More... | |
Functions | |
H3DAPI_API Group * | createVRMLFromStream (istream &in, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL) |
Create H3D nodes given VRML data as an istream. More... | |
H3DAPI_API Group * | createVRMLFromString (const string &str, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL) |
Create H3D nodes given VRML data as a string. More... | |
H3DAPI_API Group * | createVRMLFromURL (const string &urn, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, bool change_base_path_during_parsing=true) |
Create H3D nodes given VRML data as a URL. More... | |
H3DAPI_API AutoRef< Node > | createVRMLNodeFromStream (istream &in, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL) |
Create a H3D Node given VRML data as a istream. More... | |
H3DAPI_API AutoRef< Node > | createVRMLNodeFromString (const string &str, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL) |
Create a H3D Node given VRML data as a string. More... | |
H3DAPI_API AutoRef< Node > | createVRMLNodeFromURL (const string &urn, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, bool change_base_path_during_parsing=true) |
Create a H3D Node given VRML data as a URL. More... | |
H3DAPI_API Group * | createX3DFromStream (istream &in, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, const string &system_id="<stream input>") |
Create H3D nodes given X3D data as a istream. More... | |
H3DAPI_API Group * | createX3DFromString (const string &str, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL) |
Create H3D nodes given X3D data as a string. More... | |
H3DAPI_API Group * | createX3DFromURL (const string &urn, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, bool change_base_path_during_parsing=true) |
Create H3D nodes given X3D data as a URL. More... | |
H3DAPI_API AutoRef< Node > | createX3DNodeFromStream (istream &in, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, const string &system_id="<stream input>") |
Create a H3D Node given X3D data as a istream. More... | |
H3DAPI_API AutoRef< Node > | createX3DNodeFromString (const string &str, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL) |
Create a H3D Node given X3D data as a string. More... | |
H3DAPI_API AutoRef< Node > | createX3DNodeFromURL (const string &urn, DEFNodes *dn=NULL, DEFNodes *exported_nodes=NULL, PrototypeVector *prototypes=NULL, bool change_base_path_during_parsing=true) |
Create a H3D Node given X3D data as a URL. More... | |
H3DAPI_API void | writeNodeAsX3D (ostream &os, Node *node, const string &container_field="") |
Write the scene graph part of the node given in X3D/XML format to the given ostream. | |
H3DAPI_API void | writeNodeAsVRML (ostream &os, Node *node) |
Write the scene graph part of the node given in X3D/VRML format to the given ostream. | |
H3DAPI_API void | writeGeometryAsSTL (ostream &os, X3DGeometryNode *geom, const string &name="", bool use_binary_format=false) |
Write the triangles rendered by the geometry node as STL to the given ostream. More... | |
H3DAPI_API void | writeNodeAsX3DHelp (ostream &os, Node *node, const string &container_field, const string &prefix, std::set< Node * > &visited_nodes, unsigned int output_type=0) |
Help function for writeNodeAsX3D and writeNodeAsVRML output_type = 0 means xml output, 1 means vrml output. | |
template<class Type > | |
Type | X3DStringToValue (const string &x3d_string) |
Convert a string to a specified type according to the X3D/XML field encoding. More... | |
template<class VectorType > | |
void | X3DStringToVector (const string &x3d_string, VectorType &values) |
Convert a string to a vector of a specified type according to the X3D/XML field encoding. More... | |
template<> | |
void | X3DStringToVector< vector< string > > (const string &x3d_string, vector< string > &values) |
Template specializaion for handling the case of MFString where the the values are specified as e.g. More... | |
PixelImage * | X3DStringTo2DImage (const string &x3d_string) |
Convert a string to a PixelImage according to the X3D/XML field encoding for SFImage. More... | |
PixelImage * | X3DStringTo3DImage (const string &x3d_string) |
Convert a string to a 3D PixelImage according to the X3D spec for Pixel3DTexture. More... | |
X3D namespace.
Group * H3D::X3D::createVRMLFromStream | ( | istream & | in, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL |
||
) |
Create H3D nodes given VRML data as an istream.
in | The input stream to read VRML data from. |
dn | A DEFNodes structure to store the DEF nodes found in the stream. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the stream. |
References H3D::X3DGroupingNode::children.
Group * H3D::X3D::createVRMLFromString | ( | const string & | str, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL |
||
) |
Create H3D nodes given VRML data as a string.
str | The input string to read VRML data from. |
dn | A DEFNodes structure to store the DEF nodes found in the string. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the string. |
References H3D::X3DGroupingNode::children.
Referenced by createVRMLFromURL().
Group * H3D::X3D::createVRMLFromURL | ( | const string & | urn, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL , |
||
bool | change_base_path_during_parsing = true |
||
) |
Create H3D nodes given VRML data as a URL.
urn | The input URL to read VRML data from. |
dn | A DEFNodes structure to store the DEF nodes found in the URL. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the URL. |
change_base_path_during_parsing | If true, the base path of the ResourceResolver will be set to the part of urn that is before the file name during parsing of this file. E.g. if urn is /test/test.x3d, the base path will be set to /test/. If false, it will remain what it was before calling this function. |
References H3D::X3DGroupingNode::children, createVRMLFromString(), H3DUtil::ResourceResolver::getBaseURL(), H3DUtil::ResourceResolver::getURNResolver(), H3DUtil::ResourceResolver::releaseTmpFileName(), H3DUtil::ResourceResolver::resolveURLAsFile(), H3DUtil::ResourceResolver::resolveURLAsString(), H3DUtil::URNResolver::resolveURN(), and H3DUtil::ResourceResolver::setBaseURL().
AutoRef< Node > H3D::X3D::createVRMLNodeFromStream | ( | istream & | in, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL |
||
) |
Create a H3D Node given VRML data as a istream.
in | The input stream to read VRML data from. |
dn | A DEFNodes structure to store the DEF nodes found in the stream. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the stream. |
References H3D::X3DGroupingNode::children, and H3DUtil::AutoRef< class >::reset().
AutoRef< Node > H3D::X3D::createVRMLNodeFromString | ( | const string & | str, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL |
||
) |
Create a H3D Node given VRML data as a string.
str | The input string to read VRML data from. |
dn | A DEFNodes structure to store the DEF nodes found in the string. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the string. |
References H3D::X3DGroupingNode::children, and H3DUtil::AutoRef< class >::reset().
Referenced by createVRMLNodeFromURL().
AutoRef< Node > H3D::X3D::createVRMLNodeFromURL | ( | const string & | urn, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL , |
||
bool | change_base_path_during_parsing = true |
||
) |
Create a H3D Node given VRML data as a URL.
urn | The input URL to read VRML data from. |
dn | A DEFNodes structure to store the DEF nodes found in the URL. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the URL. |
change_base_path_during_parsing | If true, the base path of the ResourceResolver will be set to the part of urn that is before the file name during parsing of this file. E.g. if urn is /test/test.x3d, the base path will be set to /test/. If false, it will remain what it was before calling this function. |
References H3D::X3DGroupingNode::children, createVRMLNodeFromString(), H3DUtil::ResourceResolver::getBaseURL(), H3DUtil::ResourceResolver::getURNResolver(), H3DUtil::ResourceResolver::releaseTmpFileName(), H3DUtil::AutoRef< class >::reset(), H3DUtil::ResourceResolver::resolveURLAsFile(), H3DUtil::ResourceResolver::resolveURLAsString(), H3DUtil::URNResolver::resolveURN(), and H3DUtil::ResourceResolver::setBaseURL().
Group * H3D::X3D::createX3DFromStream | ( | istream & | in, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL , |
||
const string & | system_id = "<stream input>" |
||
) |
Create H3D nodes given X3D data as a istream.
in | The input stream to read X3D data from. |
dn | A DEFNodes structure to store the DEF nodes found in the stream. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the stream. |
system_id | Name of the source of the stream, e.g. file name. |
References H3D::X3DGroupingNode::children, createX3DNodeFromStream(), and H3DUtil::AutoRef< class >::get().
Group * H3D::X3D::createX3DFromString | ( | const string & | str, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL |
||
) |
Create H3D nodes given X3D data as a string.
str | The input string to read X3D data from. |
dn | A DEFNodes structure to store the DEF nodes found in the string. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the string. |
Referenced by createX3DFromURL(), H3D::FBODebugger::FBODebugger(), and H3D::Inline::LoadedScene::update().
Group * H3D::X3D::createX3DFromURL | ( | const string & | urn, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL , |
||
bool | change_base_path_during_parsing = true |
||
) |
Create H3D nodes given X3D data as a URL.
urn | The input URL to read X3D data from. |
dn | A DEFNodes structure to store the DEF nodes found in the URL. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the URL. |
change_base_path_during_parsing | If true, the base path of the ResourceResolver will be set to the part of urn that is before the file name during parsing of this file. E.g. if urn is /test/test.x3d, the base path will be set to /test/. If false, it will remain what it was before calling this function. |
References createX3DFromString(), H3DUtil::ResourceResolver::getBaseURL(), H3DUtil::ResourceResolver::getURNResolver(), H3DUtil::ResourceResolver::resolveURLAsFile(), H3DUtil::ResourceResolver::resolveURLAsString(), H3DUtil::URNResolver::resolveURN(), and H3DUtil::ResourceResolver::setBaseURL().
Referenced by H3D::Scene::loadSceneRoot(), H3D::Anchor::replaceSceneRoot(), H3D::Anchor::GeometrySelected::update(), and H3D::Inline::LoadedScene::update().
AutoRef< Node > H3D::X3D::createX3DNodeFromStream | ( | istream & | in, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL , |
||
const string & | system_id = "<stream input>" |
||
) |
Create a H3D Node given X3D data as a istream.
in | The input stream to read X3D data from. |
dn | A DEFNodes structure to store the DEF nodes found in the stream. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the stream. |
system_id | Name of the source of the stream, e.g. file name. |
Referenced by createX3DFromStream().
AutoRef< Node > H3D::X3D::createX3DNodeFromString | ( | const string & | str, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL |
||
) |
Create a H3D Node given X3D data as a string.
str | The input string to read X3D data from. |
dn | A DEFNodes structure to store the DEF nodes found in the string. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the string. |
Referenced by createX3DNodeFromURL(), H3D::ShadowCaster::render(), H3D::HAnimJoint::renderSkeleton(), and H3D::X3DTextureNode::renderToImage().
AutoRef< Node > H3D::X3D::createX3DNodeFromURL | ( | const string & | urn, |
DEFNodes * | dn = NULL , |
||
DEFNodes * | exported_nodes = NULL , |
||
PrototypeVector * | prototypes = NULL , |
||
bool | change_base_path_during_parsing = true |
||
) |
Create a H3D Node given X3D data as a URL.
urn | The input URL to read X3D data from. |
dn | A DEFNodes structure to store the DEF nodes found in the URL. |
exported_nodes | A DEFNodes structure to store the nodes that are exported with the EXPORT statement. |
prototypes | A map from the PROTO declaration nodes specified in the URL. |
change_base_path_during_parsing | If true, the base path of the ResourceResolver will be set to the part of urn that is before the file name during parsing of this file. E.g. if urn is /test/test.x3d, the base path will be set to /test/. If false, it will remain what it was before calling this function. |
References createX3DNodeFromString(), H3DUtil::ResourceResolver::getBaseURL(), H3DUtil::ResourceResolver::getURNResolver(), H3DUtil::ResourceResolver::resolveURLAsFile(), H3DUtil::ResourceResolver::resolveURLAsString(), H3DUtil::URNResolver::resolveURN(), and H3DUtil::ResourceResolver::setBaseURL().
Referenced by H3D::Scene::Scene().
H3DAPI_API void H3D::X3D::writeGeometryAsSTL | ( | ostream & | os, |
X3DGeometryNode * | geom, | ||
const string & | name = "" , |
||
bool | use_binary_format = false |
||
) |
Write the triangles rendered by the geometry node as STL to the given ostream.
The name parameter specifies the name to use in the stl file for the solid.
PixelImage * H3D::X3D::X3DStringTo2DImage | ( | const string & | x3d_string | ) |
Convert a string to a PixelImage according to the X3D/XML field encoding for SFImage.
x3d_string | The string to convert. |
Convert::X3DFieldConversionError |
References H3D::X3D::Convert::getValue< int >(), and H3D::X3D::Convert::skipWhitespaces().
Referenced by H3D::X3DTexture2DNode::SFImage::setValueFromString().
PixelImage * H3D::X3D::X3DStringTo3DImage | ( | const string & | x3d_string | ) |
Convert a string to a 3D PixelImage according to the X3D spec for Pixel3DTexture.
x3d_string | The string to convert. |
Convert::X3DFieldConversionError |
References H3D::X3D::Convert::getValue< int >(), and H3D::X3D::Convert::skipWhitespaces().
Referenced by H3D::H3DImageObject::SFImage::setValueFromString(), and H3D::X3DTexture3DNode::SFImage::setValueFromString().
Type H3D::X3D::X3DStringToValue | ( | const string & | x3d_string | ) |
Convert a string to a specified type according to the X3D/XML field encoding.
Type | The type to convert the string to. |
x3d_string | The string to convert. |
Convert::X3DFieldConversionError | \ returns The string converted to class Type. |
References H3D::X3D::Convert::skipWhitespaces().
|
inline |
Convert a string to a vector of a specified type according to the X3D/XML field encoding.
VectorType | The vector type to store the converted types in. |
x3d_string | The string to convert. |
values | The return vector. |
Convert::X3DFieldConversionError |
References H3D::X3D::Convert::getValue(), H3D::X3D::Convert::skipWhitespaces(), and H3D::X3D::Convert::skipWhitespacesAndCommas().
|
inline |
Template specializaion for handling the case of MFString where the the values are specified as e.g.
'"WALK" "ANY"'
x3d_string | The string to convert. |
values | The return vector. |
Convert::X3DFieldConversionError |
References H3D::X3D::Convert::getQuoteEnclosedStringValue(), H3D::X3D::Convert::getValue< string >(), H3D::X3D::Convert::skipWhitespaces(), and H3D::X3D::Convert::skipWhitespacesAndCommas().