Class: TSampledSurface3D

Declaration: SampledSurface3D.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TStreamableSampledSurface3D

Purpose:

TSampledSurface3D is an abstract base class for 3-D surfaces that can't be described by the other geometry classes. An instance of a TSampledSurface3D derived class contains discretized data, not continuous functions, that define the surface. Examples of shapes defined by discrete points include fractal surfaces, data that is digitized or scanned from real-world sources, reconstructions like volumetric CAT scans, and shapes approximated from other computations (like fluid flow). Each data point of the 3-D surface is called a vertex. The vertices are connected to each other by line segments in such a way that the entire surface is composed of triangles, known as shards. Each vertex includes optional shading information--normals, colors, and texture map indexes--as stored in a TShadingInfo. Color information that is specified for individual vertices overrides the global color specified in the TGrafBundle3D. To render an image of the TSampledSurface3D, you must iterate over the shards and render each one. The TSampledSurface3D class provides TSampledSurface3D::CreateShardChunkIterator, which creates an iterator of class TShardChunkIterator for this purpose. However, for efficiency, this iterator returns not just one shard, but a group, or chunk, of shards. In turn, each chunk of shards is iterated over by another iterator of class TShardIterator, created by the TShardChunkIterator. The reason for this scheme is that an entire group of shards can be hidden from view (either because they are clipped or because they are backfacing), and it is more efficient to skip the entire chunk than to have to determine each shard's visibility. All that the base class provides is the CreateShardChunkIterator protocol. Derived classes are responsible for actually generating and storing the data points that represent the discretized surface. The data points need not all be generated at once, ahead of time; they can instead be created only when the iterator needs them (that is, only when they are to be rendered). A derived class must implement CreateShardChunkIterator, and corresponding iterator classes must also be implemented.

Instantiation:

Abstract base class; do not instantiate.

Deriving Classes:

None. Derived classes should include techniques for generating (and possibly storing) the vertices. A corresponding iterator class must be derived from TShardChunkIterator. The TSampledSurface3D derived class must implement CreateShardChunkIterator and give the iterator a means to access the TSampledSurface3D's data points.

Concurrency:

Depends on the derived class.

Resource Use:

The client is responsible for deleting the TShardChunkIterator.

Member Function: TSampledSurface3D::GetBounds

virtual TGBox3D GetBounds () const

Interface Category:

API.

Purpose:

Gets the box that bounds this TSampledSurface3D.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the box that bounds the surface.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Depends on the derived class.

Other Considerations:

The default implementation returns TGBox3D::kInfiniteBox

Member Function: TSampledSurface3D::CreateShardChunkIterator

virtual TShardChunkIterator * CreateShardChunkIterator () const

Interface Category:

API.

Purpose:

Creates a TShardChunkIterator that can iterate over chunks of the surface (that is, over groups of shards).

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the new shard chunk 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: TSampledSurface3D::~TSampledSurface3D

virtual ~ TSampledSurface3D ()

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: TSampledSurface3D::StreamOutAsShards

virtual TStream & StreamOutAsShards (TStream & towhere) const

Interface Category:

API.

Purpose:

Provides stream-out operation for sampled surfaces by processing on a chunk-by-chunk and shard-by-shard basis. This member function is provided in order to provide samples across an interface where the derived class' definition may not be available. Because this class does not descend from MCollectible, the standard streaming operators cannot be used.

Calling Context:

Called to stream out data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself out to.

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.