Class: TShardChunkIterator

Declaration: SampledSurface3D.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TShardChunkIterator is an abstract base class for objects that iterate over chunks of shards. Shards are triangular portions of a discretized surface. The discretized surface, represented by the TSampledSurface3D class, consists of a large number of shards. For efficiency, the surface is organized into groups of shards (chunks). TShardChunkIterator contains only pure virtual functions; thus, it simply defines a protocol, and derived classes must implement all the functionality. A TShardChunkIterator has no life apart from the TSampledSurface3D; the iterator lacks a public constructor, owing its existence instead to TSampledSurface3D::CreateShardChunkIterator. TShardChunkIterator's purpose is simply to provide a systematic access to the TSampledSurface3D's data. Usually, you iterate over the chunks of shards in order to render the discretized surface. When you retrieve a chunk, you iterate over all the shards in that chunk by using TShardIterator, which is provided by TShardChunkIterator'::CreateShardIterator. In other words, the TSampledSurface3D provides the iterator for groups of shards, and this iterator itself provides another iterator for individual shards. To iterate over the shards, call TShardChunkIterator::GetVertexInfo, which causes the TShardChunkIterator to step to the next chunk. GetVertexInfo fills an array with the vertices in this chunk--the iterator never actually returns any kind of chunk object nor any array of shard objects. However, GetVertexInfo's effect is to increment the iterator to the next chunk of shards. GetVertexInfo also provides the normals, colors, and texture map indexes for every vertex in the new chunk. After calling GetVertexInfo, create a new shard iterator, using TShardChunkIterator::CreateShardIterator. Then repeatedly call TShardIterator'::GetNextShard to retrieve the vertices of each shard, presumably in order to render each shard.

Instantiation:

Abstract base class; do not instantiate.

Deriving Classes:

None. A corresponding iterator class must be derived from TShardIterator.

Concurrency:

Depends on the derived class.

Resource Use:

The client is responsible for deleting the TShardIterator.

Member Function: TShardChunkIterator::~TShardChunkIterator

virtual ~ TShardChunkIterator ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Depends on the derived class.

Other Considerations:

None.

Member Function: TShardChunkIterator::CreateShardIterator

virtual TShardIterator * CreateShardIterator () const

Interface Category:

API.

Purpose:

Creates a new TShardIterator, which can be used to iterate over the shards in the current chunk.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the new shard iterator.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Depends on the derived class.

Other Considerations:

This is a pure virtual function.

Member Function: TShardChunkIterator::GetVertexInfo

virtual bool GetVertexInfo (TSampledSurfacePointArray & data, TShadingUsageVariables & shadingVars)

Interface Category:

API.

Purpose:

Fills the first array with the vertices in the current chunk, and the second array with the shading information for each vertex.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if there is more data to fetch.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Depends on the derived class.

Other Considerations:

This is a pure virtual function.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.