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 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
The base class of all X3D nodes.
bool SetParent(X3DNODE *aParent, bool doUnlink=true) override
Set 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
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg l...
virtual bool AddChildNode(X3DNODE *aNode)=0
bool SetShininess(float aShininess) noexcept
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...
const wxChar *const traceVrmlPlugin
Flag to enable VRML plugin trace output.
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