Commit 85d0ed1b authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Removed the storage of a cgt::Camera in cgt::GLCanvas as it was weak design and not used anyway.

parent f8dc2e58
...@@ -28,7 +28,6 @@ ...@@ -28,7 +28,6 @@
#include "cgt/glcanvas.h" #include "cgt/glcanvas.h"
#include "cgt/glcontextmanager.h" #include "cgt/glcontextmanager.h"
#include "cgt/camera.h"
#include "cgt/painter.h" #include "cgt/painter.h"
#include <cstdlib> #include <cstdlib>
...@@ -50,7 +49,6 @@ GLCanvas::GLCanvas(const std::string& title, ...@@ -50,7 +49,6 @@ GLCanvas::GLCanvas(const std::string& title,
fullscreen_(false), fullscreen_(false),
autoFlush_(true), autoFlush_(true),
initialized_(false), initialized_(false),
camera_(0),
painter_(0) , painter_(0) ,
eventHandler_(new EventHandler()) eventHandler_(new EventHandler())
{} {}
...@@ -145,12 +143,4 @@ GLCanvas::Buffers GLCanvas::getBuffers() const { ...@@ -145,12 +143,4 @@ GLCanvas::Buffers GLCanvas::getBuffers() const {
return buffers_; return buffers_;
} }
void GLCanvas::setCamera(Camera* cam) {
camera_ = cam;
}
Camera* GLCanvas::getCamera() const {
return camera_;
}
} // namespace } // namespace
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
namespace cgt { namespace cgt {
class Camera;
class Painter; class Painter;
/** /**
...@@ -177,17 +176,6 @@ public: ...@@ -177,17 +176,6 @@ public:
/// Getter /// Getter
Buffers getBuffers() const; Buffers getBuffers() const;
/*
FIXME It is stupid to have the camera included in the GLCanvas
or the Painter. If you need the canvas in a Navigation or a class which
inherits from Painter, GLCanvas or what not include it there! (rl)
*/
/// Setter
void setCamera(Camera* cam);
/// Getter
Camera* getCamera() const;
/// Getter /// Getter
bool isDoubleBuffered() const { return doubleBuffered_; } bool isDoubleBuffered() const { return doubleBuffered_; }
...@@ -218,8 +206,6 @@ protected: ...@@ -218,8 +206,6 @@ protected:
bool autoFlush_; ///< whether to call glFlush or swap automatically bool autoFlush_; ///< whether to call glFlush or swap automatically
bool initialized_; // FIXME: does this make sense? bool initialized_; // FIXME: does this make sense?
Camera* camera_; ///< the camera is used to look around
Painter* painter_; ///< the painter that will be used for rendering Painter* painter_; ///< the painter that will be used for rendering
EventHandler* eventHandler_; ///< the eventHandler that will distribute incoming events to EventHandler* eventHandler_; ///< the eventHandler that will distribute incoming events to
......
...@@ -47,11 +47,4 @@ GLCanvas* Painter::getCanvas() const { ...@@ -47,11 +47,4 @@ GLCanvas* Painter::getCanvas() const {
return canvas_; return canvas_;
} }
Camera* Painter::getCamera() const {
if (canvas_)
return canvas_->getCamera();
else
return 0;
}
} // namespace cgt } // namespace cgt
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
namespace cgt { namespace cgt {
class GLCanvas; class GLCanvas;
class Camera;
/** /**
* Base class for all rendering on a canvas. Every canvas has a painter and use its * Base class for all rendering on a canvas. Every canvas has a painter and use its
...@@ -79,10 +78,6 @@ public: ...@@ -79,10 +78,6 @@ public:
/// Get the associated Canvas /// Get the associated Canvas
GLCanvas* getCanvas() const; GLCanvas* getCanvas() const;
/// A wrapper to get the camera from the Canvas
Camera* getCamera() const;
/** /**
* This is meant be overridden to do the according openGL paintings * This is meant be overridden to do the according openGL paintings
* is not meant to be called directly, will be called by repaint(). * is not meant to be called directly, will be called by repaint().
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment