15 #include "geomLinestrips.h" 16 #include "geomLines.h" 17 #include "geomVertexRewriter.h" 18 #include "pStatTimer.h" 19 #include "bamReader.h" 20 #include "bamWriter.h" 21 #include "graphicsStateGuardianBase.h" 31 GeomLinestrips(GeomLinestrips::UsageHint usage_hint) :
77 GeomPrimitive::PrimitiveType GeomLinestrips::
78 get_primitive_type()
const {
93 return GR_line_strip | GR_indexed_other | GR_strip_cut_index;
95 return GR_line_strip | GR_indexed_other;
133 bool GeomLinestrips::
136 return gsg->draw_linestrips(reader, force);
154 decompose_impl()
const {
161 int vi = -num_unused;
163 while (li < (
int)ends.size()) {
167 nassertr(vi + 1 <= end, lines.p());
173 lines->add_vertex(v0);
174 lines->add_vertex(v1);
176 lines->close_primitive();
191 rotate_impl()
const {
203 CPTA_int::const_iterator ei;
204 for (ei = ends.begin(); ei != ends.end(); ++ei) {
206 for (
int vi = end - 1; vi >= begin; --vi) {
207 from.set_row_unsafe(vi);
208 to.set_data1i(from.get_data1i());
213 nassertr(to.is_at_end(), NULL);
221 CPTA_int::const_iterator ei;
222 for (ei = ends.begin(); ei != ends.end(); ++ei) {
224 for (
int vi = end - 1; vi >= begin; --vi) {
225 to.set_data1i(vi + first_vertex);
230 nassertr(to.is_at_end(), NULL);
241 bool GeomLinestrips::
242 requires_unused_vertices()
const {
255 void GeomLinestrips::
259 to.add_data1i(get_strip_cut_index());
287 parse_params(params, scan, manager);
288 object->fillin(scan, manager);
This object provides a high-level interface for quickly writing a sequence of numeric values from a v...
virtual int get_min_num_vertices_per_primitive() const
Returns the minimum number of vertices that must be added before close_primitive() may legally be cal...
ShadeModel get_shade_model() const
Returns the ShadeModel hint for this primitive.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Base class for objects that can be written to and read from Bam files.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
int get_num_vertices() const
Returns the number of indices used by all the primitives in this object.
int get_first_vertex() const
Returns the first vertex number referenced by the primitive.
virtual int get_num_unused_vertices_per_primitive() const
Returns the number of vertices that are added between primitives that aren't, strictly speaking...
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual int get_geom_rendering() const
Returns the set of GeomRendering bits that represent the rendering properties required to properly re...
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
Defines a series of disconnected line segments.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
int get_num_rows() const
Returns the number of rows stored in the array, based on the number of bytes and the stride...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
int get_num_primitives() const
Returns the number of individual primitives stored within this object.
int get_vertex(int i) const
Returns the ith vertex index in the table.
This object provides a high-level interface for quickly reading a sequence of numeric values from a v...
Defines a series of line strips.
UsageHint get_usage_hint() const
Returns the usage hint for this primitive.
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
A class to retrieve the individual data elements previously stored in a Datagram. ...
TypeHandle is the identifier used to differentiate C++ class types.
Encapsulates the data from a GeomPrimitive, pre-fetched for one stage of the pipeline.
bool is_indexed() const
Returns true if the primitive is indexed, false otherwise.
Similar to PointerToArray, except that its contents may not be modified.
This is the data for one array of a GeomVertexData structure.