The name of the initial branch for new projects is now "main" instead of "master". Existing projects remain unchanged. More information: https://doku.lrz.de/display/PUBLIC/GitLab

Commit 1a7539f2 authored by Christian Schulte zu Berge's avatar Christian Schulte zu Berge
Browse files

Issue #44: Declared all constructors as explicit where applicable.

parent 81b17c8e
......@@ -66,7 +66,7 @@ namespace campvis {
* Creates a new DataContainerInspectorCanvas.
* \param parent Parent Qt widget, may be 0 (default)
*/
DataContainerInspectorCanvas(QWidget* parent = 0);
explicit DataContainerInspectorCanvas(QWidget* parent = 0);
/**
* Destructor.
......
......@@ -71,7 +71,7 @@ namespace campvis {
* Creates a new DataContainerInspectorWidget.
* \param parent Parent Qt widget, may be 0 (default)
*/
DataContainerInspectorWidget(QWidget* parent = 0);
explicit DataContainerInspectorWidget(QWidget* parent = 0);
/**
* Destructor.
......
......@@ -49,7 +49,7 @@ namespace campvis {
*/
class DataContainerTreeRootItem : public TreeItem {
public:
DataContainerTreeRootItem(TreeItem* parent = 0);
explicit DataContainerTreeRootItem(TreeItem* parent = 0);
virtual ~DataContainerTreeRootItem();
/// \see TreeItem::getData()
......@@ -98,7 +98,7 @@ namespace campvis {
Q_OBJECT
public:
DataContainerTreeModel(QObject *parent = 0);
explicit DataContainerTreeModel(QObject *parent = 0);
~DataContainerTreeModel();
void setData(const DataContainer* dataContainer);
......@@ -147,7 +147,7 @@ namespace campvis {
* Creates a new DataContainerTreeWidget.
* \param parent Parent widget
*/
DataContainerTreeWidget(QWidget* parent = 0);
explicit DataContainerTreeWidget(QWidget* parent = 0);
/**
* Destructor
......
......@@ -48,7 +48,7 @@ namespace campvis {
*
* \param parent the QTextEdit to install the LogHighlighter on
*/
LogHighlighter(QTextEdit* parent);
explicit LogHighlighter(QTextEdit* parent);
/**
* Destructor.
......
......@@ -58,7 +58,7 @@ namespace campvis {
* Creates a new DataContainerInspectorWidget.
* \param parent Parent Qt widget, may be 0 (default)
*/
LogViewerWidget(QWidget* parent = 0);
explicit LogViewerWidget(QWidget* parent = 0);
/**
* Destructor.
......
......@@ -62,7 +62,7 @@ namespace campvis {
* Creates a new TumVis Main window for \a application.
* \param application CampVisApplication to create a GUI for.
*/
MainWindow(CampVisApplication* application);
explicit MainWindow(CampVisApplication* application);
/**
* Destructor, make sure to call before destroying the application
......
......@@ -54,7 +54,7 @@ namespace campvis {
* \param parent the window's parent
* \param flags options customizing the frame of the subwindow
*/
PipelineMdiSubWindow(QWidget* parent = 0, Qt::WindowFlags flags = 0);
explicit PipelineMdiSubWindow(QWidget* parent = 0, Qt::WindowFlags flags = 0);
/**
* Cancel the dragging of the window.
......
......@@ -49,7 +49,7 @@ namespace campvis {
*/
class PipelineTreeRootItem : public TreeItem {
public:
PipelineTreeRootItem(TreeItem* parent = 0);
explicit PipelineTreeRootItem(TreeItem* parent = 0);
virtual ~PipelineTreeRootItem();
/// \see TreeItem::getData()
......@@ -101,7 +101,7 @@ namespace campvis {
Q_OBJECT
public:
PipelineTreeModel(QObject *parent = 0);
explicit PipelineTreeModel(QObject *parent = 0);
~PipelineTreeModel();
void setData(const std::vector<AbstractPipeline*>& pipelines);
......@@ -141,7 +141,7 @@ namespace campvis {
* Creates a new PipelineTreeWidget.
* \param parent Parent widget
*/
PipelineTreeWidget(QWidget* parent = 0);
explicit PipelineTreeWidget(QWidget* parent = 0);
/**
* Destructor
......
......@@ -50,6 +50,7 @@ namespace campvis {
, _color(color)
{
setMinimumHeight(16);
setMinimumWidth(32);
}
const QColor& ColorPickerWidget::color() const {
......
......@@ -68,7 +68,7 @@ namespace campvis {
* \param parent Parent Qt widget
* \param f Qt WindowFlags
*/
ColorPickerWidget(const QColor& color = QColor::fromRgba(qRgba(0, 0, 0, 255)), QWidget* parent=0, Qt::WindowFlags f=0);
explicit ColorPickerWidget(const QColor& color = QColor::fromRgba(qRgba(0, 0, 0, 255)), QWidget* parent=0, Qt::WindowFlags f=0);
/**
* Returns the current color of the widget.
......
......@@ -46,7 +46,7 @@ namespace campvis {
* counting mechanism. Make sure not to interfere with it or delete \a data yourself!
* \param data Data for the QtDataHandle
*/
QtDataHandle(AbstractData* data = 0)
explicit QtDataHandle(AbstractData* data = 0)
: DataHandle(data)
{}
......@@ -55,7 +55,7 @@ namespace campvis {
* \note If \a rhs is not shareable, this implies a copy of the data!
* \param rhs Source QtDataHandle
*/
QtDataHandle(const QtDataHandle& rhs)
explicit QtDataHandle(const QtDataHandle& rhs)
: DataHandle(rhs)
{}
......@@ -64,7 +64,7 @@ namespace campvis {
* \note If \a rhs is not shareable, this implies a copy of the data!
* \param rhs Source DataHandle
*/
explicit QtDataHandle(const DataHandle& rhs)
QtDataHandle(const DataHandle& rhs)
: DataHandle(rhs)
{}
......
......@@ -55,7 +55,7 @@ namespace campvis {
* \param canvas the pipeline's canvas
* \param parent the widget's parent
*/
VisualizationPipelineWidget(QWidget* canvas, QWidget* parent = 0);
explicit VisualizationPipelineWidget(QWidget* canvas, QWidget* parent = 0);
/**
* Enter the widget into forced drag mode.
......
......@@ -30,7 +30,7 @@ namespace campvis {
* \param showCat should the category be printed along with the messages
* \param showLevel should the LogLevel be printed along with the messages
*/
BufferingLog(unsigned int maxSize, QObject* parent = 0, bool dateStamping = true,
explicit BufferingLog(unsigned int maxSize, QObject* parent = 0, bool dateStamping = true,
bool timeStamping = true, bool showCat = true, bool showLevel = true);
virtual ~BufferingLog() {}
bool isOpen() { return true; }
......
......@@ -31,7 +31,7 @@ namespace campvis {
* \param showCat should the category be printed along with the messages
* \param showLevel should the LogLevel be printed along with the messages
*/
QTextEditLog(QTextEdit* logDisplay, QObject* parent = 0, bool dateStamping = true,
explicit QTextEditLog(QTextEdit* logDisplay, QObject* parent = 0, bool dateStamping = true,
bool timeStamping = true, bool showCat = true, bool showLevel = true);
virtual ~QTextEditLog() {}
bool isOpen() { return true; }
......
......@@ -44,7 +44,7 @@ namespace campvis {
* Creates a new TreeItem
* \param parent Parent item, will take ownership of this TreeItem.
*/
TreeItem(TreeItem* parent = 0);
explicit TreeItem(TreeItem* parent = 0);
/**
* Destuctor, also deletes all child items.
......
......@@ -48,7 +48,7 @@ namespace campvis {
* \param size Size of the transfer function texture
* \param intensityDomain Intensity Domain where the transfer function is mapped to during classification
*/
Geometry1DTransferFunction(size_t size, const tgt::vec2& intensityDomain = tgt::vec2(0.f, 1.f));
explicit Geometry1DTransferFunction(size_t size, const tgt::vec2& intensityDomain = tgt::vec2(0.f, 1.f));
/**
* Destructor, make sure to delete the OpenGL texture beforehand by calling deinit() with a valid OpenGL context!
......
......@@ -48,7 +48,7 @@ namespace campvis {
* \param size Size of the transfer function texture
* \param intensityDomain Intensity Domain where the transfer function is mapped to during classification
*/
Geometry2DTransferFunction(const tgt::svec2& size, const tgt::vec2& intensityDomain = tgt::vec2(0.f, 1.f));
explicit Geometry2DTransferFunction(const tgt::svec2& size, const tgt::vec2& intensityDomain = tgt::vec2(0.f, 1.f));
/**
* Destructor, make sure to delete the OpenGL texture beforehand by calling deinit() with a valid OpenGL context!
......
......@@ -44,7 +44,7 @@ namespace campvis {
* \param size Size of the transfer function texture
* \param intensityDomain Intensity Domain where the transfer function is mapped to during classification
*/
SimpleTransferFunction(size_t size, const tgt::vec2& intensityDomain = tgt::vec2(0.f, 1.f));
explicit SimpleTransferFunction(size_t size, const tgt::vec2& intensityDomain = tgt::vec2(0.f, 1.f));
/**
* Destructor, make sure to delete the OpenGL texture beforehand by calling deinit() with a valid OpenGL context!
......
......@@ -47,7 +47,7 @@ namespace campvis {
class TFGeometry1D {
public:
struct KeyPoint {
KeyPoint(float position, const tgt::col4& color)
explicit KeyPoint(float position, const tgt::col4& color)
: _position(position)
, _color(color)
{};
......@@ -60,7 +60,7 @@ namespace campvis {
* Creates a new TFGeometry1D
* \param Bounds Bounds of the position of the geometry in texture coordinates.
*/
TFGeometry1D(const std::vector<KeyPoint>& keyPoints);
explicit TFGeometry1D(const std::vector<KeyPoint>& keyPoints);
/**
* Virtual destructor
......
......@@ -47,7 +47,7 @@ namespace campvis {
class TFGeometry2D {
public:
struct KeyPoint {
KeyPoint(const tgt::vec2& position, const tgt::col4& color)
explicit KeyPoint(const tgt::vec2& position, const tgt::col4& color)
: _position(position)
, _color(color)
{};
......@@ -60,7 +60,7 @@ namespace campvis {
* Creates a new TFGeometry2D
* \param Bounds Bounds of the position of the geometry in texture coordinates.
*/
TFGeometry2D(const std::vector<KeyPoint>& keyPoints);
explicit TFGeometry2D(const std::vector<KeyPoint>& keyPoints);
/**
* Virtual destructor
......
......@@ -60,7 +60,7 @@ namespace campvis {
* \param colors The list of vertex colors, may be empty.
* \param normals The list of vertex normals, may be empty.
*/
FaceGeometry(
explicit FaceGeometry(
const std::vector<tgt::vec3>& vertices,
const std::vector<tgt::vec3>& textureCoordinates = std::vector<tgt::vec3>(),
const std::vector<tgt::vec4>& colors = std::vector<tgt::vec4>(),
......
......@@ -47,7 +47,7 @@ namespace campvis {
* Creates a new GenericPointerData and initializes its pointer with \a data.
* \param data The initial pointer for this data, may be 0, GenericPointerData takes ownerwhip.
*/
GenericPointerData(T* data)
explicit GenericPointerData(T* data)
: AbstractData()
, _data(data)
{};
......
......@@ -61,7 +61,7 @@ namespace campvis {
* \param size Size of this image (number of elements per dimension)
* \param numChannels Number of channels per element
*/
ImageData(size_t dimensionality, const tgt::svec3& size, size_t numChannels);
explicit ImageData(size_t dimensionality, const tgt::svec3& size, size_t numChannels);
/// Destructor
virtual ~ImageData();
......
......@@ -58,7 +58,7 @@ namespace campvis {
* \param colors The list of vertex colors, may be empty.
* \param normals The list of vertex normals, may be empty.
*/
IndexedMeshGeometry(
explicit IndexedMeshGeometry(
const std::vector<uint16_t>& indices,
const std::vector<tgt::vec3>& vertices,
const std::vector<tgt::vec3>& textureCoordinates = std::vector<tgt::vec3>(),
......
......@@ -53,7 +53,7 @@ namespace campvis {
/**
* Creates a new MeshGeometry built from the given faces.
*/
MeshGeometry(const std::vector<FaceGeometry>& faces);
explicit MeshGeometry(const std::vector<FaceGeometry>& faces);
/**
* Destructor, deletes VBOs/VAO if necessary. Hence, needs a valid OpenGL context
......
......@@ -44,7 +44,7 @@ namespace campvis {
/**
* Creates a MWheelToNumericPropertyEventListener.
*/
MWheelToNumericPropertyEventListener(INumericProperty* property);
explicit MWheelToNumericPropertyEventListener(INumericProperty* property);
/**
* Virtual Destructor
......
......@@ -56,7 +56,7 @@ namespace campvis {
* Constructor
* \param camProp The CameraProperty to wrap around.
*/
CamPropNavigationWrapper(CameraProperty* camProp);
explicit CamPropNavigationWrapper(CameraProperty* camProp);
/// Virtual Destructor
virtual ~CamPropNavigationWrapper();
......
......@@ -46,7 +46,7 @@ namespace campvis {
/**
* Creates a TransFuncWindowingEventListener.
*/
TransFuncWindowingEventListener(TransferFunctionProperty* property);
explicit TransFuncWindowingEventListener(TransferFunctionProperty* property);
/**
* Virtual Destructor
......
......@@ -65,8 +65,7 @@ namespace campvis {
VALID = 0, ///< Valid
INVALID_RESULT = 1 << 0, ///< Need to rerun the process() method
INVALID_SHADER = 1 << 1, ///< Need to recompile the shader
INVALID_FILE = 1 << 2, ///< Need to reread the file
INVALID_PROPERTIES = 1 << 3 ///< Need to update the properties
INVALID_PROPERTIES = 1 << 2 ///< Need to update the properties
};
/// Current state of a processor in terms of stability.
......@@ -209,14 +208,6 @@ namespace campvis {
return (_level & static_cast<int>(INVALID_SHADER)) != 0;
}
/**
* Returns wheter the the INVALID_FILE flag is set.
* \return _level & INVALID_FILE
*/
bool hasInvalidFile() const {
return (_level & static_cast<int>(INVALID_FILE)) != 0;
}
/**
* Returns wheter the the INVALID_PROPERTIES flag is set.
* \return _level & INVALID_PROPERTIES
......
......@@ -40,7 +40,7 @@ namespace campvis {
class ProcessorDecoratorShading : public AbstractProcessorDecorator {
public:
ProcessorDecoratorShading(const std::string& lightUniformName = "_lightSource");
explicit ProcessorDecoratorShading(const std::string& lightUniformName = "_lightSource");
virtual ~ProcessorDecoratorShading();
protected:
......
......@@ -55,9 +55,19 @@ namespace campvis {
*/
class VisualizationProcessor : public AbstractProcessor {
public:
/**
* Utility struct to encapuslate off-screen rendering with this processor using FBOs.
* This guard essentially activates the VisualizationProcessor's FBO and sets the OpenGL
* viewport size. Upon destruction it detaches all texutres and deactivates the FBO again.
*/
struct FramebufferActivationGuard {
public:
FramebufferActivationGuard(VisualizationProcessor* vp)
/**
* Constructor.
* Activates the FBO and sets the OpenGL viewport size to the effective viewport size of \a vp.
* \param vp This Visualization processor (usually pointer to this).
*/
explicit FramebufferActivationGuard(VisualizationProcessor* vp)
: _parentProcessor(vp)
, _fbo(vp->_fbo)
{
......@@ -68,6 +78,9 @@ namespace campvis {
glViewport(0, 0, static_cast<GLsizei>(windowSize.x), static_cast<GLsizei>(windowSize.y));
}
/**
* Destructor, detaches all textures and deactivates the FBO.
*/
~FramebufferActivationGuard() {
_fbo->detachAll();
_fbo->deactivate();
......@@ -90,7 +103,7 @@ namespace campvis {
*
* \param viewportSizeProp Pointer to the property defining the viewport size, must not be 0.
*/
VisualizationProcessor(IVec2Property* viewportSizeProp);
explicit VisualizationProcessor(IVec2Property* viewportSizeProp);
/**
* Virtual Destructor
......
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