Starting from 2021-07-01, all LRZ GitLab users will be required to explicitly accept the GitLab Terms of Service. Please see the detailed information at https://doku.lrz.de/display/PUBLIC/GitLab and make sure that your projects conform to the requirements.

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 @@
#include "cgt/glcanvas.h"
#include "cgt/glcontextmanager.h"
#include "cgt/camera.h"
#include "cgt/painter.h"
#include <cstdlib>
......@@ -50,7 +49,6 @@ GLCanvas::GLCanvas(const std::string& title,
fullscreen_(false),
autoFlush_(true),
initialized_(false),
camera_(0),
painter_(0) ,
eventHandler_(new EventHandler())
{}
......@@ -145,12 +143,4 @@ GLCanvas::Buffers GLCanvas::getBuffers() const {
return buffers_;
}
void GLCanvas::setCamera(Camera* cam) {
camera_ = cam;
}
Camera* GLCanvas::getCamera() const {
return camera_;
}
} // namespace
......@@ -41,7 +41,6 @@
namespace cgt {
class Camera;
class Painter;
/**
......@@ -177,17 +176,6 @@ public:
/// Getter
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
bool isDoubleBuffered() const { return doubleBuffered_; }
......@@ -218,8 +206,6 @@ protected:
bool autoFlush_; ///< whether to call glFlush or swap automatically
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
EventHandler* eventHandler_; ///< the eventHandler that will distribute incoming events to
......
......@@ -47,11 +47,4 @@ GLCanvas* Painter::getCanvas() const {
return canvas_;
}
Camera* Painter::getCamera() const {
if (canvas_)
return canvas_->getCamera();
else
return 0;
}
} // namespace cgt
......@@ -35,7 +35,6 @@
namespace cgt {
class GLCanvas;
class Camera;
/**
* Base class for all rendering on a canvas. Every canvas has a painter and use its
......@@ -79,10 +78,6 @@ public:
/// Get the associated Canvas
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
* 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