v2.0.2
Instance Methods | Properties | List of all members
CC3DrawableVertexArray Class Reference

#import <CC3VertexArrays.h>

Inheritance diagram for CC3DrawableVertexArray:
Inheritance graph
[legend]

Instance Methods

(void) - allocateStripLengths:
 
(void) - deallocateStripLengths
 
(void) - drawFrom:forCount:withVisitor:
 
(void) - drawWithVisitor:
 
(GLuint) - faceCountFromVertexCount:
 
(GLuint) - faceCountFromVertexIndexCount:
 
(CC3FaceIndices- faceIndicesAt:
 
(GLuint) - vertexCountFromFaceCount:
 
(GLuint) - vertexIndexCountFromFaceCount:
 
- Instance Methods inherited from CC3VertexArray
(void) - __deprecated
 
(NSString *) - __deprecated
 
(void) - __deprecated
 
(GLvoid *) - addressOfElement:
 
(GLvoid *) - allocateElements:
 
(void) - bindContentToAttributeAt:withVisitor:
 
(void) - copyVertices:from:to:
 
(void) - copyVertices:from:toAddress:
 
(void) - copyVertices:fromAddress:to:
 
(void) - copyVertices:fromAddress:toAddress:
 
(void) - createGLBuffer
 
(void) - deleteGLBuffer
 
(NSString *) - describeElements:
 
(NSString *) - describeElements:startingAt:
 
(NSString *) - describeVertices
 
(NSString *) - describeVertices:
 
(NSString *) - describeVertices:startingAt:
 
(BOOL) - ensureCapacity:
 
(id) - initFromCPODData:fromSPODMesh:
 
(GLvoid *) - interleaveWith:
 
(GLvoid *) - interleaveWith:usingOffset:
 
(GLvoid *) - reallocateElements:
 
(void) - releaseRedundantContent
 
(void) - updateGLBuffer
 
(void) - updateGLBufferStartingAt:forLength:
 
- Instance Methods inherited from CC3Identifiable
(id) - copy
 
(id) - copyAsClass:
 
(void) - copyUserDataFrom:
 
(id) - copyWithName:
 
(id) - copyWithName:asClass:
 
(id) - copyWithZone:withName:
 
(id) - copyWithZone:withName:asClass:
 
(BOOL) - deriveNameFrom:
 
(BOOL) - deriveNameFrom:usingSuffix:
 
(NSString *) - fullDescription
 
(id) - init
 
(id) - initAtIndex:fromPODResource:
 
(void) - initUserData
 
(id) - initWithName:
 
(id) - initWithTag:
 
(id) - initWithTag:withName:
 
(GLuint) - nextTag
 
(void) - populateFrom:
 

Properties

GLuint firstElement __deprecated
 
GLenum drawingMode
 
GLuint faceCount
 
GLuint stripCount
 
GLuint * stripLengths
 
- Properties inherited from CC3VertexArray
GLvoid *elements __deprecated
 
GLuint elementCount __deprecated
 
GLuint elementStride __deprecated
 
GLfloat capacityExpansionFactor __deprecated
 
BOOL shouldReleaseRedundantData __deprecated
 
GLuint allocatedVertexCapacity
 
GLuint bufferID
 
GLenum bufferTarget
 
GLenum bufferUsage
 
GLuint elementLength
 
GLuint elementOffset
 
GLint elementSize
 
GLenum elementType
 
BOOL isUsingGLBuffer
 
GLenum semantic
 
BOOL shouldAllowVertexBuffering
 
BOOL shouldNormalizeContent
 
BOOL shouldReleaseRedundantContent
 
GLuint vertexCount
 
GLuint vertexStride
 
GLvoid * vertices
 
- Properties inherited from CC3Identifiable
NSObject *sharedUserData __deprecated
 
NSString * name
 
NSString * nameSuffix
 
GLint podIndex
 
BOOL shouldIncludeInDeepCopy
 
GLuint tag
 
NSObject * userData
 
- Properties inherited from <CC3Cacheable>
NSString * name
 

Additional Inherited Members

- Class Methods inherited from CC3VertexArray
(id) + arrayFromCPODData:fromSPODMesh:
 
(GLenum) + defaultSemantic
 
(id) + vertexArray
 
(id) + vertexArrayWithName:
 
(id) + vertexArrayWithTag:
 
(id) + vertexArrayWithTag:withName:
 

Detailed Description

This abstract subclass of CC3VertexArray adds the functionality to draw the vertex content to the display through the GL engine.

The underlying content is drawn by invoking the drawWithVisitor: method, and can be drawn in a single GL call for all vertices, or the vertices can be arranged in strips, and the strips drawn serially.

You define vertex strips using the stripCount and stripLengths properties, or using the allocateStripLengths: method to set both properties at once.

Using vertex strips performs more GL calls, and will be less efficient, but in some applications, might assist in the organization of mesh vertex content.

Alternately, a subset of the vertices may be drawn by invoking the drawFrom:forCount:withVisitor: method instead of the drawWithVisitor: method.

Method Documentation

- (void) allocateStripLengths: (GLuint)  sCount

Sets the specified number of strips into the stripCount property, then allocates an array of Gluints of that length, and sets that array in the stripLengths property.

It is safe to invoke this method more than once. The previously allocated array of strip-lengths will be deallocated before the new array is created.

The array can be deallocated by invoking the deallocateStripLengths method.

- (void) deallocateStripLengths

Deallocates the array of strip-lengths that was created by a previous invocation of the allocateStripLengths: method.

It is safe to invoke this method more than once, or even if allocateStripLengths: was not previously invoked.

This method is invoked automatically when this instance is deallocated.

- (void) drawFrom: (GLuint)  vertexIndex
forCount: (GLuint)  vertexCount
withVisitor: (CC3NodeDrawingVisitor *)  visitor 

Draws the specified number of vertices, starting at the specified vertex index, in a single GL draw call.

This method can be used to draw a subset of thevertices. This can be used when this array holds content for a number of meshes, or when content is being sectioned for palette matrices.

This abstract implementation collects drawing performance statistics if the visitor is configured to do so. Subclasses will override to perform appropriate drawing activity, but should also invoke this superclass implementation to perform the collection of performance content.

- (void) drawWithVisitor: (CC3NodeDrawingVisitor *)  visitor

Draws the vertices, either in strips, or in a single call, depending on the value of the stripCount property.

This method is invoked automatically from the draw method of CC3Mesh.

- (GLuint) faceCountFromVertexCount: (GLuint)  __deprecated
Deprecated:
Renamed to faceCountFromVertexIndexCount:.
- (GLuint) faceCountFromVertexIndexCount: (GLuint)  vc

Returns the number of faces to be drawn from the specified number of vertex indices, based on the drawingMode of this array.

- (CC3FaceIndices) faceIndicesAt: (GLuint)  faceIndex

Returns the vertex indices of the face from the mesh at the specified index.

The specified faceIndex value refers to the index of the face, not the vertices themselves. So, a value of 5 will retrieve the three vertices that make up the fifth triangular face in this mesh. The specified index must be between zero, inclusive, and the value of the faceCount property, exclusive.

The returned structure reference contains the indices of the three vertices that make up the triangular face. These indices index into the actual vertex locations in the CC3VertexLocations array.

This method takes into consideration the drawingMode of this vertex array, and any padding (stride) between the vertex indices.

Implemented in CC3VertexIndices.

- (GLuint) vertexCountFromFaceCount: (GLuint)  __deprecated
Deprecated:
Renamed to vertexIndexCountFromFaceCount:.
- (GLuint) vertexIndexCountFromFaceCount: (GLuint)  fc

Returns the number of vertex indices required to draw the specified number of faces, based on the drawingMode of this array.

Property Documentation

- (GLuint firstElement) __deprecated
readnonatomicassign
Deprecated:
Renamed to firstVertex on CC3VertexLocations.
- (GLenum) drawingMode
readwritenonatomicassign

The drawing mode indicating how the vertices are connected (points, lines, triangles...).

This must be set with a valid GL drawing mode enumeration.

The default value is GL_TRIANGLES.

- (GLuint) faceCount
readnonatomicassign

Returns the number of faces in this array.

This is calculated from the number of vertices, taking into consideration the drawing mode of this array.

- (GLuint) stripCount
readwritenonatomicassign

The underlying content can be drawn in strips, using multiple GL calls, rather than a single call.

This property indicates the number of strips to draw. A value of zero indicates that vertex drawing should be done in a single GL call.

- (GLuint*) stripLengths
readwritenonatomicassign

An array of values, each indicating the number of vertices to draw in the corresponding strip.

The stripCount property indicates the number of items in this array. If drawing is not performed in strips (stripCount is zero), this property will be NULL.

An easy way to create a suitable array for this property, and set the associated stripCount property at the same time, is to invoke the allocateStripLengths: method.


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