28 #include <wx/xml/xml.h> 65 #if defined( DEBUG_X3D ) && ( DEBUG_X3D > 2 ) 66 wxLogTrace(
MASK_VRML,
" * [INFO] Destroying Appearance\n" );
107 wxXmlAttribute* prop;
109 for( prop = aNode->GetAttributes();
111 prop = prop->GetNext() )
113 const wxString& pname = prop->GetName();
120 else if( pname ==
"USE" )
135 else if( pname ==
"diffuseColor" )
137 else if( pname ==
"emissiveColor" )
139 else if( pname ==
"specularColor" )
141 else if( pname ==
"ambientIntensity" )
143 else if( pname ==
"shininess" )
145 else if( pname ==
"transparency" )
156 if(
NULL == aTopNode ||
NULL == aNode )
160 wxXmlAttribute* prop;
162 for( prop = aNode->GetAttributes();
164 prop = prop->GetNext() )
166 const wxString& pname = prop->GetName();
170 m_Name = prop->GetValue();
175 wxXmlNode* pmat =
NULL;
177 for( wxXmlNode* child = aNode->GetChildren();
179 child = child->GetNext() )
181 if( child->GetName() ==
"Material" )
203 if(
NULL != aParent )
242 std::ostringstream ostr;
243 ostr << __FILE__ <<
": " << __FUNCTION__ <<
": " << __LINE__ <<
"\n";
244 ostr <<
" * [BUG] Appearance does not have a Shape parent (parent ID: ";
245 ostr << ptype <<
")";
246 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
252 #if defined( DEBUG_X3D ) && ( DEBUG_X3D > 2 ) 254 std::ostringstream ostr;
255 ostr <<
" * [INFO] Translating Appearance with " <<
m_Children.size();
256 ostr <<
" children, " <<
m_Refs.size() <<
" references and ";
258 wxLogTrace(
MASK_VRML,
"%s\n", ostr.str().c_str() );
264 if(
NULL != aParent )
bool AddChildNode(X3DNODE *aNode) override
std::list< X3DNODE * > m_BackPointers
bool SetTransparency(float aTransparency) noexcept
X3DNODE * FindName(const wxString &aName)
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
bool DelName(const wxString &aName, X3DNODE *aNode)
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)
std::list< X3DNODE * > m_Children
X3DNODE represents the base class of all X3D nodes.
bool SetParent(X3DNODE *aParent, bool doUnlink=true) override
Function SetParent sets the parent X3DNODE of this object.
bool SetAmbient(float aRVal, float aGVal, float aBVal)
bool AddRefNode(X3DNODE *aNode) override
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
bool ParseSFFloat(const wxString &aSource, float &aResult)
SGNODE * TranslateToSG(SGNODE *aParent) override
Function TranslateToSG produces a representation of the data using the intermediate scenegraph struct...
virtual bool AddChildNode(X3DNODE *aNode)=0
bool SetShininess(float aShininess) noexcept
X3DNODES GetNodeType(void) const
Function GetNodeType returns the type of this node instance.
virtual void unlinkChildNode(const X3DNODE *aNode)
Function unlinkChild removes references to an owned child; it is invoked by the child upon destructio...
bool SetEmissive(float aRVal, float aGVal, float aBVal)
bool AddName(const wxString &aName, X3DNODE *aNode)
bool SetSpecular(float aRVal, float aGVal, float aBVal)
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
bool Read(wxXmlNode *aNode, X3DNODE *aTopNode, X3D_DICT &aDict) override
bool ParseSFVec3(const wxString &aSource, WRLVEC3F &aResult)
void readFields(wxXmlNode *aNode)
std::list< X3DNODE * > m_Refs