Commit 4826c14b authored by Jakob Weiss's avatar Jakob Weiss

Fixed a truckload of warnings

- Lots of missing override definitions
- some virtual overloaded function hiding warnings
- class initializer list order
parent fd0884e8
...@@ -313,7 +313,7 @@ namespace campvis { ...@@ -313,7 +313,7 @@ namespace campvis {
lookupTexelFloat /= (ratioRatio > 1) ? cgt::vec2(1.f, 1.f / ratioRatio) : cgt::vec2(ratioRatio, 1.f); lookupTexelFloat /= (ratioRatio > 1) ? cgt::vec2(1.f, 1.f / ratioRatio) : cgt::vec2(ratioRatio, 1.f);
cgt::svec3 lookupTexel(lookupTexelFloat.x, imageSize.y - lookupTexelFloat.y, 0); cgt::svec3 lookupTexel(lookupTexelFloat.x, imageSize.y - lookupTexelFloat.y, 0);
if (lookupTexel.x >= 0 && lookupTexel.y >= 0 && lookupTexel.x < imageSize.x && lookupTexel.y < imageSize.y) { if (lookupTexel.x < imageSize.x && lookupTexel.y < imageSize.y) {
if (tex->isDepthTexture()) { if (tex->isDepthTexture()) {
emit s_depthChanged(lookupTexel, localRep->getElementNormalized(lookupTexel, 0)); emit s_depthChanged(lookupTexel, localRep->getElementNormalized(lookupTexel, 0));
} }
......
...@@ -34,9 +34,11 @@ namespace campvis { ...@@ -34,9 +34,11 @@ namespace campvis {
: QWidget(parent) : QWidget(parent)
, _property(property) , _property(property)
, _dataContainer(dataContainer) , _dataContainer(dataContainer)
, _layout(nullptr)
, _groupBox(nullptr) , _groupBox(nullptr)
, _groupBoxInner(nullptr) , _groupBoxInner(nullptr)
, _ignorePropertyUpdates(false)
, _layout(nullptr)
, _titleLabel(nullptr)
{ {
_ignorePropertyUpdates = 0; _ignorePropertyUpdates = 0;
......
...@@ -55,7 +55,7 @@ namespace campvis { ...@@ -55,7 +55,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private slots: private slots:
void onStateChanged(int value); void onStateChanged(int value);
......
...@@ -56,7 +56,7 @@ namespace campvis { ...@@ -56,7 +56,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
protected slots: protected slots:
void onButtonClicked(bool); void onButtonClicked(bool);
......
...@@ -60,7 +60,7 @@ namespace campvis { ...@@ -60,7 +60,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private slots: private slots:
/// Slot getting called when the adjuster's value changes /// Slot getting called when the adjuster's value changes
......
...@@ -62,7 +62,7 @@ namespace campvis { ...@@ -62,7 +62,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
void onDataAdded(std::string key, DataHandle dh); void onDataAdded(std::string key, DataHandle dh);
......
...@@ -54,7 +54,7 @@ namespace campvis { ...@@ -54,7 +54,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private slots: private slots:
/// Slot getting called when the adjuster's value changes /// Slot getting called when the adjuster's value changes
...@@ -131,7 +131,7 @@ namespace campvis { ...@@ -131,7 +131,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
void onValueChangedImpl(); void onValueChangedImpl();
......
...@@ -70,13 +70,13 @@ namespace campvis { ...@@ -70,13 +70,13 @@ namespace campvis {
/** /**
* Schedule a repaint job for the editor's render target * Schedule a repaint job for the editor's render target
*/ */
virtual void repaint(); virtual void repaint() override;
/// \see cgt::Painter::sizeChanged /// \see cgt::Painter::sizeChanged
virtual void sizeChanged(const cgt::ivec2&); virtual void sizeChanged(const cgt::ivec2&) override;
/// \see cgt::EventListener::mousePressEvent /// \see cgt::EventListener::mousePressEvent
virtual void mousePressEvent(cgt::MouseEvent* e); virtual void mousePressEvent(cgt::MouseEvent* e) override;
/** /**
* Slot to be called when the geometry vector of the transfer function has changed. * Slot to be called when the geometry vector of the transfer function has changed.
...@@ -141,12 +141,12 @@ namespace campvis { ...@@ -141,12 +141,12 @@ namespace campvis {
/** /**
* Performs the painting. * Performs the painting.
*/ */
virtual void paint(); virtual void paint() override;
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
/** /**
* Updates the GeometryManipulator vector. * Updates the GeometryManipulator vector.
......
...@@ -69,13 +69,13 @@ namespace campvis { ...@@ -69,13 +69,13 @@ namespace campvis {
/** /**
* Schedule a repaint job for the editor's render target * Schedule a repaint job for the editor's render target
*/ */
virtual void repaint(); virtual void repaint() override;
/// \see cgt::Painter::sizeChanged /// \see cgt::Painter::sizeChanged
virtual void sizeChanged(const cgt::ivec2&); virtual void sizeChanged(const cgt::ivec2&) override;
/// \see cgt::EventListener::mousePressEvent /// \see cgt::EventListener::mousePressEvent
virtual void mousePressEvent(cgt::MouseEvent* e); virtual void mousePressEvent(cgt::MouseEvent* e) override;
/** /**
* Slot to be called when the geometry vector of the transfer function has changed. * Slot to be called when the geometry vector of the transfer function has changed.
...@@ -113,12 +113,12 @@ namespace campvis { ...@@ -113,12 +113,12 @@ namespace campvis {
/** /**
* Performs the painting. * Performs the painting.
*/ */
virtual void paint(); virtual void paint() override;
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
/** /**
* Updates the GeometryManipulator vector. * Updates the GeometryManipulator vector.
......
...@@ -58,7 +58,7 @@ namespace campvis { ...@@ -58,7 +58,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private slots: private slots:
void onValueChanged(int value); void onValueChanged(int value);
...@@ -137,7 +137,7 @@ namespace campvis { ...@@ -137,7 +137,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
void onValueChangedImpl(); void onValueChangedImpl();
......
...@@ -60,7 +60,7 @@ namespace campvis { ...@@ -60,7 +60,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
protected slots: protected slots:
/// \see AbstractPropertyWidget::onGroupBoxToggled /// \see AbstractPropertyWidget::onGroupBoxToggled
......
...@@ -59,7 +59,7 @@ namespace campvis { ...@@ -59,7 +59,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private slots: private slots:
void onComboBoxIndexChanged(int value); void onComboBoxIndexChanged(int value);
......
...@@ -61,7 +61,7 @@ namespace campvis { ...@@ -61,7 +61,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private slots: private slots:
void onLeftColorChanged(const QColor& color); void onLeftColorChanged(const QColor& color);
......
...@@ -55,7 +55,7 @@ namespace campvis { ...@@ -55,7 +55,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private: private:
static const char* baseStyle; static const char* baseStyle;
......
...@@ -60,7 +60,7 @@ namespace campvis { ...@@ -60,7 +60,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
private slots: private slots:
void onTextChanged(const QString& text); void onTextChanged(const QString& text);
......
...@@ -64,7 +64,7 @@ namespace campvis { ...@@ -64,7 +64,7 @@ namespace campvis {
/** /**
* Gets called when the property has changed, so that widget can update its state. * Gets called when the property has changed, so that widget can update its state.
*/ */
virtual void updateWidgetFromProperty(); virtual void updateWidgetFromProperty() override;
/** /**
* Slot to be called from property when the property's flag whether to auto fit the TF window has changed. * Slot to be called from property when the property's flag whether to auto fit the TF window has changed.
......
...@@ -178,7 +178,7 @@ IF(WIN32) ...@@ -178,7 +178,7 @@ IF(WIN32)
ELSEIF(UNIX) ELSEIF(UNIX)
LIST(APPEND CampvisGlobalDefinitions "-DUNIX") LIST(APPEND CampvisGlobalDefinitions "-DUNIX")
LIST(APPEND CampvisGlobalDefinitions "-Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas") LIST(APPEND CampvisGlobalDefinitions "-Wall -Wno-unused-local-typedefs -Wno-unused-variable -Wno-unknown-pragmas -Wno-overloaded-virtual")
LIST(APPEND CampvisGlobalDefinitions "-D__STDC_CONSTANT_MACROS") LIST(APPEND CampvisGlobalDefinitions "-D__STDC_CONSTANT_MACROS")
# dangerous! # dangerous!
......
...@@ -44,12 +44,12 @@ namespace campvis { ...@@ -44,12 +44,12 @@ namespace campvis {
: HasPropertyCollection() : HasPropertyCollection()
, cgt::EventHandler() , cgt::EventHandler()
, cgt::EventListener() , cgt::EventListener()
, p_showFullscreen("ShowFullscreen", "Show Fullscreen", false)
, _dataContainer(&dc) , _dataContainer(&dc)
, _canvas(0) , _canvas(0)
, _canvasSize("CanvasSize", "Canvas Size", cgt::ivec2(128, 128), cgt::ivec2(1, 1), cgt::ivec2(4096, 4096)) , _canvasSize("CanvasSize", "Canvas Size", cgt::ivec2(128, 128), cgt::ivec2(1, 1), cgt::ivec2(4096, 4096))
, _ignoreCanvasSizeUpdate(false) , _ignoreCanvasSizeUpdate(false)
, _renderTargetID("renderTargetID", "Render Target ID", "AbstractPipeline.renderTarget", DataNameProperty::READ) , _renderTargetID("renderTargetID", "Render Target ID", "AbstractPipeline.renderTarget", DataNameProperty::READ)
, p_showFullscreen("ShowFullscreen", "Show Fullscreen", false)
{ {
cgtAssert(_dataContainer != nullptr, "Pointer to the DataContainer for this pipeline must not be 0!"); cgtAssert(_dataContainer != nullptr, "Pointer to the DataContainer for this pipeline must not be 0!");
......
...@@ -395,7 +395,7 @@ namespace campvis { ...@@ -395,7 +395,7 @@ namespace campvis {
* Slot getting called when one of the observed properties changed and notifies its observers. * Slot getting called when one of the observed properties changed and notifies its observers.
* \param prop Property that emitted the signal * \param prop Property that emitted the signal
*/ */
virtual void onPropertyChanged(const AbstractProperty* prop); virtual void onPropertyChanged(const AbstractProperty* prop) override;
tbb::atomic<bool> _enabled; ///< flag whether this processor is currently enabled tbb::atomic<bool> _enabled; ///< flag whether this processor is currently enabled
tbb::atomic<bool> _clockExecutionTime; ///< flag whether to measure the execution time of this processor tbb::atomic<bool> _clockExecutionTime; ///< flag whether to measure the execution time of this processor
......
...@@ -95,7 +95,7 @@ namespace campvis { ...@@ -95,7 +95,7 @@ namespace campvis {
* \param name Name of the added data. * \param name Name of the added data.
* \param dh DataHandle to the newly added data. * \param dh DataHandle to the newly added data.
*/ */
virtual void onDataContainerDataAdded(std::string name, DataHandle dh); virtual void onDataContainerDataAdded(std::string name, DataHandle dh) override;
/** /**
* Callback when a property was added to one of the PropertyCollections. * Callback when a property was added to one of the PropertyCollections.
......
...@@ -55,15 +55,15 @@ namespace campvis { ...@@ -55,15 +55,15 @@ namespace campvis {
/** /**
* Schedule a repaint job for the pipeline's render target * Schedule a repaint job for the pipeline's render target
*/ */
virtual void repaint(); virtual void repaint() override;
/// \see cgt::Painter::sizeChanged /// \see cgt::Painter::sizeChanged
virtual void sizeChanged(const cgt::ivec2& size); virtual void sizeChanged(const cgt::ivec2& size) override;
/** /**
* Initializes the painter, i.e. loads the OpenGL shader. * Initializes the painter, i.e. loads the OpenGL shader.
*/ */
virtual void init(); virtual void init() override;
/** /**
* Deinitializes the painter, i.e. disposes its shader. * Deinitializes the painter, i.e. disposes its shader.
...@@ -83,7 +83,7 @@ namespace campvis { ...@@ -83,7 +83,7 @@ namespace campvis {
/** /**
* Performs the actual rendering of the pipeline's render target * Performs the actual rendering of the pipeline's render target
*/ */
virtual void paint(); virtual void paint() override;
static const std::string loggerCat_; static const std::string loggerCat_;
......
...@@ -83,7 +83,7 @@ namespace campvis { ...@@ -83,7 +83,7 @@ namespace campvis {
cgt::Texture* tex = nullptr; cgt::Texture* tex = nullptr;
if (renderData) { if (renderData) {
// check if we can get a GL representation of the desired texture // check if we can get a GL representation of the desired texture
ImageRepresentationGL* glRep; ImageRepresentationGL* glRep = nullptr;
if (attachment == GL_DEPTH_ATTACHMENT) { if (attachment == GL_DEPTH_ATTACHMENT) {
if(auto id = (*renderData)->getDepthTexture()) if(auto id = (*renderData)->getDepthTexture())
glRep = const_cast<ImageRepresentationGL*>(id->getRepresentation<ImageRepresentationGL>(false)); glRep = const_cast<ImageRepresentationGL*>(id->getRepresentation<ImageRepresentationGL>(false));
......
...@@ -64,8 +64,8 @@ namespace campvis { ...@@ -64,8 +64,8 @@ namespace campvis {
* \param vp This Visualization processor (usually pointer to this). * \param vp This Visualization processor (usually pointer to this).
*/ */
explicit FramebufferActivationGuard(VisualizationProcessor* vp) explicit FramebufferActivationGuard(VisualizationProcessor* vp)
: _parentProcessor(vp) : //_parentProcessor(vp)
, _fbo(vp->_fbo) _fbo(vp->_fbo)
{ {
cgtAssert(_fbo != nullptr, "FBO must not be 0."); cgtAssert(_fbo != nullptr, "FBO must not be 0.");
cgtAssert(_fbo->getId() != 0, "The FBO's OpenGL ID is 0, this is wrong."); cgtAssert(_fbo->getId() != 0, "The FBO's OpenGL ID is 0, this is wrong.");
...@@ -85,7 +85,7 @@ namespace campvis { ...@@ -85,7 +85,7 @@ namespace campvis {
private: private:
VisualizationProcessor* _parentProcessor; //VisualizationProcessor* _parentProcessor;
cgt::FramebufferObject* _fbo; cgt::FramebufferObject* _fbo;
}; };
......
...@@ -28,12 +28,6 @@ ...@@ -28,12 +28,6 @@
#include "gltextureformattraits.h" #include "gltextureformattraits.h"
#pragma once
#include <GL/glew.h>
#include <string>
namespace cgt { namespace cgt {
#define defFormat(INTERNAL_FORMAT, BPP, CHANNELS, PIXEL_FORMAT, PIXEL_DATA_TYPE, GLSL_FORMAT_QUALIFIER) \ #define defFormat(INTERNAL_FORMAT, BPP, CHANNELS, PIXEL_FORMAT, PIXEL_DATA_TYPE, GLSL_FORMAT_QUALIFIER) \
......
...@@ -58,8 +58,8 @@ public: ...@@ -58,8 +58,8 @@ public:
/// Constructor for known formats /// Constructor for known formats
constexpr GLTextureFormatTraits(GLint internalFormat__, const char* internalFormatName__, int bpp__, int channels__, GLint pixelFormat__, GLint pixelDataType__, const char* glslFormatQualifier__) constexpr GLTextureFormatTraits(GLint internalFormat__, const char* internalFormatName__, int bpp__, int channels__, GLint pixelFormat__, GLint pixelDataType__, const char* glslFormatQualifier__)
: internalFormatName_{ internalFormatName__ } : known_{ true }
, known_{ true } , internalFormatName_{ internalFormatName__ }
, bpp_{ bpp__ } , bpp_{ bpp__ }
, channels_{ channels__ } , channels_{ channels__ }
, internalFormat_{ internalFormat__ } , internalFormat_{ internalFormat__ }
......
...@@ -79,7 +79,7 @@ public: ...@@ -79,7 +79,7 @@ public:
* Called by the Qt framework once at the beginning, before rendering starts. * Called by the Qt framework once at the beginning, before rendering starts.
* This function calls the corresponding GLCanvas method \a initialize. * This function calls the corresponding GLCanvas method \a initialize.
*/ */
virtual void initializeGL(); virtual void initializeGL() override;
/** /**
* This is called by the Qt framework every time the canvas is resized. * This is called by the Qt framework every time the canvas is resized.
...@@ -88,7 +88,7 @@ public: ...@@ -88,7 +88,7 @@ public:
* @param w The new width of the canvas. * @param w The new width of the canvas.
* @param h The new height of the canvas. * @param h The new height of the canvas.
*/ */
virtual void resizeGL(int w, int h); virtual void resizeGL(int w, int h) override;
/* /*
* Return the recommended size for the canvas. * Return the recommended size for the canvas.
...@@ -96,49 +96,49 @@ public: ...@@ -96,49 +96,49 @@ public:
* This method is called by Qt to determine how much space to allocate to display the canvas. * This method is called by Qt to determine how much space to allocate to display the canvas.
* The returned size is the same as reported by getSize(). * The returned size is the same as reported by getSize().
*/ */
virtual QSize sizeHint() const; virtual QSize sizeHint() const override;
virtual void setSize(ivec2 newSize); virtual void setSize(ivec2 newSize) override;
/** /**
* Called by Qt if there is a paint event; it uses the \a painter_ to paint() something. * Called by Qt if there is a paint event; it uses the \a painter_ to paint() something.
*/ */
virtual void paintGL(); virtual void paintGL() override;
/** /**
* If you manually want to cause a paint-event, use this function. It will call paintGL() * If you manually want to cause a paint-event, use this function. It will call paintGL()
* via updateGL(). This will cause immediate repainting. * via updateGL(). This will cause immediate repainting.
*/ */
virtual void repaint(); virtual void repaint() override;
/** /**
* If you manually want to cause a paint-event, use this function. It will call QWidget::update() * If you manually want to cause a paint-event, use this function. It will call QWidget::update()
* and repaint when entering main loop next time. * and repaint when entering main loop next time.
*/ */
virtual void update(); virtual void update() override;
/// Acqures this canvas as current context /// Acqures this canvas as current context
virtual void acquireAsCurrentContext(); virtual void acquireAsCurrentContext() override;
/// Releases this canvas as current context /// Releases this canvas as current context
virtual void releaseAsCurrentContext(); virtual void releaseAsCurrentContext() override;
/// swap buffers /// swap buffers
virtual void swap(); virtual void swap() override;
virtual void toggleFullScreen(); virtual void toggleFullScreen() override;
virtual void enterEvent(QEvent* e); virtual void enterEvent(QEvent* e) override;
virtual void leaveEvent(QEvent* e); virtual void leaveEvent(QEvent* e) override;
virtual void mousePressEvent(QMouseEvent* e); virtual void mousePressEvent(QMouseEvent* e) override;
virtual void mouseReleaseEvent (QMouseEvent* e); virtual void mouseReleaseEvent (QMouseEvent* e) override;
virtual void mouseMoveEvent(QMouseEvent* e); virtual void mouseMoveEvent(QMouseEvent* e) override;
virtual void mouseDoubleClickEvent(QMouseEvent* e); virtual void mouseDoubleClickEvent(QMouseEvent* e) override;
virtual void wheelEvent(QWheelEvent* e); virtual void wheelEvent(QWheelEvent* e) override;
virtual void timerEvent(QTimerEvent* e); virtual void timerEvent(QTimerEvent* e) override;