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.
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
- virtual double Noise (double point) const
- virtual double Noise (const TGPoint & point) const
- virtual double Noise (const TGPoint3D & point) const
Interface Category:
API.
Purpose:
- 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.
- 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.
- 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:
- Do not call this function directly. It is designed to be overridden by a derived class.
- Do not call this function directly. It is designed to be overridden by a derived class.
- Do not call this function directly. It is designed to be overridden by a derived class.
Parameters:
- double point -The one-dimensional value used to generate the pseudo-random result.
- const TGPoint & point -The 2-D point used to generate the pseudo-random result.
- const TGPoint3D & point -The 3-D seed point used to generate the pseudo-random result.
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:
- const TGPoint3D & point -The 3-D point used to generate the pseudo-random differential noise vector.
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
- virtual double Turbulence (double point, double pixelSize =0.1) const
- virtual double Turbulence (const TGPoint & point, double pixelSize =0.1) const
- virtual double Turbulence (const TGPoint3D & point, double pixelSize =0.1) const
Interface Category:
API.
Purpose:
- 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.
- 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.
- 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:
- Do not call this function directly. It is designed to be overridden by a derived class.
- Do not call this function directly. It is designed to be overridden by a derived class.
- Do not call this function directly. It is designed to be overridden by a derived class.
Parameters:
- double point -The one-dimensional value used to generate the pseudo-random result.
- double pixelSize =0.1 -The approximate frequency of the turbulence with respect to a single pixel. The default value is 0.1. A value of 1.0 gives the same pseudo-random result as TGrafNoise::Noise does when passed the same point value.
- const TGPoint & point -The 2-D point used to generate the pseudo-random result.
- double pixelSize =0.1 -The approximate frequency of the turbulence with respect to a single pixel. The default value is 0.1. A value of 1.0 gives the same pseudo-random result as TGrafNoise::Noise does when passed the same point value.
- const TGPoint3D & point -The 3-D point used to generate the pseudo-random result.
- double pixelSize =0.1 -The approximate frequency of the turbulence with respect to a single pixel. The default value is 0.1. A value of 1.0 gives the same pseudo-random result as TGrafNoise::Noise does when passed the same point value.
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:
- const TGPoint3D & point -The 3-D point used to generate the pseudo-random differential noise vector.
- double pixelSize =0.1 -The approximate frequency of the turbulence with respect to a single pixel. The default value is 0.A value of 1.0 gives the same pseudo-random result as TGrafNoise::Noise does when passed the same point value.
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:
- TStream & -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: TGrafNoise::operator<<=
virtual TStream & operator <<= (TStream &)
Interface Category:
API.
Purpose:
Stream-in operator.
Calling Context:
Called to stream in data.
Parameters:
- TStream & -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.
- TGrafNoise ()
- TGrafNoise (const TGrafNoise &)
Interface Category:
API.
Purpose:
- Default constructor. This is a protected constructor that must be overridden by derived classes.
- Copy constructor. This is a protected constructor that must be overridden by derived classes.
Calling Context:
- Called by the stream-in operators. You cannot call this function directly.
- Called to copy an object. You cannot call this function directly.
Parameters:
- Takes no parameters.
- const TGrafNoise & -The object to be copied.
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:
- const TGrafNoise & source -The object to be copied.
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.