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

A four-dimensional cube. More...

#include <ObjectImplementations.h>

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

List of all members.

Public Member Functions

 Hypercube (double a=1., const VecMath::Vector< 4 > &_center=VecMath::Vector< 4 >(0., 0., 0., 0.))
 Construct a hypercube with a side length and a center.
virtual std::string getFunctionName () const
virtual void SetParameters (const ParameterMap &parms)
 Set parameters to the Displayable.
virtual std::string description ()
virtual void Draw (UI::View *view)
 reimplement Draw() to make use of the stored vertices (instead of indices)

Protected Member Functions

virtual void Initialize ()
 Actually creates the Hypercube.
void DeclareSquare (unsigned, unsigned, unsigned, unsigned, unsigned, unsigned=0)
 Declare a square in the Surface array.

Protected Attributes

double _a
 Side length of the hypercube.
VecMath::Vector< 4 > _center
 Center of the hypercube.
surface_vec_type Surface
 the surfaces, stored as vectors of indeces to the points in X

Static Protected Attributes

static constexpr unsigned num_vertices = 16
static constexpr unsigned num_faces = 24

Detailed Description

A four-dimensional cube.


Constructor & Destructor Documentation

Hypercube::Hypercube ( double  a = 1.,
const VecMath::Vector< 4 > &  center = VecMath::Vector<4>(0., 0., 0., 0.) 
)

Construct a hypercube with a side length and a center.

Hypercube constructor.

Parameters:
centercenter
aside_length/2

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

Here is the call graph for this function:


Member Function Documentation

void Hypercube::DeclareSquare ( unsigned  i,
unsigned  a,
unsigned  b,
unsigned  c,
unsigned  d,
unsigned  offset = 0 
) [protected]

Declare a square in the Surface array.

Parameters:
iindex of the square
aindex of vertex 1
bindex of vertex 2
cindex of vertex 3
dindex of vertex 4
offsetif there are multiple cubes, the index of the cube

References begin(), and VertexHolder< 4, 1, double >::X().

Referenced by Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual std::string Hypercube::description ( ) [inline, virtual]
Returns:
A string carrying a description of the Function

Reimplemented in Sponge, and AltSponge.

References _a, and std::ends().

Here is the call graph for this function:

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

Implements Displayable.

Reimplemented in Sponge, and AltSponge.

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

Actually creates the Hypercube.

sets up the vertices of the Hypercube in X[], then sets up the surfaces of the Hypercube by declaring the appropriate squares as a list in Surface[][].

Reimplemented from Object.

Reimplemented in Sponge, and AltSponge.

References _a, _center, DeclareSquare(), Object::setX(), size(), and VertexHolder< 4, 1, double >::X().

Referenced by Hypercube().

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void Hypercube::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 Displayable.

Reimplemented in Sponge, and AltSponge.

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

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