Class: TSurfaceSample

Declaration: Shaders.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TShadingSample

Purpose:

TSurfaceSample describes a point on a 3-D surface. This is a simple class that encapsulates a few public member variables. Some of the member variables locate the point in the 3-D world coordinate system, as well as in the surface's parametric coordinate system. (A surface has two parametric directions, u and v; values should be between 0.0 and 1.0.) Other member variables identify the normal and tangents to the surface at this point. In addition to these purely geometric properties, TSurfaceSample has two public member variables that represent graphical properties used in rendering--the base color and the texture coordinates. (The texture coordinates refer to the point in a texture map that will be mapped to this point.) TSurfaceSample has two main roles in the Graphics system. First, the TSampledSurface3D class, which approximates continuous surfaces by a set of discrete points, uses an array of TSurfaceSample objects. Second, TSurfaceSample serves as a base class for TShadingSample, which describes how a particular point should be shaded by a TShader.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

TShadingSample is provided.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TSurfaceSample::AdjustNormal

virtual void AdjustNormal (GCoordinate minThreshold =0.005)

Interface Category:

API.

Purpose:

Sets the length of the normalized geometric normal vector to 1.0, unless the normal's current length is less than the specified threshold, in which case its length is set to 0.0.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSurfaceSample::GetNormalLength

virtual GCoordinate GetNormalLength () const

Interface Category:

API.

Purpose:

Returns the length of the normal to the surface at this point.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns the length of the normal to the surface at this point.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSurfaceSample::operator<<=

TStream & operator <<= (TStream & fromwhere)

Interface Category:

API.

Purpose:

Stream-in operator.

Calling Context:

Called to stream in data.

Parameters:

Return Value:

Returns a reference to the stream the object streams itself in from.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSurfaceSample::operator>>=

TStream & operator >>=(TStream & towhere) const

Interface Category:

API.

Purpose:

Stream-out operator.

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TSurfaceSample::operator==

bool operator ==(const TSurfaceSample & source) const

Interface Category:

API.

Purpose:

Compares two TSurfaceSample objects and returns true if they are equal.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if both objects are equal.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TSurfaceSample::~TSurfaceSample

virtual ~ TSurfaceSample ()

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:

Not multithread safe.

Other Considerations:

None.

Member Function: TSurfaceSample::TSurfaceSample

  1. TSurfaceSample ()
  2. TSurfaceSample (const TSurfaceSample &)

Interface Category:

API.

Purpose:

  1. Default constructor.
  2. Copy constructor.

Calling Context:

  1. Called by the stream-in operators and directly.
  2. Called to copy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.