Public Member Functions | Static Public Member Functions | Properties

CC3Identifiable Class Reference

This is a base subclass for any class that uses tags or names to identify individual instances. More...

#import <CC3Identifiable.h>

Inheritance diagram for CC3Identifiable:
CC3Material CC3MeshModel CC3Node CC3PODResource CC3Texture CC3VertexArray CC3PODMaterial CC3VertexArrayMeshModel CC3Billboard CC3LocalContentNode CC3PODNode CC3PODResourceNode CC3TargettingNode CC3World CC3DrawableVertexArray CC3VertexColors CC3VertexNormals CC3VertexPointSizes CC3VertexTextureCoordinates

List of all members.

Public Member Functions

(NSString *) - fullDescription
(id) - init
(id) - initWithName:
(id) - initWithTag:
(id) - initWithTag:withName:
(GLuint) - nextTag

Static Public Member Functions

(void) + resetTagAllocation

Properties

NSString * name
int podIndex
GLuint tag

Detailed Description

Instances can be initialized with either or both a tag and a name. Instances initialized without an explcit tag will have a unique tag automatically generated and assigned.

When overriding initialization, subclasses typically need only override the most generic initializer, initWithTag:withName:.


Member Function Documentation

- (NSString*) fullDescription

Returns a string containing a more complete description of this object.

This implementation simply invokes the description method. Subclasses with more substantial content can override to provide much more information.

- (id) init

Initializes this unnamed instance with an automatically generated unique tag value.

The tag value will be generated automatically via the method nextTag.

- (id) initAtIndex: (int)  aPODIndex
fromPODResource: (CC3PODResource *)  aPODRez 

Initializes this instance from the data of this type at the specified index within the specified POD resource.

- (id) initWithName: (NSString *)  aName

Initializes this instance with the specified name and an automatically generated unique tag value.

The tag value will be generated automatically via the method nextTag.

- (id) initWithTag: (GLuint)  aTag

Initializes this unnamed instance with the specified tag.

- (id) initWithTag: (GLuint)  aTag
withName: (NSString *)  aName 

Initializes this instance with the specified tag and name.

When overriding initialization, subclasses typically need only override this initializer.

- (GLuint) nextTag

Returns a unique tag value to identify instances.

This value is unique across all instances of all subclasses. The initial value returned will be one, and subsequent calls will increment the value retuned on each call. The starting value can be reset back to one via the resetTagAllocation method.

+ (void) resetTagAllocation

Resets the allocation of new tags to resume at one again.


Property Documentation

- (NSString *) name [read, write, retain]

An arbitrary name for this node.

It is not necessary to give all identifiable objects a name, but can be useful for retrieving objects at runtime, and for identifying objects during development. Names need not be unique, are not automatically assigned, and leaving the name as nil is acceptable.

- (int) podIndex [read, write, assign]

The index of this object in the POD resource data.

This generally means the podIndex'th type of object of the class.

- (GLuint) tag [read, write, assign]

An arbitrary identification.

Useful for keeping track of instances. Unique tags are not explicitly required, but are highly recommended. In most cases, it is best to just let the tag be assigned automatically by using an initializer that does not explicitly set the tag.


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