HyperspaceExplorer 0.7.1
|
Interface with attributes to display four-dimensional objects. More...
#include <ViewImpl.h>
Classes | |
struct | Impl |
Public Member Functions | |
ViewImpl () | |
Initialize the View with default values for all states. | |
virtual const std::shared_ptr < Displayable > & | F () const |
virtual void | setF (Displayable *_f) |
Implementation of UI::View::setFunction. | |
virtual const VecMath::Rotation< 4 > & | getdR () |
virtual void | setdR (const VecMath::Rotation< 4 > &_dr) |
Set the rotation step between frames for animations. | |
virtual void | setNumFrames (unsigned frames) |
Set the number of frames for an animation. | |
virtual void | setNumLoops (unsigned loops) |
Set the number of times _numFrames are repeated. | |
virtual const std::string & | getImgDir () |
virtual void | setImgDir (const std::string &) |
Set the directory where to store image files. | |
virtual const std::string & | getImgPrefix () |
virtual void | setImgPrefix (const std::string &) |
Set the prefix of image file names, before the frame number and the extension. | |
virtual const Color & | getBackground () |
virtual void | setBackground (const Color &bg) |
Set the background color. | |
virtual void | addLight (Light *l) |
Add a light source to the scene. | |
virtual void | removeLight (std::vector< Light * >::iterator) |
Remove a light source from the scene. | |
virtual const std::vector < Light * > & | getLights () |
virtual bool | getColors () const |
virtual void | setColors (bool on) |
Turn display of colors on or off. | |
virtual bool | getCoordinates () const |
virtual void | setCoordinates (bool on) |
Turn display of coordinate cross on or off. | |
virtual bool | getFog () const |
virtual void | setFog (bool on) |
Turn depth cue on or off. | |
virtual bool | getHyperfog () const |
virtual void | setHyperfog (bool on) |
Turn depth cue in four dimensions on or off. | |
virtual bool | getLighting () const |
virtual void | setLighting (bool on) |
Turn lighting on or off. | |
virtual bool | getShading () const |
virtual void | setShading (bool on) |
Turn gouraud shading on or off. | |
virtual bool | getSolid () const |
virtual void | setSolid (bool on) |
Turn wireframe display on or off. | |
virtual bool | getTransparence () const |
virtual void | setTransparence (bool on) |
Turn transparence/line antialiasing on or off. | |
virtual void | drawTriangle (const VecMath::Vector< 4 > &, const VecMath::Vector< 4 > &, const VecMath::Vector< 4 > &, const VecMath::Vector< 3 > &, const VecMath::Vector< 3 > &, const VecMath::Vector< 3 > &) |
drawTriangle() is a convenience function that may not be implemented in all Views - this implementation throws an exception | |
virtual void | drawPolygon (const std::vector< VecMath::Vector< 4 > > &, const std::vector< VecMath::Vector< 3 > > &) |
drawPolygon() is a convenience function that may not be implemented in all Views - this implementation throws an exception | |
virtual void | drawCube (const VecMath::MultiDimensionalVector< VecMath::Vector< 4 >, 3 > &X, unsigned int t, unsigned int u, unsigned int 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) |
Generic implementation of drawCube() in terms of drawQuadrangle() | |
virtual void | commitDraw () |
Empty implementation; no operations are performed. | |
Protected Member Functions | |
virtual unsigned | getNumFrames () |
Number of frames for animations. | |
virtual unsigned | getNumLoops () |
Number of loops to repeat an animation. | |
virtual bool | getWriteImages () |
virtual void | setWriteImages (bool on) |
Turn saving images to file system on or off. | |
virtual void | setDefaultBackground () |
Set a default background color. | |
virtual void | setT (const VecMath::Vector< 4 > &_t) |
virtual const VecMath::Vector< 4 > & | T () |
virtual void | addT (const VecMath::Vector< 4 > &_dT) |
Add a Translation to the current translation state. | |
virtual void | setR (const VecMath::Rotation< 4 > &_r) |
virtual const VecMath::Rotation< 4 > & | R () |
virtual void | addR (const VecMath::Rotation< 4 > &_dR) |
Add a Rotation to the current rotation state. | |
virtual void | adddR (const VecMath::Rotation< 4 > &) |
Add a Rotation to the current rotation speed. | |
double | CamW () const |
void | setCamW (const double &_cw) |
double | ScrW () const |
void | setScrW (const double &_sw) |
double | distance () |
Viewport distance; currently fixed to 1. | |
Static Protected Member Functions | |
static const LightSource & | getDefaultLightSource () |
static const LightSource & | getFlatLightSource () |
Private Attributes | |
Impl * | pImpl_ |
Pointer to implementation. | |
Static Private Attributes | |
static Color | _defaultBackground |
Default Color for the background. | |
static LightSource | _defaultLightSource |
Point LightSource with sensible defaults for good light. | |
static LightSource | _flatLightSource |
LightSource for flat, all-ambient lighting. |
Interface with attributes to display four-dimensional objects.
This class provides a partial implementation of the class View, with the class attributes and their getters and setters.
It also stores view states, which are common to all implementations, such as:
void UI::ViewImpl::adddR | ( | const VecMath::Rotation< 4 > & | ddR | ) | [protected, virtual] |
void UI::ViewImpl::addLight | ( | Light * | l | ) | [virtual] |
Add a light source to the scene.
l | Light source added to the scene |
Implements UI::View.
References UI::ViewImpl::Impl::_lights, pImpl_, and std::vector< _Tp, _Alloc >::push_back().
void UI::ViewImpl::addT | ( | const VecMath::Vector< 4 > & | _dT | ) | [protected, virtual] |
Add a Translation to the current translation state.
_dT | Delta t |
References UI::ViewImpl::Impl::_T, and pImpl_.
double UI::ViewImpl::CamW | ( | ) | const [protected] |
References UI::ViewImpl::Impl::_camW, and pImpl_.
Referenced by C4DView::Project().
const std::shared_ptr< Displayable > & UI::ViewImpl::F | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_F, and pImpl_.
Referenced by C4DView::ApplyChanges(), C4DView::C4DView(), C4DView::CustomFunctionSlot< function >::createCustomFunction(), C4DView::CustomFunctionSlot< function >::createCustomSurface(), C4DView::PreRedraw(), C4DView::Project(), C4DView::Redraw(), C4DView::Transform(), and C4DView::UpdateStatus().
const Color & UI::ViewImpl::getBackground | ( | ) | [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_background, and pImpl_.
bool UI::ViewImpl::getColors | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_colors, and pImpl_.
Referenced by C4DView::Menu4D::Menu4D().
bool UI::ViewImpl::getCoordinates | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_coordinates, and pImpl_.
Referenced by C4DView::Menu4D::Menu4D(), C4DView::PreRedraw(), C4DView::Project(), and C4DView::RenderScene().
const LightSource & UI::ViewImpl::getDefaultLightSource | ( | ) | [static, protected] |
References _defaultLightSource.
const VecMath::Rotation< 4 > & UI::ViewImpl::getdR | ( | ) | [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_dR, and pImpl_.
Referenced by adddR(), C4DView::animate(), C4DView::OnAnimationTimer(), and C4DView::StartAnimation().
const LightSource & UI::ViewImpl::getFlatLightSource | ( | ) | [static, protected] |
References _flatLightSource.
bool UI::ViewImpl::getFog | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_fog, and pImpl_.
Referenced by C4DView::InitFog(), C4DView::Menu4D::Menu4D(), and C4DView::resizeGL().
bool UI::ViewImpl::getHyperfog | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_hyperfog, and pImpl_.
Referenced by C4DView::Project().
const std::string & UI::ViewImpl::getImgDir | ( | ) | [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_imageDir, and pImpl_.
Referenced by C4DView::writeFrame().
const std::string & UI::ViewImpl::getImgPrefix | ( | ) | [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_imagePrefix, and pImpl_.
Referenced by C4DView::writeFrame().
bool UI::ViewImpl::getLighting | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_lighting, and pImpl_.
Referenced by C4DView::InitLight(), C4DView::Menu4D::Menu4D(), and C4DView::setLighting().
const std::vector< Light * > & UI::ViewImpl::getLights | ( | ) | [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_lights, and pImpl_.
bool UI::ViewImpl::getShading | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_shading, and pImpl_.
Referenced by C4DView::InitShade(), and C4DView::Menu4D::Menu4D().
bool UI::ViewImpl::getSolid | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_solid, and pImpl_.
Referenced by C4DView::initializeGL(), C4DView::Menu4D::Menu4D(), and C4DView::paintEvent().
bool UI::ViewImpl::getTransparence | ( | ) | const [virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_transparence, and pImpl_.
Referenced by C4DView::InitTransparence(), and C4DView::Menu4D::Menu4D().
bool UI::ViewImpl::getWriteImages | ( | ) | [protected, virtual] |
Implements UI::View.
References UI::ViewImpl::Impl::_writeImages, and pImpl_.
Referenced by C4DView::initializeGL(), C4DView::Menu4D::Menu4D(), and C4DView::writeFrame().
const VecMath::Rotation< 4 > & UI::ViewImpl::R | ( | ) | [protected, virtual] |
References UI::ViewImpl::Impl::_R, and pImpl_.
Referenced by C4DView::animate(), C4DView::Benchmark3D(), C4DView::checkAnglesForOverflow(), C4DView::OnAnimationTimer(), and C4DView::Transform().
double UI::ViewImpl::ScrW | ( | ) | const [protected] |
References UI::ViewImpl::Impl::_scrW, and pImpl_.
Referenced by C4DView::Project().
void UI::ViewImpl::setCamW | ( | const double & | _cw | ) | [protected] |
_cw | W coordinate of the camera |
References UI::ViewImpl::Impl::_camW, and pImpl_.
void UI::ViewImpl::setdR | ( | const VecMath::Rotation< 4 > & | _dr | ) | [virtual] |
Set the rotation step between frames for animations.
_dr | Rotation step between two frames of an animation |
Implements UI::View.
References UI::ViewImpl::Impl::_dR, and pImpl_.
Referenced by adddR(), C4DView::RandomAnimation(), and C4DView::StopAnimation().
void UI::ViewImpl::setImgDir | ( | const std::string & | s | ) | [virtual] |
Set the directory where to store image files.
s | Directory where to store image files |
Implements UI::View.
References UI::ViewImpl::Impl::_imageDir, pImpl_, and setWriteImages().
void UI::ViewImpl::setImgPrefix | ( | const std::string & | s | ) | [virtual] |
Set the prefix of image file names, before the frame number and the extension.
s | Filename prefix for saved images |
Implements UI::View.
References UI::ViewImpl::Impl::_imagePrefix, pImpl_, and setWriteImages().
void UI::ViewImpl::setR | ( | const VecMath::Rotation< 4 > & | _r | ) | [protected, virtual] |
_r | New rotation state |
References UI::ViewImpl::Impl::_R, and pImpl_.
Referenced by C4DView::Transform().
void UI::ViewImpl::setScrW | ( | const double & | _sw | ) | [protected] |
_sw | W coordinate of the screen to project onto |
References UI::ViewImpl::Impl::_scrW, and pImpl_.
void UI::ViewImpl::setSolid | ( | bool | on | ) | [virtual] |
Turn wireframe display on or off.
on | if true, displays wireframe model; else solid |
Implements UI::View.
References UI::ViewImpl::Impl::_solid, and pImpl_.
Referenced by C4DView::Menu4D::Menu4D().
void UI::ViewImpl::setT | ( | const VecMath::Vector< 4 > & | _t | ) | [protected, virtual] |
_t | New translation state |
References UI::ViewImpl::Impl::_T, and pImpl_.
Referenced by C4DView::Transform().
const VecMath::Vector< 4 > & UI::ViewImpl::T | ( | ) | [protected, virtual] |
References UI::ViewImpl::Impl::_T, and pImpl_.
Referenced by C4DView::OnAnimationTimer(), and C4DView::Transform().