25#include <wx/xml/xml.h>
43 if(
nullptr != aParent )
58 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Destroying Appearance" ) );
98 for( prop = aNode->GetAttributes(); prop !=
nullptr; prop = prop->GetNext() )
100 const wxString& pname = prop->GetName();
102 if( pname == wxT(
"DEF" ) )
107 else if( pname == wxT(
"USE" ) )
122 else if( pname == wxT(
"diffuseColor" ) )
126 else if( pname == wxT(
"emissiveColor" ) )
130 else if( pname == wxT(
"specularColor" ) )
134 else if( pname == wxT(
"ambientIntensity" ) )
138 else if( pname == wxT(
"shininess" ) )
142 else if( pname == wxT(
"transparency" ) )
152 if(
nullptr == aTopNode ||
nullptr == aNode )
156 wxXmlAttribute* prop;
158 for( prop = aNode->GetAttributes(); prop !=
nullptr; prop = prop->GetNext() )
160 const wxString& pname = prop->GetName();
162 if( pname == wxT(
"DEF" ) )
164 m_Name = prop->GetValue();
169 wxXmlNode* pmat =
nullptr;
171 for( wxXmlNode* child = aNode->GetChildren(); child !=
nullptr; child = child->GetNext() )
173 if( child->GetName() == wxT(
"Material" ) )
178 if(
nullptr == pmat )
195 if(
nullptr != aParent )
203 if(
nullptr !=
m_Parent && doUnlink )
234 wxT(
" * [BUG] Appearance does not have a Shape parent (parent ID: %d)" ),
241 wxT(
" * [INFO] Translating Appearance node with %zu children, %zu"
242 "references, and %zu back pointers." ),
247 if(
nullptr != aParent )
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
bool SetEmissive(float aRVal, float aGVal, float aBVal)
bool SetSpecular(float aRVal, float aGVal, float aBVal)
bool SetShininess(float aShininess) noexcept
bool SetAmbient(float aRVal, float aGVal, float aBVal)
bool SetTransparency(float aTransparency) noexcept
SGNODE * GetRawPtr(void) noexcept
Return the raw internal SGNODE pointer.
The base class of all Scene Graph nodes.
void readFields(wxXmlNode *aNode)
bool SetParent(X3DNODE *aParent, bool doUnlink=true) override
Set the parent X3DNODE of this object.
bool AddRefNode(X3DNODE *aNode) override
bool Read(wxXmlNode *aNode, X3DNODE *aTopNode, X3D_DICT &aDict) override
bool AddChildNode(X3DNODE *aNode) override
SGNODE * TranslateToSG(SGNODE *aParent) override
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
std::list< X3DNODE * > m_Children
std::list< X3DNODE * > m_BackPointers
std::list< X3DNODE * > m_Refs
X3DNODES GetNodeType(void) const
Return the type of this node instance.
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
collects header files for all SG* wrappers and the API
SGLIB_API S3D::SGTYPES GetSGNodeType(SGNODE *aNode)
SGLIB_API SGNODE * GetSGNodeParent(SGNODE *aNode)
SGLIB_API bool AddSGNodeChild(SGNODE *aParent, SGNODE *aChild)
SGLIB_API bool AddSGNodeRef(SGNODE *aParent, SGNODE *aChild)
bool ParseSFVec3(const wxString &aSource, WRLVEC3F &aResult)
bool ParseSFFloat(const wxString &aSource, float &aResult)