KiCad PCB EDA Suite
Loading...
Searching...
No Matches
vrml2_faceset.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2016 Cirilo Bernardo <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21
22#include <iostream>
23#include <sstream>
24#include <wx/log.h>
25
26#include "vrml2_base.h"
27#include "vrml2_faceset.h"
28#include "vrml2_coords.h"
29#include "vrml2_color.h"
30#include "wrlfacet.h"
32
33
39
40
42{
45 m_Parent = aParent;
46
47 if( nullptr != m_Parent )
48 m_Parent->AddChildNode( this );
49}
50
51
53{
54 wxLogTrace( traceVrmlPlugin,
55 wxT( " * [INFO] Destroying IndexedFaceSet node with %zu children, %zu"
56 "references, and %zu back pointers." ),
57 m_Children.size(), m_Refs.size(), m_BackPointers.size() );
58}
59
60
62{
63 color = nullptr;
64 coord = nullptr;
65 normal = nullptr;
66 texCoord = nullptr;
67
68 ccw = true;
69 colorPerVertex = true;
70 convex = true;
71 normalPerVertex = true;
72 solid = true;
73
74 creaseAngle = 0.733f; // approx 42 degrees; this is larger than VRML spec.
75 creaseLimit = 0.74317f; // cos( 0.733 )
76}
77
78
80{
81 // nodes must be one of:
82 // Color
83 // Coordinate
84 // Normal
85 // TextureCoordinate
86
87 switch( aType )
88 {
93 break;
94
95 default:
96 return false;
97 break;
98 }
99
100 return true;
101}
102
103
105{
106 // this node is dangling unless it has a parent of type WRL2_SHAPE
107
108 if( nullptr == m_Parent || m_Parent->GetNodeType() != WRL2NODES::WRL2_SHAPE )
109 return true;
110
111 return false;
112}
113
114
116{
117 wxCHECK_MSG( aNode, false, wxT( "Invalid node." ) );
118
119 WRL2NODES type = aNode->GetNodeType();
120
121 if( !checkNodeType( type ) )
122 {
123 wxLogTrace( traceVrmlPlugin,
124 wxT( "%s:%s:%d\n"
125 " * [INFO] bad file format; unexpected child node '%s'." ),
126 __FILE__, __FUNCTION__, __LINE__, aNode->GetNodeTypeName( type ) );
127
128 return false;
129 }
130
131 if( WRL2NODES::WRL2_COLOR == type )
132 {
133 if( nullptr != color )
134 {
135 wxLogTrace( traceVrmlPlugin,
136 wxT( "%s:%s:%d\n"
137 " * [INFO] bad file format; multiple color nodes." ),
138 __FILE__, __FUNCTION__, __LINE__ );
139
140 return false;
141 }
142
143 color = aNode;
144 return WRL2NODE::AddRefNode( aNode );
145 }
146
147 if( WRL2NODES::WRL2_COORDINATE == type )
148 {
149 if( nullptr != coord )
150 {
151 wxLogTrace( traceVrmlPlugin,
152 wxT( "%s:%s:%d\n"
153 " * [INFO] bad file format; multiple coord nodes." ),
154 __FILE__, __FUNCTION__, __LINE__ );
155
156 return false;
157 }
158
159 coord = aNode;
160 return WRL2NODE::AddRefNode( aNode );
161 }
162
163 if( WRL2NODES::WRL2_NORMAL == type )
164 {
165 if( nullptr != normal )
166 {
167 wxLogTrace( traceVrmlPlugin,
168 wxT( "%s:%s:%d\n"
169 " * [INFO] bad file format; multiple normal nodes." ),
170 __FILE__, __FUNCTION__, __LINE__ );
171
172 return false;
173 }
174
175 normal = aNode;
176 return WRL2NODE::AddRefNode( aNode );
177 }
178
179 wxCHECK_MSG( WRL2NODES::WRL2_TEXTURECOORDINATE == type, false,
180 wxT( "Unexpected code branch." ) );
181
182 if( nullptr != texCoord )
183 {
184 wxLogTrace( traceVrmlPlugin,
185 wxT( "%s:%s:%d\n"
186 " * [INFO] bad file format; multiple texCoord nodes." ),
187 __FILE__, __FUNCTION__, __LINE__ );
188
189 return false;
190 }
191
192 texCoord = aNode;
193 return WRL2NODE::AddRefNode( aNode );
194}
195
196
198{
199 wxCHECK_MSG( aNode, false, wxT( "Invalid node." ) );
200
201 WRL2NODES type = aNode->GetNodeType();
202
203 if( !checkNodeType( type ) )
204 {
205 wxLogTrace( traceVrmlPlugin,
206 wxT( "%s:%s:%d\n"
207 " * [INFO] bad file format; unexpected child node '%s'." ),
208 __FILE__, __FUNCTION__, __LINE__, aNode->GetNodeTypeName( type ) );
209
210 return false;
211 }
212
213 if( WRL2NODES::WRL2_COLOR == type )
214 {
215 if( nullptr != color )
216 {
217 wxLogTrace( traceVrmlPlugin,
218 wxT( "%s:%s:%d\n"
219 " * [INFO] bad file format; multiple color nodes." ),
220 __FILE__, __FUNCTION__, __LINE__ );
221
222 return false;
223 }
224
225 color = aNode;
226 return WRL2NODE::AddChildNode( aNode );
227 }
228
229 if( WRL2NODES::WRL2_COORDINATE == type )
230 {
231 if( nullptr != coord )
232 {
233 wxLogTrace( traceVrmlPlugin,
234 wxT( "%s:%s:%d\n"
235 " * [INFO] bad file format; multiple coord nodes." ),
236 __FILE__, __FUNCTION__, __LINE__ );
237
238 return false;
239 }
240
241 coord = aNode;
242 return WRL2NODE::AddChildNode( aNode );
243 }
244
245 if( WRL2NODES::WRL2_NORMAL == type )
246 {
247 if( nullptr != normal )
248 {
249 wxLogTrace( traceVrmlPlugin,
250 wxT( "%s:%s:%d\n"
251 " * [INFO] bad file format; multiple normal nodes." ),
252 __FILE__, __FUNCTION__, __LINE__ );
253
254 return false;
255 }
256
257 normal = aNode;
258 return WRL2NODE::AddChildNode( aNode );
259 }
260
261 wxCHECK_MSG( WRL2NODES::WRL2_TEXTURECOORDINATE == type, false,
262 wxT( "Unexpected code branch." ) );
263
264 if( nullptr != texCoord )
265 {
266 wxLogTrace( traceVrmlPlugin,
267 wxT( "%s:%s:%d\n"
268 " * [INFO] bad file format; multiple texCoord nodes." ),
269 __FILE__, __FUNCTION__, __LINE__ );
270
271 return false;
272 }
273
274 texCoord = aNode;
275 return WRL2NODE::AddChildNode( aNode );
276}
277
278
279
280bool WRL2FACESET::Read( WRLPROC& proc, WRL2BASE* aTopNode )
281{
282 char tok = proc.Peek();
283
284 if( proc.eof() )
285 {
286 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
287 " * [INFO] bad file format; unexpected eof %s." ),
288 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition() );
289
290 return false;
291 }
292
293 if( '{' != tok )
294 {
295 wxLogTrace( traceVrmlPlugin,
296 wxT( "%s:%s:%d\n"
297 " * [INFO] bad file format; expecting '{' but got '%s' %s." ),
298 __FILE__, __FUNCTION__, __LINE__, tok, proc.GetFilePosition() );
299
300 return false;
301 }
302
303 proc.Pop();
304 std::string glob;
305
306 while( true )
307 {
308 if( proc.Peek() == '}' )
309 {
310 proc.Pop();
311 break;
312 }
313
314 if( !proc.ReadName( glob ) )
315 {
316 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
317 "%s" ),
318 __FILE__, __FUNCTION__, __LINE__ , proc.GetError() );
319
320 return false;
321 }
322
323 // expecting one of:
324 // [node]
325 // color
326 // coord
327 // normal
328 // texCoord
329 // [bool]
330 // ccw
331 // colorPerVertex
332 // convex
333 // normalPerVertex
334 // solid
335 // [ vector<int> ]
336 // colorIndex
337 // coordIndex
338 // normalIndex;
339 // [float]
340 // creaseAngle
341
342 if( !glob.compare( "ccw" ) )
343 {
344 if( !proc.ReadSFBool( ccw ) )
345 {
346 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
347 " * [INFO] invalid ccw %s\n"
348 " * [INFO] file: '%s'\n"
349 "%s" ),
350 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
351 proc.GetFileName(), proc.GetError() );
352
353 return false;
354 }
355 }
356 else if( !glob.compare( "colorPerVertex" ) )
357 {
358 if( !proc.ReadSFBool( colorPerVertex ) )
359 {
360 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
361 " * [INFO] invalid colorPerVertex %s\n"
362 " * [INFO] file: '%s'\n"
363 "%s" ),
364 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
365 proc.GetFileName(), proc.GetError() );
366
367 return false;
368 }
369 }
370 else if( !glob.compare( "convex" ) )
371 {
372 if( !proc.ReadSFBool( convex ) )
373 {
374 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
375 " * [INFO] invalid convex %s\n"
376 " * [INFO] file: '%s'\n"
377 "%s" ),
378 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
379 proc.GetFileName(), proc.GetError() );
380
381 return false;
382 }
383 }
384 else if( !glob.compare( "normalPerVertex" ) )
385 {
386 if( !proc.ReadSFBool( normalPerVertex ) )
387 {
388 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
389 " * [INFO] invalid normalPerVertex %s\n"
390 " * [INFO] file: '%s'\n"
391 "%s" ),
392 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
393 proc.GetFileName(), proc.GetError() );
394
395 return false;
396 }
397 }
398 else if( !glob.compare( "solid" ) )
399 {
400 if( !proc.ReadSFBool( solid ) )
401 {
402 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
403 " * [INFO] invalid solid %s\n"
404 " * [INFO] file: '%s'\n"
405 "%s" ),
406 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
407 proc.GetFileName(), proc.GetError() );
408
409 return false;
410 }
411 }
412 else if( !glob.compare( "creaseAngle" ) )
413 {
414 if( !proc.ReadSFFloat( creaseAngle ) )
415 {
416 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
417 " * [INFO] invalid creaseAngle %s\n"
418 " * [INFO] file: '%s'\n"
419 "%s" ),
420 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
421 proc.GetFileName(), proc.GetError() );
422
423 return false;
424 }
425
426 if( creaseAngle < 0.0 )
427 creaseAngle = 0.0f;
428 else if( creaseAngle > M_PI_2 )
429 creaseAngle = static_cast<float>( M_PI_2 );
430
431 creaseLimit = cosf( creaseAngle );
432 }
433 else if( !glob.compare( "colorIndex" ) )
434 {
435 if( !proc.ReadMFInt( colorIndex ) )
436 {
437 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
438 " * [INFO] invalid colorIndex %s\n"
439 " * [INFO] file: '%s'\n"
440 "%s" ),
441 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
442 proc.GetFileName(), proc.GetError() );
443
444 return false;
445 }
446 }
447 else if( !glob.compare( "coordIndex" ) )
448 {
449 if( !proc.ReadMFInt( coordIndex ) )
450 {
451 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
452 " * [INFO] invalid coordIndex %s\n"
453 " * [INFO] file: '%s'\n"
454 "%s" ),
455 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
456 proc.GetFileName(), proc.GetError() );
457
458 return false;
459 }
460 }
461 else if( !glob.compare( "normalIndex" ) )
462 {
463 if( !proc.ReadMFInt( normalIndex ) )
464 {
465 wxLogTrace( traceVrmlPlugin, wxT( "%s:%s:%d\n"
466 " * [INFO] invalid normalIndex %s\n"
467 " * [INFO] file: '%s'\n"
468 "%s" ),
469 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
470 proc.GetFileName(), proc.GetError() );
471
472 return false;
473 }
474 }
475 else if( !glob.compare( "color" ) )
476 {
477 if( !aTopNode->ReadNode( proc, this, nullptr ) )
478 {
479 wxLogTrace( traceVrmlPlugin,
480 wxT( "%s:%s:%d\n"
481 " * [INFO] could not read color node information." ),
482 __FILE__, __FUNCTION__, __LINE__ );
483
484 return false;
485 }
486 }
487 else if( !glob.compare( "coord" ) )
488 {
489 if( !aTopNode->ReadNode( proc, this, nullptr ) )
490 {
491 wxLogTrace( traceVrmlPlugin,
492 wxT( "%s:%s:%d\n"
493 " * [INFO] could not read coord node information." ),
494 __FILE__, __FUNCTION__, __LINE__ );
495
496 return false;
497 }
498 }
499 else if( !glob.compare( "normal" ) )
500 {
501 if( !aTopNode->ReadNode( proc, this, nullptr ) )
502 {
503 wxLogTrace( traceVrmlPlugin,
504 wxT( "%s:%s:%d\n"
505 " * [INFO] could not read normal node information." ),
506 __FILE__, __FUNCTION__, __LINE__ );
507
508 return false;
509 }
510 }
511 else if( !glob.compare( "texCoord" ) )
512 {
513 if( !aTopNode->ReadNode( proc, this, nullptr ) )
514 {
515 wxLogTrace( traceVrmlPlugin,
516 wxT( "%s:%s:%d\n"
517 " * [INFO] could not read texCoord node information." ),
518 __FILE__, __FUNCTION__, __LINE__ );
519
520 return false;
521 }
522 }
523 else
524 {
525 wxLogTrace( traceVrmlPlugin,
526 wxT( "%s:%s:%d\n"
527 " * [INFO] invalid IndexedFaceSet %s (no closing brace)\n"
528 " * [INFO] file: '%s'\n" ),
529 __FILE__, __FUNCTION__, __LINE__, proc.GetFilePosition(),
530 proc.GetFileName() );
531
532 return false;
533 }
534 } // while( true ) -- reading contents of IndexedFaceSet{}
535
536 return true;
537}
538
539
541{
542 S3D::SGTYPES ptype = S3D::GetSGNodeType( aParent );
543
544 wxCHECK_MSG( aParent && ( ptype == S3D::SGTYPE_SHAPE ), nullptr,
545 wxString::Format( wxT( "IndexedFaceSet does not have a Shape parent (parent "
546 "ID: %d)." ), ptype ) );
547
548 wxLogTrace( traceVrmlPlugin,
549 wxT( " * [INFO] Translating IndexedFaceSet with %zu children, %zu references, "
550 "%zu back pointers, and %zu coord indices." ),
551 m_Children.size(), m_Refs.size(), m_BackPointers.size(), coordIndex.size() );
552
553 if( m_sgNode )
554 {
555 if( nullptr != aParent )
556 {
557 if( nullptr == S3D::GetSGNodeParent( m_sgNode )
558 && !S3D::AddSGNodeChild( aParent, m_sgNode ) )
559 {
560 return nullptr;
561 }
562 else if( aParent != S3D::GetSGNodeParent( m_sgNode )
563 && !S3D::AddSGNodeRef( aParent, m_sgNode ) )
564 {
565 return nullptr;
566 }
567 }
568
569 return m_sgNode;
570 }
571
572 size_t vsize = coordIndex.size();
573
574 if( nullptr == coord || vsize < 3 )
575 return nullptr;
576
577 WRLVEC3F* pcoords;
578 size_t coordsize;
579 ((WRL2COORDS*) coord)->GetCoords( pcoords, coordsize );
580
581 if( coordsize < 3 )
582 return nullptr;
583
584 // check that all indices are valid
585 for( size_t idx = 0; idx < vsize; ++idx )
586 {
587 if( coordIndex[idx] < 0 )
588 continue;
589
590 if( coordIndex[idx] >= (int)coordsize )
591 return nullptr;
592 }
593
594 SHAPE lShape;
595 FACET* fp = nullptr;
596 size_t iCoord;
597 int idx; // coordinate index
598 size_t cidx = 0; // color index
599 SGCOLOR pc1;
600
601 if( nullptr == color )
602 {
603 // no per-vertex colors; we can save a few CPU cycles
604 for( iCoord = 0; iCoord < vsize; ++iCoord )
605 {
606 idx = coordIndex[iCoord];
607
608 if( idx < 0 )
609 {
610 if( nullptr != fp )
611 {
612 if( fp->HasMinPoints() )
613 fp = nullptr;
614 else
615 fp->Init();
616 }
617
618 continue;
619 }
620
621 // if the coordinate is bad then skip it
622 if( idx >= (int)coordsize )
623 continue;
624
625 if( nullptr == fp )
626 fp = lShape.NewFacet();
627
628 // push the vertex value and index
629 fp->AddVertex( pcoords[idx], idx );
630 }
631 }
632 else
633 {
634 WRL2COLOR* cn = (WRL2COLOR*) color;
635 WRLVEC3F tc;
636
637 for( iCoord = 0; iCoord < vsize; ++iCoord )
638 {
639 idx = coordIndex[iCoord];
640
641 if( idx < 0 )
642 {
643 if( nullptr != fp )
644 {
645 if( fp->HasMinPoints() )
646 fp = nullptr;
647 else
648 fp->Init();
649 }
650
651 if( !colorPerVertex )
652 ++cidx;
653
654 continue;
655 }
656
657 // if the coordinate is bad then skip it
658 if( idx >= (int)coordsize )
659 continue;
660
661 if( nullptr == fp )
662 fp = lShape.NewFacet();
663
664 // push the vertex value and index
665 fp->AddVertex( pcoords[idx], idx );
666
667 // push the color if appropriate
668 if( !colorPerVertex )
669 {
670 if( colorIndex.empty() )
671 {
672 cn->GetColor( cidx, tc.x, tc.y, tc.z );
673 pc1.SetColor( tc.x, tc.y, tc.z );
674 fp->AddColor( pc1 );
675 }
676 else
677 {
678 if( cidx < colorIndex.size() )
679 cn->GetColor( colorIndex[cidx], tc.x, tc.y, tc.z );
680 else
681 cn->GetColor( colorIndex.back(), tc.x, tc.y, tc.z );
682
683 pc1.SetColor( tc.x, tc.y, tc.z );
684 fp->AddColor( pc1 );
685 }
686 }
687 else
688 {
689 if( colorIndex.empty() )
690 {
691 cn->GetColor( idx, tc.x, tc.y, tc.z );
692 pc1.SetColor( tc.x, tc.y, tc.z );
693 fp->AddColor( pc1 );
694 }
695 else
696 {
697 if( iCoord < colorIndex.size() )
698 cn->GetColor( colorIndex[iCoord], tc.x, tc.y, tc.z );
699 else
700 cn->GetColor( colorIndex.back(), tc.x, tc.y, tc.z );
701
702 pc1.SetColor( tc.x, tc.y, tc.z );
703 fp->AddColor( pc1 );
704 }
705 }
706 }
707 }
708
709 SGNODE* np = nullptr;
710
711 if( ccw )
712 np = lShape.CalcShape( aParent, nullptr, WRL1_ORDER::ORD_CCW, creaseLimit, true );
713 else
714 np = lShape.CalcShape( aParent, nullptr, WRL1_ORDER::ORD_CLOCKWISE, creaseLimit, true );
715
716 return np;
717}
718
719
721{
722 if( nullptr == aNode )
723 return;
724
725 if( aNode->GetParent() == this )
726 {
727 if( aNode == color )
728 color = nullptr;
729 else if( aNode == coord )
730 coord = nullptr;
731 else if( aNode == normal )
732 normal = nullptr;
733 else if( aNode == texCoord )
734 texCoord = nullptr;
735 }
736
738}
739
740
742{
743 if( nullptr == aNode )
744 return;
745
746 if( aNode->GetParent() != this )
747 {
748 if( aNode == color )
749 color = nullptr;
750 else if( aNode == coord )
751 coord = nullptr;
752 else if( aNode == normal )
753 normal = nullptr;
754 else if( aNode == texCoord )
755 texCoord = nullptr;
756 }
757
759}
760
761
763{
764 if( nullptr == color )
765 return false;
766
767 return ( (WRL2COLOR*) color )->HasColors();
768}
bool HasMinPoints()
Definition wrlfacet.cpp:169
void AddVertex(WRLVEC3F &aVertex, int aIndex)
Add the vertex and its associated index to the internal list of polygon vertices.
Definition wrlfacet.cpp:187
void AddColor(const SGCOLOR &aColor)
Add the given RGB color to the internal list.
Definition wrlfacet.cpp:200
void Init()
Definition wrlfacet.cpp:154
bool SetColor(float aRedVal, float aGreenVal, float aBlueVal)
Definition sg_base.cpp:81
The base class of all Scene Graph nodes.
Definition sg_node.h:71
An abstract shape on 2D plane.
Definition shape.h:124
FACET * NewFacet()
Definition wrlfacet.cpp:691
SGNODE * CalcShape(SGNODE *aParent, SGNODE *aColor, WRL1_ORDER aVertexOrder, float aCreaseLimit=0.74317, bool isVRML2=false)
Definition wrlfacet.cpp:699
The top node of a VRML2 model.
Definition vrml2_base.h:56
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).
WRL2NODE * normal
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
WRL2NODE * coord
std::vector< int > normalIndex
virtual ~WRL2FACESET()
float creaseAngle
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...
WRL2NODE * color
float creaseLimit
bool AddRefNode(WRL2NODE *aNode) override
void setDefaults(void)
bool normalPerVertex
bool HasColors(void)
std::vector< int > colorIndex
WRL2NODE * texCoord
void unlinkChildNode(const WRL2NODE *aNode) override
Remove references to an owned child.
bool AddChildNode(WRL2NODE *aNode) override
bool colorPerVertex
SGNODE * m_sgNode
Definition vrml2_node.h:174
std::list< WRL2NODE * > m_BackPointers
Definition vrml2_node.h:169
WRL2NODE * GetParent(void) const
virtual void unlinkChildNode(const WRL2NODE *aNode)
Remove references to an owned child.
WRL2NODE * m_Parent
Definition vrml2_node.h:165
std::list< WRL2NODE * > m_Children
Definition vrml2_node.h:170
WRL2NODES m_Type
Definition vrml2_node.h:166
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
Definition vrml2_node.h:171
virtual bool AddChildNode(WRL2NODE *aNode)
void Pop(void)
Definition wrlproc.cpp:2031
bool ReadSFFloat(float &aSFFloat)
Definition wrlproc.cpp:802
char Peek(void)
Definition wrlproc.cpp:2003
std::string GetFileName(void)
Definition wrlproc.cpp:1991
bool ReadMFInt(std::vector< int > &aMFInt32)
Definition wrlproc.cpp:1500
std::string GetError(void)
Definition wrlproc.cpp:1956
bool ReadSFBool(bool &aSFBool)
Definition wrlproc.cpp:725
bool eof(void)
Definition wrlproc.cpp:1950
bool ReadName(std::string &aName)
Definition wrlproc.cpp:285
std::string GetFilePosition() const
Definition wrlproc.cpp:1978
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
Definition vrml.cpp:59
collects header files for all SG* wrappers and the API
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
Definition ifsg_api.cpp:481
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
Definition ifsg_api.cpp:490
SGTYPES
Definition sg_types.h:32
@ SGTYPE_SHAPE
Definition sg_types.h:41
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
Definition ifsg_api.cpp:508
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
Definition ifsg_api.cpp:499
declares classes to help manage normals calculations from VRML files
WRL2NODES
Definition wrltypes.h:121
@ WRL2_INDEXEDFACESET
Definition wrltypes.h:145
@ WRL2_COORDINATE
Definition wrltypes.h:134
@ WRL2_NORMAL
Definition wrltypes.h:152
@ WRL2_TEXTURECOORDINATE
Definition wrltypes.h:170
@ ORD_CLOCKWISE
Definition wrltypes.h:112
glm::vec3 WRLVEC3F
Definition wrltypes.h:184