Panda3D
Public Member Functions | Static Public Member Functions | Friends | List of all members
GeomTrifans Class Reference

Defines a series of triangle fans. More...

#include "geomTrifans.h"

Inheritance diagram for GeomTrifans:
GeomPrimitive CopyOnWriteObject GeomEnums CachedTypedWritableReferenceCount TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

Public Member Functions

 GeomTrifans (UsageHint usage_hint)
 
 GeomTrifans (const GeomTrifans &copy)
 
virtual bool draw (GraphicsStateGuardianBase *gsg, const GeomPrimitivePipelineReader *reader, bool force) const
 
virtual TypeHandle force_init_type ()
 
virtual int get_geom_rendering () const
 
virtual PrimitiveType get_primitive_type () const
 
virtual TypeHandle get_type () const
 
virtual PT (GeomPrimitive) make_copy() const
 
- Public Member Functions inherited from GeomPrimitive
 GeomPrimitive (UsageHint usage_hint)
 
 GeomPrimitive (const GeomPrimitive &copy)
 
void add_consecutive_vertices (int start, int num_vertices)
 Adds a consecutive sequence of vertices, beginning at start, to the primitive. More...
 
void add_next_vertices (int num_vertices)
 Adds the next n vertices in sequence, beginning from the last vertex added to the primitive + 1. More...
 
void add_vertex (int vertex)
 Adds the indicated vertex to the list of vertex indices used by the graphics primitive type. More...
 
void add_vertices (int v1, int v2)
 
void add_vertices (int v1, int v2, int v3)
 Adds several vertices in a row. More...
 
void add_vertices (int v1, int v2, int v3, int v4)
 Adds several vertices in a row. More...
 
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. More...
 
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). More...
 
bool check_valid (const GeomVertexData *vertex_data) const
 Verifies that the primitive only references vertices that actually exist within the indicated GeomVertexData. More...
 
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. More...
 
void clear_vertices ()
 Removes all of the vertices and primitives from the object, so they can be re-added. More...
 
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. More...
 
 CPT (GeomPrimitive) decompose() const
 
 CPT (GeomPrimitive) rotate() const
 
 CPT (GeomPrimitive) doubleside() const
 
 CPT (GeomPrimitive) reverse() const
 
 CPT (GeomPrimitive) match_shade_model(ShadeModel shade_model) const
 
 CPT (GeomPrimitive) make_points() const
 
 CPT (GeomPrimitive) make_lines() const
 
 CPT (GeomPrimitive) make_patches() const
 
 CPT (GeomVertexArrayData) get_vertices() const
 
 CPT (GeomVertexArrayDataHandle) get_vertices_handle(Thread *current_thread) const
 
 CPT (GeomVertexArrayData) get_mins() const
 
 CPT (GeomVertexArrayData) get_maxs() const
 
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. More...
 
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. More...
 
int get_first_vertex () const
 Returns the first vertex number referenced by the primitive. More...
 
const GeomVertexArrayFormatget_index_format () const
 Returns a registered format appropriate for using to store the index table. More...
 
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. More...
 
virtual int get_min_num_vertices_per_primitive () const
 
int get_min_vertex () const
 Returns the minimum vertex index number used by all the primitives in this object. More...
 
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. More...
 
int get_num_primitives () const
 Returns the number of individual primitives stored within this object. More...
 
virtual int get_num_unused_vertices_per_primitive () const
 
int get_num_used_vertices () const
 Returns the number of vertices used by all of the primitives. More...
 
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. More...
 
int get_primitive_max_vertex (int n) const
 Returns the maximum vertex index number used by the nth primitive in this object. More...
 
int get_primitive_min_vertex (int n) const
 Returns the minimum vertex index number used by the nth primitive in this object. More...
 
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. More...
 
int get_primitive_num_vertices (int n) const
 Returns the number of vertices used by the nth primitive. More...
 
int get_primitive_start (int n) const
 Returns the element within the _vertices list at which the nth primitive starts. More...
 
ShadeModel get_shade_model () const
 
int get_strip_cut_index () const
 
UsageHint get_usage_hint () const
 
int get_vertex (int i) 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. More...
 
bool is_indexed () const
 Returns true if the primitive is indexed, false otherwise. More...
 
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. More...
 
void make_indexed ()
 Converts the primitive from nonindexed form to indexed form. More...
 
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. More...
 
PTA_int modify_ends ()
 Returns a modifiable pointer to the primitive ends array, so application code can directly fiddle with this data. More...
 
void offset_vertices (int offset)
 Adds the indicated offset to all vertices used by the primitive. More...
 
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. More...
 
void operator= (const GeomPrimitive &copy)
 The copy assignment operator is not pipeline-safe. More...
 
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. More...
 
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. More...
 
IndexBufferContextprepare_now (PreparedGraphicsObjects *prepared_objects, GraphicsStateGuardianBase *gsg)
 Creates a context for the data on the particular GSG, if it does not already exist. More...
 
 PT (GeomVertexArrayData) modify_vertices(int num_vertices
 
 PT (GeomVertexArrayDataHandle) modify_vertices_handle(Thread *current_thread)
 
 PT (GeomVertexArrayData) make_index_data() const
 
bool release (PreparedGraphicsObjects *prepared_objects)
 Frees the data context only on the indicated object, if it exists there. More...
 
int release_all ()
 Frees the context allocated on all objects for which the data has been declared. More...
 
bool request_resident (Thread *current_thread=Thread::get_current_thread()) const
 
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. More...
 
void set_ends (PTA_int ends)
 Completely replaces the primitive ends array with a new table. More...
 
void set_index_type (NumericType index_type)
 Changes the numeric type of the index column. More...
 
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. More...
 
void set_nonindexed_vertices (int first_vertex, int num_vertices)
 Sets the primitive up as a nonindexed primitive, using the indicated vertex range. More...
 
void set_shade_model (ShadeModel shade_model)
 Changes the ShadeModel hint for this primitive. More...
 
void set_usage_hint (UsageHint usage_hint)
 Changes the UsageHint hint for this primitive. More...
 
void set_vertices (const GeomVertexArrayData *vertices, int num_vertices=-1)
 Completely replaces the vertex index list with a new table. More...
 
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. More...
 
- 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. More...
 
void cache_ref_only () const
 Decrements the cache reference count without affecting the normal reference count. More...
 
bool cache_unref () const
 Explicitly decrements the cache reference count and the normal reference count simultaneously. More...
 
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. More...
 
- Public Member Functions inherited from TypedWritableReferenceCount
 TypedWritableReferenceCount (const TypedWritableReferenceCount &copy)
 
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type. More...
 
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(). More...
 
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. More...
 
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. More...
 
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter. More...
 
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. More...
 
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. More...
 
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. More...
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer. More...
 
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. More...
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly. More...
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type. More...
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
static void register_with_read_factory ()
 
- Static Public Member Functions inherited from GeomPrimitive
static TypeHandle get_class_type ()
 
static const GeomVertexArrayFormatget_index_format (NumericType index_type)
 Returns a registered GeomVertexArrayFormat of the indicated unsigned integer numeric type for storing index values. More...
 
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. More...
 
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. More...
 
- 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. More...
 
 get_geom_rendering
 Returns the set of GeomRendering bits that represent the rendering properties required to properly render this primitive. More...
 
 get_index_stride
 A convenience function to return the gap between successive index numbers, in bytes, of the index data. More...
 
 get_index_type
 Returns the numeric type of the index column. More...
 
 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. More...
 
 get_mins
 
 get_modified
 Returns a sequence number which is guaranteed to change at least every time the vertex index array is modified. More...
 
 get_num_bytes
 
 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. More...
 
 get_num_vertices
 Returns the number of indices used by all the primitives in this object. More...
 
 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. More...
 
 get_primitive_type
 
 get_shade_model
 Returns the ShadeModel hint for this primitive. More...
 
 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. More...
 
 get_usage_hint
 Returns the usage hint for this primitive. More...
 
 get_vertex
 Returns the ith vertex index in the table. More...
 
- Public Attributes inherited from CachedTypedWritableReferenceCount
 get_cache_ref_count
 Returns the current reference count. More...
 
- Public Attributes inherited from TypedWritableReferenceCount
static BamReaderreader = nullptr)
 
- Public Attributes inherited from TypedObject
 get_type
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count. More...
 
- Static Public Attributes inherited from TypedWritable
static TypedWritable *const Null = nullptr
 

Detailed Description

Defines a series of triangle fans.

Definition at line 23 of file geomTrifans.h.


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