KiCad PCB EDA Suite
IFSG_APPEARANCE Class Reference

#include <ifsg_appearance.h>

Inheritance diagram for IFSG_APPEARANCE:
IFSG_NODE

Public Member Functions

 IFSG_APPEARANCE (bool create)
 
 IFSG_APPEARANCE (SGNODE *aParent)
 
 IFSG_APPEARANCE (IFSG_NODE &aParent)
 
bool Attach (SGNODE *aNode) override
 Function Attach associates a given SGNODE* with this wrapper. More...
 
bool NewNode (SGNODE *aParent) override
 Function NewNode creates a new node to associate with this wrapper. More...
 
bool NewNode (IFSG_NODE &aParent) override
 
bool SetEmissive (float aRVal, float aGVal, float aBVal)
 
bool SetEmissive (const SGCOLOR *aRGBColor)
 
bool SetEmissive (const SGCOLOR &aRGBColor)
 
bool SetDiffuse (float aRVal, float aGVal, float aBVal)
 
bool SetDiffuse (const SGCOLOR *aRGBColor)
 
bool SetDiffuse (const SGCOLOR &aRGBColor)
 
bool SetSpecular (float aRVal, float aGVal, float aBVal)
 
bool SetSpecular (const SGCOLOR *aRGBColor)
 
bool SetSpecular (const SGCOLOR &aRGBColor)
 
bool SetAmbient (float aRVal, float aGVal, float aBVal)
 
bool SetAmbient (const SGCOLOR *aRGBColor)
 
bool SetAmbient (const SGCOLOR &aRGBColor)
 
bool SetShininess (float aShininess)
 
bool SetTransparency (float aTransparency)
 
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

Definition at line 34 of file ifsg_appearance.h.

Constructor & Destructor Documentation

IFSG_APPEARANCE::IFSG_APPEARANCE ( bool  create)

Definition at line 38 of file ifsg_appearance.cpp.

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

39 {
40  m_node = NULL;
41 
42  if( !create )
43  return ;
44 
45  m_node = new SGAPPEARANCE( NULL );
46 
47  if( m_node )
49 
50  return;
51 }
SGNODE * m_node
Definition: ifsg_node.h:57
void AssociateWrapper(SGNODE **aWrapperRef)
Function AssociateWrapper associates this object with a handle to itself; this handle is typically he...
Definition: sg_node.cpp:219
IFSG_APPEARANCE::IFSG_APPEARANCE ( SGNODE aParent)

Definition at line 54 of file ifsg_appearance.cpp.

References SGNODE::AssociateWrapper(), IFSG_NODE::m_node, SGNODE::SetParent(), and WrongParent.

55 {
56  m_node = new SGAPPEARANCE( NULL );
57 
58  if( m_node )
59  {
60  if( !m_node->SetParent( aParent ) )
61  {
62  delete m_node;
63  m_node = NULL;
64 
65  #ifdef DEBUG
66  do {
67  std::ostringstream ostr;
68  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
69  ostr << WrongParent;
70  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
71  } while( 0 );
72  #endif
73 
74  return;
75  }
76 
78  }
79 
80  return;
81 }
char WrongParent[]
Definition: ifsg_node.cpp:37
SGNODE * m_node
Definition: ifsg_node.h:57
void AssociateWrapper(SGNODE **aWrapperRef)
Function AssociateWrapper associates this object with a handle to itself; this handle is typically he...
Definition: sg_node.cpp:219
virtual bool SetParent(SGNODE *aParent, bool notify=true)=0
Function SetParent sets the parent SGNODE of this object.
IFSG_APPEARANCE::IFSG_APPEARANCE ( IFSG_NODE aParent)

Definition at line 84 of file ifsg_appearance.cpp.

References SGNODE::AssociateWrapper(), BadParent, IFSG_NODE::GetRawPtr(), IFSG_NODE::m_node, SGNODE::SetParent(), and WrongParent.

85 {
86  SGNODE* pp = aParent.GetRawPtr();
87 
88  #ifdef DEBUG
89  if( ! pp )
90  {
91  std::ostringstream ostr;
92  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
93  ostr << BadParent;
94  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
95  }
96  #endif
97 
98  m_node = new SGAPPEARANCE( NULL );
99 
100  if( m_node )
101  {
102  if( !m_node->SetParent( pp ) )
103  {
104  delete m_node;
105  m_node = NULL;
106 
107  #ifdef DEBUG
108  std::ostringstream ostr;
109  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
110  ostr << WrongParent;
111  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
112  #endif
113 
114  return;
115  }
116 
118  }
119 
120  return;
121 }
SGNODE * GetRawPtr(void)
Function GetRawPtr() returns the raw internal SGNODE pointer.
Definition: ifsg_node.cpp:66
char WrongParent[]
Definition: ifsg_node.cpp:37
SGNODE * m_node
Definition: ifsg_node.h:57
Class SGNODE represents the base class of all Scene Graph nodes.
Definition: sg_node.h:76
void AssociateWrapper(SGNODE **aWrapperRef)
Function AssociateWrapper associates this object with a handle to itself; this handle is typically he...
Definition: sg_node.cpp:219
char BadParent[]
Definition: ifsg_node.cpp:36
virtual bool SetParent(SGNODE *aParent, bool notify=true)=0
Function SetParent sets the parent SGNODE of this object.

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_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
bool IFSG_APPEARANCE::Attach ( SGNODE aNode)
overridevirtual

Function Attach associates a given SGNODE* with this wrapper.

Implements IFSG_NODE.

Definition at line 124 of file ifsg_appearance.cpp.

References SGNODE::AssociateWrapper(), SGNODE::DisassociateWrapper(), SGNODE::GetNodeType(), IFSG_NODE::m_node, and S3D::SGTYPE_APPEARANCE.

125 {
126  if( m_node )
128 
129  m_node = NULL;
130 
131  if( !aNode )
132  return false;
133 
134  if( S3D::SGTYPE_APPEARANCE != aNode->GetNodeType() )
135  {
136  return false;
137  }
138 
139  m_node = aNode;
141 
142  return true;
143 }
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
void AssociateWrapper(SGNODE **aWrapperRef)
Function AssociateWrapper associates this object with a handle to itself; this handle is typically he...
Definition: sg_node.cpp:219
void DisassociateWrapper(SGNODE **aWrapperRef)
Function DisassociateWrapper removes the association between an IFSG* wrapper object and this object...
Definition: sg_node.cpp:264
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
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
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
bool IFSG_APPEARANCE::NewNode ( SGNODE aParent)
overridevirtual

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

Implements IFSG_NODE.

Definition at line 146 of file ifsg_appearance.cpp.

References SGNODE::AssociateWrapper(), SGNODE::DisassociateWrapper(), SGNODE::GetNodeType(), SGNODE::GetNodeTypeName(), SGNODE::GetParent(), and IFSG_NODE::m_node.

Referenced by NewNode().

147 {
148  if( m_node )
150 
151  m_node = new SGAPPEARANCE( aParent );
152 
153  if( aParent != m_node->GetParent() )
154  {
155  #ifdef DEBUG
156  std::ostringstream ostr;
157  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
158  ostr << " * [BUG] invalid SGNODE parent (";
159  ostr << aParent->GetNodeTypeName( aParent->GetNodeType() );
160  ostr << ") to SGAPPEARANCE";
161  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
162  #endif
163 
164  delete m_node;
165  m_node = NULL;
166  return false;
167  }
168 
170 
171  return true;
172 }
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
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
void AssociateWrapper(SGNODE **aWrapperRef)
Function AssociateWrapper associates this object with a handle to itself; this handle is typically he...
Definition: sg_node.cpp:219
void DisassociateWrapper(SGNODE **aWrapperRef)
Function DisassociateWrapper removes the association between an IFSG* wrapper object and this object...
Definition: sg_node.cpp:264
const char * GetNodeTypeName(S3D::SGTYPES aNodeType) const
Definition: sg_node.cpp:170
bool IFSG_APPEARANCE::NewNode ( IFSG_NODE aParent)
overridevirtual

Implements IFSG_NODE.

Definition at line 175 of file ifsg_appearance.cpp.

References BadParent, IFSG_NODE::GetRawPtr(), and NewNode().

176 {
177  SGNODE* np = aParent.GetRawPtr();
178 
179  if( NULL == np )
180  {
181  #ifdef DEBUG
182  std::ostringstream ostr;
183  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
184  ostr << BadParent;
185  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
186  #endif
187 
188  return false;
189  }
190 
191  return NewNode( np );
192 }
SGNODE * GetRawPtr(void)
Function GetRawPtr() returns the raw internal SGNODE pointer.
Definition: ifsg_node.cpp:66
Class SGNODE represents the base class of all Scene Graph nodes.
Definition: sg_node.h:76
char BadParent[]
Definition: ifsg_node.cpp:36
bool NewNode(SGNODE *aParent) override
Function NewNode creates a new node to associate with this wrapper.
bool IFSG_APPEARANCE::SetAmbient ( float  aRVal,
float  aGVal,
float  aBVal 
)

Definition at line 357 of file ifsg_appearance.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by getSGColor(), and SetAmbient().

358 {
359  if( NULL == m_node )
360  {
361  #ifdef DEBUG
362  std::ostringstream ostr;
363  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
364  ostr << BadObject;
365  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
366  #endif
367 
368  return false;
369  }
370 
371  return ((SGAPPEARANCE*)m_node)->SetAmbient( aRVal, aGVal, aBVal );
372 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetAmbient(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetAmbient ( const SGCOLOR aRGBColor)

Definition at line 375 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetAmbient().

376 {
377  if( NULL == m_node )
378  {
379  #ifdef DEBUG
380  std::ostringstream ostr;
381  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
382  ostr << BadObject;
383  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
384  #endif
385 
386  return false;
387  }
388 
389  return ((SGAPPEARANCE*)m_node)->SetAmbient( aRGBColor );
390 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetAmbient(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetAmbient ( const SGCOLOR aRGBColor)

Definition at line 393 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetAmbient().

394 {
395  if( NULL == m_node )
396  {
397  #ifdef DEBUG
398  std::ostringstream ostr;
399  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
400  ostr << BadObject;
401  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
402  #endif
403 
404  return false;
405  }
406 
407  return ((SGAPPEARANCE*)m_node)->SetAmbient( aRGBColor );
408 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetAmbient(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetDiffuse ( float  aRVal,
float  aGVal,
float  aBVal 
)

Definition at line 249 of file ifsg_appearance.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by getSGColor(), and SetDiffuse().

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 ((SGAPPEARANCE*)m_node)->SetDiffuse( aRVal, aGVal, aBVal );
264 }
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetDiffuse ( const SGCOLOR aRGBColor)

Definition at line 267 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetDiffuse().

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  return ((SGAPPEARANCE*)m_node)->SetDiffuse( aRGBColor );
282 }
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetDiffuse ( const SGCOLOR aRGBColor)

Definition at line 285 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetDiffuse().

286 {
287  if( NULL == m_node )
288  {
289  #ifdef DEBUG
290  std::ostringstream ostr;
291  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
292  ostr << BadObject;
293  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
294  #endif
295 
296  return false;
297  }
298 
299  return ((SGAPPEARANCE*)m_node)->SetDiffuse( aRGBColor );
300 }
bool SetDiffuse(float aRVal, float aGVal, float aBVal)
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetEmissive ( float  aRVal,
float  aGVal,
float  aBVal 
)

Definition at line 195 of file ifsg_appearance.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by SetEmissive().

196 {
197  if( NULL == m_node )
198  {
199  #ifdef DEBUG
200  std::ostringstream ostr;
201  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
202  ostr << BadObject << "\n";
203  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
204  #endif
205 
206  return false;
207  }
208 
209  return ((SGAPPEARANCE*)m_node)->SetEmissive( aRVal, aGVal, aBVal );
210 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetEmissive(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetEmissive ( const SGCOLOR aRGBColor)

Definition at line 213 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetEmissive().

214 {
215  if( NULL == m_node )
216  {
217  #ifdef DEBUG
218  std::ostringstream ostr;
219  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
220  ostr << BadObject << "\n";
221  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
222  #endif
223 
224  return false;
225  }
226 
227  return ((SGAPPEARANCE*)m_node)->SetEmissive( aRGBColor );
228 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetEmissive(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetEmissive ( const SGCOLOR aRGBColor)

Definition at line 231 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetEmissive().

232 {
233  if( NULL == m_node )
234  {
235  #ifdef DEBUG
236  std::ostringstream ostr;
237  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
238  ostr << BadObject;
239  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
240  #endif
241 
242  return false;
243  }
244 
245  return ((SGAPPEARANCE*)m_node)->SetEmissive( aRGBColor );
246 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetEmissive(float aRVal, float aGVal, float aBVal)
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
bool IFSG_APPEARANCE::SetShininess ( float  aShininess)

Definition at line 411 of file ifsg_appearance.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by getSGColor().

412 {
413  if( NULL == m_node )
414  {
415  #ifdef DEBUG
416  std::ostringstream ostr;
417  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
418  ostr << BadObject;
419  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
420  #endif
421 
422  return false;
423  }
424 
425  if( aShininess < 0 || aShininess > 1.0 )
426  {
427  #ifdef DEBUG
428  std::ostringstream ostr;
429  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
430  ostr << " * [BUG] shininess out of range [0..1]";
431  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
432  #endif
433 
434  return false;
435  }
436 
437  ((SGAPPEARANCE*)m_node)->shininess = aShininess;
438 
439  return true;
440 }
SGNODE * m_node
Definition: ifsg_node.h:57
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetSpecular ( float  aRVal,
float  aGVal,
float  aBVal 
)

Definition at line 303 of file ifsg_appearance.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by getSGColor(), and SetSpecular().

304 {
305  if( NULL == m_node )
306  {
307  #ifdef DEBUG
308  std::ostringstream ostr;
309  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
310  ostr << BadObject;
311  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
312  #endif
313 
314  return false;
315  }
316 
317  return ((SGAPPEARANCE*)m_node)->SetSpecular( aRVal, aGVal, aBVal );
318 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetSpecular(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetSpecular ( const SGCOLOR aRGBColor)

Definition at line 321 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetSpecular().

322 {
323  if( NULL == m_node )
324  {
325  #ifdef DEBUG
326  std::ostringstream ostr;
327  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
328  ostr << BadObject;
329  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
330  #endif
331 
332  return false;
333  }
334 
335  return ((SGAPPEARANCE*)m_node)->SetSpecular( aRGBColor );
336 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetSpecular(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetSpecular ( const SGCOLOR aRGBColor)

Definition at line 339 of file ifsg_appearance.cpp.

References BadObject, IFSG_NODE::m_node, and SetSpecular().

340 {
341  if( NULL == m_node )
342  {
343  #ifdef DEBUG
344  std::ostringstream ostr;
345  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
346  ostr << BadObject;
347  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
348  #endif
349 
350  return false;
351  }
352 
353  return ((SGAPPEARANCE*)m_node)->SetSpecular( aRGBColor );
354 }
SGNODE * m_node
Definition: ifsg_node.h:57
bool SetSpecular(float aRVal, float aGVal, float aBVal)
char BadObject[]
Definition: ifsg_node.cpp:34
bool IFSG_APPEARANCE::SetTransparency ( float  aTransparency)

Definition at line 443 of file ifsg_appearance.cpp.

References BadObject, and IFSG_NODE::m_node.

Referenced by getSGColor().

444 {
445  if( NULL == m_node )
446  {
447  #ifdef DEBUG
448  std::ostringstream ostr;
449  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
450  ostr << BadObject;
451  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
452  #endif
453 
454  return false;
455  }
456 
457  if( aTransparency < 0 || aTransparency > 1.0 )
458  {
459  #ifdef DEBUG
460  std::ostringstream ostr;
461  ostr << __FILE__ << ": " << __FUNCTION__ << ": " << __LINE__ << "\n";
462  ostr << " * [BUG] transparency out of range [0..1]";
463  wxLogTrace( MASK_3D_SG, "%s\n", ostr.str().c_str() );
464  #endif
465 
466  return false;
467  }
468 
469  ((SGAPPEARANCE*)m_node)->transparency = aTransparency;
470 
471  return true;
472 }
SGNODE * m_node
Definition: ifsg_node.h:57
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(), IFSG_INDEX::AddIndex(), IFSG_NORMALS::AddNormal(), IFSG_NODE::AddRefNode(), 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(), IFSG_INDEX::GetIndices(), IFSG_NODE::GetName(), IFSG_NODE::GetNodeType(), IFSG_NODE::GetNodeTypeName(), IFSG_NORMALS::GetNormalList(), IFSG_NODE::GetParent(), IFSG_NODE::GetRawPtr(), 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(), NewNode(), IFSG_COORDS::NewNode(), IFSG_FACESET::NewNode(), IFSG_NORMALS::NewNode(), IFSG_COORDINDEX::NewNode(), IFSG_SHAPE::NewNode(), IFSG_COLORS::NewNode(), IFSG_TRANSFORM::NewNode(), SetAmbient(), IFSG_TRANSFORM::SetCenter(), IFSG_COLORS::SetColorList(), IFSG_COORDS::SetCoordsList(), SetDiffuse(), SetEmissive(), IFSG_INDEX::SetIndices(), IFSG_NODE::SetName(), IFSG_NORMALS::SetNormalList(), IFSG_NODE::SetParent(), IFSG_TRANSFORM::SetRotation(), IFSG_TRANSFORM::SetScale(), IFSG_TRANSFORM::SetScaleOrientation(), SetShininess(), SetSpecular(), IFSG_TRANSFORM::SetTranslation(), SetTransparency(), and IFSG_NODE::~IFSG_NODE().


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