62 std::map< std::string, SGNODE* >::iterator iS =
m_inlineModels.begin();
63 std::map< std::string, SGNODE* >::iterator eS =
m_inlineModels.end();
82 wxCHECK_MSG(
false,
false, wxT(
"Attempt to set parent on WRL2BASE node." ) );
103 std::map< std::string, SGNODE* >::iterator dp =
m_inlineModels.find( aName );
110 if( aName.compare( 0, 7,
"file://" ) == 0 )
112 if( aName.length() <= 7 )
115 tname = wxString::FromUTF8Unchecked( aName.substr( 7 ).c_str() );
119 tname = wxString::FromUTF8Unchecked( aName.c_str() );
125 if( fn.IsRelative() && !
m_dir.empty() )
127 wxString fname = wxString::FromUTF8Unchecked(
m_dir.c_str() );
128 fname.append( tname );
154 wxCHECK_MSG(
false, std::string(
"" ), wxT(
"Attempt to extract name from base node." ) );
160 wxCHECK_MSG(
false,
false, wxT(
"Attempt to set name of base node." ) );
167 wxT(
"No open file or file is not a VRML2 file." ) );
172 while(
ReadNode( proc,
this, &node ) && !proc.
eof() );
190 if(
nullptr != aNode )
193 wxCHECK_MSG( aParent,
false, wxT(
"Invalid parent." ) );
201 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
212 " * [INFO] node '%s' not found." ),
213 __FILE__, __FUNCTION__, __LINE__, glob );
222 " * [INFO] failed to add node '%s' (%d) to parent of type %d" ),
223 __FILE__, __FUNCTION__, __LINE__, glob, ref->
GetNodeType(),
229 if(
nullptr != aNode )
238 if(
nullptr != aNode )
241 wxCHECK_MSG( aParent,
false, wxT(
"Invalid parent." ) );
250 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
255 if(
ReadNode( proc, aParent, &lnode ) )
257 if(
nullptr != aNode )
260 if( lnode && !lnode->
SetName( glob ) )
264 " * [INFO] bad formatting (invalid name) %s." ),
285 if(
nullptr != aNode )
288 wxCHECK_MSG( aParent,
false, wxT(
"Invalid parent." ) );
297 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
313 if( !glob.compare(
"USE" ) )
319 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
327 if( !glob.compare(
"DEF" ) )
333 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
342 if( !glob.compare(
"PROTO" ) )
348 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
357 if( !glob.compare(
"EXTERNPROTO" ) )
363 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
372 if( !glob.compare(
"ROUTE" ) )
378 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
388 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Processing node '%s' ID: %d" ), glob, ntype );
404 if( !
readBox( proc, aParent, aNode ) )
420 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
444 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
461 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
478 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
537 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
615 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
635 wxCHECK_MSG(
false,
false, wxT(
"This method must never be invoked on a WRL2BASE object." ) );
641 if(
nullptr != aNode )
646 if( !np->
Read( proc,
this ) )
652 if(
nullptr != aNode )
661 if(
nullptr != aNode )
666 if( !np->
Read( proc,
this ) )
672 if(
nullptr != aNode )
681 if(
nullptr != aNode )
686 if( !np->
Read( proc,
this ) )
692 if(
nullptr != aNode )
701 if(
nullptr != aNode )
706 if( !np->
Read( proc,
this ) )
712 if(
nullptr != aNode )
721 if(
nullptr != aNode )
726 if( !np->
Read( proc,
this ) )
732 if(
nullptr != aNode )
741 if(
nullptr != aNode )
746 if( !np->
Read( proc,
this ) )
752 if(
nullptr != aNode )
761 if(
nullptr != aNode )
766 if( !np->
Read( proc,
this ) )
772 if(
nullptr != aNode )
781 if(
nullptr != aNode )
786 if( !np->
Read( proc,
this ) )
792 if(
nullptr != aNode )
801 if(
nullptr != aNode )
806 if( !np->
Read( proc,
this ) )
812 if(
nullptr != aNode )
821 if(
nullptr != aNode )
826 if( !np->
Read( proc,
this ) )
832 if(
nullptr != aNode )
841 if(
nullptr != aNode )
846 if( !np->
Read( proc,
this ) )
852 if(
nullptr != aNode )
861 if(
nullptr != aNode )
866 if( !np->
Read( proc,
this ) )
872 if(
nullptr != aNode )
881 if(
nullptr != aNode )
888 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard in line node %s." ),
899 if( !np->
Read( proc,
this ) )
905 if(
nullptr != aNode )
919 if(
nullptr != aParent )
938 std::list< WRL2NODE* >::iterator sC =
m_Children.begin();
939 std::list< WRL2NODE* >::iterator eC =
m_Children.end();
947 type = (*sC)->GetNodeType();
958 if(
nullptr != pshape )
971 if(
nullptr != (*sC)->TranslateToSG( topNode.
GetRawPtr() ) )
SGNODE * GetRawPtr(void) noexcept
Function GetRawPtr() returns the raw internal SGNODE pointer.
void Destroy(void)
Function Destroy deletes the object held by this wrapper.
Define the basic data set required to represent a 3D model.
The base class of all Scene Graph nodes.
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
The top node of a VRML2 model.
bool readMaterial(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
std::map< std::string, SGNODE * > m_inlineModels
virtual bool SetName(const std::string &aName) override
void SetEnableInline(bool enable)
bool readTransform(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool GetEnableInline(void)
bool readLineSet(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readShape(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool implementDef(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readPointSet(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readInline(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
SGNODE * GetInlineData(const std::string &aName)
bool ReadNode(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool implementUse(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readColor(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool SetParent(WRL2NODE *aParent, bool doUnlink=true) override
Set the parent WRL2NODE of this object.
virtual std::string GetName(void) override
bool readBox(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readAppearance(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readNorms(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readSwitch(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readCoords(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
SGNODE * TranslateToSG(SGNODE *aParent) override
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
bool isDangling(void) override
Determine whether an object should be moved to a different parent during the VRML to SG* translation.
bool readFaceSet(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
virtual bool SetName(const std::string &aName)
WRL2NODES getNodeTypeID(const std::string &aNodeName)
std::list< WRL2NODE * > m_Children
virtual WRL2NODE * FindNode(const std::string &aNodeName, const WRL2NODE *aCaller)
Search the tree of linked nodes and returns a reference to the first node found with the given name.
virtual bool AddRefNode(WRL2NODE *aNode)
WRL2NODES GetNodeType(void) const
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool ReadGlob(std::string &aGlob)
WRLVERSION GetVRMLType(void)
const char * GetParentDir(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 SGNODE * GetSGNodeParent(SGNODE *aNode)
SGLIB_API void DestroyNode(SGNODE *aNode) noexcept
Function DestroyNode deletes the given SG* class node.
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
SCENEGRAPH * LoadVRML(const wxString &aFileName, bool useInline)
@ WRL2_POSITIONINTERPOLATOR
@ WRL2_SCALARINTERPOLATOR
@ WRL2_ORIENTATIONINTERPOLATOR
@ WRL2_NORMALINTERPOLATOR
@ WRL2_COORDINATEINTERPOLATOR
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().