KiCad PCB EDA Suite
IFSG_INDEX Class Referenceabstract

Class IFSG_INDEX is the wrapper for SGINDEX. More...

#include <ifsg_index.h>

Inheritance diagram for IFSG_INDEX:
IFSG_NODE IFSG_COORDINDEX

Public Member Functions

 IFSG_INDEX ()
 
virtual bool Attach (SGNODE *aNode) override=0
 Function Attach associates a given SGNODE* with this wrapper. More...
 
virtual bool NewNode (SGNODE *aParent) override=0
 Function NewNode creates a new node to associate with this wrapper. More...
 
virtual bool NewNode (IFSG_NODE &aParent) override=0
 
bool GetIndices (size_t &nIndices, int *&aIndexList)
 
bool SetIndices (size_t nIndices, int *aIndexList)
 Function SetIndices sets the number of indices and creates a copy of the given index data. More...
 
bool AddIndex (int aIndex)
 Function AddIndex adds a single index to the list. More...
 
void Destroy (void)
 Function Destroy deletes the object held by this wrapper. More...
 
SGNODEGetRawPtr (void)
 Function GetRawPtr() returns the raw internal SGNODE pointer. More...
 
S3D::SGTYPES GetNodeType (void) const
 Function GetNodeType returns the type of this node instance. More...
 
SGNODEGetParent (void) const
 Function GetParent returns a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie. More...
 
bool SetParent (SGNODE *aParent)
 Function SetParent sets the parent SGNODE of this object. More...
 
const char * GetName (void)
 Function GetName returns a pointer to the node name (NULL if no name assigned) More...
 
bool SetName (const char *aName)
 Function SetName sets the node's name; if the pointer passed is NULL then the node's name is erased. More...
 
const char * GetNodeTypeName (S3D::SGTYPES aNodeType) const
 Function GetNodeTypeName returns the text representation of the node type or NULL if the node somehow has an invalid type. More...
 
SGNODEFindNode (const char *aNodeName)
 Function FindNode searches the tree of linked nodes and returns a reference to the first node found with the given name. More...
 
bool AddRefNode (SGNODE *aNode)
 Function AddRefNode adds a reference to an existing node which is not owned by (not a child of) this node. More...
 
bool AddRefNode (IFSG_NODE &aNode)
 
bool AddChildNode (SGNODE *aNode)
 Function AddChildNode adds a node as a child owned by this node. More...
 
bool AddChildNode (IFSG_NODE &aNode)
 

Protected Attributes

SGNODEm_node
 

Detailed Description

Class IFSG_INDEX is the wrapper for SGINDEX.

Definition at line 40 of file ifsg_index.h.

Constructor & Destructor Documentation

IFSG_INDEX::IFSG_INDEX ( )

Definition at line 39 of file ifsg_index.cpp.

39  : IFSG_NODE()
40 {
41  return;
42 }

Member Function Documentation

bool IFSG_NODE::AddChildNode ( SGNODE aNode)
inherited

Function AddChildNode adds a node as a child owned by this node.

Returns
true on success

Definition at line 249 of file ifsg_node.cpp.

References SGNODE::AddChildNode(), BadObject, and IFSG_NODE::m_node.

Referenced by export_vrml_module().

250 {
251  if( NULL == m_node )
252  {
253  #ifdef DEBUG
254  std::ostringstream ostr;
255  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
256  ostr << BadObject;
257  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
258  #endif
259 
260  return false;
261  }
262 
263  return m_node->AddChildNode( aNode );
264 }
SGNODE * m_node
Definition: ifsg_node.h:57
virtual bool AddChildNode(SGNODE *aNode)=0
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_NODE::AddChildNode ( IFSG_NODE aNode)
inherited

Definition at line 267 of file ifsg_node.cpp.

References SGNODE::AddChildNode(), BadObject, BadOperand, IFSG_NODE::GetRawPtr(), and IFSG_NODE::m_node.

268 {
269  if( NULL == m_node )
270  {
271  #ifdef DEBUG
272  std::ostringstream ostr;
273  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
274  ostr << BadObject;
275  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
276  #endif
277 
278  return false;
279  }
280 
281  SGNODE* np = aNode.GetRawPtr();
282 
283  if( NULL == np )
284  {
285  #ifdef DEBUG
286  std::ostringstream ostr;
287  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
288  ostr << BadOperand;
289  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
290  #endif
291 
292  return false;
293  }
294 
295  return m_node->AddChildNode( np );
296 }
SGNODE * GetRawPtr(void)
Function GetRawPtr() returns the raw internal SGNODE pointer.
Definition: ifsg_node.cpp:66
char BadOperand[]
Definition: ifsg_node.cpp:35
SGNODE * m_node
Definition: ifsg_node.h:57
Class SGNODE represents the base class of all Scene Graph nodes.
Definition: sg_node.h:76
virtual bool AddChildNode(SGNODE *aNode)=0
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_INDEX::AddIndex ( int  aIndex)

Function AddIndex adds a single index to the list.

Parameters
nIndices[in] the number of indices to be stored
aIndexList[in] the index data

Definition at line 83 of file ifsg_index.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by create_vrml_shell().

84 {
85  if( NULL == m_node )
86  {
87  #ifdef DEBUG
88  std::ostringstream ostr;
89  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
90  ostr << BadObject;
91  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
92  #endif
93 
94  return false;
95  }
96 
97  ((SGINDEX*)m_node)->AddIndex( aIndex );
98 
99  return true;
100 }
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_NODE::AddRefNode ( SGNODE aNode)
inherited

Function AddRefNode adds a reference to an existing node which is not owned by (not a child of) this node.

Returns
true on success

Definition at line 199 of file ifsg_node.cpp.

References SGNODE::AddRefNode(), BadObject, and IFSG_NODE::m_node.

Referenced by export_vrml_module().

200 {
201  if( NULL == m_node )
202  {
203  #ifdef DEBUG
204  std::ostringstream ostr;
205  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
206  ostr << BadObject;
207  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
208  #endif
209 
210  return false;
211  }
212 
213  return m_node->AddRefNode( aNode );
214 }
virtual bool AddRefNode(SGNODE *aNode)=0
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_NODE::AddRefNode ( IFSG_NODE aNode)
inherited

Definition at line 217 of file ifsg_node.cpp.

References SGNODE::AddRefNode(), BadObject, BadOperand, IFSG_NODE::GetRawPtr(), and IFSG_NODE::m_node.

218 {
219  if( NULL == m_node )
220  {
221  #ifdef DEBUG
222  std::ostringstream ostr;
223  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
224  ostr << BadObject;
225  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
226  #endif
227 
228  return false;
229  }
230 
231  SGNODE* np = aNode.GetRawPtr();
232 
233  if( NULL == np )
234  {
235  #ifdef DEBUG
236  std::ostringstream ostr;
237  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
238  ostr << BadOperand;
239  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
240  #endif
241 
242  return false;
243  }
244 
245  return m_node->AddRefNode( np );
246 }
SGNODE * GetRawPtr(void)
Function GetRawPtr() returns the raw internal SGNODE pointer.
Definition: ifsg_node.cpp:66
char BadOperand[]
Definition: ifsg_node.cpp:35
virtual bool AddRefNode(SGNODE *aNode)=0
SGNODE * m_node
Definition: ifsg_node.h:57
Class SGNODE represents the base class of all Scene Graph nodes.
Definition: sg_node.h:76
char BadObject[]
Definition: ifsg_node.cpp:34
virtual bool IFSG_INDEX::Attach ( SGNODE aNode)
overridepure virtual

Function Attach associates a given SGNODE* with this wrapper.

Implements IFSG_NODE.

Implemented in IFSG_COORDINDEX.

void IFSG_NODE::Destroy ( void  )
inherited

Function Destroy deletes the object held by this wrapper.

Definition at line 54 of file ifsg_node.cpp.

References SGNODE::DisassociateWrapper(), and IFSG_NODE::m_node.

Referenced by MODEL_VRML::~MODEL_VRML().

55 {
56  if( m_node )
58 
59  delete m_node;
60  m_node = NULL;
61 
62  return;
63 }
SGNODE * m_node
Definition: ifsg_node.h:57
void DisassociateWrapper(SGNODE **aWrapperRef)
Function DisassociateWrapper removes the association between an IFSG* wrapper object and this object...
Definition: sg_node.cpp:264
SGNODE * IFSG_NODE::FindNode ( const char *  aNodeName)
inherited

Function FindNode searches the tree of linked nodes and returns a reference to the first node found with the given name.

The reference is then typically added to another node via AddRefNode().

Parameters
aNodeNameis the name of the node to search for
aCalleris a pointer to the node invoking this function
Returns
is a valid node pointer on success, otherwise NULL

Definition at line 181 of file ifsg_node.cpp.

References BadObject, SGNODE::FindNode(), and IFSG_NODE::m_node.

182 {
183  if( NULL == m_node )
184  {
185  #ifdef DEBUG
186  std::ostringstream ostr;
187  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
188  ostr << BadObject;
189  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
190  #endif
191 
192  return NULL;
193  }
194 
195  return m_node->FindNode( aNodeName, NULL );
196 }
SGNODE * m_node
Definition: ifsg_node.h:57
virtual SGNODE * FindNode(const char *aNodeName, const SGNODE *aCaller)=0
Function FindNode searches the tree of linked nodes and returns a reference to the first node found w...
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_INDEX::GetIndices ( size_t &  nIndices,
int *&  aIndexList 
)

Definition at line 45 of file ifsg_index.cpp.

References BadObject, and IFSG_NODE::m_node.

46 {
47  if( NULL == m_node )
48  {
49  #ifdef DEBUG
50  std::ostringstream ostr;
51  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
52  ostr << BadObject;
53  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
54  #endif
55 
56  return false;
57  }
58 
59  return ((SGINDEX*)m_node)->GetIndices( nIndices, aIndexList );
60 }
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool GetIndices(size_t &nIndices, int *&aIndexList)
Definition: ifsg_index.cpp:45
const char * IFSG_NODE::GetName ( void  )
inherited

Function GetName returns a pointer to the node name (NULL if no name assigned)

Definition at line 126 of file ifsg_node.cpp.

References BadObject, SGNODE::GetName(), and IFSG_NODE::m_node.

127 {
128  if( NULL == m_node )
129  {
130  #ifdef DEBUG
131  std::ostringstream ostr;
132  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
133  ostr << BadObject;
134  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
135  #endif
136 
137  return NULL;
138  }
139 
140  return m_node->GetName();
141 }
SGNODE * m_node
Definition: ifsg_node.h:57
const char * GetName(void)
Definition: sg_node.cpp:150
char BadObject[]
Definition: ifsg_node.cpp:34
S3D::SGTYPES IFSG_NODE::GetNodeType ( void  ) const
inherited

Function GetNodeType returns the type of this node instance.

Definition at line 72 of file ifsg_node.cpp.

References BadObject, SGNODE::GetNodeType(), IFSG_NODE::m_node, and S3D::SGTYPE_END.

73 {
74  if( NULL == m_node )
75  {
76  #ifdef DEBUG
77  std::ostringstream ostr;
78  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
79  ostr << BadObject;
80  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
81  #endif
82 
83  return S3D::SGTYPE_END;
84  }
85 
86  return m_node->GetNodeType();
87 }
SGNODE * m_node
Definition: ifsg_node.h:57
S3D::SGTYPES GetNodeType(void) const
Function GetNodeType returns the type of this node instance.
Definition: sg_node.cpp:108
char BadObject[]
Definition: ifsg_node.cpp:34
const char * IFSG_NODE::GetNodeTypeName ( S3D::SGTYPES  aNodeType) const
inherited

Function GetNodeTypeName returns the text representation of the node type or NULL if the node somehow has an invalid type.

Definition at line 163 of file ifsg_node.cpp.

References BadObject, SGNODE::GetNodeTypeName(), and IFSG_NODE::m_node.

164 {
165  if( NULL == m_node )
166  {
167  #ifdef DEBUG
168  std::ostringstream ostr;
169  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
170  ostr << BadObject;
171  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
172  #endif
173 
174  return NULL;
175  }
176 
177  return m_node->GetNodeTypeName( aNodeType );
178 }
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
const char * GetNodeTypeName(S3D::SGTYPES aNodeType) const
Definition: sg_node.cpp:170
SGNODE * IFSG_NODE::GetParent ( void  ) const
inherited

Function GetParent returns a pointer to the parent SGNODE of this object or NULL if the object has no parent (ie.

top level transform).

Definition at line 90 of file ifsg_node.cpp.

References BadObject, SGNODE::GetParent(), and IFSG_NODE::m_node.

91 {
92  if( NULL == m_node )
93  {
94  #ifdef DEBUG
95  std::ostringstream ostr;
96  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
97  ostr << BadObject;
98  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
99  #endif
100 
101  return NULL;
102  }
103 
104  return m_node->GetParent();
105 }
SGNODE * m_node
Definition: ifsg_node.h:57
SGNODE * GetParent(void) const
Function GetParent returns a pointer to the parent SGNODE of this object or NULL if the object has no...
Definition: sg_node.cpp:114
char BadObject[]
Definition: ifsg_node.cpp:34
virtual bool IFSG_INDEX::NewNode ( SGNODE aParent)
overridepure virtual

Function NewNode creates a new node to associate with this wrapper.

Implements IFSG_NODE.

Implemented in IFSG_COORDINDEX.

virtual bool IFSG_INDEX::NewNode ( IFSG_NODE aParent)
overridepure virtual

Implements IFSG_NODE.

Implemented in IFSG_COORDINDEX.

bool IFSG_INDEX::SetIndices ( size_t  nIndices,
int *  aIndexList 
)

Function SetIndices sets the number of indices and creates a copy of the given index data.

Parameters
nIndices[in] the number of indices to be stored
aIndexList[in] the index data

Definition at line 63 of file ifsg_index.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by create_vrml_plane(), and create_vrml_shell().

64 {
65  if( NULL == m_node )
66  {
67  #ifdef DEBUG
68  std::ostringstream ostr;
69  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
70  ostr << BadObject;
71  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
72  #endif
73 
74  return false;
75  }
76 
77  ((SGINDEX*)m_node)->SetIndices( nIndices, aIndexList );
78 
79  return true;
80 }
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_NODE::SetName ( const char *  aName)
inherited

Function SetName sets the node's name; if the pointer passed is NULL then the node's name is erased.

Returns
true on success

Definition at line 144 of file ifsg_node.cpp.

References BadObject, IFSG_NODE::m_node, and SGNODE::SetName().

145 {
146  if( NULL == m_node )
147  {
148  #ifdef DEBUG
149  std::ostringstream ostr;
150  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
151  ostr << BadObject;
152  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
153  #endif
154 
155  return false;
156  }
157 
158  m_node->SetName( aName );
159  return true;
160 }
SGNODE * m_node
Definition: ifsg_node.h:57
void SetName(const char *aName)
Definition: sg_node.cpp:159
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_NODE::SetParent ( SGNODE aParent)
inherited

Function SetParent sets the parent SGNODE of this object.

Parameters
aParent[in] is the desired parent node
Returns
true if the operation succeeds; false if the given node is not allowed to be a parent to the derived object

Definition at line 108 of file ifsg_node.cpp.

References BadObject, IFSG_NODE::m_node, and SGNODE::SetParent().

Referenced by MODEL_VRML::~MODEL_VRML().

109 {
110  if( NULL == m_node )
111  {
112  #ifdef DEBUG
113  std::ostringstream ostr;
114  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
115  ostr << BadObject;
116  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
117  #endif
118 
119  return false;
120  }
121 
122  return m_node->SetParent( aParent );
123 }
SGNODE * m_node
Definition: ifsg_node.h:57
virtual bool SetParent(SGNODE *aParent, bool notify=true)=0
Function SetParent sets the parent SGNODE of this object.
char BadObject[]
Definition: ifsg_node.cpp:34

Member Data Documentation

SGNODE* IFSG_NODE::m_node
protectedinherited

Definition at line 57 of file ifsg_node.h.

Referenced by IFSG_NODE::AddChildNode(), IFSG_COLORS::AddColor(), IFSG_COORDS::AddCoord(), AddIndex(), IFSG_NORMALS::AddNormal(), IFSG_NODE::AddRefNode(), IFSG_APPEARANCE::Attach(), IFSG_COORDS::Attach(), IFSG_COORDINDEX::Attach(), IFSG_NORMALS::Attach(), IFSG_FACESET::Attach(), IFSG_SHAPE::Attach(), IFSG_COLORS::Attach(), IFSG_TRANSFORM::Attach(), IFSG_FACESET::CalcNormals(), IFSG_NODE::Destroy(), IFSG_NODE::FindNode(), IFSG_COLORS::GetColorList(), IFSG_COORDS::GetCoordsList(), GetIndices(), IFSG_NODE::GetName(), IFSG_NODE::GetNodeType(), IFSG_NODE::GetNodeTypeName(), IFSG_NORMALS::GetNormalList(), IFSG_NODE::GetParent(), IFSG_NODE::GetRawPtr(), IFSG_APPEARANCE::IFSG_APPEARANCE(), IFSG_COLORS::IFSG_COLORS(), IFSG_COORDINDEX::IFSG_COORDINDEX(), IFSG_COORDS::IFSG_COORDS(), IFSG_FACESET::IFSG_FACESET(), IFSG_NODE::IFSG_NODE(), IFSG_NORMALS::IFSG_NORMALS(), IFSG_SHAPE::IFSG_SHAPE(), IFSG_TRANSFORM::IFSG_TRANSFORM(), IFSG_APPEARANCE::NewNode(), IFSG_COORDS::NewNode(), IFSG_FACESET::NewNode(), IFSG_SHAPE::NewNode(), IFSG_NORMALS::NewNode(), IFSG_COORDINDEX::NewNode(), IFSG_COLORS::NewNode(), IFSG_TRANSFORM::NewNode(), IFSG_APPEARANCE::SetAmbient(), IFSG_TRANSFORM::SetCenter(), IFSG_COLORS::SetColorList(), IFSG_COORDS::SetCoordsList(), IFSG_APPEARANCE::SetDiffuse(), IFSG_APPEARANCE::SetEmissive(), SetIndices(), IFSG_NODE::SetName(), IFSG_NORMALS::SetNormalList(), IFSG_NODE::SetParent(), IFSG_TRANSFORM::SetRotation(), IFSG_TRANSFORM::SetScale(), IFSG_TRANSFORM::SetScaleOrientation(), IFSG_APPEARANCE::SetShininess(), IFSG_APPEARANCE::SetSpecular(), IFSG_TRANSFORM::SetTranslation(), IFSG_APPEARANCE::SetTransparency(), and IFSG_NODE::~IFSG_NODE().


The documentation for this class was generated from the following files: