HyperspaceExplorer 0.7.1
Classes | Public Member Functions | Protected Member Functions
UI::View Class Reference

Interface to display four-dimensional objects. More...

#include <View.h>

Inheritance diagram for UI::View:
Inheritance graph
[legend]

List of all members.

Classes

class  FunctionNotSupportedException
 Thrown when a function is not supported by a View implementation. More...

Public Member Functions

virtual const std::shared_ptr
< Displayable > & 
F () const =0
virtual void setF (Displayable *f)=0
 Set the currently displayed object to the given Function.
template<typename T >
void setParameter (const std::string &parmName, const T &value)
 Makes setting a parameter from the outside possible.
virtual void applyTransform (const VecMath::Rotation< 4 > &R, const VecMath::Vector< 4 > &T)=0
 Apply the given Transformation to the currently displayed object.
virtual const
VecMath::Rotation< 4 > & 
getdR ()=0
virtual void setdR (const VecMath::Rotation< 4 > &_dr)=0
 Set the rotation step between frames for animations.
virtual void setNumFrames (unsigned _numFrames)=0
 Set the number of frames for an animation.
virtual void setNumLoops (unsigned _numLoops)=0
 Set the number of times _numFrames are repeated.
virtual void animate ()=0
 Start the animation with the currently active values.
virtual void setSize (unsigned, unsigned)=0
 Set the width and height of the viewport.
virtual const std::stringgetImgDir ()=0
virtual void setImgDir (const std::string &)=0
 Set the directory where to store image files.
virtual const std::stringgetImgPrefix ()=0
virtual void setImgPrefix (const std::string &)=0
 Set the prefix of image file names, before the frame number and the extension.
virtual void setBackground (const Color &)=0
 Set the background color.
virtual const ColorgetBackground ()=0
virtual void addLight (Light *)=0
 Add a light source to the scene.
virtual void removeLight (std::vector< Light * >::iterator)=0
 Remove a light source from the scene.
virtual const std::vector
< Light * > & 
getLights ()=0
virtual bool getColors () const =0
virtual void setColors (bool)=0
 Turn display of colors in rendering on or off.
virtual bool getCoordinates () const =0
virtual void setCoordinates (bool)=0
 Turn display of 4D coordinate cross on or off.
virtual bool getFog () const =0
virtual void setFog (bool)=0
 Turn depth cue on or off.
virtual bool getHyperfog () const =0
virtual void setHyperfog (bool)=0
 Turn depth cue in four dimensions on or off.
virtual bool getLighting () const =0
virtual void setLighting (bool)=0
 Turn lighting on or off.
virtual bool getShading () const =0
virtual void setShading (bool)=0
 Turn gouraud shading on or off.
virtual bool getSolid () const =0
virtual void setSolid (bool on)=0
 Turn wireframe display on or off.
virtual bool getTransparence () const =0
virtual void setTransparence (bool)=0
 Turn transparence/line antialiasing on or off.
virtual void drawVertex (const VecMath::Vector< 4 > &x, const VecMath::Vector< 3 > &xscr)=0
 Draws a single point.
virtual void drawLine (const VecMath::Vector< 4 > &x0, const VecMath::Vector< 4 > &x1, const VecMath::Vector< 3 > &xscr0, const VecMath::Vector< 3 > &xscr1)=0
 Draws a line between two points.
virtual void drawTriangle (const VecMath::Vector< 4 > &x0, const VecMath::Vector< 4 > &x1, const VecMath::Vector< 4 > &x2, const VecMath::Vector< 3 > &xscr0, const VecMath::Vector< 3 > &xscr1, const VecMath::Vector< 3 > &xscr2)=0
 Draws a triangle using three vertices projected to 3D and their four-space originals.
virtual void drawQuadrangle (const VecMath::Vector< 4 > &x0, const VecMath::Vector< 4 > &x1, const VecMath::Vector< 4 > &x2, const VecMath::Vector< 4 > &x3, const VecMath::Vector< 3 > &xscr0, const VecMath::Vector< 3 > &xscr1, const VecMath::Vector< 3 > &xscr2, const VecMath::Vector< 3 > &xscr3)=0
 Draws a quadrangle using four vertices projected to 3D and their four-space originals.
virtual void drawPolygon (const std::vector< VecMath::Vector< 4 > > &x0, const std::vector< VecMath::Vector< 3 > > &xscr0)=0
 Draws a polygon from a list of vertices projected to 3D and their four-space originals.
virtual void drawCube (const VecMath::MultiDimensionalVector< VecMath::Vector< 4 >, 3 > &X, unsigned t, unsigned u, unsigned v, const VecMath::Vector< 3 > &v0, const VecMath::Vector< 3 > &v1, const VecMath::Vector< 3 > &v2, const VecMath::Vector< 3 > &v3, const VecMath::Vector< 3 > &v4, const VecMath::Vector< 3 > &v5, const VecMath::Vector< 3 > &v6, const VecMath::Vector< 3 > &v7)=0
 Draws a cube.
virtual void commitDraw ()=0
 This function must be called at the end of each draw operation.

Protected Member Functions

virtual void ApplyChanges (const ParameterMap &)=0
 Apply changes in parameters and display them.
virtual unsigned getNumFrames ()=0
 Number of frames for animations.
virtual unsigned getNumLoops ()=0
 Number of loops to repeat an animation.
virtual bool getWriteImages ()=0
virtual void setWriteImages (bool)=0
 Turn saving images to file system on or off.
virtual void setDefaultBackground ()=0
 Set a default background color.

Detailed Description

Interface to display four-dimensional objects.

Provides functions to display Function objects, transform them and animate them. Also to set various viewing states.


Member Function Documentation

virtual void UI::View::applyTransform ( const VecMath::Rotation< 4 > &  R,
const VecMath::Vector< 4 > &  T 
) [pure virtual]

Apply the given Transformation to the currently displayed object.

The object is redrawn after the Transformation.

Parameters:
RRotation to be performed on the object
TTranslation to be applied to the object

Implemented in C4DView.

Referenced by Script::XformStmt::execute().

Here is the caller graph for this function:

virtual void UI::View::commitDraw ( ) [pure virtual]

This function must be called at the end of each draw operation.

To optimize the drawing process, it is not necessary to do every drawing operation immediately as it is called. The View is allowed to store the operations internally and perform optimizations. Only after commitDraw() is called, the operations are actually executed.

Implemented in UI::ViewImpl.

Referenced by Sponge::Draw(), Gasket::Draw(), Hypercube::Draw(), and Object::Draw().

Here is the caller graph for this function:

virtual void UI::View::drawCube ( const VecMath::MultiDimensionalVector< VecMath::Vector< 4 >, 3 > &  X,
unsigned  t,
unsigned  u,
unsigned  v,
const VecMath::Vector< 3 > &  v0,
const VecMath::Vector< 3 > &  v1,
const VecMath::Vector< 3 > &  v2,
const VecMath::Vector< 3 > &  v3,
const VecMath::Vector< 3 > &  v4,
const VecMath::Vector< 3 > &  v5,
const VecMath::Vector< 3 > &  v6,
const VecMath::Vector< 3 > &  v7 
) [pure virtual]

Draws a cube.

Todo:
Eeew! Thisis only temporary, until I have a better idea; i just copied this signature from the old RealFunction implementation.
virtual void UI::View::drawLine ( const VecMath::Vector< 4 > &  x0,
const VecMath::Vector< 4 > &  x1,
const VecMath::Vector< 3 > &  xscr0,
const VecMath::Vector< 3 > &  xscr1 
) [pure virtual]

Draws a line between two points.

Parameters:
x0Location of first point in 4-space. Possibly needed for coloring information.
x1Location of second point in 4-space. Possibly needed for coloring information.
xscr0Location of first point projected int 3D.
xscr1Location of second point projected int 3D.
Todo:
Limit the number of arguments...

Implemented in C4DView.

Referenced by Rotope::drawLine().

Here is the caller graph for this function:

virtual void UI::View::drawVertex ( const VecMath::Vector< 4 > &  x,
const VecMath::Vector< 3 > &  xscr 
) [pure virtual]

Draws a single point.

Parameters:
xLocation of the point in 4-space. Possibly needed for coloring information.
xscrLocation of the point projected int 3D.
Todo:

Should it draw a point or just define one, e.g. for polygons?

Abstract from the original vertex and only use the projected one?

Implemented in C4DView.

Referenced by Rotope::drawPoint().

Here is the caller graph for this function:

virtual const std::shared_ptr<Displayable>& UI::View::F ( ) const [pure virtual]
Returns:
The currently displayed object

Implemented in UI::ViewImpl.

virtual const Color& UI::View::getBackground ( ) [pure virtual]
Returns:
The background color

Implemented in UI::ViewImpl.

virtual bool UI::View::getColors ( ) const [pure virtual]
Returns:
whether to use colors in rendering or not

Implemented in UI::ViewImpl.

virtual bool UI::View::getCoordinates ( ) const [pure virtual]
Returns:
whether to display the 4D coordinate cross or not

Implemented in UI::ViewImpl.

virtual const VecMath::Rotation<4>& UI::View::getdR ( ) [pure virtual]
Returns:
delta values in angles for 4D rotation for animations

Implemented in UI::ViewImpl.

virtual bool UI::View::getFog ( ) const [pure virtual]
Returns:
whether to use depth cue/fog in rendering or not

Implemented in UI::ViewImpl.

virtual bool UI::View::getHyperfog ( ) const [pure virtual]
Returns:
whether to use four-dimensional depth cue or not

Implemented in UI::ViewImpl.

virtual const std::string& UI::View::getImgDir ( ) [pure virtual]
Returns:
directory to save images to

Implemented in UI::ViewImpl.

virtual const std::string& UI::View::getImgPrefix ( ) [pure virtual]
Returns:
filename prefix for saved images

Implemented in UI::ViewImpl.

virtual bool UI::View::getLighting ( ) const [pure virtual]
Returns:
whether to use lighting in rendering or not

Implemented in UI::ViewImpl.

virtual const std::vector<Light *>& UI::View::getLights ( ) [pure virtual]
Returns:
All lights in the scene
Todo:
Abstract from std::vector and use a generic container

Implemented in UI::ViewImpl.

virtual bool UI::View::getShading ( ) const [pure virtual]
Returns:
whether to use shading in rendering or not

Implemented in UI::ViewImpl.

virtual bool UI::View::getSolid ( ) const [pure virtual]
Returns:
whether to draw the objects' surfaces

Implemented in UI::ViewImpl.

virtual bool UI::View::getTransparence ( ) const [pure virtual]
Returns:
whether to use transparence/line antialiasing or not

Implemented in UI::ViewImpl.

virtual bool UI::View::getWriteImages ( ) [protected, pure virtual]
Returns:
whether to save images to file system

Implemented in UI::ViewImpl.

virtual void UI::View::setdR ( const VecMath::Rotation< 4 > &  _dr) [pure virtual]

Set the rotation step between frames for animations.

Parameters:
_drRotation step between two frames of an animation

Implemented in UI::ViewImpl.

Referenced by Script::DeltaStmt::execute().

Here is the caller graph for this function:

virtual void UI::View::setF ( Displayable f) [pure virtual]

Set the currently displayed object to the given Function.

Parameters:
fThe object to be set

Implemented in UI::ViewImpl.

Referenced by Script::ObjectStmt::execute().

Here is the caller graph for this function:

template<typename T >
void UI::View::setParameter ( const std::string parmName,
const T &  value 
) [inline]

Makes setting a parameter from the outside possible.

Parameters:
parmNameName of the parameter, as defined in the Function
valueParameter value. Type must match exactly.

References ApplyChanges().

Here is the call graph for this function:

virtual void UI::View::setSolid ( bool  on) [pure virtual]

Turn wireframe display on or off.

Parameters:
onif true, displays wireframe model; else solid

Implemented in UI::ViewImpl.

Referenced by Script::SolidStmt::execute(), and Script::WireStmt::execute().

Here is the caller graph for this function:


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