In January 2021 we will introduce a 10 GB quota for project repositories. Higher limits for individual projects will be available on request. Please see https://doku.lrz.de/display/PUBLIC/GitLab for more information.

Taking care of CppCheck issues #1

parent 87b21ec4
......@@ -55,6 +55,7 @@ namespace campvis {
, p_renderAChannel("RenderAChannel", "Render Alpha Channel", true)
, p_geometryRendererProperties("GeometryRendererProperties", "GeometryRenderer Properties")
, _texturesDirty(true)
, _geometriesDirty(true)
, _dataContainer(nullptr)
, _paintShader(nullptr)
, _quad(nullptr)
......@@ -252,7 +253,7 @@ namespace campvis {
if (_quad != 0 && _paintShader != 0) {
// avoid recursive paints.
if (! cgt::GlContextManager::getRef().checkWhetherThisThreadHasAcquiredOpenGlContext()) {
std::thread backgroundThread([this] () {
std::thread([this] () {
cgt::GLContextScopedLock lock(this);
paint();
});
......
......@@ -40,6 +40,8 @@ namespace campvis {
TFGeometry1D::TFGeometry1D(const std::vector<KeyPoint>& keyPoints)
: _keyPoints(keyPoints)
, _tfRenderFace(nullptr)
, _tfEditorFace(nullptr)
{
std::sort(_keyPoints.begin(), _keyPoints.end());
}
......
......@@ -61,9 +61,4 @@ namespace campvis {
const_cast<ImageData*>(_parent)->addRepresentation(this);
}
AbstractImageRepresentation& AbstractImageRepresentation::operator=(const AbstractImageRepresentation& rhs) {
return *this;
}
}
\ No newline at end of file
......@@ -106,7 +106,7 @@ namespace campvis {
private:
/// Not copy-constructable
AbstractImageRepresentation(const AbstractImageRepresentation& rhs);
explicit AbstractImageRepresentation(const AbstractImageRepresentation& rhs);
/// Not assignable
AbstractImageRepresentation& operator=(const AbstractImageRepresentation& rhs);
......
......@@ -63,7 +63,7 @@ namespace campvis {
* Copy constructor
* \param rhs GeometryData to copy
*/
GeometryData(const GeometryData& rhs);
explicit GeometryData(const GeometryData& rhs);
/**
* Destructor, deletes VBOs/VAO if necessary.
......
......@@ -180,8 +180,8 @@ namespace campvis {
// We don't want this data to be copied - clone() must be enough
// (read: We are too lazy to implement a correct copy constructor / assignment-operator)
ImageRepresentationLocal(const ImageRepresentationLocal& rhs);
ImageRepresentationLocal& operator=(const ImageRepresentationLocal& rhs);
explicit ImageRepresentationLocal(const ImageRepresentationLocal& rhs);
ImageRepresentationLocal& operator=(const ImageRepresentationLocal& rhs);
};
}
......
......@@ -52,6 +52,8 @@ namespace campvis {
, _customGlslVersion(customGlslVersion)
, _shader(0)
, _bindEntryExitDepthTextures(bindEntryExitDepthTextures)
, _minReduction(nullptr)
, _maxReduction(nullptr)
{
addProperty(p_sourceImageID, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES);
addProperty(p_entryImageID);
......
......@@ -45,8 +45,7 @@ const std::string DRIVER_DLL_ATI = "atioglxx.dll";
namespace cgt {
GpuCapabilitiesWindows::GpuCapabilitiesWindows()
: loggerCat_("cgt.GpuCapabilitiesWindows")
, GpuCapabilities()
: GpuCapabilities()
, videoRamSize_(-1)
#ifdef CGT_WITH_WMI
, pIWbemLocator_(0)
......@@ -901,6 +900,8 @@ bool GpuCapabilitiesWindows::createVersionStringFromDigits(FileVersion &fileVers
return true;
}
std::string GpuCapabilitiesWindows::loggerCat_ = "cgt.GpuCapabilitiesWindows";
} // namespace cgt
#endif //WIN32
......@@ -133,7 +133,7 @@ public:
protected:
std::string loggerCat_;
static std::string loggerCat_;
#ifdef CGT_WITH_WMI
......
......@@ -79,7 +79,7 @@ namespace cgt {
private:
/// Runnables are not copyable
Runnable(Runnable const&);
explicit Runnable(Runnable const&);
/// Runnables are not copyable
Runnable& operator =(Runnable const&);
......
......@@ -60,7 +60,7 @@ namespace campvis {
, p_connectDisconnectButton("ConnectToIGTLink", "Connect/Disconnect")
, p_resamplingScale("ResampleScale", "Resample Scale", 0.5f, 0.01f, 1.0f)
, p_beta("Beta", "Beta", 80.0f, 1.0f, 200.0f)
, p_resetToDefault("ResetToDefault", "Reset Settings to Default")
, p_resetToDefault("ResetToDefault", "Reset Settings to Default")
, p_collectStatistics("CollectStatistics", "Collect Statistics", false)
, p_copyStatisticsToClipboard("CopyStatisticsToClipboard", "Copy Statistics To Clipboard as CSV")
, p_showAdvancedOptions("ShowAdvancedOptions", "Advanced options...", false)
......@@ -75,11 +75,9 @@ namespace campvis {
, p_recordingDirectory("RecordingDirectory", "Recording output direcotry", "D:\\us_acquisitions\\")
, p_enableRecording("EnableRecording", "Enable recording", false)
, _recordedFrames(0)
, _filePrefix(QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss_").toStdString()) // Calculate file prefix, using date, hour, minute and second of when the pipeline was created
, _statisticsLastUpdateTime()
{
// Calculate file prefix, using date, hour, minute and second of when the pipeline was created
_filePrefix = QDateTime::currentDateTime().toString("yyyyMMdd_hhmmss_").toStdString();
addProcessor(&_usIgtlReader);
addProcessor(&_usCropFilter);
addProcessor(&_usPreBlur);
......@@ -95,7 +93,7 @@ namespace campvis {
addProperty(p_connectDisconnectButton);
addProperty(p_resamplingScale);
addProperty(p_beta);
addProperty(p_resetToDefault);
addProperty(p_resetToDefault);
addProperty(p_collectStatistics);
addProperty(p_copyStatisticsToClipboard);
......@@ -176,7 +174,7 @@ namespace campvis {
// Bind buttons to event handlers
p_connectDisconnectButton.s_clicked.connect(this, &CudaConfidenceMapsDemo::toggleIGTLConnection);
p_resetToDefault.s_clicked.connect(this, &CudaConfidenceMapsDemo::resetSettingsToDefault);
p_resetToDefault.s_clicked.connect(this, &CudaConfidenceMapsDemo::resetSettingsToDefault);
p_copyStatisticsToClipboard.s_clicked.connect(this, &CudaConfidenceMapsDemo::copyStatisticsToClipboard);
// Bind pipeline proeprties to processor properties
......@@ -407,14 +405,14 @@ namespace campvis {
_usIgtlReader.p_disconnect.click();
}
void CudaConfidenceMapsDemo::resetSettingsToDefault() {
p_resamplingScale.setValue(.5f);
p_gaussianFilterSize.setValue(2.5f);
p_gradientScaling.setValue(2.f);
p_alpha.setValue(2.f);
p_beta.setValue(80.f);
p_gamma.setValue(.05f);
}
void CudaConfidenceMapsDemo::resetSettingsToDefault() {
p_resamplingScale.setValue(.5f);
p_gaussianFilterSize.setValue(2.5f);
p_gradientScaling.setValue(2.f);
p_alpha.setValue(2.f);
p_beta.setValue(80.f);
p_gamma.setValue(.05f);
}
void CudaConfidenceMapsDemo::copyStatisticsToClipboard() {
// Copy statistics to the clipboard in CSV format
......
......@@ -95,6 +95,10 @@ namespace fontrendering {
private:
// disable copying and assignment
explicit FontAtlas(const FontAtlas& rhs);
FontAtlas& operator=(FontAtlas rhs);
/// Struct storing glyph parameters of each printable ASCII character
struct {
cgt::vec2 advance; ///< Advance of this glyph
......
......@@ -127,9 +127,11 @@ namespace campvis {
std::string concatenated = ss.str(); \
\
std::ifstream file(concatenated.c_str(), std::ifstream::in); \
if (!file.is_open() || file.bad()) \
if (!file.is_open() || file.bad()) { \
delete [] dataArray; \
throw cgt::FileException("Could not open file " + ss.str() + " for reading.", p_url.getValue()); \
\
} \
\
TMP_TYPE tmp; \
for (size_t column = 0; column < size.y && file.good(); ++column) { \
for (size_t row = 0; row < size.x && file.good(); ++row) { \
......
......@@ -54,12 +54,12 @@ namespace campvis {
ContourObject::~ContourObject() {
}
ContourObject* ContourObject::operator=(const ContourObject& rhs) {
ContourObject& ContourObject::operator=(const ContourObject& rhs) {
this->_objectName.setValue(rhs._objectName.getValue());
this->_color.setValue(rhs._color.getValue());
this->_points = rhs._points;
this->_objectsCoordinates = rhs._objectsCoordinates;
return this;
return *this;
}
void ContourObject::addObject() {
......@@ -198,7 +198,7 @@ namespace campvis {
_vr.init();
_sliceExtractor.init();
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/vis/glsl/microscopyimagesegmentation.frag", "");
_shader = ShdrMgr.load("core/glsl/passthrough.vert", "modules/microscopysegmentation/glsl/microscopyimagesegmentation.frag", "");
_sliceExtractor.s_invalidated.connect(this, &MicroscopyImageSegmentation::onProcessorInvalidated);
_vr.s_invalidated.connect(this, &MicroscopyImageSegmentation::onProcessorInvalidated);
......
......@@ -60,7 +60,7 @@ namespace campvis {
public:
ContourObject(std::string name);
virtual ~ContourObject();
ContourObject* operator=(const ContourObject& rhs);
ContourObject& operator=(const ContourObject& rhs);
void addObject();
StringProperty _objectName;
......
......@@ -48,6 +48,8 @@ namespace campvis {
, p_outputImage("OutputImage", "Output Image", "GlImageCrop.out", DataNameProperty::WRITE)
, p_llf("Llf", "LLF of Cropped Region", cgt::ivec3(0), cgt::ivec3(0), cgt::ivec3(1))
, p_urb("Urb", "URB of Cropped Region", cgt::ivec3(1), cgt::ivec3(0), cgt::ivec3(1))
, _shader2D(nullptr)
, _shader3D(nullptr)
{
addProperty(p_inputImage, INVALID_PROPERTIES | INVALID_RESULT);
addProperty(p_outputImage);
......
......@@ -62,6 +62,7 @@ namespace campvis {
, p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ)
, p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 3)
, p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0)
, _shader(nullptr)
, _ellipsoidGeometry(nullptr)
, _cubeGeometry(nullptr)
{
......
......@@ -73,6 +73,7 @@ namespace campvis {
, p_enableShading("EnableShading", "Enable Shading", true)
, p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ)
, _shader(nullptr)
, _currentTime(0)
, _positionBufferA(nullptr)
, _positionBufferB(nullptr)
, _velocityBufferA(nullptr)
......
......@@ -63,6 +63,7 @@ namespace campvis {
, p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 4)
, p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0)
, _arrowGeometry(nullptr)
, _shader(nullptr)
{
addProperty(p_inputVectors, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(p_camera);
......
......@@ -51,6 +51,7 @@ namespace campvis {
, p_flipMatrix("FlipMatrix", "Flip Matrix for Alignment (optional)", cgt::mat4::identity)
, _cubeGeometry(nullptr)
, _shader(nullptr)
, _passthroughShader(nullptr)
, _textures(nullptr)
{
addProperty(p_camera);
......
......@@ -43,7 +43,10 @@ namespace campvis {
std::string VoxelHierarchyMapper::loggerCat_ = "CAMPVis.modules.vis.VoxelHierarchyMapper";
VoxelHierarchyMapper::VoxelHierarchyMapper()
: _xorBitmaskShader(nullptr)
: _brickSize(0)
, _brickDepth(0)
, _maxMipmapLevel(0)
, _xorBitmaskShader(nullptr)
, _hierarchyRendererShader(nullptr)
, _mimapRendererShader(nullptr)
, _fbo(nullptr)
......
......@@ -27,6 +27,7 @@
#include <string>
#include "cgt/assert.h"
#include "cgt/framebufferobject.h"
#include "cgt/shadermanager.h"
......@@ -74,6 +75,9 @@ namespace campvis {
GLuint getMaxMipmapLevel() { return _maxMipmapLevel; }
private:
// disable copying and assignment
explicit VoxelHierarchyMapper(const VoxelHierarchyMapper& rhs);
VoxelHierarchyMapper& operator=(VoxelHierarchyMapper rhs);
void createXorBitmaskTexture();
......@@ -108,7 +112,6 @@ namespace campvis {
std::unique_ptr<FaceGeometry> _quad;
static std::string loggerCat_;
};
......
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