54 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 2 ) 56 std::ostringstream ostr;
57 ostr <<
" * [INFO] Destroying Transform with " <<
m_Children.size();
58 ostr <<
" children, " <<
m_Refs.size() <<
" references and ";
60 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
95 if(
NULL == aTopNode )
99 std::ostringstream ostr;
100 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
101 ostr <<
" * [BUG] aTopNode is NULL";
102 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
131 char tok = proc.
Peek();
135 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 137 std::ostringstream ostr;
138 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
139 ostr <<
" * [INFO] bad file format; unexpected eof at line ";
140 ostr << line <<
", column " << column;
141 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
150 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 152 std::ostringstream ostr;
154 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
155 ostr <<
" * [INFO] bad file format; expecting '{' but got '" << tok;
156 ostr <<
"' at line " << line <<
", column " << column;
157 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
169 if( proc.
Peek() ==
'}' )
177 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 179 std::ostringstream ostr;
180 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
182 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
199 if( !glob.compare(
"center" ) )
203 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 205 std::ostringstream ostr;
206 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
207 ostr <<
" * [INFO] invalid center at line " << line <<
", column ";
208 ostr << column <<
"\n";
209 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
210 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
211 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
223 else if( !glob.compare(
"rotation" ) )
227 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 229 std::ostringstream ostr;
230 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
231 ostr <<
" * [INFO] invalid rotation at line " << line <<
", column ";
232 ostr << column <<
"\n";
233 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
234 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
235 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
242 else if( !glob.compare(
"scale" ) )
246 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 248 std::ostringstream ostr;
249 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
250 ostr <<
" * [INFO] invalid scale at line " << line <<
", column ";
251 ostr << column <<
"\n";
252 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
253 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
254 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
261 else if( !glob.compare(
"scaleOrientation" ) )
265 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 267 std::ostringstream ostr;
268 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
269 ostr <<
" * [INFO] invalid scaleOrientation at line " << line <<
", column ";
270 ostr << column <<
"\n";
271 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
272 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
273 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
280 else if( !glob.compare(
"translation" ) )
284 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 286 std::ostringstream ostr;
287 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
288 ostr <<
" * [INFO] invalid translation at line " << line <<
", column ";
289 ostr << column <<
"\n";
290 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
291 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
292 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
304 else if( !glob.compare(
"children" ) )
311 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 313 std::ostringstream ostr;
314 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
315 ostr <<
" * [INFO] bad Transform at line " << line <<
", column ";
316 ostr << column <<
"\n";
317 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'";
318 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
336 std::ostringstream ostr;
337 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
338 ostr <<
" * [BUG] NULL passed as node pointer";
339 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
375 char tok = proc.
Peek();
379 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 381 std::ostringstream ostr;
382 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
383 ostr <<
" * [INFO] bad file format; unexpected eof at line ";
384 ostr << line <<
", column " << column;
385 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
398 if( proc.
Peek() ==
',' )
408 if( proc.
Peek() ==
']' )
417 if( proc.
Peek() ==
',' )
428 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 2 ) 430 std::ostringstream ostr;
431 ostr <<
" * [INFO] Translating Transform with " <<
m_Children.size();
432 ostr <<
" children, " <<
m_Refs.size() <<
" references and ";
434 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
447 std::ostringstream ostr;
448 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
449 ostr <<
" * [BUG] Transform does not have a Transform parent (parent ID: ";
450 ostr << ptype <<
")";
451 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
460 if(
NULL != aParent )
479 std::list< WRL2NODE* >::iterator sC =
m_Children.begin();
480 std::list< WRL2NODE* >::iterator eC =
m_Children.end();
490 for(
int i = 0; i < 2; ++i )
494 type = (*sC)->GetNodeType();
bool ReadSFRotation(WRLROTATION &aSFRotation)
virtual bool SetParent(WRL2NODE *aParent, bool doUnlink=true)
Function SetParent sets the parent WRL2NODE of this object.
WRL2NODE represents the base class of all VRML2 nodes.
std::list< WRL2NODE * > m_Children
bool GetFilePosData(size_t &line, size_t &column)
bool ReadSFVec3f(WRLVEC3F &aSFVec3f)
std::list< WRL2NODE * > m_Refs
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
The base class of all Scene Graph nodes.
collects header files for all SG* wrappers and the API
SGNODE * GetRawPtr(void) noexcept
Function GetRawPtr() returns the raw internal SGNODE pointer.
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
bool ReadNode(WRLPROC &proc, WRL2NODE *aParent, WRL2NODE **aNode)
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
std::list< WRL2NODE * > m_BackPointers
WRL2NODES GetNodeType(void) const
Function GetNodeType returns the type of this node instance.
std::string GetFileName(void)
WRL2BASE represents the top node of a VRML2 model.
virtual bool isDangling(void)=0
Function isDangling returns true if the object does not have a parent which is a logical container fo...
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
virtual bool AddChildNode(WRL2NODE *aNode)
bool ReadName(std::string &aName)
WRL2NODE * GetParent(void) const
Function GetParent returns a pointer to the parent SGNODE of this object or NULL if the object has no...
std::string GetError(void)
void Destroy(void)
Function Destroy deletes the object held by this wrapper.
virtual bool AddRefNode(WRL2NODE *aNode)