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

GeomVertexArrayDataHandle Class Reference

This data object is returned by GeomVertexArrayData.get_handle() or modify_handle(). More...

Inheritance diagram for GeomVertexArrayDataHandle:
ReferenceCount GeomEnums 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

 clearRows ()
 copyDataFrom (GeomVertexArrayDataHandle const other)
 Copies the entire data array from the other object.
 copySubdataFrom (unsigned int to_start, unsigned int to_size, GeomVertexArrayDataHandle const other, unsigned int from_start, unsigned int from_size)
 Copies a portion of the data array from the other object into a portion of the data array of this object.
GeomVertexArrayFormat const getArrayFormat ()
string getData ()
 Returns the entire raw data of the GeomVertexArrayData object, formatted as a string.
int getDataSizeBytes ()
UpdateSeq getModified ()
int getNumRows ()
GeomVertexArrayData const getObject ()
GeomVertexArrayData getObject ()
int getRefCount ()
 Returns the current reference count.
string getSubdata (unsigned int start, unsigned int size)
 Returns a subset of the raw data of the GeomVertexArrayData object, formatted as a string.
UsageHint getUsageHint ()
 markUsed ()
 Marks the array data recently-used.
 ref ()
 Explicitly increments the reference count.
bool requestResident ()
 Returns true if the vertex data is currently resident in memory.
 setData (string data)
 Replaces the entire raw data array with the contents of the indicated string.
bool setNumRows (int n)
 setSubdata (unsigned int start, unsigned int size, string data)
 Replaces a portion of the data array from the indicated string.
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 uncleanSetNumRows (int n)
bool unref ()
 Explicitly decrements the reference count.

Static Public Member Functions

static TypeHandle getClassType ()

Detailed Description

This data object is returned by GeomVertexArrayData.get_handle() or modify_handle().

As long as it exists, the data is locked; when the last of these destructs, the data is unlocked.

Only one thread at a time may lock the data; other threads attempting to lock the data will block. A given thread may simultaneously lock the data multiple times.

This class serves in lieu of a pair of GeomVertexArrayDataPipelineReader and GeomVertexArrayDataPipelineWriter classes


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 

Member Function Documentation

clearRows ( )
copyDataFrom ( GeomVertexArrayDataHandle const  other)

Copies the entire data array from the other object.

copySubdataFrom ( unsigned int  to_start,
unsigned int  to_size,
GeomVertexArrayDataHandle const  other,
unsigned int  from_start,
unsigned int  from_size 
)

Copies a portion of the data array from the other object into a portion of the data array of this object.

If to_size != from_size, the size of this data array is adjusted accordingly.

GeomVertexArrayFormat const getArrayFormat ( )
static TypeHandle getClassType ( ) [static]

Reimplemented from ReferenceCount.

string getData ( )

Returns the entire raw data of the GeomVertexArrayData object, formatted as a string.

This is primarily for the benefit of high-level languages such as Python.

int getDataSizeBytes ( )
UpdateSeq getModified ( )
int getNumRows ( )
GeomVertexArrayData const getObject ( )
GeomVertexArrayData getObject ( )
int getRefCount ( ) [inherited]

Returns the current reference count.

string getSubdata ( unsigned int  start,
unsigned int  size 
)

Returns a subset of the raw data of the GeomVertexArrayData object, formatted as a string.

This is primarily for the benefit of high-level languages such as Python.

UsageHint getUsageHint ( )
markUsed ( )

Marks the array data recently-used.

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

Returns true if the vertex data is currently resident in memory.

If this returns true, the next call to get_handle()->get_read_pointer() will probably not block. If this returns false, the vertex data will be brought back into memory shortly; try again later.

setData ( string  data)

Replaces the entire raw data array with the contents of the indicated string.

This is primarily for the benefit of high-level languages like Python.

bool setNumRows ( int  n)
setSubdata ( unsigned int  start,
unsigned int  size,
string  data 
)

Replaces a portion of the data array from the indicated string.

If size != data.size(), the size of this data array is adjusted accordingly.

This is primarily for the benefit of high-level languages like Python.

bool testRefCountIntegrity ( ) [inherited]

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

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and 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 uncleanSetNumRows ( int  n)
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.

 All Classes Namespaces Functions Variables Enumerations Enumerator Properties