15 #include "geomTrifans.h"
16 #include "geomTriangles.h"
17 #include "geomVertexRewriter.h"
18 #include "bamReader.h"
19 #include "bamWriter.h"
20 #include "graphicsStateGuardianBase.h"
30 GeomTrifans(GeomTrifans::UsageHint usage_hint) :
76 GeomPrimitive::PrimitiveType GeomTrifans::
77 get_primitive_type()
const {
91 return GR_triangle_fan | GR_indexed_other;
93 return GR_triangle_fan;
106 return gsg->draw_trifans(reader, force);
124 decompose_impl()
const {
129 int num_vertices = get_num_vertices();
133 while (li < (
int)ends.size()) {
135 nassertr(vi + 2 <= end, triangles.p());
136 int v0 = get_vertex(vi);
138 int v1 = get_vertex(vi);
141 int v2 = get_vertex(vi);
143 triangles->add_vertex(v0);
144 triangles->add_vertex(v1);
145 triangles->add_vertex(v2);
147 triangles->close_primitive();
152 nassertr(vi == num_vertices, NULL);
154 return triangles.p();
163 rotate_impl()
const {
166 nassertr(
false, NULL);
195 parse_params(params, scan, manager);
196 object->fillin(scan, manager);
bool is_indexed() const
Returns true if the primitive is indexed, false otherwise.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
Defines a series of triangle fans.
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...
ShadeModel get_shade_model() const
Returns the shade model common to all of the individual GeomPrimitives that have been added to the ge...
UsageHint get_usage_hint() const
Returns the minimum (i.e.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
virtual Geom * make_copy() const
Returns a newly-allocated Geom that is a shallow copy of this one.
void register_factory(TypeHandle handle, CreateFunc *func)
Registers a new kind of thing the Factory will be able to create.
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
virtual bool draw(GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
Calls the appropriate method on the GSG to draw the primitive.
Defines a series of disconnected triangles.
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.
virtual int get_geom_rendering() const
Returns the set of GeomRendering bits that represent the rendering properties required to properly re...
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
Similar to PointerToArray, except that its contents may not be modified.
This is the data for one array of a GeomVertexData structure.