Class: TMarbleProcedureMap

Declaration: SampleProcedureMaps.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

TNoiseProcedureMap

Inherited By:

None.

Purpose:

TMarbleProcedureMap is a concrete class, derived from TNoiseProcedureMap, that creates a texture with the appearance of marble. A TMarbleProcedureMap object alters the color but not the shading normal of a surface point. (It does not perturb the shading normal as a bump map would, because marble surfaces typically are smooth.) The procedure uses a TGrafNoise object (by default, an instance of TLatticeNoise) to generate a pseudo-random number for a given surface point. It then sends this number to a TShaderColorSpline object, which returns a new color based on the number and on the existing surface point's base color.

Instantiation:

Allocate on the heap or the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TMarbleProcedureMap::TMarbleProcedureMap

  1. TMarbleProcedureMap ()
  2. TMarbleProcedureMap (const TMarbleProcedureMap & map)
  3. TMarbleProcedureMap (const TShaderColorSpline & spline)

Interface Category:

API.

Purpose:

  1. Default constructor. Sets the scale to 1.0. Sets the noise generator to a TLatticeNoise object. Sets the TShaderColorSpline object to a gray scale (RGB) color map.
  2. Copy constructor.
  3. Constructor to set the shader color spline object that returns the new marbled color based on the noise generator and the base color.

Calling Context:

  1. Called by the stream-in operators. You can also call this function directly.
  2. Called to copy an object.
  3. 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: TMarbleProcedureMap::~TMarbleProcedureMap

virtual ~ TMarbleProcedureMap ()

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: TMarbleProcedureMap::SetGrafNoise

virtual void SetGrafNoise (const TGrafNoise & noise)

Interface Category:

API.

Purpose:

Sets the noise object, which generate a certain type of pseudo- random number, to a copy of the specified TGrafNoise.

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: TMarbleProcedureMap::SetColorSpline

virtual void SetColorSpline (const TShaderColorSpline & spline)

Interface Category:

API.

Purpose:

Sets the color spline to a copy of the specified TShaderColorSpline.

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: TMarbleProcedureMap::GetValue

virtual void GetValue (TShadingSample & info, const TSceneState &) const

Interface Category:

API.

Purpose:

Returns, in the fBaseColor field of the TShadingSample argument, the new color that the procedure map computes for the given surface point.

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: TMarbleProcedureMap::SetScale

virtual void SetScale (double scale)

Interface Category:

API.

Purpose:

Sets the scalar used to multiply the x-, y-, and z-coordinates of a surface point before computing the new color. Larger scalars make the marbled pattern noisier.

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: TMarbleProcedureMap::GetModifiedShadingVariables

virtual void GetModifiedShadingVariables (TShadingUsageVariables & variables) const

Interface Category:

API.

Purpose:

Returns, in its TShadingUsageVariables argument, an object indicating which TShadingSample fields the procedure map alters (namely, fBaseColor only). The shader needs this information to save and store variables in the TShadingSample that it operates on.

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: TMarbleProcedureMap::operator=

TMarbleProcedureMap & operator =(const TMarbleProcedureMap & source)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Call this function by using the operator in an assignment statement.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TMarbleProcedureMap::operator>>=

virtual TStream & operator >>=(TStream &) 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: TMarbleProcedureMap::operator<<=

virtual TStream & operator <<= (TStream &)

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