53 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Destroying IndexedFaceSet with %zu children, "
54 "%zu references, and %zu back pointers." ),
62 wxCHECK_MSG(
false,
false, wxT(
"AddRefNode is not applicable." ) );
69 wxCHECK_MSG(
false,
false, wxT(
"AddChildNode is not applicable." ) );
75 char tok = proc.
Peek();
81 " * [INFO] bad file format; unexpected eof %s." ),
91 " * [INFO] bad file format; expecting '{' but got '%s' %s." ),
102 if( proc.
Peek() ==
'}' )
111 __FILE__, __FUNCTION__, __LINE__, proc.
GetError() );
120 if( !glob.compare(
"coordIndex" ) )
126 " * [INFO] invalid coordIndex %s.\n"
127 " * [INFO] file: '%s'\n"
135 else if( !glob.compare(
"materialIndex" ) )
141 " * [INFO] invalid materialIndex %s.\n"
142 " * [INFO] file: '%s'\n"
150 else if( !glob.compare(
"normalIndex" ) )
156 " * [INFO] invalid normalIndex %s\n"
157 " * [INFO] file: '%s'\n"
165 else if( !glob.compare(
"textureCoordIndex" ) )
171 " * [INFO] invalid textureCoordIndex %s.\n"
172 " * [INFO] file: '%s'\n"
184 " * [INFO] invalid IndexedFaceSet %s.\n"
185 " * [INFO] file: '%s'" ),
205 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no parent node." ) );
213 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no base data given." ) );
223 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no vertex set." ) );
229 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] bad model: no material set." ) );
236 m_current.coord->GetCoords( pcoords, coordsize );
239 if( coordsize < 3 || vsize < 3 )
242 wxT(
" * [INFO] bad model: coordsize = %zu, indexsize = %zu" ),
249 SGNODE* sgcolor =
nullptr;
265 wxT(
" * [INFO] bad model: per face indexed but no indices" ) );
269 sgcolor =
m_current.mat->GetAppearance( 0 );
277 sgcolor =
m_current.mat->GetAppearance( 0 );
293 for( iCoord = 0; iCoord < vsize; ++iCoord )
311 if( idx >= (
int)coordsize )
319 glm::vec4 pt = glm::vec4( pcoords[idx].x, pcoords[idx].y, pcoords[idx].z, 1.0 );
330 for( iCoord = 0; iCoord < vsize; ++iCoord )
352 if( idx >= (
int)coordsize )
360 glm::vec4 pt = glm::vec4( pcoords[idx].x, pcoords[idx].y, pcoords[idx].z, 1.0 );
390 if( cidx >= matSize )
408 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