15 #include "lwoPolygons.h" 16 #include "lwoInputFile.h" 30 return _polygons.size();
40 nassertr(n >= 0 && n < (
int)_polygons.size(), (
Polygon *)NULL);
62 _polygon_type = lin->
get_id();
66 int num_vertices = nf & PF_numverts_mask;
69 poly->_flags = nf & ~PF_numverts_mask;
70 poly->_surface_index = -1;
72 for (
int i = 0; i < num_vertices; i++) {
73 int vindex = lin->
get_vx();
74 poly->_vertices.push_back(vindex);
77 _polygons.push_back(poly);
83 _polygon_type =
IffId(
"FACE");
92 for (
int i = 0; i < num_vertices; i++) {
93 int vindex = lin->
get_vx();
94 poly->_vertices.push_back(vindex);
102 poly->_flags |= PF_decal;
113 poly->_surface_index = surface - 1;
115 _polygons.push_back(poly);
128 write(ostream &out,
int indent_level)
const {
129 indent(out, indent_level)
130 <<
get_id() <<
" { polygon_type = " << _polygon_type
131 <<
", " << _polygons.size() <<
" polygons }\n";
int get_num_polygons() const
Returns the number of polygons of this group.
Polygon * get_polygon(int n) const
Returns the nth polygon of this group.
TypeHandle is the identifier used to differentiate C++ class types.
A four-byte chunk ID appearing in an "IFF" file.
IffId get_id() const
Returns the ID associated with this chunk.
virtual bool read_iff(IffInputFile *in, size_t stop_at)
Reads the data of the chunk in from the given input file, if possible.