55 wxT(
" * [INFO] Destroying IndexedFaceSet node with %zu children, %zu"
56 "references, and %zu back pointers." ),
117 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node." ) );
125 " * [INFO] bad file format; unexpected child node '%s'." ),
133 if(
nullptr !=
color )
137 " * [INFO] bad file format; multiple color nodes." ),
138 __FILE__, __FUNCTION__, __LINE__ );
149 if(
nullptr !=
coord )
153 " * [INFO] bad file format; multiple coord nodes." ),
154 __FILE__, __FUNCTION__, __LINE__ );
169 " * [INFO] bad file format; multiple normal nodes." ),
170 __FILE__, __FUNCTION__, __LINE__ );
180 wxT(
"Unexpected code branch." ) );
186 " * [INFO] bad file format; multiple texCoord nodes." ),
187 __FILE__, __FUNCTION__, __LINE__ );
199 wxCHECK_MSG( aNode,
false, wxT(
"Invalid node." ) );
207 " * [INFO] bad file format; unexpected child node '%s'." ),
215 if(
nullptr !=
color )
219 " * [INFO] bad file format; multiple color nodes." ),
220 __FILE__, __FUNCTION__, __LINE__ );
231 if(
nullptr !=
coord )
235 " * [INFO] bad file format; multiple coord nodes." ),
236 __FILE__, __FUNCTION__, __LINE__ );
251 " * [INFO] bad file format; multiple normal nodes." ),
252 __FILE__, __FUNCTION__, __LINE__ );
262 wxT(
"Unexpected code branch." ) );
268 " * [INFO] bad file format; multiple texCoord nodes." ),
269 __FILE__, __FUNCTION__, __LINE__ );
282 char tok = proc.
Peek();
287 " * [INFO] bad file format; unexpected eof %s." ),
297 " * [INFO] bad file format; expecting '{' but got '%s' %s." ),
308 if( proc.
Peek() ==
'}' )
318 __FILE__, __FUNCTION__, __LINE__ , proc.
GetError() );
342 if( !glob.compare(
"ccw" ) )
347 " * [INFO] invalid ccw %s\n"
348 " * [INFO] file: '%s'\n"
356 else if( !glob.compare(
"colorPerVertex" ) )
361 " * [INFO] invalid colorPerVertex %s\n"
362 " * [INFO] file: '%s'\n"
370 else if( !glob.compare(
"convex" ) )
375 " * [INFO] invalid convex %s\n"
376 " * [INFO] file: '%s'\n"
384 else if( !glob.compare(
"normalPerVertex" ) )
389 " * [INFO] invalid normalPerVertex %s\n"
390 " * [INFO] file: '%s'\n"
398 else if( !glob.compare(
"solid" ) )
403 " * [INFO] invalid solid %s\n"
404 " * [INFO] file: '%s'\n"
412 else if( !glob.compare(
"creaseAngle" ) )
417 " * [INFO] invalid creaseAngle %s\n"
418 " * [INFO] file: '%s'\n"
433 else if( !glob.compare(
"colorIndex" ) )
438 " * [INFO] invalid colorIndex %s\n"
439 " * [INFO] file: '%s'\n"
447 else if( !glob.compare(
"coordIndex" ) )
452 " * [INFO] invalid coordIndex %s\n"
453 " * [INFO] file: '%s'\n"
461 else if( !glob.compare(
"normalIndex" ) )
466 " * [INFO] invalid normalIndex %s\n"
467 " * [INFO] file: '%s'\n"
475 else if( !glob.compare(
"color" ) )
477 if( !aTopNode->
ReadNode( proc,
this,
nullptr ) )
481 " * [INFO] could not read color node information." ),
482 __FILE__, __FUNCTION__, __LINE__ );
487 else if( !glob.compare(
"coord" ) )
489 if( !aTopNode->
ReadNode( proc,
this,
nullptr ) )
493 " * [INFO] could not read coord node information." ),
494 __FILE__, __FUNCTION__, __LINE__ );
499 else if( !glob.compare(
"normal" ) )
501 if( !aTopNode->
ReadNode( proc,
this,
nullptr ) )
505 " * [INFO] could not read normal node information." ),
506 __FILE__, __FUNCTION__, __LINE__ );
511 else if( !glob.compare(
"texCoord" ) )
513 if( !aTopNode->
ReadNode( proc,
this,
nullptr ) )
517 " * [INFO] could not read texCoord node information." ),
518 __FILE__, __FUNCTION__, __LINE__ );
527 " * [INFO] invalid IndexedFaceSet %s (no closing brace)\n"
528 " * [INFO] file: '%s'\n" ),
545 wxString::Format( wxT(
"IndexedFaceSet does not have a Shape parent (parent "
546 "ID: %d)." ), ptype ) );
549 wxT(
" * [INFO] Translating IndexedFaceSet with %zu children, %zu references, "
550 "%zu back pointers, and %zu coord indices." ),
555 if(
nullptr != aParent )
574 if(
nullptr ==
coord || vsize < 3 )
585 for(
size_t idx = 0; idx < vsize; ++idx )
601 if(
nullptr ==
color )
604 for( iCoord = 0; iCoord < vsize; ++iCoord )
622 if( idx >= (
int)coordsize )
637 for( iCoord = 0; iCoord < vsize; ++iCoord )
658 if( idx >= (
int)coordsize )
672 cn->
GetColor( cidx, tc.x, tc.y, tc.z );
691 cn->
GetColor( idx, tc.x, tc.y, tc.z );
722 if(
nullptr == aNode )
729 else if( aNode ==
coord )
731 else if( aNode ==
normal )
743 if(
nullptr == aNode )
750 else if( aNode ==
coord )
752 else if( aNode ==
normal )
764 if(
nullptr ==
color )
void AddVertex(WRLVEC3F &aVertex, int aIndex)
Add the vertex and its associated index to the internal list of polygon vertices.
void AddColor(const SGCOLOR &aColor)
Add the given RGB color to the internal list.
bool SetColor(float aRedVal, float aGreenVal, float aBlueVal)
The base class of all Scene Graph nodes.
An abstract shape on 2D plane.
SGNODE * CalcShape(SGNODE *aParent, SGNODE *aColor, WRL1_ORDER aVertexOrder, float aCreaseLimit=0.74317, bool isVRML2=false)
The top node of a VRML2 model.
bool ReadNode(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
void GetColor(int aIndex, float &red, float &green, float &blue)
Retrieve the given color (or default 0.8, 0.8, 0.8 if index is invalid).
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
std::vector< int > normalIndex
std::vector< int > coordIndex
bool checkNodeType(WRL2NODES aType)
void unlinkRefNode(const WRL2NODE *aNode) override
Remove pointers to a referenced node.
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 AddRefNode(WRL2NODE *aNode) override
std::vector< int > colorIndex
void unlinkChildNode(const WRL2NODE *aNode) override
Remove references to an owned child.
bool AddChildNode(WRL2NODE *aNode) override
std::list< WRL2NODE * > m_BackPointers
WRL2NODE * GetParent(void) const
virtual void unlinkChildNode(const WRL2NODE *aNode)
Remove references to an owned child.
std::list< WRL2NODE * > m_Children
virtual bool AddRefNode(WRL2NODE *aNode)
virtual void unlinkRefNode(const WRL2NODE *aNode)
Remove pointers to a referenced node.
const char * GetNodeTypeName(WRL2NODES aNodeType) const
WRL2NODES GetNodeType(void) const
std::list< WRL2NODE * > m_Refs
virtual bool AddChildNode(WRL2NODE *aNode)
bool ReadSFFloat(float &aSFFloat)
std::string GetFileName(void)
bool ReadMFInt(std::vector< int > &aMFInt32)
std::string GetError(void)
bool ReadSFBool(bool &aSFBool)
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)
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
declares classes to help manage normals calculations from VRML files