Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | List of all 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:

## 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 LNormald & | get_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.
EggAttributes & | operator= (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 (std::ostream &out, int indent_level) const
| Writes the attributes to the indicated output stream in Egg format.
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)

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

## Constructor & Destructor Documentation

## ◆ EggAttributes() [1/2]

EggAttributes::EggAttributes | ( |  | ) |

Definition at line 27 of file eggAttributes.cxx.

## ◆ EggAttributes() [2/2]

EggAttributes::EggAttributes | ( | const EggAttributes & | copy | ) |

Definition at line 35 of file eggAttributes.cxx.

## ◆ ~EggAttributes()

EggAttributes::~EggAttributes | ( |  | ) |
| virtual

Definition at line 56 of file eggAttributes.cxx.

## Member Function Documentation

## ◆ clear_color()

void EggAttributes::clear_color | ( |  | ) |
| inline

Definition at line 111 of file eggAttributes.I.

## ◆ clear_normal()

void EggAttributes::clear_normal | ( |  | ) |
| inline

Definition at line 43 of file eggAttributes.I.

## ◆ compare_to()

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 95 of file eggAttributes.cxx.

Referenced by EggVertex::compare_to(), and sorts_less_than().

## ◆ copy_color()

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 136 of file eggAttributes.I.

References get_color().

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

## ◆ copy_normal()

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 68 of file eggAttributes.I.

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

## ◆ get_class_type()

static TypeHandle EggAttributes::get_class_type | ( |  | ) |
| inline static

Definition at line 75 of file eggAttributes.h.

## ◆ get_color()

LColor EggAttributes::get_color | ( |  | ) | const
| inline

Returns the color set on this particular attribute.

If there is no color set, returns white.

Definition at line 90 of file eggAttributes.I.

Referenced by EggVertexPool::check_overall_color(), copy_color(), EggRenderState::fill_state(), EggVertexPool::has_nonwhite_colors(), matches_color(), EggCompositePrimitive::post_apply_flat_attribute(), EggPrimitive::post_apply_flat_attribute(), PT(), PT(), PT(), XFileMaterial::set_from_egg(), XFileVertex::set_from_egg(), EggPolysetMaker::sorts_less(), EggPrimitive::unify_attributes(), write(), and EggToDXFLayer::write_polyline().

## ◆ get_normal()

const LNormald & EggAttributes::get_normal | ( |  | ) | const
| inline

Definition at line 25 of file eggAttributes.I.

## ◆ has_color()

bool EggAttributes::has_color | ( |  | ) | const
| inline

Definition at line 81 of file eggAttributes.I.

## ◆ has_normal()

bool EggAttributes::has_normal | ( |  | ) | const
| inline

Definition at line 17 of file eggAttributes.I.

## ◆ init_type()

static void EggAttributes::init_type | ( |  | ) |
| inline static

Definition at line 78 of file eggAttributes.h.

## ◆ matches_color()

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 120 of file eggAttributes.I.

References get_color().

Referenced by EggCompositePrimitive::get_shading().

## ◆ matches_normal()

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 52 of file eggAttributes.I.

Referenced by EggCompositePrimitive::get_shading().

## ◆ operator=()

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

Definition at line 43 of file eggAttributes.cxx.

## ◆ set_color()

void EggAttributes::set_color | ( | const LColor & | Color | ) |
| inline

Definition at line 102 of file eggAttributes.I.

## ◆ set_normal()

void EggAttributes::set_normal | ( | const LNormald & | normal | ) |
| inline

Definition at line 34 of file eggAttributes.I.

## ◆ sorts_less_than()

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 150 of file eggAttributes.I.

References compare_to().

## ◆ transform()

void EggAttributes::transform | ( | const LMatrix4d & | mat | ) |

Applies the indicated transformation matrix to the attributes.

Definition at line 131 of file eggAttributes.cxx.

Referenced by EggVertex::transform().

## ◆ write()

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

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

Definition at line 64 of file eggAttributes.cxx.

References get_color(), and indent().

Referenced by EggVertex::write().

## Member Data Documentation

## ◆ _dnormals

EggMorphNormalList EggAttributes::_dnormals

Definition at line 60 of file eggAttributes.h.

## ◆ _drgbas

EggMorphColorList EggAttributes::_drgbas

Definition at line 61 of file eggAttributes.h.

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

- panda/src/egg/eggAttributes.h
- panda/src/egg/eggAttributes.cxx
- panda/src/egg/eggAttributes.I