HyperspaceExplorer 0.7.1
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes | Static Private Attributes
UI::ViewImpl Class Reference

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

#include <ViewImpl.h>

Inheritance diagram for UI::ViewImpl:
Inheritance graph
[legend]
Collaboration diagram for UI::ViewImpl:
Collaboration graph
[legend]

List of all members.

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::stringgetImgDir ()
virtual void setImgDir (const std::string &)
 Set the directory where to store image files.
virtual const std::stringgetImgPrefix ()
virtual void setImgPrefix (const std::string &)
 Set the prefix of image file names, before the frame number and the extension.
virtual const ColorgetBackground ()
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 LightSourcegetDefaultLightSource ()
static const LightSourcegetFlatLightSource ()

Private Attributes

ImplpImpl_
 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.

Detailed Description

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:


Member Function Documentation

void UI::ViewImpl::adddR ( const VecMath::Rotation< 4 > &  ddR) [protected, virtual]

Add a Rotation to the current rotation speed.

Parameters:
ddRRotation to be added to the current Rotation state

Make sure temporary is not optimized away

References getdR(), and setdR().

Here is the call graph for this function:

void UI::ViewImpl::addLight ( Light l) [virtual]

Add a light source to the scene.

Parameters:
lLight source added to the scene

Implements UI::View.

References UI::ViewImpl::Impl::_lights, pImpl_, and std::vector< _Tp, _Alloc >::push_back().

Here is the call graph for this function:

void UI::ViewImpl::addT ( const VecMath::Vector< 4 > &  _dT) [protected, virtual]

Add a Translation to the current translation state.

Parameters:
_dTDelta t

References UI::ViewImpl::Impl::_T, and pImpl_.

double UI::ViewImpl::CamW ( ) const [protected]
Returns:
W coordinate of the camera

References UI::ViewImpl::Impl::_camW, and pImpl_.

Referenced by C4DView::Project().

Here is the caller graph for this function:

const std::shared_ptr< Displayable > & UI::ViewImpl::F ( ) const [virtual]
const Color & UI::ViewImpl::getBackground ( ) [virtual]
Returns:
The background color

Implements UI::View.

References UI::ViewImpl::Impl::_background, and pImpl_.

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

Implements UI::View.

References UI::ViewImpl::Impl::_colors, and pImpl_.

Referenced by C4DView::Menu4D::Menu4D().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_coordinates, and pImpl_.

Referenced by C4DView::Menu4D::Menu4D(), C4DView::PreRedraw(), C4DView::Project(), and C4DView::RenderScene().

Here is the caller graph for this function:

const LightSource & UI::ViewImpl::getDefaultLightSource ( ) [static, protected]
Returns:
Point LightSource with sensible defaults for good light

References _defaultLightSource.

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

Implements UI::View.

References UI::ViewImpl::Impl::_dR, and pImpl_.

Referenced by adddR(), C4DView::animate(), C4DView::OnAnimationTimer(), and C4DView::StartAnimation().

Here is the caller graph for this function:

const LightSource & UI::ViewImpl::getFlatLightSource ( ) [static, protected]
Returns:
LightSource for flat, all-ambient lighting

References _flatLightSource.

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

Implements UI::View.

References UI::ViewImpl::Impl::_fog, and pImpl_.

Referenced by C4DView::InitFog(), C4DView::Menu4D::Menu4D(), and C4DView::resizeGL().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_hyperfog, and pImpl_.

Referenced by C4DView::Project().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_imageDir, and pImpl_.

Referenced by C4DView::writeFrame().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_imagePrefix, and pImpl_.

Referenced by C4DView::writeFrame().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_lighting, and pImpl_.

Referenced by C4DView::InitLight(), C4DView::Menu4D::Menu4D(), and C4DView::setLighting().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_lights, and pImpl_.

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

Implements UI::View.

References UI::ViewImpl::Impl::_shading, and pImpl_.

Referenced by C4DView::InitShade(), and C4DView::Menu4D::Menu4D().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_solid, and pImpl_.

Referenced by C4DView::initializeGL(), C4DView::Menu4D::Menu4D(), and C4DView::paintEvent().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_transparence, and pImpl_.

Referenced by C4DView::InitTransparence(), and C4DView::Menu4D::Menu4D().

Here is the caller graph for this function:

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

Implements UI::View.

References UI::ViewImpl::Impl::_writeImages, and pImpl_.

Referenced by C4DView::initializeGL(), C4DView::Menu4D::Menu4D(), and C4DView::writeFrame().

Here is the caller graph for this function:

const VecMath::Rotation< 4 > & UI::ViewImpl::R ( ) [protected, virtual]
Returns:
Current rotation state

References UI::ViewImpl::Impl::_R, and pImpl_.

Referenced by C4DView::animate(), C4DView::Benchmark3D(), C4DView::checkAnglesForOverflow(), C4DView::OnAnimationTimer(), and C4DView::Transform().

Here is the caller graph for this function:

double UI::ViewImpl::ScrW ( ) const [protected]
Returns:
W coordinate of the screen to project onto

References UI::ViewImpl::Impl::_scrW, and pImpl_.

Referenced by C4DView::Project().

Here is the caller graph for this function:

void UI::ViewImpl::setCamW ( const double &  _cw) [protected]
Parameters:
_cwW 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.

Parameters:
_drRotation 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().

Here is the caller graph for this function:

void UI::ViewImpl::setImgDir ( const std::string s) [virtual]

Set the directory where to store image files.

Parameters:
sDirectory where to store image files

Implements UI::View.

References UI::ViewImpl::Impl::_imageDir, pImpl_, and setWriteImages().

Here is the call graph for this function:

void UI::ViewImpl::setImgPrefix ( const std::string s) [virtual]

Set the prefix of image file names, before the frame number and the extension.

Parameters:
sFilename prefix for saved images

Implements UI::View.

References UI::ViewImpl::Impl::_imagePrefix, pImpl_, and setWriteImages().

Here is the call graph for this function:

void UI::ViewImpl::setR ( const VecMath::Rotation< 4 > &  _r) [protected, virtual]
Parameters:
_rNew rotation state

References UI::ViewImpl::Impl::_R, and pImpl_.

Referenced by C4DView::Transform().

Here is the caller graph for this function:

void UI::ViewImpl::setScrW ( const double &  _sw) [protected]
Parameters:
_swW 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.

Parameters:
onif true, displays wireframe model; else solid

Implements UI::View.

References UI::ViewImpl::Impl::_solid, and pImpl_.

Referenced by C4DView::Menu4D::Menu4D().

Here is the caller graph for this function:

void UI::ViewImpl::setT ( const VecMath::Vector< 4 > &  _t) [protected, virtual]
Parameters:
_tNew translation state

References UI::ViewImpl::Impl::_T, and pImpl_.

Referenced by C4DView::Transform().

Here is the caller graph for this function:

const VecMath::Vector< 4 > & UI::ViewImpl::T ( ) [protected, virtual]
Returns:
Current translation state

References UI::ViewImpl::Impl::_T, and pImpl_.

Referenced by C4DView::OnAnimationTimer(), and C4DView::Transform().

Here is the caller 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:19 for HyperspaceExplorer 0.7.1 by doxygen 1.7.4  -  Hosted bySourceForge.net Logo