Panda3D
|
The set of attributes that may be applied to vertices as well as polygons, such as surface normal and color. More...
#include "eggAttributes.h"
Public Member Functions | |
EggAttributes (const EggAttributes ©) | |
void | clear_color () |
void | clear_normal () |
int | compare_to (const EggAttributes &other) const |
An ordering operator to compare two vertices for sorting order. More... | |
void | copy_color (const EggAttributes &other) |
Sets this color to be the same as the other's, include morphs. More... | |
void | copy_normal (const EggAttributes &other) |
Sets this normal to be the same as the other's, include morphs. More... | |
LColor | get_color () const |
Returns the color set on this particular attribute. More... | |
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. More... | |
bool | matches_normal (const EggAttributes &other) const |
Returns true if this normal matches that of the other EggAttributes object, include the morph list. More... | |
EggAttributes & | operator= (const EggAttributes ©) |
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. More... | |
void | transform (const LMatrix4d &mat) |
Applies the indicated transformation matrix to the attributes. More... | |
void | write (ostream &out, int indent_level) const |
Writes the attributes to the indicated output stream in Egg format. More... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Public Attributes | |
EggMorphNormalList | _dnormals |
EggMorphColorList | _drgbas |
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.
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 EggMorphList< MorphType >::compare_to(), LVecBase4f::compare_to(), LVecBase3d::compare_to(), and transform().
Referenced by EggCompositePrimitive::cleanup(), EggVertex::compare_to(), sorts_less_than(), and write().
|
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(), and sorts_less_than().
Referenced by matches_color(), EggCompositePrimitive::unify_attributes(), and EggPrimitive::unify_attributes().
|
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.
References get_color().
Referenced by matches_normal(), EggCompositePrimitive::unify_attributes(), and EggPrimitive::unify_attributes().
|
inline |
Returns the color set on this particular attribute.
If there is no color set, returns white.
Definition at line 110 of file eggAttributes.I.
References matches_color().
Referenced by EggTriangleFan::apply_first_attribute(), EggVertexPool::check_overall_color(), MayaToEggConverter::clear(), EggVertex::clear_aux(), FltToEggConverter::convert_flt(), copy_color(), copy_normal(), EggPrimitive::copy_vertices(), EggRenderState::fill_state(), EggVertexPool::has_nonwhite_colors(), EggLoader::make_polyset(), matches_color(), EggCompositePrimitive::post_apply_flat_attribute(), EggPrimitive::post_apply_flat_attribute(), XFileVertex::set_from_egg(), XFileMaterial::set_from_egg(), EggPolysetMaker::sorts_less(), MayaToEggConverter::string_transform_type(), EggPrimitive::unify_attributes(), EggTriangleStrip::write(), write(), and EggToDXFLayer::write_polyline().
|
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(), copy_color(), and get_color().
Referenced by EggPrimitive::copy_vertices(), get_color(), EggCompositePrimitive::get_shading(), and EggPrimitive::get_shading().
|
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(), and copy_normal().
Referenced by EggPrimitive::copy_vertices(), EggCompositePrimitive::get_shading(), and EggPrimitive::get_shading().
|
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().
Referenced by copy_color().
void EggAttributes::transform | ( | const LMatrix4d & | mat | ) |
Applies the indicated transformation matrix to the attributes.
Definition at line 150 of file eggAttributes.cxx.
References LVecBase3d::normalize().
Referenced by compare_to(), EggPrimitive::copy_vertices(), and EggVertex::transform().
void EggAttributes::write | ( | ostream & | out, |
int | indent_level | ||
) | const |
Writes the attributes to the indicated output stream in Egg format.
Definition at line 77 of file eggAttributes.cxx.
References compare_to(), and get_color().
Referenced by EggCompositePrimitive::cleanup(), EggPrimitive::copy_vertices(), and EggVertex::write().