Panda3D

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
GeomTristripsAdjacency Class Reference

Defines a series of triangle strips with adjacency information. More...

`#include "geomTristripsAdjacency.h"`

Inheritance diagram for GeomTristripsAdjacency:

## Public Member Functions
| GeomTristripsAdjacency (const GeomTristripsAdjacency &copy)
| GeomTristripsAdjacency (UsageHint usage_hint)
virtual bool | draw (GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
| Calls the appropriate method on the GSG to draw the primitive.
virtual TypeHandle | force_init_type ()
virtual int | get_geom_rendering () const
| Returns the set of GeomRendering bits that represent the rendering properties required to properly render this primitive.
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 called.
virtual int | get_num_unused_vertices_per_primitive () const
| Returns the number of vertices that are added between primitives that aren't, strictly speaking, part of the primitives themselves.
virtual PrimitiveType | get_primitive_type () const
| Returns the fundamental rendering type of this primitive: whether it is points, lines, or polygons.
virtual TypeHandle | get_type () const
virtual PointerTo< GeomPrimitive > | make_copy () const
Public Member Functions inherited from GeomPrimitive
| GeomPrimitive (const GeomPrimitive &copy)
| GeomPrimitive (UsageHint usage_hint)
void | add_consecutive_vertices (int start, int num_vertices)
| Adds a consecutive sequence of vertices, beginning at start, to the primitive.
void | add_next_vertices (int num_vertices)
| Adds the next n vertices in sequence, beginning from the last vertex added to the primitive + 1.
void | add_vertex (int vertex)
| Adds the indicated vertex to the list of vertex indices used by the graphics primitive type.
void | add_vertices (int v1, int v2)
void | add_vertices (int v1, int v2, int v3)
| Adds several vertices in a row.
void | add_vertices (int v1, int v2, int v3, int v4)
| Adds several vertices in a row.
void | calc_sphere_radius (const LPoint3 &center, PN_stdfloat &sq_radius, bool &found_any, const GeomVertexData *vertex_data, Thread *current_thread) const
| Expands radius so that a sphere with the given center point fits all of the vertices.
void | calc_tight_bounds (LPoint3 &min_point, LPoint3 &max_point, PN_stdfloat &sq_center_dist, bool &found_any, const GeomVertexData *vertex_data, bool got_mat, const LMatrix4 &mat, const InternalName *column_name, Thread *current_thread) const
| Expands min_point and max_point to include all of the vertices in the Geom, if any (or the data of any point type, for instance, texture coordinates– based on the column name).
bool | check_valid (const GeomVertexData *vertex_data) const
| Verifies that the primitive only references vertices that actually exist within the indicated GeomVertexData.
bool | check_valid (const GeomVertexDataPipelineReader *data_reader) const
void | clear_minmax ()
| Undoes a previous call to set_minmax(), and allows the minimum and maximum values to be recomputed normally.
void | clear_vertices ()
| Removes all of the vertices and primitives from the object, so they can be re-added.
bool | close_primitive ()
| Indicates that the previous n calls to add_vertex(), since the last call to close_primitive(), have fully defined a new primitive.
ConstPointerTo< GeomPrimitive > | decompose () const
| Decomposes a complex primitive type into a simpler primitive type, for instance triangle strips to triangles, and returns a pointer to the new primitive definition.
ConstPointerTo< GeomPrimitive > | doubleside () const
| Duplicates triangles in the primitive so that each triangle is back-to-back with another triangle facing in the opposite direction.
virtual void | finalize (BamReader *manager)
| Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
int | get_data_size_bytes () const
CPTA_int | get_ends () const
| Returns a const pointer to the primitive ends array so application code can read it directly.
int | get_first_vertex () const
| Returns the first vertex number referenced by the primitive.
const GeomVertexArrayFormat * | get_index_format () const
| Returns a registered format appropriate for using to store the index table.
int | get_index_stride () const
NumericType | get_index_type () const
int | get_max_vertex () const
| Returns the maximum vertex index number used by all the primitives in this object.
ConstPointerTo< GeomVertexArrayData > | get_maxs () const
int | get_min_vertex () const
| Returns the minimum vertex index number used by all the primitives in this object.
ConstPointerTo< GeomVertexArrayData > | get_mins () const
UpdateSeq | get_modified () const
int | get_num_bytes () const
int | get_num_faces () const
| Returns the number of triangles or other fundamental type (such as line segments) represented by all the primitives in this object.
int | get_num_primitives () const
| Returns the number of individual primitives stored within this object.
int | get_num_used_vertices () const
| Returns the number of vertices used by all of the primitives.
int | get_num_vertices () const
virtual int | get_num_vertices_per_primitive () const
int | get_primitive_end (int n) const
| Returns the element within the _vertices list at which the nth primitive ends.
int | get_primitive_max_vertex (int n) const
| Returns the maximum vertex index number used by the nth primitive in this object.
int | get_primitive_min_vertex (int n) const
| Returns the minimum vertex index number used by the nth primitive in this object.
int | get_primitive_num_faces (int n) const
| Returns the number of triangles or other fundamental type (such as line segments) represented by the nth primitive in this object.
int | get_primitive_num_vertices (int n) const
| Returns the number of vertices used by the nth primitive.
int | get_primitive_start (int n) const
| Returns the element within the _vertices list at which the nth primitive starts.
ShadeModel | get_shade_model () const
int | get_strip_cut_index () const
UsageHint | get_usage_hint () const
int | get_vertex (int i) const
ConstPointerTo< GeomVertexArrayData > | get_vertices () const
ConstPointerTo< GeomVertexArrayDataHandle > | get_vertices_handle (Thread *current_thread) const
bool | is_composite () const
| Returns true if the primitive is a composite primitive such as a tristrip or trifan, or false if it is a fundamental primitive such as a collection of triangles.
bool | is_indexed () const
| Returns true if the primitive is indexed, false otherwise.
bool | is_prepared (PreparedGraphicsObjects *prepared_objects) const
| Returns true if the data has already been prepared or enqueued for preparation on the indicated GSG, false otherwise.
virtual ConstPointerTo< GeomPrimitive > | make_adjacency () const
| Adds adjacency information to this primitive.
PointerTo< GeomVertexArrayData > | make_index_data () const
void | make_indexed ()
| Converts the primitive from nonindexed form to indexed form.
ConstPointerTo< GeomPrimitive > | make_lines () const
| Returns a new GeomLines primitive that represents each of the edges in the original primitive rendered as a line.
void | make_nonindexed (GeomVertexData *dest, const GeomVertexData *source)
| Converts the primitive from indexed to nonindexed by duplicating vertices as necessary into the indicated dest GeomVertexData.
ConstPointerTo< GeomPrimitive > | make_patches () const
| Decomposes a complex primitive type into a simpler primitive type, for instance triangle strips to triangles, puts these in a new GeomPatches object and returns a pointer to the new primitive definition.
ConstPointerTo< GeomPrimitive > | make_points () const
| Returns a new GeomPoints primitive that represents each of the vertices in the original primitive, rendered exactly once.
ConstPointerTo< GeomPrimitive > | match_shade_model (ShadeModel shade_model) const
| Returns a new primitive that is compatible with the indicated shade model, if possible, or NULL if this is not possible.
PTA_int | modify_ends ()
| Returns a modifiable pointer to the primitive ends array, so application code can directly fiddle with this data.
PointerTo< GeomVertexArrayData > | modify_vertices (int num_vertices=-1)
| Returns a modifiable pointer to the vertex index list, so application code can directly fiddle with this data.
PointerTo< GeomVertexArrayDataHandle > | modify_vertices_handle (Thread *current_thread)
void | offset_vertices (int offset)
| Adds the indicated offset to all vertices used by the primitive.
void | offset_vertices (int offset, int begin_row, int end_row)
| Adds the indicated offset to the indicated segment of vertices used by the primitive.
void | operator= (const GeomPrimitive &copy)
| The copy assignment operator is not pipeline-safe.
virtual void | output (std::ostream &out) const
void | pack_vertices (GeomVertexData *dest, const GeomVertexData *source)
| Packs the vertices used by the primitive from the indicated source array onto the end of the indicated destination array.
void | prepare (PreparedGraphicsObjects *prepared_objects)
| Indicates that the data should be enqueued to be prepared in the indicated prepared_objects at the beginning of the next frame.
IndexBufferContext * | prepare_now (PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg)
| Creates a context for the data on the particular GSG, if it does not already exist.
bool | release (PreparedGraphicsObjects *prepared_objects)
| Frees the data context only on the indicated object, if it exists there.
int | release_all ()
| Frees the context allocated on all objects for which the data has been declared.
bool | request_resident (Thread *current_thread=Thread::get_current_thread()) const
| Returns true if the primitive data is currently resident in memory.
void | reserve_num_vertices (int num_vertices)
| This ensures that enough memory space for n vertices is allocated, so that you may increase the number of vertices to n without causing a new memory allocation.
ConstPointerTo< GeomPrimitive > | reverse () const
| Reverses the winding order in the primitive so that each triangle is facing in the opposite direction it was originally.
ConstPointerTo< GeomPrimitive > | rotate () const
| Returns a new primitive with the shade_model reversed (if it is flat shaded), if possible.
void | set_ends (PTA_int ends)
| Completely replaces the primitive ends array with a new table.
void | set_index_type (NumericType index_type)
| Changes the numeric type of the index column.
void | set_minmax (int min_vertex, int max_vertex, GeomVertexArrayData *mins, GeomVertexArrayData *maxs)
| Explicitly specifies the minimum and maximum vertices, as well as the lists of per-component min and max.
void | set_nonindexed_vertices (int first_vertex, int num_vertices)
| Sets the primitive up as a nonindexed primitive, using the indicated vertex range.
void | set_shade_model (ShadeModel shade_model)
| Changes the ShadeModel hint for this primitive.
void | set_usage_hint (UsageHint usage_hint)
| Changes the UsageHint hint for this primitive.
void | set_vertices (const GeomVertexArrayData *vertices, int num_vertices=-1)
| Completely replaces the vertex index list with a new table.
virtual void | write (std::ostream &out, int indent_level) const
virtual void | write_datagram (BamWriter *manager, Datagram &dg)
| Writes the contents of this object to the datagram for shipping out to a Bam file.
Public Member Functions inherited from CopyOnWriteObject
| CopyOnWriteObject (const CopyOnWriteObject &copy)
void | operator= (const CopyOnWriteObject &copy)
Public Member Functions inherited from CachedTypedWritableReferenceCount
void | cache_ref () const
| Explicitly increments the cache reference count and the normal reference count simultaneously.
void | cache_ref_only () const
| Decrements the cache reference count without affecting the normal reference count.
bool | cache_unref () const
| Explicitly decrements the cache reference count and the normal reference count simultaneously.
int | get_cache_ref_count () const
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
Public Member Functions inherited from TypedWritableReferenceCount
| TypedWritableReferenceCount (const TypedWritableReferenceCount &copy)
virtual ReferenceCount * | as_reference_count ()
| Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
void | operator= (const TypedWritableReferenceCount &copy)
Public Member Functions inherited from TypedWritable
| TypedWritable (const TypedWritable &copy)
virtual int | complete_pointers (TypedWritable **p_list, BamReader *manager)
| Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
vector_uchar | encode_to_bam_stream () const
| Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a bytes object.
bool | encode_to_bam_stream (vector_uchar &data, BamWriter *writer=nullptr) const
| Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
UpdateSeq | get_bam_modified () const
| Returns the current bam_modified counter.
void | mark_bam_modified ()
| Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
void | operator= (const TypedWritable &copy)
virtual bool | require_fully_complete () const
| Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
virtual void | update_bam_nested (BamWriter *manager)
| Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.
Public Member Functions inherited from TypedObject
| TypedObject (const TypedObject &copy)=default
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_typed_object () const
| Returns the object, upcast (if necessary) to a TypedObject pointer.
int | get_best_parent_from_Set (const std::set< int > &) const
int | get_type_index () const
| Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
bool | is_exact_type (TypeHandle handle) const
| Returns true if the current object is the indicated type exactly.
bool | is_of_type (TypeHandle handle) const
| Returns true if the current object is or derives from the indicated type.
TypedObject & | operator= (const TypedObject &copy)=default
Public Member Functions inherited from MemoryBase
void | operator delete (void *, void *)
void | operator delete (void *ptr)
void | operator delete[] (void *, void *)
void | operator delete[] (void *ptr)
void * | operator new (size_t size)
void * | operator new (size_t size, void *ptr)
void * | operator new[] (size_t size)
void * | operator new[] (size_t size, void *ptr)
Public Member Functions inherited from ReferenceCount
int | get_ref_count () const
WeakReferenceList * | get_weak_list () const
| Returns the WeakReferenceList associated with this ReferenceCount object.
bool | has_weak_list () const
| Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
void | local_object ()
| This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void | ref () const
| Explicitly increments the reference count.
bool | ref_if_nonzero () const
| Atomically increases the reference count of this object if it is not zero.
bool | test_ref_count_integrity () const
| Does some easy checks to make sure that the reference count isn't completely bogus.
bool | test_ref_count_nonzero () const
| Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
virtual bool | unref () const
| Explicitly decrements the reference count.
bool | unref_if_one () const
| Atomically decreases the reference count of this object if it is one.
WeakReferenceList * | weak_ref ()
| Adds the indicated PointerToVoid as a weak reference to this object.
void | weak_unref ()
| Removes the indicated PointerToVoid as a weak reference to this object.

## Static Public Member Functions
static TypeHandle | get_class_type ()
static void | init_type ()
static void | register_with_read_factory ()
| Tells the BamReader how to create objects of type Geom.
Static Public Member Functions inherited from GeomPrimitive
static TypeHandle | get_class_type ()
static const GeomVertexArrayFormat * | get_index_format (NumericType index_type)
| Returns a registered GeomVertexArrayFormat of the indicated unsigned integer numeric type for storing index values.
static void | init_type ()
Static Public Member Functions inherited from CopyOnWriteObject
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from CachedTypedWritableReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedWritableReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()
static | PT (TypedWritableReferenceCount) decode_from_bam_stream(vector_uchar data
Static Public Member Functions inherited from TypedWritable
static bool | decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, vector_uchar data, BamReader *reader=nullptr)
| Reads the bytes created by a previous call to encode_to_bam_stream(), and extracts the single object on those bytes.
static TypeHandle | get_class_type ()
static void | init_type ()
Static Public Member Functions inherited from TypedObject
static TypeHandle | get_class_type ()
static void | init_type ()
| This function is declared non-inline to work around a compiler bug in g++ 2.96.
Static Public Member Functions inherited from ReferenceCount
static TypeHandle | get_class_type ()
static void | init_type ()

## Friends
class | Geom

## Additional Inherited Members
Public Types inherited from GeomEnums
enum | AnimationType { AT_none , AT_panda , AT_hardware }
enum | Contents { C_other , C_point , C_clip_point , C_vector , C_texcoord , C_color , C_index , C_morph_delta , C_matrix , C_normal }
enum | GeomRendering { GR_indexed_point = 0x00001 , GR_indexed_other = 0x10000 , GR_indexed_bits = 0x10001 , GR_point = 0x00002 , GR_point_uniform_size = 0x00004 , GR_per_point_size = 0x00008 , GR_point_perspective = 0x00010 , GR_point_aspect_ratio = 0x00020 , GR_point_scale = 0x00040 , GR_point_rotate = 0x00080 , GR_point_sprite = 0x00100 , GR_point_sprite_tex_matrix = 0x00200 , GR_point_bits = 0x003fe , GR_triangle_strip = 0x00400 , GR_triangle_fan = 0x00800 , GR_line_strip = 0x01000 , GR_composite_bits = 0x01c00 , GR_strip_cut_index = 0x20000 , GR_flat_first_vertex = 0x02000 , GR_flat_last_vertex = 0x04000 , GR_shade_model_bits = 0x06000 , GR_render_mode_wireframe = 0x40000 , GR_render_mode_point = 0x80000 , GR_adjacency = 0x100000 }
enum | NumericType { NT_uint8 , NT_uint16 , NT_uint32 , NT_packed_dcba , NT_packed_dabc , NT_float32 , NT_float64 , NT_stdfloat , NT_int8 , NT_int16 , NT_int32 , NT_packed_ufloat }
enum | PrimitiveType { PT_none , PT_polygons , PT_lines , PT_points , PT_patches }
enum | ShadeModel { SM_uniform , SM_smooth , SM_flat_first_vertex , SM_flat_last_vertex }
enum | UsageHint { UH_client , UH_stream , UH_dynamic , UH_static , UH_unspecified }
Public Attributes inherited from GeomPrimitive
| get_data_size_bytes
| Returns the number of bytes stored in the vertices array.
| get_geom_rendering
| Returns the set of GeomRendering bits that represent the rendering properties required to properly render this primitive.
| get_index_stride
| A convenience function to return the gap between successive index numbers, in bytes, of the index data.
| get_index_type
| Returns the numeric type of the index column.
| get_maxs
| get_min_num_vertices_per_primitive
| Returns the minimum number of vertices that must be added before close_primitive() may legally be called.
| get_mins
| get_modified
| Returns a sequence number which is guaranteed to change at least every time the vertex index array is modified.
| get_num_bytes
| Returns the number of bytes consumed by the primitive and its index table(s).
| get_num_unused_vertices_per_primitive
| Returns the number of vertices that are added between primitives that aren't, strictly speaking, part of the primitives themselves.
| get_num_vertices
| Returns the number of indices used by all the primitives in this object.
| get_num_vertices_per_primitive
| If the primitive type is a simple type in which all primitives have the same number of vertices, like triangles, returns the number of vertices per primitive.
| get_primitive_type
| get_shade_model
| Returns the ShadeModel hint for this primitive.
| get_strip_cut_index
| Returns the index of the indicated type that is reserved for use as a strip cut index, if enabled for the primitive.
| get_usage_hint
| Returns the usage hint for this primitive.
| get_vertex
| Returns the ith vertex index in the table.
Public Attributes inherited from CachedTypedWritableReferenceCount
| get_cache_ref_count
| Returns the current reference count.
Public Attributes inherited from TypedWritableReferenceCount
static BamReader * | reader = nullptr)
Public Attributes inherited from TypedObject
| get_type
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count.
Static Public Attributes inherited from TypedWritable
static TypedWritable *const | Null = nullptr

## Detailed Description

Defines a series of triangle strips with adjacency information.

Since
  1.10.0

Definition at line 25 of file geomTristripsAdjacency.h.

## Constructor & Destructor Documentation

## ◆ GeomTristripsAdjacency() [1/2]

GeomTristripsAdjacency::GeomTristripsAdjacency | ( | GeomTristripsAdjacency::UsageHint | usage_hint | ) |
| explicit

Definition at line 27 of file geomTristripsAdjacency.cxx.

## ◆ GeomTristripsAdjacency() [2/2]

GeomTristripsAdjacency::GeomTristripsAdjacency | ( | const GeomTristripsAdjacency & | copy | ) |

Definition at line 36 of file geomTristripsAdjacency.cxx.

## ◆ ~GeomTristripsAdjacency()

GeomTristripsAdjacency::~GeomTristripsAdjacency | ( |  | ) |
| virtual

Definition at line 45 of file geomTristripsAdjacency.cxx.

## Member Function Documentation

## ◆ draw()

bool GeomTristripsAdjacency::draw | ( | GraphicsStateGuardianBase * | gsg,
|  | const GeomPrimitivePipelineReader * | reader,
|  | bool | force ) const
| virtual

Calls the appropriate method on the GSG to draw the primitive.

Implements GeomPrimitive.

Definition at line 110 of file geomTristripsAdjacency.cxx.

## ◆ force_init_type()

virtual TypeHandle GeomTristripsAdjacency::force_init_type | ( |  | ) |
| inline virtual

Reimplemented from GeomPrimitive.

Definition at line 67 of file geomTristripsAdjacency.h.

## ◆ get_class_type()

static TypeHandle GeomTristripsAdjacency::get_class_type | ( |  | ) |
| inline static

Definition at line 56 of file geomTristripsAdjacency.h.

## ◆ get_geom_rendering()

int GeomTristripsAdjacency::get_geom_rendering | ( |  | ) | const
| virtual

Returns the set of GeomRendering bits that represent the rendering properties required to properly render this primitive.

Reimplemented from GeomPrimitive.

Definition at line 74 of file geomTristripsAdjacency.cxx.

References GeomPrimitive::get_num_primitives(), and GeomPrimitive::is_indexed().

## ◆ get_min_num_vertices_per_primitive()

int GeomTristripsAdjacency::get_min_num_vertices_per_primitive | ( |  | ) | const
| virtual

Returns the minimum number of vertices that must be added before close_primitive() may legally be called.

Reimplemented from GeomPrimitive.

Definition at line 91 of file geomTristripsAdjacency.cxx.

## ◆ get_num_unused_vertices_per_primitive()

int GeomTristripsAdjacency::get_num_unused_vertices_per_primitive | ( |  | ) | const
| virtual

Returns the number of vertices that are added between primitives that aren't, strictly speaking, part of the primitives themselves.

This is used, for instance, to define degenerate triangles to connect otherwise disconnected triangle strips.

Reimplemented from GeomPrimitive.

Definition at line 102 of file geomTristripsAdjacency.cxx.

## ◆ get_primitive_type()

GeomPrimitive::PrimitiveType GeomTristripsAdjacency::get_primitive_type | ( |  | ) | const
| virtual

Returns the fundamental rendering type of this primitive: whether it is points, lines, or polygons.

This is used to set up the appropriate antialiasing settings when AntialiasAttrib::M_auto is in effect; it also implies the type of primitive that will be produced when decompose() is called.

Implements GeomPrimitive.

Definition at line 65 of file geomTristripsAdjacency.cxx.

## ◆ get_type()

virtual TypeHandle GeomTristripsAdjacency::get_type | ( |  | ) | const
| inline virtual

Reimplemented from GeomPrimitive.

Definition at line 64 of file geomTristripsAdjacency.h.

## ◆ init_type()

static void GeomTristripsAdjacency::init_type | ( |  | ) |
| inline static

Definition at line 59 of file geomTristripsAdjacency.h.

## ◆ make_copy()

PointerTo< GeomPrimitive > GeomTristripsAdjacency::make_copy | ( |  | ) | const
| virtual

Implements GeomPrimitive.

Definition at line 52 of file geomTristripsAdjacency.cxx.

## ◆ register_with_read_factory()

void GeomTristripsAdjacency::register_with_read_factory | ( |  | ) |
| static

Tells the BamReader how to create objects of type Geom.

Definition at line 141 of file geomTristripsAdjacency.cxx.

References BamReader::get_factory(), and Factory< Type >::register_factory().

## Friends And Related Symbol Documentation

## ◆ Geom

friend class Geom
| friend

Definition at line 72 of file geomTristripsAdjacency.h.

The documentation for this class was generated from the following files:

- panda/src/gobj/geomTristripsAdjacency.h
- panda/src/gobj/geomTristripsAdjacency.cxx