Panda3D
|
A connected fan of triangles. More...
#include "eggTriangleFan.h"
Public Member Functions | |
EggTriangleFan (const string &name="") | |
EggTriangleFan (const EggTriangleFan ©) | |
virtual void | apply_first_attribute () |
Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded. | |
virtual TypeHandle | force_init_type () |
virtual TypeHandle | get_type () const |
EggTriangleFan & | operator= (const EggTriangleFan ©) |
virtual void | write (ostream &out, int indent_level) const |
Writes the triangle fan to the indicated output stream in Egg format. | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
Protected Member Functions | |
virtual bool | do_triangulate (EggGroupNode *container) const |
Fills the container up with EggPolygons that represent the component triangles of this triangle fan. | |
virtual int | get_num_lead_vertices () const |
Returns the number of initial vertices that are not used in defining any component; the first component is defined by the (n + 1)th vertex, and then a new component at each vertex thereafter. |
A connected fan of triangles.
This does not normally appear in an egg file; it is typically generated as a result of meshing.
Definition at line 28 of file eggTriangleFan.h.
void EggTriangleFan::apply_first_attribute | ( | ) | [virtual] |
Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.
This reflects the DirectX convention of storing flat-shaded properties on the first vertex, although it is not usually a convention in Egg.
This may introduce redundant vertices to the vertex pool.
Reimplemented from EggCompositePrimitive.
Definition at line 60 of file eggTriangleFan.cxx.
References EggPrimitive::do_apply_flat_attribute(), EggCompositePrimitive::get_component(), and EggCompositePrimitive::get_num_components().
bool EggTriangleFan::do_triangulate | ( | EggGroupNode * | container | ) | const [protected, virtual] |
Fills the container up with EggPolygons that represent the component triangles of this triangle fan.
It is assumed that the EggTriangleFan is not already a child of any other group when this function is called.
Returns true if the triangulation is successful, or false if there was some error (in which case the container may contain some partial triangulation).
Reimplemented from EggCompositePrimitive.
Definition at line 99 of file eggTriangleFan.cxx.
References EggGroupNode::add_child(), EggPrimitive::copy_attributes(), EggAttributes::get_color(), and EggCompositePrimitive::get_component().
int EggTriangleFan::get_num_lead_vertices | ( | ) | const [protected, virtual] |
Returns the number of initial vertices that are not used in defining any component; the first component is defined by the (n + 1)th vertex, and then a new component at each vertex thereafter.
Implements EggCompositePrimitive.
Definition at line 79 of file eggTriangleFan.cxx.
void EggTriangleFan::write | ( | ostream & | out, |
int | indent_level | ||
) | const [virtual] |
Writes the triangle fan to the indicated output stream in Egg format.
Implements EggPrimitive.
Definition at line 40 of file eggTriangleFan.cxx.
References EggCompositePrimitive::write_body(), and EggNamedObject::write_header().