Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

EggAttributes Class Reference

The set of attributes that may be applied to vertices as well as polygons, such as surface normal and color. More...

#include <eggAttributes.h>

Inheritance diagram for EggAttributes:

EggPrimitive EggVertex EggCurve EggPoint EggPolygon EggSurface EggNurbsCurve EggNurbsSurface List of all members.

Public Member Functions

 EggAttributes ()
 EggAttributes (const EggAttributes &copy)
EggAttributes & operator= (const EggAttributes &copy)
virtual ~EggAttributes ()
bool has_normal () const
const Normaldget_normal () const
void set_normal (const Normald &normal)
void clear_normal ()
bool has_uv () const
const TexCoorddget_uv () const
void set_uv (const TexCoordd &texCoord)
void clear_uv ()
bool has_color () const
Colorf get_color () const
 Returns the color set on this particular attribute.

void set_color (const Colorf &Color)
void clear_color ()
void write (ostream &out, int indent_level) const
 Writes the attributes to the indicated output stream in Egg format.

bool sorts_less_than (const EggAttributes &other) const
 An ordering operator to compare two vertices for sorting order.

void transform (const LMatrix4d &mat)
 Applies the indicated transformation matrix to the attributes.


Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Public Attributes

EggMorphNormalList _dnormals
EggMorphTexCoordList _duvs
EggMorphColorList _drgbas

Private Types

enum  Flags { F_has_normal = 0x001, F_has_uv = 0x002, F_has_color = 0x004 }

Private Attributes

int _flags
Normald _normal
TexCoordd _uv
Colorf _color

Static Private Attributes

TypeHandle _type_handle

Detailed Description

The set of attributes that may be applied to vertices as well as polygons, such as surface normal and color.

This class cannot inherit from EggObject, because it causes problems at the EggPolygon level with multiple appearances of the EggObject base class. And making EggObject a virtual base class is just no fun.

Definition at line 53 of file eggAttributes.h.


Member Enumeration Documentation

enum EggAttributes::Flags [private]
 

Enumeration values:
F_has_normal 
F_has_uv 
F_has_color 

Definition at line 85 of file eggAttributes.h.


Constructor & Destructor Documentation

EggAttributes::EggAttributes  ) 
 

Definition at line 41 of file eggAttributes.cxx.

EggAttributes::EggAttributes const EggAttributes &  copy  ) 
 

Definition at line 53 of file eggAttributes.cxx.

References _color, _dnormals, _drgbas, _duvs, _flags, _normal, and _uv.

EggAttributes::~EggAttributes  )  [virtual]
 

Definition at line 84 of file eggAttributes.cxx.

References _dnormals, _duvs, EggMorphList< EggMorphTexCoord >::empty(), EggMorphList< EggMorphNormal >::empty(), get_normal(), has_normal(), has_uv(), indent(), and EggMorphList< EggMorphNormal >::write().


Member Function Documentation

void EggAttributes::clear_color  )  [inline]
 

Definition at line 177 of file eggAttributes.I.

void EggAttributes::clear_normal  )  [inline]
 

Definition at line 71 of file eggAttributes.I.

References _flags, and F_has_uv.

Referenced by EggGroupNode::find_textures(), and EggPolygon::operator=().

void EggAttributes::clear_uv  )  [inline]
 

Definition at line 121 of file eggAttributes.I.

References _color, Colorf, has_color(), and INLINE.

TypeHandle EggAttributes::get_class_type void   )  [inline, static]
 

Reimplemented in EggCurve, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSurface, and EggVertex.

Definition at line 98 of file eggAttributes.h.

Referenced by EggPrimitive::get_class_type(), and EggVertex::init_type().

Colorf EggAttributes::get_color  )  const [inline]
 

Returns the color set on this particular attribute.

If there is no color set, returns white.

Definition at line 148 of file eggAttributes.I.

References _flags, and F_has_color.

const Normald & EggAttributes::get_normal  )  const [inline]
 

Definition at line 45 of file eggAttributes.I.

References _flags, _normal, F_has_normal, and INLINE.

Referenced by ~EggAttributes().

const TexCoordd & EggAttributes::get_uv  )  const [inline]
 

Definition at line 95 of file eggAttributes.I.

References _flags, F_has_uv, and INLINE.

bool EggAttributes::has_color  )  const [inline]
 

Definition at line 133 of file eggAttributes.I.

References _color, _flags, F_has_color, and INLINE.

Referenced by clear_uv().

bool EggAttributes::has_normal  )  const [inline]
 

Definition at line 33 of file eggAttributes.I.

References _normal, INLINE, nassertr, and Normald.

Referenced by ~EggAttributes().

bool EggAttributes::has_uv  )  const [inline]
 

Definition at line 83 of file eggAttributes.I.

Referenced by ~EggAttributes().

void EggAttributes::init_type void   )  [inline, static]
 

Reimplemented in EggCurve, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSurface, and EggVertex.

Definition at line 101 of file eggAttributes.h.

Referenced by EggPrimitive::get_class_type().

EggAttributes & EggAttributes::operator= const EggAttributes &  copy  ) 
 

Definition at line 65 of file eggAttributes.cxx.

void EggAttributes::set_color const Colorf Color  )  [inline]
 

Definition at line 164 of file eggAttributes.I.

void EggAttributes::set_normal const Normald normal  )  [inline]
 

Definition at line 58 of file eggAttributes.I.

References _flags, F_has_normal, and INLINE.

Referenced by EggPolygon::operator=().

void EggAttributes::set_uv const TexCoordd texCoord  )  [inline]
 

Definition at line 108 of file eggAttributes.I.

References _flags, F_has_color, and INLINE.

bool EggAttributes::sorts_less_than const EggAttributes &  other  )  const
 

An ordering operator to compare two vertices for sorting order.

This imposes an arbitrary ordering useful to identify unique vertices.

Definition at line 149 of file eggAttributes.cxx.

void EggAttributes::transform const LMatrix4d &  mat  ) 
 

Applies the indicated transformation matrix to the attributes.

Reimplemented in EggVertex.

Definition at line 201 of file eggAttributes.cxx.

void EggAttributes::write ostream &  out,
int  indent_level
const
 

Writes the attributes to the indicated output stream in Egg format.

Reimplemented in EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, and EggVertex.

Definition at line 99 of file eggAttributes.cxx.


Member Data Documentation

Colorf EggAttributes::_color [private]
 

Definition at line 94 of file eggAttributes.h.

Referenced by clear_uv(), EggAttributes(), and has_color().

EggMorphNormalList EggAttributes::_dnormals
 

Definition at line 80 of file eggAttributes.h.

Referenced by EggAttributes(), and ~EggAttributes().

EggMorphColorList EggAttributes::_drgbas
 

Definition at line 82 of file eggAttributes.h.

Referenced by EggAttributes().

EggMorphTexCoordList EggAttributes::_duvs
 

Definition at line 81 of file eggAttributes.h.

Referenced by EggAttributes(), and ~EggAttributes().

int EggAttributes::_flags [private]
 

Definition at line 91 of file eggAttributes.h.

Referenced by clear_normal(), EggAttributes(), get_color(), get_normal(), get_uv(), has_color(), set_normal(), and set_uv().

Normald EggAttributes::_normal [private]
 

Definition at line 92 of file eggAttributes.h.

Referenced by EggAttributes(), get_normal(), and has_normal().

TypeHandle EggAttributes::_type_handle [static, private]
 

Reimplemented in EggCurve, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSurface, and EggVertex.

Definition at line 30 of file eggAttributes.cxx.

TexCoordd EggAttributes::_uv [private]
 

Definition at line 93 of file eggAttributes.h.

Referenced by EggAttributes().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:49:48 2003 for Panda by doxygen1.3