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

Defines a series of triangle strips. More...

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

Public Member Functions

 __init__ (GeomEnums::UsageHint usage_hint)
 
 __init__ (const GeomTristrips copy)
 
 operator new (size_t size)
 
- Public Member Functions inherited from GeomPrimitive
 addConsecutiveVertices (int start, int num_vertices)
 Adds a consecutive sequence of vertices, beginning at start, to the primitive. More...
 
 addNextVertices (int num_vertices)
 Adds the next n vertices in sequence, beginning from the last vertex added to the primitive + 1. More...
 
 addVertex (int vertex)
 Adds the indicated vertex to the list of vertex indices used by the graphics primitive type. To define a primitive, you must call add_vertex() for each vertex of the new primitive, and then call close_primitive() after you have specified the last vertex of each primitive. More...
 
 addVertices (int v1, int v2)
 Adds several vertices in a row. More...
 
 addVertices (int v1, int v2, int v3)
 Adds several vertices in a row. More...
 
 addVertices (int v1, int v2, int v3, int v4)
 Adds several vertices in a row. More...
 
bool checkValid (const GeomVertexData vertex_data)
 Verifies that the primitive only references vertices that actually exist within the indicated GeomVertexData. Returns true if the primitive appears to be valid, false otherwise. More...
 
 clearMinmax ()
 Undoes a previous call to set_minmax(), and allows the minimum and maximum values to be recomputed normally. More...
 
 clearVertices ()
 Removes all of the vertices and primitives from the object, so they can be re-added. More...
 
bool closePrimitive ()
 Indicates that the previous n calls to add_vertex(), since the last call to close_primitive(), have fully defined a new primitive. Returns true if successful, false otherwise. More...
 
const GeomPrimitive decompose ()
 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. If the decomposition cannot be performed, this might return the original object. More...
 
const GeomPrimitive doubleside ()
 Duplicates triangles in the primitive so that each triangle is back-to-back with another triangle facing in the opposite direction. Note that this doesn't affect vertex normals, so this operation alone won't work in the presence of lighting (but see SceneGraphReducer::doubleside()). More...
 
int getDataSizeBytes ()
 Returns the number of bytes stored in the vertices array. More...
 
CPTAInt getEnds ()
 Returns a const pointer to the primitive ends array so application code can read it directly. Do not attempt to modify the returned array; use modify_ends() or set_ends() for this. More...
 
int getFirstVertex ()
 Returns the first vertex number referenced by the primitive. This is particularly important in the case of a nonindexed primitive, in which case get_first_vertex() and get_num_vertices() completely define the extent of the vertex range. More...
 
int getGeomRendering ()
 Returns the set of GeomRendering bits that represent the rendering properties required to properly render this primitive. More...
 
int getIndexStride ()
 A convenience function to return the gap between successive index numbers, in bytes, of the index data. More...
 
GeomEnums::NumericType getIndexType ()
 Returns the numeric type of the index column. Normally, this will be either NT_uint16 or NT_uint32. More...
 
const GeomVertexArrayData getMaxs ()
 Returns a const pointer to the primitive maxs array so application code can read it directly. Do not attempt to modify the returned array; use set_minmax(). More...
 
int getMaxVertex ()
 Returns the maximum vertex index number used by all the primitives in this object. More...
 
int getMinNumVerticesPerPrimitive ()
 Returns the minimum number of vertices that must be added before close_primitive() may legally be called. More...
 
const GeomVertexArrayData getMins ()
 Returns a const pointer to the primitive mins array so application code can read it directly. Do not attempt to modify the returned array; use set_minmax() for this. More...
 
int getMinVertex ()
 Returns the minimum vertex index number used by all the primitives in this object. More...
 
UpdateSeq getModified ()
 Returns a sequence number which is guaranteed to change at least every time the vertex index array is modified. More...
 
int getNumBytes ()
 Returns the number of bytes consumed by the primitive and its index table(s). More...
 
int getNumFaces ()
 Returns the number of triangles or other fundamental type (such as line segments) represented by all the primitives in this object. More...
 
int getNumPrimitives ()
 Returns the number of individual primitives stored within this object. All primitives are the same type. More...
 
int getNumUnusedVerticesPerPrimitive ()
 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. More...
 
int getNumUsedVertices ()
 Returns the number of vertices used by all of the primitives. This is the same as summing get_primitive_num_vertices(n) for n in get_num_primitives(). It is like get_num_vertices except that it excludes all of the degenerate vertices and strip-cut indices. More...
 
int getNumVertices ()
 Returns the number of indices used by all the primitives in this object. More...
 
int getNumVerticesPerPrimitive ()
 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. If the primitive type is a more complex type in which different primitives might have different numbers of vertices, for instance a triangle strip, returns 0. More...
 
int getPrimitiveEnd (int n)
 Returns the element within the _vertices list at which the nth primitive ends. This is one past the last valid element for the nth primitive. More...
 
int getPrimitiveMaxVertex (int n)
 Returns the maximum vertex index number used by the nth primitive in this object. More...
 
int getPrimitiveMinVertex (int n)
 Returns the minimum vertex index number used by the nth primitive in this object. More...
 
int getPrimitiveNumFaces (int n)
 Returns the number of triangles or other fundamental type (such as line segments) represented by the nth primitive in this object. More...
 
int getPrimitiveNumVertices (int n)
 Returns the number of vertices used by the nth primitive. This is the same thing as get_primitive_end(n) - get_primitive_start(n). More...
 
int getPrimitiveStart (int n)
 Returns the element within the _vertices list at which the nth primitive starts. More...
 
GeomEnums::PrimitiveType getPrimitiveType ()
 
GeomEnums::ShadeModel getShadeModel ()
 Returns the ShadeModel hint for this primitive. This is intended as a hint to the renderer to tell it how the per-vertex colors and normals are applied. More...
 
int getStripCutIndex ()
 If relevant, returns the index value that may be used in some cases to signify the end of a primitive. This is typically the highest value that the numeric type can store. More...
 
GeomEnums::UsageHint getUsageHint ()
 Returns the usage hint for this primitive. See geomEnums.h. This has nothing to do with the usage hint associated with the primitive's vertices; this only specifies how often the vertex indices that define the primitive will be modified. More...
 
int getVertex (int i)
 Returns the ith vertex index in the table. More...
 
list getVertexList ()
 
const GeomVertexArrayData getVertices ()
 Returns a const pointer to the vertex index array so application code can read it directly. This might return NULL if the primitive is nonindexed. Do not attempt to modify the returned array; use modify_vertices() or set_vertices() for this. More...
 
bool isComposite ()
 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 isIndexed ()
 Returns true if the primitive is indexed, false otherwise. An indexed primitive stores a table of index numbers into its GeomVertexData, so that it can reference the vertices in any order. A nonindexed primitive, on the other hand, stores only the first vertex number and number of vertices used, so that it can only reference the vertices consecutively. More...
 
GeomPrimitive makeCopy ()
 
 makeIndexed ()
 Converts the primitive from nonindexed form to indexed form. This will simply create an index table that is numbered consecutively from get_first_vertex(); it does not automatically collapse together identical vertices that may have been split apart by a previous call to make_nonindexed(). More...
 
const GeomPrimitive makeLines ()
 Returns a new GeomLines primitive that represents each of the edges in the original primitive rendered as a line. If the original primitive is already a GeomLines primitive, returns the original primitive unchanged. More...
 
 makeNonindexed (GeomVertexData dest, const GeomVertexData source)
 Converts the primitive from indexed to nonindexed by duplicating vertices as necessary into the indicated dest GeomVertexData. Note: does not support primitives with strip cut indices. More...
 
const GeomPrimitive makePatches ()
 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. If the decomposition cannot be performed, this might return the original object. More...
 
const GeomPrimitive makePoints ()
 Returns a new GeomPoints primitive that represents each of the vertices in the original primitive, rendered exactly once. If the original primitive is already a GeomPoints primitive, returns the original primitive unchanged. More...
 
const GeomPrimitive matchShadeModel (GeomEnums::ShadeModel shade_model)
 Returns a new primitive that is compatible with the indicated shade model, if possible, or NULL if this is not possible. More...
 
PTAInt modifyEnds ()
 Returns a modifiable pointer to the primitive ends array, so application code can directly fiddle with this data. Use with caution, since there are no checks that the data will be left in a stable state. More...
 
GeomVertexArrayData modifyVertices (int num_vertices)
 Returns a modifiable pointer to the vertex index list, so application code can directly fiddle with this data. Use with caution, since there are no checks that the data will be left in a stable state. More...
 
 offsetVertices (int offset)
 Adds the indicated offset to all vertices used by the primitive. More...
 
 offsetVertices (int offset, int begin_row, int end_row)
 Adds the indicated offset to the indicated segment of vertices used by the primitive. Unlike the other version of offset_vertices, this makes the geometry indexed if it isn't already. More...
 
 operator new (size_t size)
 
GeomPrimitive operator= (const GeomPrimitive copy)
 
 output (Ostream out)
 
 packVertices (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...
 
bool requestResident ()
 Returns true if the primitive data is currently resident in memory. If this returns false, the primitive data will be brought back into memory shortly; try again later. More...
 
 reserveNumVertices (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. This is a performance optimization only; it is especially useful when you know ahead of time that you will be adding n vertices to the primitive. More...
 
const GeomPrimitive reverse ()
 Reverses the winding order in the primitive so that each triangle is facing in the opposite direction it was originally. Note that this doesn't affect vertex normals, so this operation alone won't work in the presence of lighting (but see SceneGraphReducer::reverse()). More...
 
const GeomPrimitive rotate ()
 Returns a new primitive with the shade_model reversed (if it is flat shaded), if possible. If the primitive type cannot be rotated, returns the original primitive, unrotated. More...
 
 setEnds (CPTAInt ends)
 Completely replaces the primitive ends array with a new table. Chances are good that you should also replace the vertices list with set_vertices() at the same time. More...
 
 setIndexType (GeomEnums::NumericType index_type)
 Changes the numeric type of the index column. Normally, this should be either NT_uint16 or NT_uint32. More...
 
 setMinmax (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...
 
 setNonindexedVertices (int first_vertex, int num_vertices)
 Sets the primitive up as a nonindexed primitive, using the indicated vertex range. More...
 
 setShadeModel (GeomEnums::ShadeModel shade_model)
 Changes the ShadeModel hint for this primitive. This is different from the ShadeModelAttrib that might also be applied from the scene graph. This does not affect the shade model that is in effect when rendering, but rather serves as a hint to the renderer to tell it how the per-vertex colors and normals on this primitive are applied. More...
 
 setUsageHint (GeomEnums::UsageHint usage_hint)
 Changes the UsageHint hint for this primitive. See get_usage_hint(). More...
 
 setVertices (const GeomVertexArrayData vertices, int num_vertices)
 Completely replaces the vertex index list with a new table. Chances are good that you should also replace the ends list with set_ends() at the same time. More...
 
 write (Ostream out, int indent_level)
 
- Public Member Functions inherited from CopyOnWriteObject
 cacheRef ()
 See CachedTypedWritableReferenceCount::cache_ref(). More...
 
bool cacheUnref ()
 See CachedTypedWritableReferenceCount::cache_unref(). More...
 
- Public Member Functions inherited from CachedTypedWritableReferenceCount
 cacheRef ()
 Explicitly increments the cache reference count and the normal reference count simultaneously. More...
 
bool cacheUnref ()
 Explicitly decrements the cache reference count and the normal reference count simultaneously. More...
 
int getCacheRefCount ()
 Returns the current reference count. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
- Public Member Functions inherited from TypedWritable
object __reduce__ ()
 
object __reduce_persist__ (object pickler)
 
str encodeToBamStream ()
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string. Returns empty string on failure. More...
 
bool encodeToBamStream (String data, BamWriter writer)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string. Returns true on success, false on failure. More...
 
UpdateSeq getBamModified ()
 Returns the current bam_modified counter. This counter is normally incremented automatically whenever the object is modified. More...
 
 markBamModified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams. This should normally not need to be called by user code; it should be called internally when the object has been changed in a way that legitimately requires its retransmission to any connected clients. More...
 
- Public Member Functions inherited from TypedObject
TypeHandle getType ()
 Derived classes should override this function to return get_class_type(). More...
 
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. This is equivalent to get_type().get_index(). More...
 
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly. More...
 
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type. More...
 
- Public Member Functions inherited from ReferenceCount
int getRefCount ()
 Returns the current reference count. More...
 
 ref ()
 Explicitly increments the reference count. User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically. More...
 
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus. Returns true if ok, false otherwise. More...
 
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. Returns true if ok, false otherwise. More...
 
bool unref ()
 Explicitly decrements the reference count. Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete(). More...
 

Static Public Member Functions

static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from GeomPrimitive
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from CopyOnWriteObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from CachedTypedWritableReferenceCount
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedWritableReferenceCount
static TypedWritableReferenceCount decodeFromBamStream (str data, BamReader reader)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string. Returns NULL on error. More...
 
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedWritable
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle getClassType ()
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle getClassType ()
 

Additional Inherited Members

- Public Types inherited from GeomEnums
enum  AnimationType { AT_none = 0, AT_panda = 1, AT_hardware = 2 }
 The type of animation data that is represented by a particular GeomVertexFormat. More...
 
enum  Contents {
  C_other = 0, C_point = 1, C_clip_point = 2, C_vector = 3,
  C_texcoord = 4, C_color = 5, C_index = 6, C_morph_delta = 7,
  C_matrix = 8, C_normal = 9
}
 The contents determine the semantic meaning of a numeric value within the vertex data. This is also used to determine what automatic transforms might be applied to the various columns. More...
 
enum  GeomRendering {
  GR_indexed_point = 1, GR_indexed_other = 65536, GR_indexed_bits = 65537, GR_point = 2,
  GR_point_uniform_size = 4, GR_per_point_size = 8, GR_point_perspective = 16, GR_point_aspect_ratio = 32,
  GR_point_scale = 64, GR_point_rotate = 128, GR_point_sprite = 256, GR_point_sprite_tex_matrix = 512,
  GR_point_bits = 1022, GR_triangle_strip = 1024, GR_triangle_fan = 2048, GR_line_strip = 4096,
  GR_composite_bits = 7168, GR_strip_cut_index = 131072, GR_flat_first_vertex = 8192, GR_flat_last_vertex = 16384,
  GR_shade_model_bits = 24576
}
 This type specifies a number of bits that are used to represent the rendering requirements of a particular Geom, as well as the rendering capabilities of the GSG. The difference between the two indicates whether the Geom needs to be munged for the GSG. More...
 
enum  NumericType {
  NT_uint8 = 0, NT_uint16 = 1, NT_uint32 = 2, NT_packed_dcba = 3,
  NT_packed_dabc = 4, NT_float32 = 5, NT_float64 = 6, NT_stdfloat = 7
}
 The numeric type determines what physical representation is used to encode a numeric value within the vertex data. More...
 
enum  PrimitiveType {
  PT_none = 0, PT_polygons = 1, PT_lines = 2, PT_points = 3,
  PT_patches = 4
}
 The primitive type represents the core primitive type of a particular GeomPrimitive. It's used for determining what kind of antialiasing should be enabled. More...
 
enum  ShadeModel { SM_uniform = 0, SM_smooth = 1, SM_flat_first_vertex = 2, SM_flat_last_vertex = 3 }
 The shade model specifies whether the per-vertex colors and normals indexed by a given primitive truly represent per-vertex colors and normals, or whether they actually represent per-triangle flat-shaded colors and normals. More...
 
enum  UsageHint {
  UH_client = 0, UH_stream = 1, UH_dynamic = 2, UH_static = 3,
  UH_unspecified = 4
}
 

Detailed Description

Defines a series of triangle strips.

Member Function Documentation

◆ __init__() [1/2]

__init__ ( GeomEnums::UsageHint  usage_hint)

◆ __init__() [2/2]

__init__ ( const GeomTristrips  copy)

◆ getClassType()

static TypeHandle getClassType ( )
static

◆ operator new()

operator new ( size_t  size)