HyperspaceExplorer 0.7.1
Public Member Functions | Protected Member Functions | Protected Attributes

A four-dimensional version of the Sierpinski Gasket. More...

#include <ObjectImplementations.h>

Inheritance diagram for Gasket:
Inheritance graph
[legend]
Collaboration diagram for Gasket:
Collaboration graph
[legend]

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
levelhyper-sierpinski gasket level
_radside_length/2
_centercenter

References Displayable::declareParameter(), and Initialize().

Here is the call graph for this function:


Member Function Documentation

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().

Here is the call graph for this function:

virtual std::string Gasket::getFunctionName ( ) const [inline, virtual]
Returns:
The name of the Displayable in cleartext

Reimplemented from Pyramid.

void Gasket::Initialize ( void  ) [protected, virtual]

This function actually creates the Sierpinski Gasket.

See also:
Sponge::Initialize()

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().

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long Gasket::MemRequired ( void  ) [protected, virtual]

return the approximate amount of memory needed to display a gasket of current level

Todo:
uses hardcoded and experimentally found value for memory per simplex
Returns:
approx. mem required

Reimplemented from Displayable.

References Level, and pow().

Referenced by Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

void Gasket::Project ( double  scr_w,
double  cam_w,
bool  depthcue4d 
) [virtual]

projects a Gasket into three-space

Parameters:
scr_ww coordinate of screen
cam_ww coordinate of camera
depthcue4dwheter to use hyperfog/dc

Reimplemented from VertexHolder< 4, 1, double >.

References List, and std::vector< _Tp, _Alloc >::size().

Here is the call graph for this function:

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.

Here is the call graph for this function:

virtual void Gasket::SetParameters ( const ParameterMap ) [inline, virtual]

Set parameters to the Displayable.

Todo:
This function is only there to provide an interface, and it's not abstract so that Displayable s which don't have Parameters don't need to reimplement an unneeded method. But the present implementation does not make sense.

Reimplemented from Pyramid.

References std::map< _Key, _Tp, _Compare, _Alloc >::begin(), std::map< _Key, _Tp, _Compare, _Alloc >::end(), Level, rad, and Displayable::setParameter().

Here is the call graph for this function:

void Gasket::Transform ( const VecMath::Rotation< 4 > &  R,
const VecMath::Vector< 4 > &  T,
const VecMath::Vector< 4 > &  scale 
) [virtual]

Transforms a Gasket.

Parameters:
RRotation
TTranslation

References List, and std::vector< _Tp, _Alloc >::size().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends

Generated on Mon Apr 9 2012 20:25:18 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo