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 {
, 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,7 +180,7 @@ 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);
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&);
......
......@@ -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,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,8 +127,10 @@ 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) { \
......
......@@ -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);
......
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