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

Taking care of CppCheck issues #1

parent 87b21ec4
...@@ -55,6 +55,7 @@ namespace campvis { ...@@ -55,6 +55,7 @@ namespace campvis {
, p_renderAChannel("RenderAChannel", "Render Alpha Channel", true) , p_renderAChannel("RenderAChannel", "Render Alpha Channel", true)
, p_geometryRendererProperties("GeometryRendererProperties", "GeometryRenderer Properties") , p_geometryRendererProperties("GeometryRendererProperties", "GeometryRenderer Properties")
, _texturesDirty(true) , _texturesDirty(true)
, _geometriesDirty(true)
, _dataContainer(nullptr) , _dataContainer(nullptr)
, _paintShader(nullptr) , _paintShader(nullptr)
, _quad(nullptr) , _quad(nullptr)
...@@ -252,7 +253,7 @@ namespace campvis { ...@@ -252,7 +253,7 @@ namespace campvis {
if (_quad != 0 && _paintShader != 0) { if (_quad != 0 && _paintShader != 0) {
// avoid recursive paints. // avoid recursive paints.
if (! cgt::GlContextManager::getRef().checkWhetherThisThreadHasAcquiredOpenGlContext()) { if (! cgt::GlContextManager::getRef().checkWhetherThisThreadHasAcquiredOpenGlContext()) {
std::thread backgroundThread([this] () { std::thread([this] () {
cgt::GLContextScopedLock lock(this); cgt::GLContextScopedLock lock(this);
paint(); paint();
}); });
......
...@@ -40,6 +40,8 @@ namespace campvis { ...@@ -40,6 +40,8 @@ namespace campvis {
TFGeometry1D::TFGeometry1D(const std::vector<KeyPoint>& keyPoints) TFGeometry1D::TFGeometry1D(const std::vector<KeyPoint>& keyPoints)
: _keyPoints(keyPoints) : _keyPoints(keyPoints)
, _tfRenderFace(nullptr)
, _tfEditorFace(nullptr)
{ {
std::sort(_keyPoints.begin(), _keyPoints.end()); std::sort(_keyPoints.begin(), _keyPoints.end());
} }
......
...@@ -61,9 +61,4 @@ namespace campvis { ...@@ -61,9 +61,4 @@ namespace campvis {
const_cast<ImageData*>(_parent)->addRepresentation(this); 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 { ...@@ -106,7 +106,7 @@ namespace campvis {
private: private:
/// Not copy-constructable /// Not copy-constructable
AbstractImageRepresentation(const AbstractImageRepresentation& rhs); explicit AbstractImageRepresentation(const AbstractImageRepresentation& rhs);
/// Not assignable /// Not assignable
AbstractImageRepresentation& operator=(const AbstractImageRepresentation& rhs); AbstractImageRepresentation& operator=(const AbstractImageRepresentation& rhs);
......
...@@ -63,7 +63,7 @@ namespace campvis { ...@@ -63,7 +63,7 @@ namespace campvis {
* Copy constructor * Copy constructor
* \param rhs GeometryData to copy * \param rhs GeometryData to copy
*/ */
GeometryData(const GeometryData& rhs); explicit GeometryData(const GeometryData& rhs);
/** /**
* Destructor, deletes VBOs/VAO if necessary. * Destructor, deletes VBOs/VAO if necessary.
......
...@@ -180,7 +180,7 @@ namespace campvis { ...@@ -180,7 +180,7 @@ namespace campvis {
// We don't want this data to be copied - clone() must be enough // 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) // (read: We are too lazy to implement a correct copy constructor / assignment-operator)
ImageRepresentationLocal(const ImageRepresentationLocal& rhs); explicit ImageRepresentationLocal(const ImageRepresentationLocal& rhs);
ImageRepresentationLocal& operator=(const ImageRepresentationLocal& rhs); ImageRepresentationLocal& operator=(const ImageRepresentationLocal& rhs);
}; };
......
...@@ -52,6 +52,8 @@ namespace campvis { ...@@ -52,6 +52,8 @@ namespace campvis {
, _customGlslVersion(customGlslVersion) , _customGlslVersion(customGlslVersion)
, _shader(0) , _shader(0)
, _bindEntryExitDepthTextures(bindEntryExitDepthTextures) , _bindEntryExitDepthTextures(bindEntryExitDepthTextures)
, _minReduction(nullptr)
, _maxReduction(nullptr)
{ {
addProperty(p_sourceImageID, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES); addProperty(p_sourceImageID, AbstractProcessor::INVALID_RESULT | AbstractProcessor::INVALID_PROPERTIES);
addProperty(p_entryImageID); addProperty(p_entryImageID);
......
...@@ -45,8 +45,7 @@ const std::string DRIVER_DLL_ATI = "atioglxx.dll"; ...@@ -45,8 +45,7 @@ const std::string DRIVER_DLL_ATI = "atioglxx.dll";
namespace cgt { namespace cgt {
GpuCapabilitiesWindows::GpuCapabilitiesWindows() GpuCapabilitiesWindows::GpuCapabilitiesWindows()
: loggerCat_("cgt.GpuCapabilitiesWindows") : GpuCapabilities()
, GpuCapabilities()
, videoRamSize_(-1) , videoRamSize_(-1)
#ifdef CGT_WITH_WMI #ifdef CGT_WITH_WMI
, pIWbemLocator_(0) , pIWbemLocator_(0)
...@@ -901,6 +900,8 @@ bool GpuCapabilitiesWindows::createVersionStringFromDigits(FileVersion &fileVers ...@@ -901,6 +900,8 @@ bool GpuCapabilitiesWindows::createVersionStringFromDigits(FileVersion &fileVers
return true; return true;
} }
std::string GpuCapabilitiesWindows::loggerCat_ = "cgt.GpuCapabilitiesWindows";
} // namespace cgt } // namespace cgt
#endif //WIN32 #endif //WIN32
...@@ -133,7 +133,7 @@ public: ...@@ -133,7 +133,7 @@ public:
protected: protected:
std::string loggerCat_; static std::string loggerCat_;
#ifdef CGT_WITH_WMI #ifdef CGT_WITH_WMI
......
...@@ -79,7 +79,7 @@ namespace cgt { ...@@ -79,7 +79,7 @@ namespace cgt {
private: private:
/// Runnables are not copyable /// Runnables are not copyable
Runnable(Runnable const&); explicit Runnable(Runnable const&);
/// Runnables are not copyable /// Runnables are not copyable
Runnable& operator =(Runnable const&); Runnable& operator =(Runnable const&);
......
...@@ -75,11 +75,9 @@ namespace campvis { ...@@ -75,11 +75,9 @@ namespace campvis {
, p_recordingDirectory("RecordingDirectory", "Recording output direcotry", "D:\\us_acquisitions\\") , p_recordingDirectory("RecordingDirectory", "Recording output direcotry", "D:\\us_acquisitions\\")
, p_enableRecording("EnableRecording", "Enable recording", false) , p_enableRecording("EnableRecording", "Enable recording", false)
, _recordedFrames(0) , _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() , _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(&_usIgtlReader);
addProcessor(&_usCropFilter); addProcessor(&_usCropFilter);
addProcessor(&_usPreBlur); addProcessor(&_usPreBlur);
......
...@@ -95,6 +95,10 @@ namespace fontrendering { ...@@ -95,6 +95,10 @@ namespace fontrendering {
private: private:
// disable copying and assignment
explicit FontAtlas(const FontAtlas& rhs);
FontAtlas& operator=(FontAtlas rhs);
/// Struct storing glyph parameters of each printable ASCII character /// Struct storing glyph parameters of each printable ASCII character
struct { struct {
cgt::vec2 advance; ///< Advance of this glyph cgt::vec2 advance; ///< Advance of this glyph
......
...@@ -127,8 +127,10 @@ namespace campvis { ...@@ -127,8 +127,10 @@ namespace campvis {
std::string concatenated = ss.str(); \ std::string concatenated = ss.str(); \
\ \
std::ifstream file(concatenated.c_str(), std::ifstream::in); \ 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()); \ throw cgt::FileException("Could not open file " + ss.str() + " for reading.", p_url.getValue()); \
} \
\ \
TMP_TYPE tmp; \ TMP_TYPE tmp; \
for (size_t column = 0; column < size.y && file.good(); ++column) { \ for (size_t column = 0; column < size.y && file.good(); ++column) { \
......
...@@ -54,12 +54,12 @@ namespace campvis { ...@@ -54,12 +54,12 @@ namespace campvis {
ContourObject::~ContourObject() { ContourObject::~ContourObject() {
} }
ContourObject* ContourObject::operator=(const ContourObject& rhs) { ContourObject& ContourObject::operator=(const ContourObject& rhs) {
this->_objectName.setValue(rhs._objectName.getValue()); this->_objectName.setValue(rhs._objectName.getValue());
this->_color.setValue(rhs._color.getValue()); this->_color.setValue(rhs._color.getValue());
this->_points = rhs._points; this->_points = rhs._points;
this->_objectsCoordinates = rhs._objectsCoordinates; this->_objectsCoordinates = rhs._objectsCoordinates;
return this; return *this;
} }
void ContourObject::addObject() { void ContourObject::addObject() {
...@@ -198,7 +198,7 @@ namespace campvis { ...@@ -198,7 +198,7 @@ namespace campvis {
_vr.init(); _vr.init();
_sliceExtractor.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); _sliceExtractor.s_invalidated.connect(this, &MicroscopyImageSegmentation::onProcessorInvalidated);
_vr.s_invalidated.connect(this, &MicroscopyImageSegmentation::onProcessorInvalidated); _vr.s_invalidated.connect(this, &MicroscopyImageSegmentation::onProcessorInvalidated);
......
...@@ -60,7 +60,7 @@ namespace campvis { ...@@ -60,7 +60,7 @@ namespace campvis {
public: public:
ContourObject(std::string name); ContourObject(std::string name);
virtual ~ContourObject(); virtual ~ContourObject();
ContourObject* operator=(const ContourObject& rhs); ContourObject& operator=(const ContourObject& rhs);
void addObject(); void addObject();
StringProperty _objectName; StringProperty _objectName;
......
...@@ -48,6 +48,8 @@ namespace campvis { ...@@ -48,6 +48,8 @@ namespace campvis {
, p_outputImage("OutputImage", "Output Image", "GlImageCrop.out", DataNameProperty::WRITE) , 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_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)) , 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_inputImage, INVALID_PROPERTIES | INVALID_RESULT);
addProperty(p_outputImage); addProperty(p_outputImage);
......
...@@ -62,6 +62,7 @@ namespace campvis { ...@@ -62,6 +62,7 @@ namespace campvis {
, p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ) , p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ)
, p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 3) , p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 3)
, p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0) , p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0)
, _shader(nullptr)
, _ellipsoidGeometry(nullptr) , _ellipsoidGeometry(nullptr)
, _cubeGeometry(nullptr) , _cubeGeometry(nullptr)
{ {
......
...@@ -73,6 +73,7 @@ namespace campvis { ...@@ -73,6 +73,7 @@ namespace campvis {
, p_enableShading("EnableShading", "Enable Shading", true) , p_enableShading("EnableShading", "Enable Shading", true)
, p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ) , p_lightId("LightId", "Input Light Source", "lightsource", DataNameProperty::READ)
, _shader(nullptr) , _shader(nullptr)
, _currentTime(0)
, _positionBufferA(nullptr) , _positionBufferA(nullptr)
, _positionBufferB(nullptr) , _positionBufferB(nullptr)
, _velocityBufferA(nullptr) , _velocityBufferA(nullptr)
......
...@@ -63,6 +63,7 @@ namespace campvis { ...@@ -63,6 +63,7 @@ namespace campvis {
, p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 4) , p_sliceOrientation("SliceOrientation", "Slice Orientation", sliceOrientationOptions, 4)
, p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0) , p_sliceNumber("SliceNumber", "Slice Number", 0, 0, 0)
, _arrowGeometry(nullptr) , _arrowGeometry(nullptr)
, _shader(nullptr)
{ {
addProperty(p_inputVectors, INVALID_RESULT | INVALID_PROPERTIES); addProperty(p_inputVectors, INVALID_RESULT | INVALID_PROPERTIES);
addProperty(p_camera); addProperty(p_camera);
......
Supports Markdown
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