15 #include "eggTriangleFan.h"
16 #include "eggGroupNode.h"
17 #include "eggPolygon.h"
40 write(ostream &out,
int indent_level)
const {
42 write_body(out, indent_level+2);
43 indent(out, indent_level) <<
"}\n";
66 do_apply_flat_attribute(i + 1, component);
79 get_num_lead_vertices()
const {
103 const_iterator vi = begin();
109 for (
int i = 0; i < (int)size() - 2; i++) {
113 if (attrib->has_color()) {
114 poly->set_color(attrib->get_color());
116 if (attrib->has_normal()) {
117 poly->set_normal(attrib->get_normal());
120 poly->add_vertex(v0);
121 poly->add_vertex(v1);
122 poly->add_vertex(*vi);
void write_header(ostream &out, int indent_level, const char *egg_keyword) const
Writes the first line of the egg object, e.g.
A base class for nodes in the hierarchy that are not leaf nodes.
void clear()
Removes all of the vertices from the primitive.
void copy_attributes(const EggAttributes &other)
Copies the rendering attributes from the indicated primitive.
virtual void apply_first_attribute()
Sets the first vertex of the triangle (or each component) to the primitive normal and/or color...
The set of attributes that may be applied to vertices as well as polygons, such as surface normal and...
const EggAttributes * get_component(int i) const
Returns the attributes for the nth component triangle.
Any one-, two-, three-, or four-component vertex, possibly with attributes such as a normal...
EggNode * add_child(EggNode *node)
Adds the indicated child to the group and returns it.
virtual void write(ostream &out, int indent_level) const
Writes the triangle fan to the indicated output stream in Egg format.
TypeHandle is the identifier used to differentiate C++ class types.
int get_num_components() const
Returns the number of individual component triangles within the composite.