57 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Destroying IndexedFaceSet with %zu children, "
58 "%zu references, and %zu back pointers." ),
66 wxCHECK_MSG(
false,
false, wxT(
"AddRefNode is not applicable." ) );
73 wxCHECK_MSG(
false,
false, wxT(
"AddChildNode is not applicable." ) );
79 char tok = proc.
Peek();
85 " * [INFO] bad file format; unexpected eof %s." ),
95 " * [INFO] bad file format; expecting '{' but got '%s' %s." ),
106 if( proc.
Peek() ==
'}' )
115 __FILE__, __FUNCTION__, __LINE__, proc.
GetError() );
124 if( !glob.compare(
"coordIndex" ) )
130 " * [INFO] invalid coordIndex %s.\n"
131 " * [INFO] file: '%s'\n"
139 else if( !glob.compare(
"materialIndex" ) )
145 " * [INFO] invalid materialIndex %s.\n"
146 " * [INFO] file: '%s'\n"
154 else if( !glob.compare(
"normalIndex" ) )
160 " * [INFO] invalid normalIndex %s\n"
161 " * [INFO] file: '%s'\n"
169 else if( !glob.compare(
"textureCoordIndex" ) )
175 " * [INFO] invalid textureCoordIndex %s.\n"
176 " * [INFO] file: '%s'\n"
188 " * [INFO] invalid IndexedFaceSet %s.\n"
189 " * [INFO] file: '%s'" ),
209 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no parent node." ) );
217 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no base data given." ) );
227 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no vertex set." ) );
233 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no material set." ) );
240 m_current.coord->GetCoords( pcoords, coordsize );
243 if( coordsize < 3 || vsize < 3 )
246 wxT(
" * [INFO] bad model: coordsize = %zu, indexsize = %zu" ),
253 SGNODE* sgcolor =
nullptr;
269 wxT(
" * [INFO] bad model: per face indexed but no indices" ) );
273 sgcolor =
m_current.mat->GetAppearance( 0 );
281 sgcolor =
m_current.mat->GetAppearance( 0 );
297 for( iCoord = 0; iCoord < vsize; ++iCoord )
315 if( idx >= (
int)coordsize )
323 glm::vec4 pt = glm::vec4( pcoords[idx].x, pcoords[idx].y, pcoords[idx].z, 1.0 );
334 for( iCoord = 0; iCoord < vsize; ++iCoord )
356 if( idx >= (
int)coordsize )
364 glm::vec4 pt = glm::vec4( pcoords[idx].x, pcoords[idx].y, pcoords[idx].z, 1.0 );
394 if( cidx >= matSize )
412 if( iCoord >= matSize )
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.
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)
Represent the top node of a VRML1 model.
SGNODE * TranslateToSG(SGNODE *aParent, WRL1STATUS *sp) override
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
std::vector< int > normIndex
WRL1FACESET(NAMEREGISTER *aDictionary)
bool AddChildNode(WRL1NODE *aNode) override
bool Read(WRLPROC &proc, WRL1BASE *aTopNode) override
bool AddRefNode(WRL1NODE *aNode) override
std::vector< int > texIndex
std::vector< int > matIndex
std::vector< int > coordIndex
WRL1NODE(NAMEREGISTER *aDictionary)
std::list< WRL1NODE * > m_BackPointers
std::list< WRL1NODE * > m_Children
std::list< WRL1NODE * > m_Refs
std::string GetFileName(void)
bool ReadMFInt(std::vector< int > &aMFInt32)
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
declares classes to help manage normals calculations from VRML files
@ BIND_PER_VERTEX_INDEXED