AGX Dynamics  2.37.3.2
agxModel::GaussianHeightMapGenerator Class Reference

A height map generator using a Gaussian function. More...

#include <HeightMapGenerator.h>

+ Inheritance diagram for agxModel::GaussianHeightMapGenerator:

Public Member Functions

 GaussianHeightMapGenerator ()
 Default constructor. More...
 
 GaussianHeightMapGenerator (const size_t &width, const size_t &height, const GaussianFunctionSettings &settings)
 Constructor that takes the image width, image hegiht and settings as arguments. More...
 
agx::RealMatrix generateHeightData ()
 Generates and returns height data in matrix form. More...
 
GaussianFunctionSettings getSettings ()
 Gets the settings used in the simulation. More...
 
void setSeed (agx::UInt seed)
 Sets the seed that it used by the random number generator when creating a bump texture. More...
 
void setSettings (const GaussianFunctionSettings &settings)
 Sets the settings that will be used when creating the Gaussian texture. More...
 
- Public Member Functions inherited from agxModel::HeightMapGenerator
 HeightMapGenerator ()
 
 HeightMapGenerator (const size_t &width, const size_t &height)
 
size_t getHeight ()
 Gets the height in pixels of the produced texture. More...
 
size_t getWidth ()
 Gets the width in pixels of the produced texture. More...
 
void setHeigth (const size_t &height)
 Sets the height in pixels of the produced texture. More...
 
void setWidth (const size_t &width)
 Sets the height in pixels of the produced texture. More...
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor. More...
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting. More...
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match. More...
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test. More...
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object. More...
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it. More...
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it. More...
 

Protected Member Functions

virtual ~GaussianHeightMapGenerator ()
 Default destructor. More...
 
agx::RealMatrix createGaussianHeightMatrix (agx::Vec2 X_bounds, size_t X_resolution, agx::Vec2 Y_bounds, size_t Y_resolution, const agx::RealMatrix &pos, const agx::RealMatrix &spread, const agx::RealVector &amplitude, bool limitToMaxHeight=false, agx::Real maxHeight=0)
 Creates a matrix that holds the heights of the Gaussian dimples. More...
 
void init ()
 
- Protected Member Functions inherited from agxModel::HeightMapGenerator
virtual ~HeightMapGenerator ()
 Default destructor. More...
 
- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor. More...
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 

Protected Attributes

agx::UInt m_seed
 
GaussianFunctionSettings m_settings
 
- Protected Attributes inherited from agxModel::HeightMapGenerator
size_t m_height
 
size_t m_width
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Additional Inherited Members

- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to. More...
 

Detailed Description

A height map generator using a Gaussian function.

Definition at line 105 of file HeightMapGenerator.h.

Constructor & Destructor Documentation

◆ GaussianHeightMapGenerator() [1/2]

agxModel::GaussianHeightMapGenerator::GaussianHeightMapGenerator ( )

Default constructor.

◆ GaussianHeightMapGenerator() [2/2]

agxModel::GaussianHeightMapGenerator::GaussianHeightMapGenerator ( const size_t &  width,
const size_t &  height,
const GaussianFunctionSettings &  settings 
)

Constructor that takes the image width, image hegiht and settings as arguments.

◆ ~GaussianHeightMapGenerator()

virtual agxModel::GaussianHeightMapGenerator::~GaussianHeightMapGenerator ( )
protectedvirtual

Default destructor.

Member Function Documentation

◆ createGaussianHeightMatrix()

agx::RealMatrix agxModel::GaussianHeightMapGenerator::createGaussianHeightMatrix ( agx::Vec2  X_bounds,
size_t  X_resolution,
agx::Vec2  Y_bounds,
size_t  Y_resolution,
const agx::RealMatrix &  pos,
const agx::RealMatrix &  spread,
const agx::RealVector &  amplitude,
bool  limitToMaxHeight = false,
agx::Real  maxHeight = 0 
)
protected

Creates a matrix that holds the heights of the Gaussian dimples.

◆ generateHeightData()

agx::RealMatrix agxModel::GaussianHeightMapGenerator::generateHeightData ( )

Generates and returns height data in matrix form.

◆ getSettings()

GaussianFunctionSettings agxModel::GaussianHeightMapGenerator::getSettings ( )

Gets the settings used in the simulation.

◆ init()

void agxModel::GaussianHeightMapGenerator::init ( )
protected

◆ setSeed()

void agxModel::GaussianHeightMapGenerator::setSeed ( agx::UInt  seed)

Sets the seed that it used by the random number generator when creating a bump texture.

Definition at line 170 of file HeightMapGenerator.h.

◆ setSettings()

void agxModel::GaussianHeightMapGenerator::setSettings ( const GaussianFunctionSettings &  settings)

Sets the settings that will be used when creating the Gaussian texture.

Member Data Documentation

◆ m_seed

agx::UInt agxModel::GaussianHeightMapGenerator::m_seed
protected

Definition at line 155 of file HeightMapGenerator.h.

◆ m_settings

GaussianFunctionSettings agxModel::GaussianHeightMapGenerator::m_settings
protected

Definition at line 154 of file HeightMapGenerator.h.


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