HyperspaceExplorer 0.7.1
|
A four-dimensional version of the Sierpinski Gasket. More...
#include <ObjectImplementations.h>
Public Member Functions | |
Gasket (unsigned level=1, double rad=1, VecMath::Vector< 4 > Center=VecMath::Vector< 4 >(0., 0., 0., 0.)) | |
Create a gasket with a level, size and center. | |
virtual std::string | getFunctionName () const |
virtual void | Transform (const VecMath::Rotation< 4 > &R, const VecMath::Vector< 4 > &T, const VecMath::Vector< 4 > &scale) |
Transforms a Gasket. | |
virtual void | Project (double ScrW, double CamW, bool DepthCue4D) |
projects a Gasket into three-space | |
virtual void | Draw (UI::View *view) |
draw the projected Gasket (onto screen or into GL list, as it is) | |
virtual void | SetParameters (const ParameterMap &parms) |
Set parameters to the Displayable. | |
virtual void | ReInit (double, double, double, double, double, double, double, double, double) |
Protected Member Functions | |
virtual void | Initialize () |
This function actually creates the Sierpinski Gasket. | |
virtual unsigned long | MemRequired (void) |
return the approximate amount of memory needed to display a gasket of current level | |
Protected Attributes | |
unsigned | Level |
Recursion depth creating the gasket. | |
std::vector< Pyramid * > | List |
List of sub-gaskets. | |
double | rad |
Scale of the gasket. | |
VecMath::Vector< 4 > | center |
location |
A four-dimensional version of the Sierpinski Gasket.
This object is similar to the Menger Sponge, but it uses a Hypersimplex as generator.
It lacks the distance
parameter, because there is only one way to generate a Sierpinski Gasket of level n
. Otherwise it is analogous to the Menger Sponge fractal.
Gasket::Gasket | ( | unsigned | level = 1 , |
double | _rad = 1 , |
||
VecMath::Vector< 4 > | _center = VecMath::Vector<4> (0., 0.,0., 0.) |
||
) |
Create a gasket with a level, size and center.
Gasket constructor.
level | hyper-sierpinski gasket level |
_rad | side_length/2 |
_center | center |
References Displayable::declareParameter(), and Initialize().
void Gasket::Draw | ( | UI::View * | view | ) | [virtual] |
draw the projected Gasket (onto screen or into GL list, as it is)
Reimplemented from Object.
References UI::View::commitDraw(), List, and std::vector< _Tp, _Alloc >::size().
virtual std::string Gasket::getFunctionName | ( | ) | const [inline, virtual] |
Reimplemented from Pyramid.
void Gasket::Initialize | ( | void | ) | [protected, virtual] |
This function actually creates the Sierpinski Gasket.
Reimplemented from Pyramid.
References center, cerr, endl(), Loki::SingletonHolder< T, CreationPolicy >::Instance(), Level, List, MemRequired(), std::vector< _Tp, _Alloc >::push_back(), rad, and sqrt().
Referenced by Gasket().
unsigned long Gasket::MemRequired | ( | void | ) | [protected, virtual] |
return the approximate amount of memory needed to display a gasket of current level
Reimplemented from Displayable.
Referenced by Initialize().
void Gasket::Project | ( | double | scr_w, |
double | cam_w, | ||
bool | depthcue4d | ||
) | [virtual] |
projects a Gasket into three-space
scr_w | w coordinate of screen |
cam_w | w coordinate of camera |
depthcue4d | wheter to use hyperfog/dc |
Reimplemented from VertexHolder< 4, 1, double >.
References List, and std::vector< _Tp, _Alloc >::size().
virtual void Gasket::ReInit | ( | double | , |
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | , | ||
double | |||
) | [inline, virtual] |
Reinitialize an Object. This function is called when the initialization is done outside the constructor.
Currently it does not differ from Initialize(). In fact, it simply calls Initialize().
Reimplemented from Object.
References std::vector< _Tp, _Alloc >::clear(), and List.
virtual void Gasket::SetParameters | ( | const ParameterMap & | ) | [inline, virtual] |
Set parameters to the Displayable.
Reimplemented from Pyramid.
References std::map< _Key, _Tp, _Compare, _Alloc >::begin(), std::map< _Key, _Tp, _Compare, _Alloc >::end(), Level, rad, and Displayable::setParameter().
void Gasket::Transform | ( | const VecMath::Rotation< 4 > & | R, |
const VecMath::Vector< 4 > & | T, | ||
const VecMath::Vector< 4 > & | scale | ||
) | [virtual] |
Transforms a Gasket.
R | Rotation |
T | Translation |
References List, and std::vector< _Tp, _Alloc >::size().