31#include <wx/tokenzr.h>
32#include <wx/wfstream.h>
33#include <wx/xml/xml.h>
44 wxFFileInputStream stream( aFileName );
47 if( !stream.IsOk() || !doc.Load( stream ) )
50 if( doc.GetRoot()->GetName() != wxT(
"X3D" ) )
62 for( NODE_LIST::iterator node_it = children.begin(); node_it != children.end(); ++node_it )
64 wxXmlNode* node = *node_it;
65 wxString
name = node->GetName();
67 if(
name == wxT(
"Transform" ) ||
name == wxT(
"Group" ) )
72 else if(
name == wxT(
"Switch" ) )
91 wxXmlNode* scene =
nullptr;
93 for( wxXmlNode* child = aNode->GetChildren(); child !=
nullptr; child = child->GetNext() )
95 if( child->GetName() == wxT(
"Scene" ) )
102 if(
nullptr == scene )
105 for( wxXmlNode* child = scene->GetChildren(); child !=
nullptr; child = child->GetNext() )
107 const wxString&
name = child->GetName();
109 if(
name == wxT(
"Transform" ) ||
name == wxT(
"Switch" ) ||
name == wxT(
"Group" ) )
110 aResult.push_back( child );
113 if( aResult.empty() )
Define the basic data set required to represent a 3D model.
The base class of all X3D nodes.
virtual SGNODE * TranslateToSG(SGNODE *aParent)=0
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
bool getGroupingNodes(wxXmlNode *aNode, std::vector< wxXmlNode * > &aResult)
Retrieve all permissible top-level nodes in an X3D/VRML file.
SCENEGRAPH * Load(const wxString &aFileName)
collects header files for all SG* wrappers and the API
bool ReadSwitch(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
bool ReadTransform(wxXmlNode *aNode, X3DNODE *aParent, X3D_DICT &aDict)
std::vector< wxXmlNode * > NODE_LIST