Omnidome
Fulldome Mapping Software Toolkit
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | Private Attributes
omni::canvas::Dome Class Reference

A basic dome canvas width a radius/diameter and offset. More...

#include <Dome.h>

Inheritance diagram for omni::canvas::Dome:
Inheritance graph
[legend]
Collaboration diagram for omni::canvas::Dome:
Collaboration graph
[legend]

Public Member Functions

 Dome ()
 
virtual ~Dome ()
 
qreal radius () const
 Return radius (10.0m by default) More...
 
void setRadius (qreal)
 Set radius in meter. More...
 
qreal diameter () const
 Return diameter in meter. More...
 
void setDiameter (qreal)
 Set diameter in meter. More...
 
Box bounds () const
 Return internally cached bounding box. More...
 
virtual void draw () const
 Draw dome sphere. More...
 
virtual void drawAux () const
 Draw auxiliary elements. More...
 
virtual void update ()
 Update dome mesh. More...
 
virtual void toPropertyMap (PropertyMap &) const
 Serialize to stream. More...
 
virtual void fromPropertyMap (PropertyMap const &)
 Deserialize from stream. More...
 
- Public Member Functions inherited from omni::canvas::Envelope
 Envelope ()
 
 ~Envelope ()
 
Box bounds () const
 Returns copy of cached bounding box. More...
 
- Public Member Functions inherited from omni::canvas::Interface
 Interface ()
 
virtual ~Interface ()
 Virtual destructor. More...
 
ViewMode viewMode () const
 Return current view mode. More...
 
void setViewMode (ViewMode _viewMode)
 Set view mode. More...
 
void drawWithViewMode () const
 Draws with culled front or back faces, depending on view mode. More...
 
virtual QVector3D center () const
 Spectator's center of canvas (center of bounding box by default) More...
 
AffineTransform const & transform () const
 Return const ref to affine transform. More...
 
AffineTransform & transform ()
 Return ref to affine transform. More...
 
void setTransform (AffineTransform const &_transform)
 Set new affine transform. More...
 
visual::Scene const * scene () const
 The scene this canvas belongs to. More...
 
void setScene (visual::Scene const *)
 Set the scene this canvas belongs to. Is set automatically when a canvas is added to a session. More...
 
virtual QMatrix4x4 matrix () const
 Transformation matrix for canvas. More...
 
virtual ui::CanvasParameterswidget ()=0
 Returns pointer to new parameter widget. More...
 
- Public Member Functions inherited from omni::TypeIdInterface
virtual ~TypeIdInterface ()
 
virtual Id getTypeId () const =0
 Returns type id of object. More...
 
virtual void registerInFactory () const =0
 Register the inherited class in factory. More...
 

Protected Attributes

visual::Sphere sphere_
 Sphere visualizer. More...
 
- Protected Attributes inherited from omni::canvas::Envelope
omni::Box bounds_
 Protected bounding box member. More...
 
- Protected Attributes inherited from omni::canvas::Interface
bool needsUpdate_ = true
 

Private Attributes

QVector3D center_
 

Additional Inherited Members

- Public Types inherited from omni::canvas::Interface
enum  ViewMode { ViewMode::INSIDE, ViewMode::OUTSIDE, ViewMode::BOTH }
 
- Static Protected Member Functions inherited from omni::visual::Interface
static void vertex3 (QVector3D const &)
 glVertex3f from QVector3D More...
 
static void visualLine (QVector3D const &_from, QVector3D const &_to)
 Draws a line. More...
 
static void color (QColor _color, float _alpha=1.0)
 glColor4f from QColor More...
 

Detailed Description

A basic dome canvas width a radius/diameter and offset.

Constructor & Destructor Documentation

omni::canvas::Dome::Dome ( )
26  : center_(0.0, 0.0, 0.0)
27  {
28  update();
29  }
virtual void update()
Update dome mesh.
Definition: Dome.cpp:71
QVector3D center_
Definition: Dome.h:71
omni::canvas::Dome::~Dome ( )
virtual
32  {}

Member Function Documentation

Box omni::canvas::Dome::bounds ( ) const
virtual

Return internally cached bounding box.

Implements omni::canvas::Interface.

67  {
68  return bounds_;
69  }
omni::Box bounds_
Protected bounding box member.
Definition: Envelope.h:43
qreal omni::canvas::Dome::diameter ( ) const

Return diameter in meter.

57  {
58  return radius() * 2.0;
59  }
qreal radius() const
Return radius (10.0m by default)
Definition: Dome.cpp:44
void omni::canvas::Dome::draw ( ) const
virtual

Draw dome sphere.

Reimplemented from omni::canvas::Envelope.

35  {
37 
38  this->sphere_.draw();
39  }
visual::Sphere sphere_
Sphere visualizer.
Definition: Dome.h:68
void draw() const
Draws sphere from vertex buffer object.
Definition: Sphere.cpp:98
virtual void draw() const
Draw envelope.
Definition: Envelope.cpp:36
void omni::canvas::Dome::drawAux ( ) const
virtual

Draw auxiliary elements.

Reimplemented from omni::canvas::Interface.

42  {}
void omni::canvas::Dome::fromPropertyMap ( PropertyMap const &  _map)
virtual

Deserialize from stream.

Reimplemented from omni::canvas::Interface.

88  {
90  qreal _radius = _map.getValue<qreal>("radius", qreal(5.0));
91  setRadius(_radius);
92  }
virtual void fromPropertyMap(PropertyMap const &)
Read mapping from stream.
Definition: Interface.cpp:108
void setRadius(qreal)
Set radius in meter.
Definition: Dome.cpp:49
qreal omni::canvas::Dome::radius ( ) const
virtual

Return radius (10.0m by default)

Reimplemented from omni::canvas::Interface.

45  {
46  return sphere_.radius();
47  }
qreal radius() const
Return radius of sphere.
Definition: Sphere.cpp:36
visual::Sphere sphere_
Sphere visualizer.
Definition: Dome.h:68
void omni::canvas::Dome::setDiameter ( qreal  _diameter)

Set diameter in meter.

62  {
63  setRadius(_diameter * 0.5);
64  }
void setRadius(qreal)
Set radius in meter.
Definition: Dome.cpp:49
void omni::canvas::Dome::setRadius ( qreal  _radius)

Set radius in meter.

50  {
51  sphere_.setRadius(_radius);
52  needsUpdate_ = true;
53  update();
54  }
virtual void update()
Update dome mesh.
Definition: Dome.cpp:71
void setRadius(qreal)
Set new sphere radius.
Definition: Sphere.cpp:41
visual::Sphere sphere_
Sphere visualizer.
Definition: Dome.h:68
bool needsUpdate_
Definition: Interface.h:115
void omni::canvas::Dome::toPropertyMap ( PropertyMap &  _map) const
virtual

Serialize to stream.

Reimplemented from omni::canvas::Interface.

82  {
84  _map("radius", radius());
85  }
qreal radius() const
Return radius (10.0m by default)
Definition: Dome.cpp:44
virtual void toPropertyMap(PropertyMap &) const
Write mapping to stream.
Definition: Interface.cpp:103
void omni::canvas::Dome::update ( )
virtual

Update dome mesh.

Reimplemented from omni::visual::Interface.

72  {
73  if (!this->needsUpdate_) return;
74 
75  auto _r = radius();
76  QVector3D _vr(_r, _r, _r);
77  this->bounds_ = Box(-_vr + center_, _vr + center_);
78  sphere_.update();
79  }
qreal radius() const
Return radius (10.0m by default)
Definition: Dome.cpp:44
omni::Box bounds_
Protected bounding box member.
Definition: Envelope.h:43
visual::Sphere sphere_
Sphere visualizer.
Definition: Dome.h:68
QVector3D center_
Definition: Dome.h:71
void update()
Regenerates the mesh and updates the vertex buffer objects.
Definition: Sphere.cpp:110
bool needsUpdate_
Definition: Interface.h:115

Field Documentation

QVector3D omni::canvas::Dome::center_
private
visual::Sphere omni::canvas::Dome::sphere_
protected

Sphere visualizer.


The documentation for this class was generated from the following files: