44 m_Type = WRL1NODES::WRL1_BASE;
52 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Destroying virtual base node." ) );
60 wxCHECK_MSG(
false,
false, wxT(
"Attempt to set parent on WRL1BASE node." ) );
66 wxCHECK_MSG(
false, std::string(
"" ),
67 wxT(
"Attempt to extract name from virtual base node." ) );
73 wxCHECK_MSG(
false,
false, wxT(
"Attempt to set name on virtual base node." ) );
79 wxCHECK_MSG( proc.
GetVRMLType() == WRLVERSION::VRML_V1,
false,
80 wxT(
"No open file or file is not a VRML1 file" ) );
89 if( !
ReadNode( proc,
this,
nullptr ) )
92 wxT(
"%s:%s:%d\n * [INFO] bad file format; unexpected eof %s" ),
102 __FILE__, __FUNCTION__, __LINE__, proc.
GetError() );
113 if(
nullptr != aNode )
116 wxCHECK_MSG( aParent,
false, wxT(
"Invoked with invalid parent." ) );
132 wxLogTrace(
traceVrmlPlugin, wxT(
"%s:%s:%d\n * [INFO] node '%s' not found." ),
133 __FILE__, __FUNCTION__, __LINE__, glob );
141 wxT(
"%s:%s:%d\n * [INFO] failed to add node '%s' (%s) to parent of type %s." ),
142 __FILE__, __FUNCTION__, __LINE__, glob,
149 if(
nullptr != aNode )
158 if(
nullptr != aNode )
161 wxCHECK_MSG(
nullptr != aParent,
false, wxT(
"Invalid parent pointer." ) );
169 __FILE__, __FUNCTION__, __LINE__, proc.
GetError() );
174 if(
ReadNode( proc, aParent, &lnode ) )
176 if(
nullptr != aNode )
179 if( lnode && !lnode->
SetName( glob ) )
182 wxT(
"%s:%s:%d\n * [INFO] bad formatting (invalid name) %s." ),
208 if(
nullptr != aNode )
211 wxCHECK_MSG( aParent,
false, wxT(
"Invalid parent pointer." ) );
221 __FILE__, __FUNCTION__, __LINE__, proc.
GetError() );
231 if( !glob.compare(
"USE" ) )
239 if( !glob.compare(
"DEF" ) )
249 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Processing node '%s' ID: %d." ), glob, ntype );
253 case WRL1NODES::WRL1_GROUP:
260 case WRL1NODES::WRL1_SEPARATOR:
267 case WRL1NODES::WRL1_SWITCH:
274 case WRL1NODES::WRL1_MATERIAL:
281 case WRL1NODES::WRL1_MATERIALBINDING:
288 case WRL1NODES::WRL1_COORDINATE3:
295 case WRL1NODES::WRL1_INDEXEDFACESET:
302 case WRL1NODES::WRL1_TRANSFORM:
303 case WRL1NODES::WRL1_TRANSLATION:
304 case WRL1NODES::WRL1_ROTATION:
305 case WRL1NODES::WRL1_SCALE:
312 case WRL1NODES::WRL1_SHAPEHINTS:
327 wxT(
"%s:%s:%d\n * [INFO] could not discard node %s." ),
335 wxT(
" * [INFO] discarded node '%s' %s (currently unsupported)." ),
348 wxCHECK_MSG(
false,
false, wxT(
"This method must never be invoked on a WRL1BASE object" ) );
354 if(
nullptr != aNode )
359 if( !np->
Read( proc,
this ) )
365 if(
nullptr != aNode )
374 if(
nullptr != aNode )
379 if( !np->
Read( proc,
this ) )
385 if(
nullptr != aNode )
396 if( !np->
Read( proc,
this ) )
402 if(
nullptr != aNode )
411 if(
nullptr != aNode )
416 if( !np->
Read( proc,
this ) )
422 if(
nullptr != aNode )
431 if(
nullptr != aNode )
436 if( !np->
Read( proc,
this ) )
442 if(
nullptr != aNode )
451 if(
nullptr != aNode )
456 if( !np->
Read( proc,
this ) )
462 if(
nullptr != aNode )
471 if(
nullptr != aNode )
476 if( !np->
Read( proc,
this ) )
482 if(
nullptr != aNode )
491 if(
nullptr != aNode )
496 if( !np->
Read( proc,
this ) )
502 if(
nullptr != aNode )
511 if(
nullptr != aNode )
516 if( !np->
Read( proc,
this ) )
522 if(
nullptr != aNode )
531 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Translating VRML1 Base with %zu items." ),
538 return ( *
m_Items.begin() )->TranslateToSG(
nullptr,
nullptr );
547 bool hasContent =
false;
549 std::list< WRL1NODE* >::iterator sI =
m_Items.begin();
550 std::list< WRL1NODE* >::iterator eI =
m_Items.end();
556 if(
nullptr != (*sI)->TranslateToSG( node, &
m_current ) )
SGNODE * GetRawPtr(void) noexcept
Function GetRawPtr() returns the raw internal SGNODE pointer.
void Destroy(void)
Function Destroy deletes the object held by this wrapper.
bool AddName(const std::string &aName, WRL1NODE *aNode)
The base class of all Scene Graph nodes.
Represent the top node of a VRML1 model.
bool readMaterial(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool implementUse(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool readMatBinding(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool readFaceSet(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool readCoords(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool ReadNode(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool readTransform(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool readShapeHints(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
virtual std::string GetName(void) override
bool SetParent(WRL1NODE *aParent, bool doUnlink=true) override
Set the parent WRL1NODE of this object.
bool readGroup(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool readSwitch(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
SGNODE * TranslateToSG(SGNODE *aParent, WRL1STATUS *sp) override
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
virtual bool SetName(const std::string &aName) override
bool implementDef(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool readSeparator(WRLPROC &proc, WRL1NODE *aParent, WRL1NODE **aNode)
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
The base class of all VRML1 nodes.
WRL1NODES getNodeTypeID(const std::string &aNodeName)
Return the ID based on the given aNodeName or WRL1_INVALID (WRL1_END) if no such node name exists.
std::list< WRL1NODE * > m_Items
NAMEREGISTER * m_dictionary
virtual WRL1NODE * FindNode(const std::string &aNodeName)
Search the tree of linked nodes and returns a reference to the current node with the given name.
virtual bool AddRefNode(WRL1NODE *aNode)
virtual bool SetName(const std::string &aName)
const char * GetNodeTypeName(WRL1NODES aNodeType) const
WRL1NODES GetNodeType(void) const
Return the type of this node instance.
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
WRLVERSION GetVRMLType(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