Panda3D
Public Types | Public Member Functions | Static Public Member Functions

GeomTrifans Class Reference

Defines a series of triangle fans. More...

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

List of all members.

Public Types

enum  AnimationType { ATNone = 0, ATPanda = 1, ATHardware = 2 }
enum  Contents {
  COther = 0, CPoint = 1, CClipPoint = 2, CVector = 3,
  CTexcoord = 4, CColor = 5, CIndex = 6, CMorphDelta = 7
}
enum  GeomRendering {
  GRIndexedPoint = 1, GRIndexedOther = 65536, GRIndexedBits = 65537, GRPoint = 2,
  GRPointUniformSize = 4, GRPerPointSize = 8, GRPointPerspective = 16, GRPointAspectRatio = 32,
  GRPointScale = 64, GRPointRotate = 128, GRPointSprite = 256, GRPointSpriteTexMatrix = 512,
  GRPointBits = 1022, GRTriangleStrip = 1024, GRTriangleFan = 2048, GRLineStrip = 4096,
  GRCompositeBits = 7168, GRFlatFirstVertex = 8192, GRFlatLastVertex = 16384, GRShadeModelBits = 24576,
  GRTexcoordLightVector = 32768
}
enum  NumericType {
  NTUint8 = 0, NTUint16 = 1, NTUint32 = 2, NTPackedDcba = 3,
  NTPackedDabc = 4, NTFloat32 = 5
}
enum  PrimitiveType { PTNone = 0, PTPolygons = 1, PTLines = 2, PTPoints = 3 }
enum  ShadeModel { SMUniform = 0, SMSmooth = 1, SMFlatFirstVertex = 2, SMFlatLastVertex = 3 }
enum  UsageHint {
  UHClient = 0, UHStream = 1, UHDynamic = 2, UHStatic = 3,
  UHUnspecified = 4
}

Public Member Functions

 GeomTrifans (UsageHint usage_hint)
 GeomTrifans (GeomTrifans const copy)
 addConsecutiveVertices (int start, int num_vertices)
 Adds a consecutive sequence of vertices, beginning at start, to the primitive.
 addNextVertices (int num_vertices)
 Adds the next n vertices in sequence, beginning from the last vertex added to the primitive + 1.
 addVertex (int vertex)
 Adds the indicated vertex to the list of vertex indices used by the graphics primitive type.
 addVertices (int v1, int v2)
 Adds several vertices in a row.
 addVertices (int v1, int v2, int v3, int v4)
 Adds several vertices in a row.
 addVertices (int v1, int v2, int v3)
 Adds several vertices in a row.
 cacheRef ()
 See CachedTypedWritableReferenceCount.cache_ref().
bool cacheUnref ()
 Explicitly decrements the cache reference count and the normal reference count simultaneously.
bool checkValid (GeomVertexData const vertex_data)
 Verifies that the primitive only references vertices that actually exist within the indicated GeomVertexData.
 clearMinmax ()
 Undoes a previous call to set_minmax(), and allows the minimum and maximum values to be recomputed normally.
 clearVertices ()
 Removes all of the vertices and primitives from the object, so they can be re-added.
bool closePrimitive ()
 Indicates that the previous n calls to add_vertex(), since the last call to close_primitive(), have fully defined a new primitive.
GeomPrimitive const 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.
GeomPrimitive const doubleside ()
 Duplicates triangles in the primitive so that each triangle is back-to-back with another triangle facing in the opposite direction.
string encodeToBamStream ()
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
bool encodeToBamStream (basic_stringchar data, BamWriter writer)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
bool encodeToBamStream (basic_stringchar data)
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
UpdateSeq getBamModified ()
 Returns the current bam_modified counter.
int getCacheRefCount ()
 Returns the current reference count.
int getDataSizeBytes ()
 Returns the number of bytes stored in the vertices array.
ConstPointerToArrayint getEnds ()
 Returns a const pointer to the primitive ends array so application code can read it directly.
int getFirstVertex ()
 Returns the first vertex number referenced by the primitive.
int getGeomRendering ()
 Returns the set of GeomRendering bits that represent the rendering properties required to properly render this primitive.
int getIndexStride ()
 A convenience function to return the gap between successive index numbers, in bytes, of the index data.
NumericType getIndexType ()
 Returns the numeric type of the index column.
GeomVertexArrayData const getMaxs ()
 Returns a const pointer to the primitive maxs array so application code can read it directly.
int getMaxVertex ()
 Returns the maximum vertex index number used by all the primitives in this object.
int getMinNumVerticesPerPrimitive ()
 Returns the minimum number of vertices that must be added before close_primitive() may legally be called.
GeomVertexArrayData const getMins ()
 Returns a const pointer to the primitive mins array so application code can read it directly.
int getMinVertex ()
 Returns the minimum vertex index number used by all the primitives in this object.
UpdateSeq getModified ()
 Returns a sequence number which is guaranteed to change at least every time the vertex index array is modified.
int getNumBytes ()
 Returns the number of bytes consumed by the primitive and its index table(s).
int getNumFaces ()
 Returns the number of triangles or other fundamental type (such as line segments) represented by all the primitives in this object.
int getNumPrimitives ()
 Returns the number of individual primitives stored within this object.
int getNumUnusedVerticesPerPrimitive ()
 Returns the number of vertices that are added between primitives that aren't, strictly speaking, part of the primitives themselves.
int getNumVertices ()
 Returns the number of vertices used by all the primitives in this object.
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.
int getPrimitiveEnd (int n)
 Returns the element within the _vertices list at which the nth primitive ends.
int getPrimitiveMaxVertex (int n)
 Returns the maximum vertex index number used by the nth primitive in this object.
int getPrimitiveMinVertex (int n)
 Returns the minimum vertex index number used by the nth primitive in this object.
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.
int getPrimitiveNumVertices (int n)
 Returns the number of vertices used by the nth primitive.
int getPrimitiveStart (int n)
 Returns the element within the _vertices list at which the nth primitive starts.
PrimitiveType getPrimitiveType ()
int getRefCount ()
 Returns the current reference count.
ShadeModel getShadeModel ()
 Returns the ShadeModel hint for this primitive.
TypeHandle getType ()
int getTypeIndex ()
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
UsageHint getUsageHint ()
 Returns the usage hint for this primitive.
int getVertex (int i)
 Returns the ith vertex index in the table.
GeomVertexArrayData const getVertices ()
 Returns a const pointer to the vertex index array so application code can read it directly.
list getVertices ()
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.
bool isExactType (TypeHandle handle)
 Returns true if the current object is the indicated type exactly.
bool isIndexed ()
 Returns true if the primitive is indexed, false otherwise.
bool isOfType (TypeHandle handle)
 Returns true if the current object is or derives from the indicated type.
GeomPrimitive makeCopy ()
 makeIndexed ()
 Converts the primitive from nonindexed form to indexed form.
 makeNonindexed (GeomVertexData dest, GeomVertexData const source)
 Converts the primitive from indexed to nonindexed by duplicating vertices as necessary into the indicated dest GeomVertexData.
GeomPrimitive const makePoints ()
 Returns a new GeomPoints primitive that represents each of the vertices in the original primitive, rendered exactly once.
 markBamModified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
GeomPrimitive const matchShadeModel (ShadeModel shade_model)
 Returns a new primitive that is compatible with the indicated shade model, if possible, or NULL if this is not possible.
PointerToArrayint modifyEnds ()
 Returns a modifiable pointer to the primitive ends array, so application code can directly fiddle with this data.
GeomVertexArrayData modifyVertices (int num_vertices)
 Returns a modifiable pointer to the vertex index list, so application code can directly fiddle with this data.
GeomVertexArrayData modifyVertices ()
 Returns a modifiable pointer to the vertex index list, so application code can directly fiddle with this data.
 offsetVertices (int offset)
 Adds the indicated offset to all vertices used by the primitive.
 operator new (unsigned int size)
 output (ostream out)
 packVertices (GeomVertexData dest, GeomVertexData const source)
 Packs the vertices used by the primitive from the indicated source array onto the end of the indicated destination array.
PyObject reduce (PyObject self)
 This special Python method is implement to provide support for the pickle module.
PyObject reducePersist (PyObject self, PyObject pickler)
 This special Python method is implement to provide support for the pickle module.
 ref ()
 Explicitly increments the reference count.
bool requestResident ()
 Returns true if the primitive data is currently resident in memory.
GeomPrimitive const reverse ()
 Reverses the winding order in the primitive so that each triangle is facing in the opposite direction it was originally.
GeomPrimitive const rotate ()
 Returns a new primitive with the shade_model reversed (if it is flat shaded), if possible.
 setEnds (ConstPointerToArrayint ends)
 Completely replaces the primitive ends array with a new table.
 setIndexType (NumericType index_type)
 Changes the numeric type of the index column.
 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.
 setNonindexedVertices (int first_vertex, int num_vertices)
 Sets the primitive up as a nonindexed primitive, using the indicated vertex range.
 setShadeModel (ShadeModel shade_model)
 Changes the ShadeModel hint for this primitive.
 setUsageHint (UsageHint usage_hint)
 Changes the UsageHint hint for this primitive.
 setVertices (GeomVertexArrayData const vertices)
 Completely replaces the vertex index list with a new table.
 setVertices (GeomVertexArrayData const vertices, int num_vertices)
 Completely replaces the vertex index list with a new table.
bool testRefCountIntegrity ()
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool testRefCountNonzero ()
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
bool unref ()
 Explicitly decrements the reference count.
 write (ostream out, int indent_level)

Static Public Member Functions

static TypedWritableReferenceCount decodeFromBamStream (string 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.
static TypedWritableReferenceCount decodeFromBamStream (string data)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts and returns the single object on that string.
static TypeHandle getClassType ()

Detailed Description

Defines a series of triangle fans.


Member Enumeration Documentation

enum AnimationType [inherited]
Enumerator:
ATNone 
ATPanda 
ATHardware 
enum Contents [inherited]
Enumerator:
COther 
CPoint 
CClipPoint 
CVector 
CTexcoord 
CColor 
CIndex 
CMorphDelta 
enum GeomRendering [inherited]
Enumerator:
GRIndexedPoint 
GRIndexedOther 
GRIndexedBits 
GRPoint 
GRPointUniformSize 
GRPerPointSize 
GRPointPerspective 
GRPointAspectRatio 
GRPointScale 
GRPointRotate 
GRPointSprite 
GRPointSpriteTexMatrix 
GRPointBits 
GRTriangleStrip 
GRTriangleFan 
GRLineStrip 
GRCompositeBits 
GRFlatFirstVertex 
GRFlatLastVertex 
GRShadeModelBits 
GRTexcoordLightVector 
enum NumericType [inherited]
Enumerator:
NTUint8 
NTUint16 
NTUint32 
NTPackedDcba 
NTPackedDabc 
NTFloat32 
enum PrimitiveType [inherited]
Enumerator:
PTNone 
PTPolygons 
PTLines 
PTPoints 
enum ShadeModel [inherited]
Enumerator:
SMUniform 
SMSmooth 
SMFlatFirstVertex 
SMFlatLastVertex 
enum UsageHint [inherited]
Enumerator:
UHClient 
UHStream 
UHDynamic 
UHStatic 
UHUnspecified 

Constructor & Destructor Documentation

GeomTrifans ( UsageHint  usage_hint)
GeomTrifans ( GeomTrifans const  copy)

Member Function Documentation

addConsecutiveVertices ( int  start,
int  num_vertices 
) [inherited]

Adds a consecutive sequence of vertices, beginning at start, to the primitive.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

addNextVertices ( int  num_vertices) [inherited]

Adds the next n vertices in sequence, beginning from the last vertex added to the primitive + 1.

This is most useful when you are building up a primitive and a GeomVertexData at the same time, and you just want the primitive to reference the first n vertices from the data, then the next n, and so on.

addVertex ( int  vertex) [inherited]

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.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

addVertices ( int  v1,
int  v2,
int  v3 
) [inherited]

Adds several vertices in a row.

addVertices ( int  v1,
int  v2,
int  v3,
int  v4 
) [inherited]

Adds several vertices in a row.

addVertices ( int  v1,
int  v2 
) [inherited]

Adds several vertices in a row.

cacheRef ( ) [inherited]

See CachedTypedWritableReferenceCount.cache_ref().

Reimplemented from CachedTypedWritableReferenceCount.

bool cacheUnref ( ) [inherited]

Explicitly decrements the cache reference count and the normal reference count simultaneously.

The return value is true if the new reference count is nonzero, false if it is zero.

Reimplemented in TransformState, and RenderState.

bool checkValid ( GeomVertexData const  vertex_data) [inherited]

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.

clearMinmax ( ) [inherited]

Undoes a previous call to set_minmax(), and allows the minimum and maximum values to be recomputed normally.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

clearVertices ( ) [inherited]

Removes all of the vertices and primitives from the object, so they can be re-added.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

bool closePrimitive ( ) [inherited]

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.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

static TypedWritableReferenceCount decodeFromBamStream ( string  data,
BamReader  reader 
) [static, inherited]

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.

This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.

static TypedWritableReferenceCount decodeFromBamStream ( string  data) [static, inherited]

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.

This method is intended to replace decode_raw_from_bam_stream() when you know the stream in question returns an object of type TypedWritableReferenceCount, allowing for easier reference count management. Note that the caller is still responsible for maintaining the reference count on the return value.

GeomPrimitive const decompose ( ) [inherited]

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.

This method is useful for application code that wants to iterate through the set of triangles on the primitive without having to write handlers for each possible kind of primitive type.

GeomPrimitive const doubleside ( ) [inherited]

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()).

Also see CullFaceAttrib, which can enable rendering of both sides of a triangle without having to duplicate it (but which doesn't necessarily work in the presence of lighting).

string encodeToBamStream ( ) [inherited]

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.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

bool encodeToBamStream ( basic_stringchar  data,
BamWriter  writer 
) [inherited]

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.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

bool encodeToBamStream ( basic_stringchar  data) [inherited]

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.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

UpdateSeq getBamModified ( ) [inherited]

Returns the current bam_modified counter.

This counter is normally incremented automatically whenever the object is modified.

int getCacheRefCount ( ) [inherited]

Returns the current reference count.

static TypeHandle getClassType ( ) [static]

Reimplemented from GeomPrimitive.

int getDataSizeBytes ( ) [inherited]

Returns the number of bytes stored in the vertices array.

ConstPointerToArrayint getEnds ( ) [inherited]

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.

Note that simple primitive types, like triangles, do not have a ends array: since all the primitives have the same number of vertices, it is not needed.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

int getFirstVertex ( ) [inherited]

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.

int getGeomRendering ( ) [inherited]

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

int getIndexStride ( ) [inherited]

A convenience function to return the gap between successive index numbers, in bytes, of the index data.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

NumericType getIndexType ( ) [inherited]

Returns the numeric type of the index column.

Normally, this will be either NT_uint16 or NT_uint32.

GeomVertexArrayData const getMaxs ( ) [inherited]

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().

Note that simple primitive types, like triangles, do not have a maxs array.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

int getMaxVertex ( ) [inherited]

Returns the maximum vertex index number used by all the primitives in this object.

int getMinNumVerticesPerPrimitive ( ) [inherited]

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

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

GeomVertexArrayData const getMins ( ) [inherited]

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.

Note that simple primitive types, like triangles, do not have a mins array.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

int getMinVertex ( ) [inherited]

Returns the minimum vertex index number used by all the primitives in this object.

UpdateSeq getModified ( ) [inherited]

Returns a sequence number which is guaranteed to change at least every time the vertex index array is modified.

int getNumBytes ( ) [inherited]

Returns the number of bytes consumed by the primitive and its index table(s).

int getNumFaces ( ) [inherited]

Returns the number of triangles or other fundamental type (such as line segments) represented by all the primitives in this object.

int getNumPrimitives ( ) [inherited]

Returns the number of individual primitives stored within this object.

All primitives are the same type.

int getNumUnusedVerticesPerPrimitive ( ) [inherited]

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.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

int getNumVertices ( ) [inherited]

Returns the number of vertices used by all the primitives in this object.

int getNumVerticesPerPrimitive ( ) [inherited]

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.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

int getPrimitiveEnd ( int  n) [inherited]

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.

int getPrimitiveMaxVertex ( int  n) [inherited]

Returns the maximum vertex index number used by the nth primitive in this object.

int getPrimitiveMinVertex ( int  n) [inherited]

Returns the minimum vertex index number used by the nth primitive in this object.

int getPrimitiveNumFaces ( int  n) [inherited]

Returns the number of triangles or other fundamental type (such as line segments) represented by the nth primitive in this object.

int getPrimitiveNumVertices ( int  n) [inherited]

Returns the number of vertices used by the nth primitive.

This is the same thing as get_primitive_end(n) - get_primitive_start(n).

int getPrimitiveStart ( int  n) [inherited]

Returns the element within the _vertices list at which the nth primitive starts.

If i is one more than the highest valid primitive vertex, the return value will be one more than the last valid vertex. Thus, it is generally true that the vertices used by a particular primitive i are the set get_primitive_start(n) <= vi < get_primitive_start(n + 1) (although this range also includes the unused vertices between primitives).

PrimitiveType getPrimitiveType ( ) [inherited]
int getRefCount ( ) [inherited]

Returns the current reference count.

ShadeModel getShadeModel ( ) [inherited]

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.

TypeHandle getType ( ) [inherited]

Reimplemented in AnimChannelBase.

int getTypeIndex ( ) [inherited]

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().

UsageHint getUsageHint ( ) [inherited]

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.

It is perfectly legal (and, in fact, common) for a GeomPrimitive to have UH_static on itself, while referencing vertex data with UH_dynamic. This means that the vertices themselves will be animated, but the primitive will always reference the same set of vertices from the pool.

int getVertex ( int  i) [inherited]

Returns the ith vertex index in the table.

GeomVertexArrayData const getVertices ( ) [inherited]

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.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

list getVertices ( ) [inherited]
bool isComposite ( ) [inherited]

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 isExactType ( TypeHandle  handle) [inherited]

Returns true if the current object is the indicated type exactly.

bool isIndexed ( ) [inherited]

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.

bool isOfType ( TypeHandle  handle) [inherited]

Returns true if the current object is or derives from the indicated type.

GeomPrimitive makeCopy ( ) [inherited]
makeIndexed ( ) [inherited]

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().

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

makeNonindexed ( GeomVertexData  dest,
GeomVertexData const  source 
) [inherited]

Converts the primitive from indexed to nonindexed by duplicating vertices as necessary into the indicated dest GeomVertexData.

GeomPrimitive const makePoints ( ) [inherited]

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.

markBamModified ( ) [inherited]

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.

GeomPrimitive const matchShadeModel ( ShadeModel  shade_model) [inherited]

Returns a new primitive that is compatible with the indicated shade model, if possible, or NULL if this is not possible.

In most cases, this will return either NULL or the original primitive. In the case of a SM_flat_first_vertex vs. a SM_flat_last_vertex (or vice-versa), however, it will return a rotated primitive.

PointerToArrayint modifyEnds ( ) [inherited]

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.

Note that simple primitive types, like triangles, do not have a ends array: since all the primitives have the same number of vertices, it is not needed.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

GeomVertexArrayData modifyVertices ( int  num_vertices) [inherited]

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.

If this is called on a nonindexed primitive, it will implicitly be converted to an indexed primitive.

If num_vertices is not -1, it specifies an artificial limit to the number of vertices in the array. Otherwise, all of the vertices in the array will be used.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

GeomVertexArrayData modifyVertices ( ) [inherited]

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.

If this is called on a nonindexed primitive, it will implicitly be converted to an indexed primitive.

If num_vertices is not -1, it specifies an artificial limit to the number of vertices in the array. Otherwise, all of the vertices in the array will be used.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

offsetVertices ( int  offset) [inherited]

Adds the indicated offset to all vertices used by the primitive.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

operator new ( unsigned int  size) [inherited]
output ( ostream  out) [inherited]
packVertices ( GeomVertexData  dest,
GeomVertexData const  source 
) [inherited]

Packs the vertices used by the primitive from the indicated source array onto the end of the indicated destination array.

PyObject reduce ( PyObject  self) [inherited]

This special Python method is implement to provide support for the pickle module.

This hooks into the native pickle and cPickle modules, but it cannot properly handle self-referential BAM objects.

PyObject reducePersist ( PyObject  self,
PyObject  pickler 
) [inherited]

This special Python method is implement to provide support for the pickle module.

This is similar to __reduce__, but it provides additional support for the missing persistent-state object needed to properly support self-referential BAM objects written to the pickle stream. This hooks into the pickle and cPickle modules implemented in direct/src/stdpy.

ref ( ) [inherited]

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.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

bool requestResident ( ) [inherited]

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.

GeomPrimitive const reverse ( ) [inherited]

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()).

Also see CullFaceAttrib, which can change the visible direction of a triangle without having to duplicate it (but which doesn't necessarily work in the presence of lighting).

GeomPrimitive const rotate ( ) [inherited]

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.

If the current shade_model indicates flat_vertex_last, this should bring the last vertex to the first position; if it indicates flat_vertex_first, this should bring the first vertex to the last position.

setEnds ( ConstPointerToArrayint  ends) [inherited]

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.

Note that simple primitive types, like triangles, do not have a ends array: since all the primitives have the same number of vertices, it is not needed.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

setIndexType ( NumericType  index_type) [inherited]

Changes the numeric type of the index column.

Normally, this should be either NT_uint16 or NT_uint32.

The index type must be large enough to include all of the index values in the primitive. It may be automatically elevated, if necessary, to a larger index type, by a subsequent call to add_index() that names an index value that does not fit in the index type you specify.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

setMinmax ( int  min_vertex,
int  max_vertex,
GeomVertexArrayData  mins,
GeomVertexArrayData  maxs 
) [inherited]

Explicitly specifies the minimum and maximum vertices, as well as the lists of per-component min and max.

Use this method with extreme caution. It's generally better to let the GeomPrimitive compute these explicitly, unless for some reason you can do it faster and you absolutely need the speed improvement.

Note that any modification to the vertex array will normally cause this to be recomputed, unless you set it immediately again.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

setNonindexedVertices ( int  first_vertex,
int  num_vertices 
) [inherited]

Sets the primitive up as a nonindexed primitive, using the indicated vertex range.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

setShadeModel ( ShadeModel  shade_model) [inherited]

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.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

setUsageHint ( UsageHint  usage_hint) [inherited]

Changes the UsageHint hint for this primitive.

See get_usage_hint().

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

setVertices ( GeomVertexArrayData const  vertices) [inherited]

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.

If num_vertices is not -1, it specifies an artificial limit to the number of vertices in the array. Otherwise, all of the vertices in the array will be used.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

setVertices ( GeomVertexArrayData const  vertices,
int  num_vertices 
) [inherited]

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.

If num_vertices is not -1, it specifies an artificial limit to the number of vertices in the array. Otherwise, all of the vertices in the array will be used.

Don't call this in a downstream thread unless you don't mind it blowing away other changes you might have recently made in an upstream thread.

This method is intended for low-level usage only. There are higher-level methods for more common usage. We recommend you do not use this method directly. If you do, be sure you know what you are doing!

bool testRefCountIntegrity ( ) [inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Reimplemented from ReferenceCount.

Reimplemented in NodeCachedReferenceCount.

bool testRefCountNonzero ( ) [inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

bool unref ( ) [inherited]

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().

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.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is true if the new reference count is nonzero, false if it is zero.

Reimplemented in GeomVertexArrayFormat, and GeomVertexFormat.

write ( ostream  out,
int  indent_level 
) [inherited]
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties