57 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 2 ) 58 wxLogTrace(
MASK_VRML,
" * [INFO] Destroying Material node\n" );
103 std::ostringstream ostr;
104 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
105 ostr <<
" * [BUG] AddRefNode is not applicable";
106 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
120 std::ostringstream ostr;
121 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
122 ostr <<
" * [BUG] AddChildNode is not applicable";
123 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
133 if(
NULL == aTopNode )
137 std::ostringstream ostr;
138 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
139 ostr <<
" * [BUG] aTopNode is NULL";
140 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
150 char tok = proc.
Peek();
154 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 156 std::ostringstream ostr;
157 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
158 ostr <<
" * [INFO] bad file format; unexpected eof at line ";
159 ostr << line <<
", column " << column;
160 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
169 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 171 std::ostringstream ostr;
173 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
174 ostr <<
" * [INFO] bad file format; expecting '{' but got '" << tok;
175 ostr <<
"' at line " << line <<
", column " << column;
176 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
188 if( proc.
Peek() ==
'}' )
196 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 198 std::ostringstream ostr;
199 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
201 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
218 if( !glob.compare(
"specularColor" ) )
222 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 224 std::ostringstream ostr;
225 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
226 ostr <<
" * [INFO] invalid specularColor at line " << line <<
", column ";
227 ostr << column <<
"\n";
228 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
229 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
230 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
237 else if( !glob.compare(
"diffuseColor" ) )
241 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 243 std::ostringstream ostr;
244 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
245 ostr <<
" * [INFO] invalid diffuseColor at line " << line <<
", column ";
246 ostr << column <<
"\n";
247 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
248 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
249 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
256 else if( !glob.compare(
"emissiveColor" ) )
260 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 262 std::ostringstream ostr;
263 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
264 ostr <<
" * [INFO] invalid emissiveColor at line " << line <<
", column ";
265 ostr << column <<
"\n";
266 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
267 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
268 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
275 else if( !glob.compare(
"shininess" ) )
279 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 281 std::ostringstream ostr;
282 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
283 ostr <<
" * [INFO] invalid shininess at line " << line <<
", column ";
284 ostr << column <<
"\n";
285 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
286 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
287 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
294 else if( !glob.compare(
"transparency" ) )
298 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 300 std::ostringstream ostr;
301 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
302 ostr <<
" * [INFO] invalid transparency at line " << line <<
", column ";
303 ostr << column <<
"\n";
304 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
305 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
306 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
313 else if( !glob.compare(
"ambientIntensity" ) )
317 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 319 std::ostringstream ostr;
320 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
321 ostr <<
" * [INFO] invalid ambientIntensity at line " << line <<
", column ";
322 ostr << column <<
"\n";
323 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'\n";
324 ostr <<
" * [INFO] message: '" << proc.
GetError() <<
"'";
325 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
334 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 1 ) 336 std::ostringstream ostr;
337 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
338 ostr <<
" * [INFO] bad Material at line " << line <<
", column ";
339 ostr << column <<
"\n";
340 ostr <<
" * [INFO] file: '" << proc.
GetFileName() <<
"'";
341 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
361 std::ostringstream ostr;
362 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
363 ostr <<
" * [BUG] Material does not have a Shape parent (parent ID: ";
364 ostr << ptype <<
")";
365 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
372 #if defined( DEBUG_VRML2 ) && ( DEBUG_VRML2 > 2 ) 374 std::ostringstream ostr;
375 ostr <<
" * [INFO] Translating Material with " <<
m_Children.size();
376 ostr <<
" children, " <<
m_Refs.size() <<
" references and ";
378 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
384 if(
NULL != aParent )
bool Read(WRLPROC &proc, WRL2BASE *aTopNode) override
bool isDangling(void) override
Function isDangling returns true if the object does not have a parent which is a logical container fo...
WRL2NODE represents the base class of all VRML2 nodes.
std::list< WRL2NODE * > m_Children
bool GetFilePosData(size_t &line, size_t &column)
bool SetTransparency(float aTransparency) noexcept
bool ReadSFVec3f(WRLVEC3F &aSFVec3f)
bool AddChildNode(WRL2NODE *aNode) override
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
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 SetAmbient(float aRVal, float aGVal, float aBVal)
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
bool ReadSFFloat(float &aSFFloat)
std::list< WRL2NODE * > m_BackPointers
SGNODE * TranslateToSG(SGNODE *aParent) override
Function TranslateToSG produces a representation of the data using the intermediate scenegraph struct...
WRL2NODES GetNodeType(void) const
Function GetNodeType returns the type of this node instance.
bool SetShininess(float aShininess) noexcept
std::string GetFileName(void)
WRL2BASE represents the top node of a VRML2 model.
bool SetEmissive(float aRVal, float aGVal, float aBVal)
bool AddRefNode(WRL2NODE *aNode) override
bool SetSpecular(float aRVal, float aGVal, float aBVal)
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
virtual bool AddChildNode(WRL2NODE *aNode)
bool ReadName(std::string &aName)
std::string GetError(void)