15 #include "eggTriangleStrip.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";
54 int EggTriangleStrip::
55 get_num_lead_vertices()
const {
74 bool EggTriangleStrip::
79 const_iterator vi = begin();
84 bool reversed =
false;
86 for (
int i = 0; i < (int)size() - 2; i++) {
90 if (attrib->has_color()) {
91 poly->set_color(attrib->get_color());
93 if (attrib->has_normal()) {
94 poly->set_normal(attrib->get_normal());
102 poly->add_vertex(v0);
103 poly->add_vertex(v1);
106 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.
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.
TypeHandle is the identifier used to differentiate C++ class types.
virtual void write(ostream &out, int indent_level) const
Writes the triangle strip to the indicated output stream in Egg format.