Class: TGrafNoise

Declaration: GrafNoise.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MCollectible

Inherited By:

TLatticeNoise

Purpose:

TGrafNoise is an abstract base class for generating more or less random numbers when given a double floating-point number, a 2-D point, or a 3-D point as input. The primary use of the class is in procedure maps. Classes derived from TNoiseProcedureMap use TGrafNoise derived classes to create textures (such as marbled or wrinkled surfaces) that are based on noise or turbulence effects. These TNoiseProcedureMap derived classes accept any noise object that descends from TGrafNoise. TGrafNoise derived classes are responsible for implementing the noise generator. A typical case produces white noise, which is uncorrelated from point to point, and whose spectral density is a flat line, containing equal amounts at all frequencies. The overloaded Noise member function is intended to produce uncorrelated pseudo-random numbers. The overloaded Turbulence member function is used to create the visual impression of turbulent fluid flow; this function can approximate a 1/f signal. It is easy to produce uncorrelated pseudo-random numbers, but not so easy to map a small set of random numbers to every point in the entire 3-D space. The derived class TLatticeNoise solves this problem.

Instantiation:

Abstract class; do not allocate.

Deriving Classes:

Provided class: TLatticeNoise. You can create other TGrafNoise derived classes and use them with any TNoiseProcedureMap derived class. TGrafNoise derived classes should override all the pure virtual member functions, which should return values in the ranges documented for TGrafNoise.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Member Function: TGrafNoise::~TGrafNoise

virtual ~ TGrafNoise ()

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: TGrafNoise::Noise

  1. virtual double Noise (double point) const
  2. virtual double Noise (const TGPoint & point) const
  3. virtual double Noise (const TGPoint3D & point) const

Interface Category:

API.

Purpose:

  1. Returns the pseudo-random noise value as computed by the class when passed a one-dimensional argument. This is a pure virtual function and is designed to be overridden by derived classes.
  2. Returns the pseudo-random noise value as computed by the class when passed a TGPoint argument. This is a pure virtual function and is designed to be overridden by derived classes.
  3. Returns the pseudo-random noise value as computed by the class when passed a TGPoint3D argument. This is a pure virtual function and is designed to be overridden by derived classes.

Calling Context:

  1. Do not call this function directly. It is designed to be overridden by a derived class.
  2. Do not call this function directly. It is designed to be overridden by a derived class.
  3. Do not call this function directly. It is designed to be overridden by a derived class.

Parameters:

Return Value:

A floating point number with a range between 0 and 1, inclusive, which represents the pseudo-random number associated with the input argument.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

These are pure virtual functions that must be overridden by the derived classes.

Member Function: TGrafNoise::DNoise

virtual TGPoint3D DNoise (const TGPoint3D & point) const

Interface Category:

API.

Purpose:

Returns the pseudo-random differential noise vector as computed by the class when passed a TGPoint3D argument. This is a pure virtual function and is designed to be overridden by derived classes.

Calling Context:

Do not call this function directly. It is designed to be overridden by a derived class.

Parameters:

Return Value:

A TGPoint3D, each component of which has a range between -1 and 1, inclusive, representing the differential noise vector associated with the input argument.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

This is a pure virtual function that must be overridden by the derived classes.

Member Function: TGrafNoise::Turbulence

  1. virtual double Turbulence (double point, double pixelSize =0.1) const
  2. virtual double Turbulence (const TGPoint & point, double pixelSize =0.1) const
  3. virtual double Turbulence (const TGPoint3D & point, double pixelSize =0.1) const

Interface Category:

API.

Purpose:

  1. Returns a number between 0 and 1, inclusive, approximating a 1/f function (which gives the visual impression of turbulent fluid flow) when passed a one-dimensional value and a pixel size. This is a pure virtual function and is designed to be overridden by derived classes.
  2. Returns a number between 0 and 1, inclusive, approximating a 1/f function (which gives the visual impression of turbulent fluid flow) when passed a 2-D point and a pixel size. This is a pure virtual function and is designed to be overridden by derived classes.
  3. Returns a number between 0 and 1, inclusive, approximating a 1/f function (which gives the visual impression of turbulent fluid flow) when passed a 3-D point and a pixel size. This is a pure virtual function and is designed to be overridden by derived classes.

Calling Context:

  1. Do not call this function directly. It is designed to be overridden by a derived class.
  2. Do not call this function directly. It is designed to be overridden by a derived class.
  3. Do not call this function directly. It is designed to be overridden by a derived class.

Parameters:

Return Value:

A floating point number with a range between 0 and 1, inclusive, which represents the pseudo-random number (modified by a turbulence function) associated with the input argument.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

These are pure virtual functions that must be overridden by the derived classes.

Member Function: TGrafNoise::DTurbulence

virtual TGPoint3D DTurbulence (const TGPoint3D & point, double pixelSize =0.1) const

Interface Category:

API.

Purpose:

Returns the pseudo-random differential turbulence vector as computed by the class when passed a TGPoint3D argument. This is a pure virtual function and is designed to be overridden by derived classes.

Calling Context:

Do not call this function directly. It is designed to be overridden by a derived class.

Parameters:

Return Value:

A TGPoint3D, each component of which has a range between -1 and 1, inclusive, which represents the differential turbulence vector associated with the input argument.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TGrafNoise::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: TGrafNoise::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.

Member Function: TGrafNoise::TGrafNoise

  1. TGrafNoise ()
  2. TGrafNoise (const TGrafNoise &)

Interface Category:

API.

Purpose:

  1. Default constructor. This is a protected constructor that must be overridden by derived classes.
  2. Copy constructor. This is a protected constructor that must be overridden by derived classes.

Calling Context:

  1. Called by the stream-in operators. You cannot call this function directly.
  2. Called to copy an object. You cannot call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

These are protected constructors that must be overridden by derived classes.

Member Function: TGrafNoise::operator=

TGrafNoise & operator =(const TGrafNoise & source)

Interface Category:

API.

Purpose:

Assignment operator. This is a protected member function that must be overridden by derived classes.

Calling Context:

Called by derived classes. You cannot call this function directly.

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:

This is a protected member function that must be overridden by derived classes.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.