29#include <wx/xml/xml.h>
47 if(
nullptr != aParent )
62 wxLogTrace(
traceVrmlPlugin, wxT(
" * [INFO] Destroying Appearance" ) );
100 wxXmlAttribute* prop;
102 for( prop = aNode->GetAttributes(); prop !=
nullptr; prop = prop->GetNext() )
104 const wxString& pname = prop->GetName();
106 if( pname == wxT(
"DEF" ) )
111 else if( pname == wxT(
"USE" ) )
126 else if( pname == wxT(
"diffuseColor" ) )
130 else if( pname == wxT(
"emissiveColor" ) )
134 else if( pname == wxT(
"specularColor" ) )
138 else if( pname == wxT(
"ambientIntensity" ) )
142 else if( pname == wxT(
"shininess" ) )
146 else if( pname == wxT(
"transparency" ) )
156 if(
nullptr == aTopNode ||
nullptr == aNode )
160 wxXmlAttribute* prop;
162 for( prop = aNode->GetAttributes(); prop !=
nullptr; prop = prop->GetNext() )
164 const wxString& pname = prop->GetName();
166 if( pname == wxT(
"DEF" ) )
168 m_Name = prop->GetValue();
173 wxXmlNode* pmat =
nullptr;
175 for( wxXmlNode* child = aNode->GetChildren(); child !=
nullptr; child = child->GetNext() )
177 if( child->GetName() == wxT(
"Material" ) )
182 if(
nullptr == pmat )
199 if(
nullptr != aParent )
207 if(
nullptr !=
m_Parent && doUnlink )
238 wxT(
" * [BUG] Appearance does not have a Shape parent (parent ID: %d)" ),
245 wxT(
" * [INFO] Translating Appearance node with %zu children, %zu"
246 "references, and %zu back pointers." ),
251 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
Function GetRawPtr() returns 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...
The base class of all X3D nodes.
std::list< X3DNODE * > m_Children
std::list< X3DNODE * > m_BackPointers
virtual bool AddChildNode(X3DNODE *aNode)=0
std::list< X3DNODE * > m_Refs
X3DNODES GetNodeType(void) const
Return the type of this node instance.
virtual void unlinkChildNode(const X3DNODE *aNode)
Remove references to an owned child; it is invoked by the child upon destruction to ensure that the p...
bool DelName(const wxString &aName, X3DNODE *aNode)
bool AddName(const wxString &aName, X3DNODE *aNode)
X3DNODE * FindName(const wxString &aName)
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)