36 m_Type = WRL2NODES::WRL2_SWITCH;
43 m_Type = WRL2NODES::WRL2_SWITCH;
55 wxT(
" * [INFO] Destroying Switch node with %zu children, %zu"
56 "references, and %zu back pointers." ),
79 wxCHECK_MSG( aTopNode,
false, wxT(
"Invalid top node." ) );
81 char tok = proc.
Peek();
86 " * [INFO] bad file format; unexpected eof %s." ),
96 " * [INFO] bad file format; expecting '{' but got '%s' %s." ),
107 if( proc.
Peek() ==
'}' )
117 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
125 if( !glob.compare(
"whichChoice" ) )
130 " * [INFO] invalid whichChoice %s\n"
131 " * [INFO] file: '%s'\n"
139 else if( !glob.compare(
"choice" ) )
148 " * [INFO] invalid Switch %s.\n"
149 " * [INFO] file: '%s'\n" ),
163 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node." ) );
189 char tok = proc.
Peek();
194 " * [INFO] bad file format; unexpected eof %s." ),
205 if( !aTopNode->
ReadNode( proc,
this, &child ) )
208 if(
nullptr != child )
211 if( proc.
Peek() ==
',' )
221 if( proc.
Peek() ==
']' )
227 if( !aTopNode->
ReadNode( proc,
this, &child ) )
230 if(
nullptr != child )
233 if( proc.
Peek() ==
',' )
245 wxT(
" * [INFO] Translating Switch with %zu children, %zu references, and"
246 "%zu back pointers." ),
251 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Switch translation: no choices." ) );
259 wxString::Format( wxT(
"Switch does not have a Transform parent (parent "
260 "ID: %d)." ), ptype ) );
262 if( whichChoice < 0 || whichChoice >= (
int)
choices.size() )
265 wxT(
" * [INFO] Switch translation: no choice (choices = %zu), "
275 case WRL2NODES::WRL2_SHAPE:
276 case WRL2NODES::WRL2_SWITCH:
277 case WRL2NODES::WRL2_INLINE:
278 case WRL2NODES::WRL2_TRANSFORM:
The base class of all Scene Graph nodes.
The top node of a VRML2 model.
bool ReadNode(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
virtual bool isDangling(void)=0
Determine whether an object should be moved to a different parent during the VRML to SG* translation.
std::list< WRL2NODE * > m_BackPointers
WRL2NODE * GetParent(void) const
virtual bool SetParent(WRL2NODE *aParent, bool doUnlink=true)
Set the parent WRL2NODE of this object.
std::list< WRL2NODE * > m_Children
virtual bool AddRefNode(WRL2NODE *aNode)
WRL2NODES GetNodeType(void) const
std::list< WRL2NODE * > m_Refs
virtual bool AddChildNode(WRL2NODE *aNode)
bool isDangling(void) override
Determine whether an object should be moved to a different parent during the VRML to SG* translation.
SGNODE * TranslateToSG(SGNODE *aParent) override
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool AddRefNode(WRL2NODE *aNode) override
bool readChildren(WRLPROC &proc, WRL2BASE *aTopNode)
std::vector< WRL2NODE * > choices
bool ReadSFInt(int &aSFInt32)
std::string GetFileName(void)
std::string GetError(void)
bool ReadName(std::string &aName)
std::string GetFilePosition() const
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
collects header files for all SG* wrappers and the API
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)