KiCad PCB EDA Suite
|
#include <vrml1_material.h>
Public Member Functions | |
WRL1MATERIAL (NAMEREGISTER *aDictionary) | |
WRL1MATERIAL (NAMEREGISTER *aDictionary, WRL1NODE *aParent) | |
virtual | ~WRL1MATERIAL () |
bool | Read (WRLPROC &proc, WRL1BASE *aTopNode) override |
bool | AddRefNode (WRL1NODE *aNode) override |
bool | AddChildNode (WRL1NODE *aNode) override |
SGNODE * | TranslateToSG (SGNODE *aParent, WRL1STATUS *sp) override |
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library. | |
SGNODE * | GetAppearance (int aIndex) |
Return an SGAPPEARANCE node representing the appearance for an IndexedFaceSet. | |
void | GetColor (SGCOLOR *aColor, int aIndex) |
Compute an SGCOLOR representing the appearance of a vertex or face. | |
void | Reclaim (SGNODE *aColor) |
Destroy the given color node if it does not have a parent. | |
void | cancelDict (void) |
WRL1NODES | getNodeTypeID (const std::string &aNodeName) |
Return the ID based on the given aNodeName or WRL1_INVALID (WRL1_END) if no such node name exists. | |
virtual void | unlinkChildNode (const WRL1NODE *aNode) |
Remove references to an owned child; it is invoked by the child upon destruction to ensure that the parent has no invalid references. | |
virtual void | unlinkRefNode (const WRL1NODE *aNode) |
Remove pointers to a referenced node; it is invoked by the referenced node upon destruction to ensure that the referring node has no invalid references. | |
void | addNodeRef (WRL1NODE *aNode) |
Add a pointer to a node which references, but does not own, this node. | |
void | delNodeRef (WRL1NODE *aNode) |
Remove a pointer to a node which references, but does not own, this node. | |
WRL1NODES | GetNodeType (void) const |
Return the type of this node instance. | |
WRL1NODE * | GetParent (void) const |
Return a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie. | |
virtual bool | SetParent (WRL1NODE *aParent, bool doUnlink=true) |
Set the parent WRL1NODE of this object. | |
virtual std::string | GetName (void) |
virtual bool | SetName (const std::string &aName) |
const char * | GetNodeTypeName (WRL1NODES aNodeType) const |
size_t | GetNItems (void) const |
virtual WRL1NODE * | FindNode (const std::string &aNodeName) |
Search the tree of linked nodes and returns a reference to the current node with the given name. | |
std::string | GetError (void) |
Protected Attributes | |
WRL1NODE * | m_Parent |
WRL1NODES | m_Type |
std::string | m_Name |
std::list< WRL1NODE * > | m_BackPointers |
std::list< WRL1NODE * > | m_Children |
std::list< WRL1NODE * > | m_Refs |
std::list< WRL1NODE * > | m_Items |
std::string | m_error |
WRL1STATUS | m_current |
SGNODE * | m_sgNode |
NAMEREGISTER * | m_dictionary |
Private Member Functions | |
void | checkRange (float &aValue) |
void | addItem (WRL1NODE *aNode) |
void | delItem (const WRL1NODE *aNode) |
Private Attributes | |
std::vector< WRLVEC3F > | diffuseColor |
std::vector< WRLVEC3F > | emissiveColor |
std::vector< WRLVEC3F > | specularColor |
std::vector< WRLVEC3F > | ambientColor |
std::vector< float > | shininess |
std::vector< float > | transparency |
SGNODE * | colors [2] |
Definition at line 41 of file vrml1_material.h.
WRL1MATERIAL::WRL1MATERIAL | ( | NAMEREGISTER * | aDictionary | ) |
Definition at line 35 of file vrml1_material.cpp.
References colors, and WRL1NODE::m_Type.
WRL1MATERIAL::WRL1MATERIAL | ( | NAMEREGISTER * | aDictionary, |
WRL1NODE * | aParent | ||
) |
Definition at line 43 of file vrml1_material.cpp.
References WRL1NODE::AddChildNode(), colors, WRL1NODE::m_Parent, and WRL1NODE::m_Type.
|
virtual |
Definition at line 56 of file vrml1_material.cpp.
References colors, S3D::DestroyNode(), S3D::GetSGNodeParent(), and traceVrmlPlugin.
|
overridevirtual |
Reimplemented from WRL1NODE.
Definition at line 81 of file vrml1_material.cpp.
|
privateinherited |
Definition at line 458 of file vrml1_node.cpp.
References WRL1NODE::m_Items.
Referenced by WRL1NODE::AddChildNode(), and WRL1NODE::AddRefNode().
|
inherited |
Add a pointer to a node which references, but does not own, this node.
Such back-pointers are required to ensure that invalidated references are removed when a node is deleted
aNode | is the node holding a reference to this object. |
Definition at line 216 of file vrml1_node.cpp.
References WRL1NODE::m_BackPointers, and WRL1NODE::m_Parent.
Referenced by WRL1NODE::AddRefNode().
|
overridevirtual |
Reimplemented from WRL1NODE.
Definition at line 74 of file vrml1_material.cpp.
|
inherited |
Definition at line 198 of file vrml1_node.cpp.
References WRL1NODE::m_Children, WRL1NODE::m_dictionary, and WRL1NODE::m_Type.
Referenced by WRL1BASE::~WRL1BASE().
|
private |
Definition at line 533 of file vrml1_material.cpp.
Referenced by GetAppearance(), and GetColor().
|
privateinherited |
Definition at line 464 of file vrml1_node.cpp.
References WRL1NODE::m_Items.
Referenced by WRL1NODE::unlinkChildNode(), and WRL1NODE::unlinkRefNode().
|
inherited |
Remove a pointer to a node which references, but does not own, this node.
aNode | is the node holding a reference to this object. |
Definition at line 237 of file vrml1_node.cpp.
References WRL1NODE::m_BackPointers, and traceVrmlPlugin.
|
virtualinherited |
Search the tree of linked nodes and returns a reference to the current node with the given name.
The reference is then typically added to another node via AddRefNode().
aNodeName | is the name of the node to search for. |
Definition at line 350 of file vrml1_node.cpp.
References NAMEREGISTER::FindName(), and WRL1NODE::m_dictionary.
Referenced by WRL1BASE::implementUse().
SGNODE * WRL1MATERIAL::GetAppearance | ( | int | aIndex | ) |
Return an SGAPPEARANCE node representing the appearance for an IndexedFaceSet.
Definition at line 255 of file vrml1_material.cpp.
References ambientColor, checkRange(), colors, diffuseColor, emissiveColor, IFSG_NODE::GetRawPtr(), red, IFSG_APPEARANCE::SetAmbient(), IFSG_APPEARANCE::SetDiffuse(), IFSG_APPEARANCE::SetEmissive(), IFSG_APPEARANCE::SetShininess(), IFSG_APPEARANCE::SetSpecular(), IFSG_APPEARANCE::SetTransparency(), shininess, specularColor, and transparency.
Referenced by WRL1FACESET::TranslateToSG().
void WRL1MATERIAL::GetColor | ( | SGCOLOR * | aColor, |
int | aIndex | ||
) |
Compute an SGCOLOR representing the appearance of a vertex or face.
Definition at line 364 of file vrml1_material.cpp.
References ambientColor, checkRange(), diffuseColor, emissiveColor, red, SGCOLOR::SetColor(), shininess, and specularColor.
Referenced by WRL1FACESET::TranslateToSG().
|
inherited |
Definition at line 344 of file vrml1_node.cpp.
References WRL1NODE::m_error.
|
virtualinherited |
Reimplemented in WRL1BASE.
Definition at line 266 of file vrml1_node.cpp.
References WRL1NODE::m_Name.
|
inherited |
Definition at line 338 of file vrml1_node.cpp.
References WRL1NODE::m_Items.
|
inherited |
Return the type of this node instance.
Definition at line 254 of file vrml1_node.cpp.
References WRL1NODE::m_Type.
Referenced by WRL1NODE::AddChildNode(), WRL1NODE::AddRefNode(), WRL1BASE::implementUse(), WRL1GROUP::TranslateToSG(), and WRL1TRANSFORM::TranslateToSG().
|
inherited |
Return the ID based on the given aNodeName or WRL1_INVALID (WRL1_END) if no such node name exists.
Definition at line 327 of file vrml1_node.cpp.
References nodenames.
Referenced by WRL1BASE::ReadNode().
|
inherited |
Definition at line 312 of file vrml1_node.cpp.
References nodenames.
Referenced by WRL1BASE::implementUse().
|
inherited |
Return a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.
top level transform).
Definition at line 260 of file vrml1_node.cpp.
References WRL1NODE::m_Parent.
Referenced by WRL1NODE::AddChildNode().
Implements WRL1NODE.
Definition at line 88 of file vrml1_material.cpp.
References ambientColor, diffuseColor, emissiveColor, WRLPROC::eof(), WRLPROC::GetError(), WRLPROC::GetFileName(), WRLPROC::GetFilePosition(), WRLPROC::Peek(), WRLPROC::Pop(), WRLPROC::ReadMFFloat(), WRLPROC::ReadMFVec3f(), WRLPROC::ReadName(), shininess, specularColor, traceVrmlPlugin, and transparency.
Referenced by WRL1BASE::readMaterial().
void WRL1MATERIAL::Reclaim | ( | SGNODE * | aColor | ) |
Destroy the given color node if it does not have a parent.
Definition at line 542 of file vrml1_material.cpp.
References colors, S3D::DestroyNode(), and S3D::GetSGNodeParent().
|
virtualinherited |
Reimplemented in WRL1BASE.
Definition at line 272 of file vrml1_node.cpp.
References NAMEREGISTER::AddName(), BAD_CHARS1, BAD_CHARS2, WRL1NODE::m_dictionary, WRL1NODE::m_Name, and traceVrmlPlugin.
Referenced by WRL1BASE::implementDef().
|
virtualinherited |
Set the parent WRL1NODE of this object.
aParent | [in] is the desired parent node. |
doUnlink | indicates that the child must be unlinked from the parent |
Reimplemented in WRL1BASE.
Definition at line 359 of file vrml1_node.cpp.
References WRL1NODE::AddChildNode(), WRL1NODE::m_Parent, and WRL1NODE::unlinkChildNode().
Referenced by WRL1NODE::AddChildNode().
|
overridevirtual |
Produce a representation of the data using the intermediate scenegraph structures of the kicad_3dsg library.
aParent | is a pointer to the parent SG node. |
Implements WRL1NODE.
Definition at line 245 of file vrml1_material.cpp.
References WRL1STATUS::mat.
|
virtualinherited |
Remove references to an owned child; it is invoked by the child upon destruction to ensure that the parent has no invalid references.
aNode | is the child which is being deleted. |
Definition at line 420 of file vrml1_node.cpp.
References WRL1NODE::delItem(), and WRL1NODE::m_Children.
Referenced by WRL1NODE::SetParent(), and WRL1NODE::~WRL1NODE().
|
virtualinherited |
Remove pointers to a referenced node; it is invoked by the referenced node upon destruction to ensure that the referring node has no invalid references.
aNode | is the node which is being deleted. |
Definition at line 439 of file vrml1_node.cpp.
References WRL1NODE::delItem(), and WRL1NODE::m_Refs.
|
private |
Definition at line 74 of file vrml1_material.h.
Referenced by GetAppearance(), GetColor(), and Read().
|
private |
Definition at line 78 of file vrml1_material.h.
Referenced by GetAppearance(), Reclaim(), WRL1MATERIAL(), and ~WRL1MATERIAL().
|
private |
Definition at line 71 of file vrml1_material.h.
Referenced by GetAppearance(), GetColor(), and Read().
|
private |
Definition at line 72 of file vrml1_material.h.
Referenced by GetAppearance(), GetColor(), and Read().
|
protectedinherited |
Definition at line 230 of file vrml1_node.h.
Referenced by WRL1NODE::addNodeRef(), WRL1NODE::delNodeRef(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), WRL1SWITCH::TranslateToSG(), WRL1FACESET::~WRL1FACESET(), WRL1GROUP::~WRL1GROUP(), WRL1NODE::~WRL1NODE(), WRL1SEPARATOR::~WRL1SEPARATOR(), WRL1SWITCH::~WRL1SWITCH(), and WRL1TRANSFORM::~WRL1TRANSFORM().
|
protectedinherited |
Definition at line 231 of file vrml1_node.h.
Referenced by WRL1NODE::AddChildNode(), WRL1NODE::cancelDict(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), WRL1SWITCH::TranslateToSG(), WRL1NODE::unlinkChildNode(), WRL1FACESET::~WRL1FACESET(), WRL1GROUP::~WRL1GROUP(), WRL1NODE::~WRL1NODE(), WRL1SEPARATOR::~WRL1SEPARATOR(), WRL1SWITCH::~WRL1SWITCH(), and WRL1TRANSFORM::~WRL1TRANSFORM().
|
protectedinherited |
Definition at line 236 of file vrml1_node.h.
Referenced by WRL1BASE::TranslateToSG(), WRL1FACESET::TranslateToSG(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), and WRL1SWITCH::TranslateToSG().
|
protectedinherited |
Definition at line 246 of file vrml1_node.h.
Referenced by WRL1NODE::cancelDict(), WRL1NODE::FindNode(), WRL1BASE::implementDef(), WRL1BASE::readCoords(), WRL1BASE::readFaceSet(), WRL1BASE::readGroup(), WRL1BASE::readMatBinding(), WRL1BASE::readMaterial(), WRL1BASE::readSeparator(), WRL1BASE::readShapeHints(), WRL1BASE::readSwitch(), WRL1BASE::readTransform(), WRL1NODE::SetName(), WRL1BASE::WRL1BASE(), WRL1NODE::WRL1NODE(), and WRL1NODE::~WRL1NODE().
|
protectedinherited |
Definition at line 234 of file vrml1_node.h.
Referenced by WRL1NODE::GetError().
|
protectedinherited |
Definition at line 233 of file vrml1_node.h.
Referenced by WRL1NODE::addItem(), WRL1NODE::delItem(), WRL1NODE::GetNItems(), WRL1BASE::TranslateToSG(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), WRL1SWITCH::TranslateToSG(), and WRL1NODE::~WRL1NODE().
|
protectedinherited |
Definition at line 228 of file vrml1_node.h.
Referenced by WRL1NODE::GetName(), WRL1NODE::SetName(), and WRL1NODE::~WRL1NODE().
|
protectedinherited |
Definition at line 226 of file vrml1_node.h.
Referenced by WRL1NODE::addNodeRef(), WRL1NODE::GetParent(), WRL1NODE::SetParent(), WRL1FACESET::TranslateToSG(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), WRL1TRANSFORM::TranslateToSG(), WRL1COORDS::WRL1COORDS(), WRL1FACESET::WRL1FACESET(), WRL1GROUP::WRL1GROUP(), WRL1MATBINDING::WRL1MATBINDING(), WRL1MATERIAL(), WRL1NODE::WRL1NODE(), WRL1SEPARATOR::WRL1SEPARATOR(), WRL1SHAPEHINTS::WRL1SHAPEHINTS(), WRL1SWITCH::WRL1SWITCH(), WRL1TRANSFORM::WRL1TRANSFORM(), and WRL1NODE::~WRL1NODE().
|
protectedinherited |
Definition at line 232 of file vrml1_node.h.
Referenced by WRL1NODE::AddRefNode(), WRL1GROUP::TranslateToSG(), WRL1SEPARATOR::TranslateToSG(), WRL1SWITCH::TranslateToSG(), WRL1NODE::unlinkRefNode(), WRL1FACESET::~WRL1FACESET(), WRL1GROUP::~WRL1GROUP(), WRL1NODE::~WRL1NODE(), WRL1SEPARATOR::~WRL1SEPARATOR(), WRL1SWITCH::~WRL1SWITCH(), and WRL1TRANSFORM::~WRL1TRANSFORM().
|
protectedinherited |
Definition at line 237 of file vrml1_node.h.
Referenced by WRL1NODE::WRL1NODE().
|
protectedinherited |
Definition at line 227 of file vrml1_node.h.
Referenced by WRL1NODE::cancelDict(), WRL1NODE::GetNodeType(), WRL1BASE::WRL1BASE(), WRL1COORDS::WRL1COORDS(), WRL1FACESET::WRL1FACESET(), WRL1GROUP::WRL1GROUP(), WRL1MATBINDING::WRL1MATBINDING(), WRL1MATERIAL(), WRL1NODE::WRL1NODE(), WRL1SEPARATOR::WRL1SEPARATOR(), WRL1SHAPEHINTS::WRL1SHAPEHINTS(), WRL1SWITCH::WRL1SWITCH(), WRL1TRANSFORM::WRL1TRANSFORM(), and WRL1NODE::~WRL1NODE().
|
private |
Definition at line 75 of file vrml1_material.h.
Referenced by GetAppearance(), GetColor(), and Read().
|
private |
Definition at line 73 of file vrml1_material.h.
Referenced by GetAppearance(), GetColor(), and Read().
|
private |
Definition at line 76 of file vrml1_material.h.
Referenced by GetAppearance(), and Read().