59 std::map< std::string, SGNODE* >::iterator iS =
m_inlineModels.begin();
60 std::map< std::string, SGNODE* >::iterator eS =
m_inlineModels.end();
79 wxCHECK_MSG(
false,
false, wxT(
"Attempt to set parent on WRL2BASE node." ) );
119 std::map< std::string, SGNODE* >::iterator dp =
m_inlineModels.find( aName );
126 if( aName.compare( 0, 7,
"file://" ) == 0 )
128 if( aName.length() <= 7 )
131 tname = wxString::FromUTF8Unchecked( aName.substr( 7 ).c_str() );
135 tname = wxString::FromUTF8Unchecked( aName.c_str() );
141 if( fn.IsRelative() && !
m_dir.empty() )
143 wxString fname = wxString::FromUTF8Unchecked(
m_dir.c_str() );
144 fname.append( tname );
179 wxCHECK_MSG(
false, std::string(
"" ), wxT(
"Attempt to extract name from base node." ) );
185 wxCHECK_MSG(
false,
false, wxT(
"Attempt to set name of base node." ) );
192 wxT(
"No open file or file is not a VRML2 file." ) );
197 while(
ReadNode( proc,
this, &node ) && !proc.
eof() );
215 if(
nullptr != aNode )
218 wxCHECK_MSG( aParent,
false, wxT(
"Invalid parent." ) );
226 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
237 " * [INFO] node '%s' not found." ),
238 __FILE__, __FUNCTION__, __LINE__, glob );
247 " * [INFO] failed to add node '%s' (%d) to parent of type %d" ),
248 __FILE__, __FUNCTION__, __LINE__, glob, ref->
GetNodeType(),
254 if(
nullptr != aNode )
263 if(
nullptr != aNode )
266 wxCHECK_MSG( aParent,
false, wxT(
"Invalid parent." ) );
275 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
280 if(
ReadNode( proc, aParent, &lnode ) )
282 if(
nullptr != aNode )
285 if( lnode && !lnode->
SetName( glob ) )
289 " * [INFO] bad formatting (invalid name) %s." ),
310 if(
nullptr != aNode )
313 wxCHECK_MSG( aParent,
false, wxT(
"Invalid parent." ) );
322 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
338 if( !glob.compare(
"USE" ) )
344 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
352 if( !glob.compare(
"DEF" ) )
358 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
367 if( !glob.compare(
"PROTO" ) )
373 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
382 if( !glob.compare(
"EXTERNPROTO" ) )
388 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
397 if( !glob.compare(
"ROUTE" ) )
403 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
413 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Processing node '%s' ID: %d" ), glob, ntype );
429 if( !
readBox( proc, aParent, aNode ) )
445 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
469 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
486 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
503 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
562 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
640 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard %s node %s." ),
660 wxCHECK_MSG(
false,
false, wxT(
"This method must never be invoked on a WRL2BASE object." ) );
666 if(
nullptr != aNode )
671 if( !np->
Read( proc,
this ) )
677 if(
nullptr != aNode )
686 if(
nullptr != aNode )
691 if( !np->
Read( proc,
this ) )
697 if(
nullptr != aNode )
706 if(
nullptr != aNode )
711 if( !np->
Read( proc,
this ) )
717 if(
nullptr != aNode )
726 if(
nullptr != aNode )
731 if( !np->
Read( proc,
this ) )
737 if(
nullptr != aNode )
746 if(
nullptr != aNode )
751 if( !np->
Read( proc,
this ) )
757 if(
nullptr != aNode )
766 if(
nullptr != aNode )
771 if( !np->
Read( proc,
this ) )
777 if(
nullptr != aNode )
786 if(
nullptr != aNode )
791 if( !np->
Read( proc,
this ) )
797 if(
nullptr != aNode )
806 if(
nullptr != aNode )
811 if( !np->
Read( proc,
this ) )
817 if(
nullptr != aNode )
826 if(
nullptr != aNode )
831 if( !np->
Read( proc,
this ) )
837 if(
nullptr != aNode )
846 if(
nullptr != aNode )
851 if( !np->
Read( proc,
this ) )
857 if(
nullptr != aNode )
866 if(
nullptr != aNode )
871 if( !np->
Read( proc,
this ) )
877 if(
nullptr != aNode )
886 if(
nullptr != aNode )
891 if( !np->
Read( proc,
this ) )
897 if(
nullptr != aNode )
906 if(
nullptr != aNode )
915 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] failed to discard in line node %s." ),
926 if( !np->
Read( proc,
this ) )
932 if(
nullptr != aNode )
946 if(
nullptr != aParent )
965 std::list< WRL2NODE* >::iterator sC =
m_Children.begin();
966 std::list< WRL2NODE* >::iterator eC =
m_Children.end();
974 type = (*sC)->GetNodeType();
983 SGNODE* pshape = (*sC)->TranslateToSG(
wrapper.GetRawPtr() );
985 if(
nullptr != pshape )
998 if(
nullptr != (*sC)->TranslateToSG( topNode.
GetRawPtr() ) )
SGNODE * GetRawPtr(void) noexcept
Return the raw internal SGNODE pointer.
void Destroy(void)
Delete 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
bool readMaterial(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
MODEL_IMPORT_STATUS * m_status
std::map< std::string, SGNODE * > m_inlineModels
virtual bool SetName(const std::string &aName) override
void SetEnableInline(bool enable)
void SetImportOptions(const S3D::MODEL_IMPORT_OPTIONS &aOptions, MODEL_IMPORT_STATUS *aStatus)
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 m_applyUnitConversion
S3D::MODEL_IMPORT_OPTIONS m_options
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
void SetApplyUnitConversion(bool apply)
bool readBox(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool readAppearance(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
bool GetApplyUnitConversion(void) const
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
Delete the given SG* class node.
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
bool vrmlApplyLegacyUnitConversion
SCENEGRAPH * LoadVRML(const wxString &aFileName, const S3D::MODEL_IMPORT_OPTIONS &aOptions, MODEL_IMPORT_STATUS *aStatus)
@ WRL2_POSITIONINTERPOLATOR
@ WRL2_SCALARINTERPOLATOR
@ WRL2_ORIENTATIONINTERPOLATOR
@ WRL2_NORMALINTERPOLATOR
@ WRL2_COORDINATEINTERPOLATOR
#define FN_NORMALIZE_FLAGS
Default flags to pass to wxFileName::Normalize().