# EggAttributes¶

class EggAttributes

Bases: MemoryBase

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.

Inheritance diagram

EggAttributes(void)
EggAttributes(EggAttributes const &copy)
void clear_color(void)
void clear_normal(void)
int compare_to(EggAttributes const &other) const

An ordering operator to compare two vertices for sorting order. This imposes an arbitrary ordering useful to identify unique vertices.

void copy_color(EggAttributes const &other)

Sets this color to be the same as the other’s, include morphs. If the other has no color, this clears the color.

void copy_normal(EggAttributes const &other)

Sets this normal to be the same as the other’s, include morphs. If the other has no normal, this clears the normal.

static TypeHandle get_class_type(void)
LColor get_color(void) const

Returns the color set on this particular attribute. If there is no color set, returns white.

LNormald const &get_normal(void) const
bool has_color(void) const
bool has_normal(void) const
bool matches_color(EggAttributes const &other) const

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

bool matches_normal(EggAttributes const &other) const

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

void set_color(LColor const &Color)
void set_normal(LNormald const &normal)
bool sorts_less_than(EggAttributes const &other) const

An ordering operator to compare two vertices for sorting order. This imposes an arbitrary ordering useful to identify unique vertices.

void transform(LMatrix4d const &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.