Class: TShardIterator

Declaration: SampledSurface3D.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

None.

Purpose:

TShardIterator is an abstract base class for objects that iterate over shards. Shards are triangular portions of a discretized surface. The discretized surface, represented by the TSampledSurface3D class, consists of a large number of shards, which are grouped into chunks. To render the sampled surface, first iterate over all the chunks, and then for each chunk, iterate over the shards in the chunk, rendering each one. TShardChunkIterator is responsible for iterating over the chunks; whereas TShardIterator iterates over the individual shards in a single chunk. TShardIterator contains only pure virtual functions; thus, it simply defines a protocol, and derived classes must implement all the functionality. The TShardIterator protocol lacks a constructor, because the shard iterator is supposed to be generated by TShardChunkIterator::CreateShardIterator. Before creating the iterator, invoke TShardChunkIterator::GetVertexInfo to get an array of all the points in the chunk. Then get the shard iterator by invoking TShardChunkIterator::CreateShardIterator. Iteration is accomplished by TShardIterator::GetNextShard. This member function returns, in its first three arguments, the array indexes where the three vertices of the shard are stored. Then you can use these three vertices to render the triangle. GetNextShard also retrieves information about the visibility of the edges when they are rendered as wireframes.

Instantiation:

Abstract base class; do not instantiate.

Deriving Classes:

None. Along with the TShardIterator derived class, you should derive corresponding classes from TSampledSurface3D and TShardChunkIterator.

Concurrency:

Depends on the derived class.

Resource Use:

No special requirements.

Member Function: TShardIterator::GetNextShard

virtual bool GetNextShard (long & i0, long & i1, long & i2, bool & edge01vis, bool & edge12vis, bool & edge20vis, EFrontFaceFlag & frontFlag)

Interface Category:

API.

Purpose:

Retrieves the array indexes of the shard's three vertices, along with visibility information (in the specified parameters).

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if more shards are left in this 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: TShardIterator::~TShardIterator

virtual ~ TShardIterator ()

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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.