![](../../Home/Icons/Home.gif)
![](../icons/UpCNM.gif)
![](../icons/CNMContext.gif)
![](../../Home/Icons/Search.gif)
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:
- GCoordinate minThreshold =0.005 -The minimum value at which to adjust the normal vector to 1.The default value is 0.005.
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:
- TStream & fromwhere -The stream that the object streams itself in from.
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:
- TStream & towhere -The stream that the object streams itself out to.
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.
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.
- TSurfaceSample ()
- TSurfaceSample (const TSurfaceSample &)
Interface Category:
API.
Purpose:
- Default constructor.
- Copy constructor.
Calling Context:
- Called by the stream-in operators and directly.
- 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.