Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

osgParticle::range< T_ > Struct Template Reference

A simple struct template useful to store ranges of values as min/max pairs. More...

Inheritance diagram for osgParticle::range< T_ >:

Inheritance graph
[legend]
List of all members.

Public Methods

 range ()
 Construct the object by calling default constructors for min and max.

 range (const T_ &mn, const T_ &mx)
 Construct and initialize min and max directly.

void set (const T_ &mn, const T_ &mx)
 Set min and max.

T_ get_random () const
 Get a random value between min and max.


Public Attributes

T_ minimum
 Lower bound.

T_ maximum
 Higher bound.


Detailed Description

template<class T_>
struct osgParticle::range< T_ >

A simple struct template useful to store ranges of values as min/max pairs.

This struct template helps storing min/max ranges for values of any kind; class T_ is the type of values to be stored, and it must support operations T_ + T_, T_ - T_, and T_ * float, otherwise the get_random() method will not compile. This struct could be extended to customize the random number generator (now it uses only std::rand()).


Constructor & Destructor Documentation

template<class T_>
osgParticle::range< T_ >::range   [inline]
 

Construct the object by calling default constructors for min and max.

template<class T_>
osgParticle::range< T_ >::range const T_ &    mn,
const T_ &    mx
[inline]
 

Construct and initialize min and max directly.


Member Function Documentation

template<class T_>
T_ osgParticle::range< T_ >::get_random   const [inline]
 

Get a random value between min and max.

template<class T_>
void osgParticle::range< T_ >::set const T_ &    mn,
const T_ &    mx
[inline]
 

Set min and max.


Member Data Documentation

template<class T_>
T_ osgParticle::range< T_ >::maximum
 

Higher bound.

template<class T_>
T_ osgParticle::range< T_ >::minimum
 

Lower bound.


The documentation for this struct was generated from the following file:
Generated at Wed Sep 18 13:55:54 2002 for the Open Scene Graph by doxygen 1.2.16.