HyperspaceExplorer 0.7.1
|
Interface to display four-dimensional objects. More...
#include <View.h>
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::string & | getImgDir ()=0 |
virtual void | setImgDir (const std::string &)=0 |
Set the directory where to store image files. | |
virtual const std::string & | getImgPrefix ()=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 Color & | getBackground ()=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. |
Interface to display four-dimensional objects.
Provides functions to display Function objects, transform them and animate them. Also to set various viewing states.
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.
R | Rotation to be performed on the object |
T | Translation to be applied to the object |
Implemented in C4DView.
Referenced by Script::XformStmt::execute().
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().
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.
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.
x0 | Location of first point in 4-space. Possibly needed for coloring information. |
x1 | Location of second point in 4-space. Possibly needed for coloring information. |
xscr0 | Location of first point projected int 3D. |
xscr1 | Location of second point projected int 3D. |
Implemented in C4DView.
Referenced by Rotope::drawLine().
virtual void UI::View::drawVertex | ( | const VecMath::Vector< 4 > & | x, |
const VecMath::Vector< 3 > & | xscr | ||
) | [pure virtual] |
Draws a single point.
x | Location of the point in 4-space. Possibly needed for coloring information. |
xscr | Location of the point projected int 3D. |
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().
virtual const std::shared_ptr<Displayable>& UI::View::F | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual const Color& UI::View::getBackground | ( | ) | [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getColors | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getCoordinates | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual const VecMath::Rotation<4>& UI::View::getdR | ( | ) | [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getFog | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getHyperfog | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual const std::string& UI::View::getImgDir | ( | ) | [pure virtual] |
Implemented in UI::ViewImpl.
virtual const std::string& UI::View::getImgPrefix | ( | ) | [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getLighting | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual const std::vector<Light *>& UI::View::getLights | ( | ) | [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getShading | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getSolid | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getTransparence | ( | ) | const [pure virtual] |
Implemented in UI::ViewImpl.
virtual bool UI::View::getWriteImages | ( | ) | [protected, pure virtual] |
Implemented in UI::ViewImpl.
virtual void UI::View::setdR | ( | const VecMath::Rotation< 4 > & | _dr | ) | [pure virtual] |
Set the rotation step between frames for animations.
_dr | Rotation step between two frames of an animation |
Implemented in UI::ViewImpl.
Referenced by Script::DeltaStmt::execute().
virtual void UI::View::setF | ( | Displayable * | f | ) | [pure virtual] |
Set the currently displayed object to the given Function.
f | The object to be set |
Implemented in UI::ViewImpl.
Referenced by Script::ObjectStmt::execute().
void UI::View::setParameter | ( | const std::string & | parmName, |
const T & | value | ||
) | [inline] |
Makes setting a parameter from the outside possible.
parmName | Name of the parameter, as defined in the Function |
value | Parameter value. Type must match exactly. |
References ApplyChanges().
virtual void UI::View::setSolid | ( | bool | on | ) | [pure virtual] |
Turn wireframe display on or off.
on | if true, displays wireframe model; else solid |
Implemented in UI::ViewImpl.
Referenced by Script::SolidStmt::execute(), and Script::WireStmt::execute().