Panda3D
Public Member Functions | Static Public Member Functions | Public Attributes

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:
MemoryBase EggPrimitive EggVertex EggCompositePrimitive EggCurve EggPoint EggPolygon EggSurface EggLine EggTriangleFan EggTriangleStrip EggNurbsCurve EggNurbsSurface

List of all members.

Public Member Functions

 EggAttributes (const EggAttributes &copy)
void clear_color ()
void clear_normal ()
int compare_to (const EggAttributes &other) const
 An ordering operator to compare two vertices for sorting order.
void copy_color (const EggAttributes &other)
 Sets this color to be the same as the other's, include morphs.
void copy_normal (const EggAttributes &other)
 Sets this normal to be the same as the other's, include morphs.
LColor get_color () const
 Returns the color set on this particular attribute.
const LNormaldget_normal () const
bool has_color () const
bool has_normal () const
bool matches_color (const EggAttributes &other) const
 Returns true if this color matches that of the other EggAttributes object, include the morph list.
bool matches_normal (const EggAttributes &other) const
 Returns true if this normal matches that of the other EggAttributes object, include the morph list.
EggAttributesoperator= (const EggAttributes &copy)
void set_color (const LColor &Color)
void set_normal (const LNormald &normal)
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.
void write (ostream &out, int indent_level) const
 Writes the attributes to the indicated output stream in Egg format.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()

Public Attributes

EggMorphNormalList _dnormals
EggMorphColorList _drgbas

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 37 of file eggAttributes.h.


Member Function Documentation

int EggAttributes::compare_to ( 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 111 of file eggAttributes.cxx.

References LVecBase4f::compare_to(), EggMorphList< MorphType >::compare_to(), and LVecBase3d::compare_to().

Referenced by sorts_less_than(), and EggCompositePrimitive::write_body().

void EggAttributes::copy_color ( const EggAttributes other) [inline]

Sets this color to be the same as the other's, include morphs.

If the other has no color, this clears the color.

Definition at line 165 of file eggAttributes.I.

References get_color().

Referenced by EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().

void EggAttributes::copy_normal ( const EggAttributes other) [inline]

Sets this normal to be the same as the other's, include morphs.

If the other has no normal, this clears the normal.

Definition at line 84 of file eggAttributes.I.

Referenced by EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().

LColor EggAttributes::get_color ( ) const [inline]
bool EggAttributes::matches_color ( const EggAttributes other) const [inline]

Returns true if this color matches that of the other EggAttributes object, include the morph list.

Definition at line 146 of file eggAttributes.I.

References EggMorphList< MorphType >::compare_to(), and get_color().

Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::get_shading(), and EggCompositePrimitive::get_shading().

bool EggAttributes::matches_normal ( const EggAttributes other) const [inline]

Returns true if this normal matches that of the other EggAttributes object, include the morph list.

Definition at line 65 of file eggAttributes.I.

References EggMorphList< MorphType >::compare_to().

Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::get_shading(), and EggCompositePrimitive::get_shading().

bool EggAttributes::sorts_less_than ( const EggAttributes other) const [inline]

An ordering operator to compare two vertices for sorting order.

This imposes an arbitrary ordering useful to identify unique vertices.

Definition at line 182 of file eggAttributes.I.

References compare_to().

void EggAttributes::transform ( const LMatrix4d mat)

Applies the indicated transformation matrix to the attributes.

Reimplemented in EggVertex.

Definition at line 150 of file eggAttributes.cxx.

References LVecBase3d::normalize().

Referenced by EggPrimitive::r_flatten_transforms(), and EggPrimitive::r_transform().

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

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

Reimplemented in EggLine, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggTriangleFan, EggTriangleStrip, and EggVertex.

Definition at line 77 of file eggAttributes.cxx.

References get_color().

Referenced by EggCompositePrimitive::write_body().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations