HyperspaceExplorer 0.7.1
Classes | Public Member Functions | Protected Member Functions | Private Attributes | Static Private Attributes | Friends
VertexData< D > Class Template Reference

Base class for all Rotope s. More...

#include <VertexData.h>

Inheritance diagram for VertexData< D >:
Inheritance graph
[legend]
Collaboration diagram for VertexData< D >:
Collaboration graph
[legend]

List of all members.

Classes

class  VertexDataPrinter
 Auxiliary class encapsulating printing and conversion to std::string. More...

Public Member Functions

virtual Realmrealm ()
 The array of realms (D-1 dimensional surfaces of D-dimensional object)
virtual const Realmrealm () const
 The array of realms (D-1 dimensional surfaces of D-dimensional object)
const std::vector
< VecMath::Vector< D > > & 
raw_vertices () const
 Read-only access to the list of vertices managed by this object.
virtual std::vector
< VecMath::Vector< 4 > > 
projected_vertices ()
 The array of vertices, projected to four dimensions if necessary.
virtual unsigned dimension () const
 Dimension of the object.
virtual unsigned & dimension ()
 Direct access to the dimension member instead of setter for convenience.
virtual std::string toString ()
 String representation.

Protected Member Functions

 VertexData ()
 Default c'tor. VertexData objects can only be initialized in derived classes.
virtual void addTransform (unsigned, const VecMath::RotationBase *)
 Perform a D -dimensional transformation.
std::vector< VecMath::Vector
< D > > & 
raw_vertices ()
 Read/write access to the list of vertices managed by this object.
void set_raw_vertices (const std::vector< VecMath::Vector< D > > &new_vertices)
 Write access to the list of vertices managed by this object.

Private Attributes

unsigned _dimension
 Dimension of the object.
std::vector< VecMath::Vector< D > > _raw_vertices
 The array of vertices.
Realm _realm
 The array of realms (D-1 dimensional surfaces of D-dimensional object)
std::vector< const
VecMath::RotationBase * > 
_transform
 List of transformations executed on the object in dimensions > 4.

Static Private Attributes

static constexpr double PROJECTION_SCREEN_W = 2.
 Hardcoded screen distance for generation of the Projection in projected_vertices().
static constexpr double PROJECTION_CAMERA_W = 8.
 Hardcoded camera w coordinate for generation of the Projection in projected_vertices().

Friends

class RotopeFactory
 Allow RotopeFactory free access to create VertexData objects.

Detailed Description

template<unsigned D>
class VertexData< D >

Base class for all Rotope s.

Contains an array of vertices (Vectors) and a function to print them. This is used mainly in the development of Rotope objects.

Template Parameters:
DDimension of the vector space we're working in
Todo:
transforming rotopes, allowing for rotation in D dimensions and scaling.
Author:
Lene Preuss <lene.preuss@gmail.com>

Member Function Documentation

template<unsigned D>
void VertexData< D >::addTransform ( unsigned  d,
const VecMath::RotationBase R 
) [protected, virtual]

Perform a D -dimensional transformation.

Parameters:
RRotation component of the transformation
dDimension on which the transform acts

Implements RotopeInterface.

References std::cerr.

template<unsigned D>
virtual unsigned& VertexData< D >::dimension ( ) [inline, virtual]

Direct access to the dimension member instead of setter for convenience.

This way, implementing classes can simply use

instead of the more cumbersome

Because Rotope operations (extrusion, tapering etc.) are all about increasing the dimension, I'll let this stand.

Implements RotopeInterface.

References VertexData< D >::_dimension.

template<unsigned D>
std::vector< VecMath::Vector< 4 > > VertexData< D >::projected_vertices ( ) [virtual]

The array of vertices, projected to four dimensions if necessary.

Todo:
This is hardcoded! Ugh!

Implements RotopeInterface.


Member Data Documentation

template<unsigned D>
constexpr double VertexData< D >::PROJECTION_CAMERA_W = 8. [static, private]

Hardcoded camera w coordinate for generation of the Projection in projected_vertices().

Todo:
un-hardcode this (configure from Rotope)
template<unsigned D>
constexpr double VertexData< D >::PROJECTION_SCREEN_W = 2. [static, private]

Hardcoded screen distance for generation of the Projection in projected_vertices().

Todo:
un-hardcode this (configure from Rotope)

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

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