21TypeHandle GeomTrianglesAdjacency::_type_handle;
26GeomTrianglesAdjacency::
27GeomTrianglesAdjacency(GeomTrianglesAdjacency::UsageHint usage_hint) :
35GeomTrianglesAdjacency::
44GeomTrianglesAdjacency::
45~GeomTrianglesAdjacency() {
53 return new GeomTrianglesAdjacency(*
this);
96 return gsg->draw_triangles_adj(reader, force);
103doubleside_impl()
const {
114 bool needs_rotate =
false;
115 switch (from.get_shade_model()) {
116 case SM_flat_first_vertex:
117 case SM_flat_last_vertex:
126 for (
int i = from.get_num_vertices() - 1; i >= 0; --i) {
127 reversed->add_vertex(from.get_vertex(i));
133 reversed = (GeomTrianglesAdjacency *)DCAST(GeomTrianglesAdjacency, reversed->rotate());
143reverse_impl()
const {
145 PT(GeomTrianglesAdjacency) reversed =
new GeomTrianglesAdjacency(*
this);
147 GeomPrimitivePipelineReader from(
this, current_thread);
148 reversed->clear_vertices();
150 for (
int i = from.get_num_vertices() - 1; i >= 0; --i) {
151 reversed->add_vertex(from.get_vertex(i));
154 switch (from.get_shade_model()) {
155 case SM_flat_first_vertex:
156 reversed->set_shade_model(SM_flat_last_vertex);
157 reversed = (GeomTrianglesAdjacency *)DCAST(GeomTrianglesAdjacency, reversed->rotate());
160 case SM_flat_last_vertex:
161 reversed->set_shade_model(SM_flat_first_vertex);
162 reversed = (GeomTrianglesAdjacency *)DCAST(GeomTrianglesAdjacency, reversed->rotate());
192 object->fillin(scan, manager);
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void parse_params(const FactoryParams ¶ms, DatagramIterator &scan, BamReader *&manager)
Takes in a FactoryParams, passed from a WritableFactory into any TypedWritable's make function,...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This is the fundamental interface for extracting binary objects from a Bam file, as generated by a Ba...
static WritableFactory * get_factory()
Returns the global WritableFactory for generating TypedWritable objects.
A class to retrieve the individual data elements previously stored in a Datagram.
An instance of this class is passed to the Factory when requesting it to do its business and construc...
void register_factory(TypeHandle handle, CreateFunc *func, void *user_data=nullptr)
Registers a new kind of thing the Factory will be able to create.
Encapsulates the data from a GeomPrimitive, pre-fetched for one stage of the pipeline.
This is an abstract base class for a family of classes that represent the fundamental geometry primit...
ConstPointerTo< GeomPrimitive > rotate() const
Returns a new primitive with the shade_model reversed (if it is flat shaded), if possible.
get_geom_rendering
Returns the set of GeomRendering bits that represent the rendering properties required to properly re...
Defines a series of disconnected triangles, with adjacency information.
virtual PrimitiveType get_primitive_type() const
Returns the fundamental rendering type of this primitive: whether it is points, lines,...
virtual bool draw(GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
Calls the appropriate method on the GSG to draw the primitive.
static void register_with_read_factory()
Tells the BamReader how to create objects of type Geom.
virtual int get_geom_rendering() const
Returns the set of GeomRendering bits that represent the rendering properties required to properly re...
virtual int get_num_vertices_per_primitive() const
If the primitive type is a simple type in which all primitives have the same number of vertices,...
This is a base class for the GraphicsStateGuardian class, which is itself a base class for the variou...
A thread; that is, a lightweight process.
get_current_thread
Returns a pointer to the currently-executing Thread object.
TypeHandle is the identifier used to differentiate C++ class types.
Base class for objects that can be written to and read from Bam files.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.