CS::Math::Noise::Model::Line Class Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
CS::Math::Noise::Model::Line Class Reference
Models

Model that defines the displacement of a line segment. More...

`#include <cstool/noise/model/line.h>`

List of all members.

## Public Member Functions
bool | GetAttenuate () const
| Returns a flag indicating whether the output value is to be attenuated (moved toward 0.0) as the ends of the line segment are approached by the input value.
const CS::Math::Noise::Module::Module & | GetModule () const
| Returns the noise module that is used to generate the output values.
double | GetValue (double p) const
| Returns the output value from the noise module given the one-dimensional coordinate of the specified input value located on the line segment.
| Line ()
| Constructor.
| Line (const CS::Math::Noise::Module::Module &module)
| Constructor.
void | SetAttenuate (bool att)
| Sets a flag indicating that the output value is to be attenuated (moved toward 0.0) as the ends of the line segment are approached.
void | SetEndPoint (double x, double y, double z)
| Sets the position ( x, y, z ) of the end of the line segment to choose values along.
void | SetModule (const CS::Math::Noise::Module::Module &module)
| Sets the noise module that is used to generate the output values.
void | SetStartPoint (double x, double y, double z)
| Sets the position ( x, y, z ) of the start of the line segment to choose values along.

## Detailed Description

Model that defines the displacement of a line segment.

This model returns an output value from a noise module given the one-dimensional coordinate of an input value located on a line segment, which can be used as displacements.

This class is useful for creating:

- roads and rivers
- disaffected college students

To generate an output value, pass an input value between 0.0 and 1.0 to the GetValue() method. 0.0 represents the start position of the line segment and 1.0 represents the end position of the line segment.

Definition at line 52 of file line.h.

## Constructor & Destructor Documentation

CS::Math::Noise::Model::Line::Line | ( |  | ) |

Constructor.

CS::Math::Noise::Model::Line::Line | ( | const CS::Math::Noise::Module::Module & | module | ) |

Constructor.

Parameters:

  module | The noise module that is used to generate the output values.

## Member Function Documentation

bool CS::Math::Noise::Model::Line::GetAttenuate | ( |  | ) | const`[inline]`

Returns a flag indicating whether the output value is to be attenuated (moved toward 0.0) as the ends of the line segment are approached by the input value.

Returns:
  - true if the value is to be attenuated
  - false if not.

Definition at line 73 of file line.h.

const CS::Math::Noise::Module::Module& CS::Math::Noise::Model::Line::GetModule | ( |  | ) | const`[inline]`

Returns the noise module that is used to generate the output values.

Returns:
  A reference to the noise module.

Precondition:
  A noise module was passed to the SetModule() method.

Definition at line 84 of file line.h.

double CS::Math::Noise::Model::Line::GetValue | ( | double | p | ) | const

Returns the output value from the noise module given the one-dimensional coordinate of the specified input value located on the line segment.

Parameters:

  p | The distance along the line segment (ranges from 0.0 to 1.0)

Returns:
  The output value from the noise module.

Precondition:
  A noise module was passed to the SetModule() method.
  The start and end points of the line segment were specified.

The output value is generated by the noise module passed to the SetModule() method. This value may be attenuated (moved toward 0.0) as p approaches either end of the line segment; this is the default behavior.

If the value is not to be attenuated, p can safely range outside the 0.0 to 1.0 range; the output value will be extrapolated along the line that this segment is part of.

void CS::Math::Noise::Model::Line::SetAttenuate | ( | bool | att | ) | `[inline]`

Sets a flag indicating that the output value is to be attenuated (moved toward 0.0) as the ends of the line segment are approached.

Parameters:

  att | A flag that specifies whether the output value is to be attenuated.

Definition at line 117 of file line.h.

void CS::Math::Noise::Model::Line::SetEndPoint | ( | double | x,
|  | double | y,
|  | double | z
| ) |  | `[inline]`

Sets the position ( x, y, z ) of the end of the line segment to choose values along.

Parameters:

  x | x coordinate of the end position.
  y | y coordinate of the end position.
  z | z coordinate of the end position.

Definition at line 128 of file line.h.

void CS::Math::Noise::Model::Line::SetModule | ( | const CS::Math::Noise::Module::Module & | module | ) | `[inline]`

Sets the noise module that is used to generate the output values.

Parameters:

  module | The noise module that is used to generate the output values.

This noise module must exist for the lifetime of this object, until you pass a new noise module to this method.

Definition at line 142 of file line.h.

void CS::Math::Noise::Model::Line::SetStartPoint | ( | double | x,
|  | double | y,
|  | double | z
| ) |  | `[inline]`

Sets the position ( x, y, z ) of the start of the line segment to choose values along.

Parameters:

  x | x coordinate of the start position.
  y | y coordinate of the start position.
  z | z coordinate of the start position.

Definition at line 153 of file line.h.

The documentation for this class was generated from the following file:

- cstool/noise/model/line.h