#1292 Fixed CppCheck Issues in AppFwk viewer/vizExtensions/CommonCode

This commit is contained in:
Magne Sjaastad 2017-03-06 19:22:32 +01:00
parent 749ce8e8af
commit b2e9d3fe11
12 changed files with 27 additions and 12 deletions

View File

@ -56,7 +56,7 @@ namespace caf {
class ColorTable
{
public:
ColorTable(const std::vector<cvf::Color3ub>& colors);
explicit ColorTable(const std::vector<cvf::Color3ub>& colors);
cvf::Color3f cycledColor3f(size_t itemIndex) const;
cvf::Color3ub cycledColor3ub(size_t itemIndex) const;

View File

@ -86,7 +86,6 @@ cvf::Effect* EffectCache::findEffect(const EffectGenerator* generator)
if (m_effectCache[i].first->isEqual(generator))
{
cvf::ref<cvf::Effect> effect = m_effectCache[i].second;
EffectGenerator* effGen = m_effectCache[i].first;
return effect.p();
}
}

View File

@ -206,7 +206,7 @@ private:
class ScalarMapperMeshEffectGenerator : public EffectGenerator
{
public:
ScalarMapperMeshEffectGenerator(const cvf::ScalarMapper* scalarMapper);
explicit ScalarMapperMeshEffectGenerator(const cvf::ScalarMapper* scalarMapper);
void setOpacityLevel(float opacity) { m_opacityLevel = cvf::Math::clamp(opacity, 0.0f , 1.0f ); }
void setUndefinedColor(cvf::Color3f color) { m_undefinedColor = color; }
@ -237,7 +237,7 @@ private:
class MeshEffectGenerator : public EffectGenerator
{
public:
MeshEffectGenerator(const cvf::Color3f& color);
explicit MeshEffectGenerator(const cvf::Color3f& color);
void setLineStipple(bool enable) { m_lineStipple = enable; }
void setLineWidth(float lineWidth);

View File

@ -55,7 +55,7 @@ class MessagePanel : public QWidget
Q_OBJECT
public:
MessagePanel(QDockWidget* parent);
explicit MessagePanel(QDockWidget* parent);
static MessagePanel* instance();

View File

@ -58,7 +58,7 @@ class StructGridScalarDataAccess;
class StructGridCutPlane : public Object
{
public:
StructGridCutPlane(const StructGridInterface* grid);
explicit StructGridCutPlane(const StructGridInterface* grid);
~StructGridCutPlane();
void setPlane(const Plane& plane);

View File

@ -144,7 +144,7 @@ private:
class StuctGridTriangleToCellFaceMapper : public Object
{
public:
StuctGridTriangleToCellFaceMapper(const StructGridQuadToCellFaceMapper* quadMapper) { m_quadMapper = quadMapper; }
explicit StuctGridTriangleToCellFaceMapper(const StructGridQuadToCellFaceMapper* quadMapper) { m_quadMapper = quadMapper; }
size_t triangleCount() const { return 2* m_quadMapper->quadCount();}
size_t cellIndex(size_t triangleIdx) const {return m_quadMapper->cellIndex(triangleIdx/2); }
@ -163,7 +163,7 @@ private:
class StructGridGeometryGenerator : public Object
{
public:
StructGridGeometryGenerator(const StructGridInterface* grid);
explicit StructGridGeometryGenerator(const StructGridInterface* grid);
~StructGridGeometryGenerator();
// Setup methods

View File

@ -61,6 +61,7 @@ using cvf::ManipulatorTrackball;
///
//--------------------------------------------------------------------------------------------------
caf::CeetronNavigation::CeetronNavigation()
: m_isRotCenterInitialized(false)
{
}

View File

@ -50,7 +50,14 @@
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
caf::TrackBallBasedNavigation::TrackBallBasedNavigation() : m_consumeEvents(false)
caf::TrackBallBasedNavigation::TrackBallBasedNavigation() :
m_isRotCenterInitialized(false),
m_isNavigating(false),
m_hasMovedMouseDuringNavigation(false),
m_isZooming(false),
m_lastPosX(0),
m_lastPosY(0),
m_consumeEvents(false)
{
}

View File

@ -62,6 +62,13 @@ protected:
{
OverlayColorLegendLayoutInfo(const cvf::Vec2i& pos, const cvf::Vec2ui& setSize)
{
charHeight = 0.0f;
lineSpacing = 0.0f;
margins = cvf::Vec2f::ZERO;
tickX = 0.0f;
x0 = 0.0f;
x1 = 0.0f;
position = pos;
size = setSize;
}

View File

@ -16,7 +16,8 @@ namespace caf {
///
//--------------------------------------------------------------------------------------------------
CategoryMapper::CategoryMapper()
: m_textureSize(2048)
: m_textureSize(2048),
m_maxTexCoord(1.0)
{
}

View File

@ -70,7 +70,7 @@ public:
};
public:
FixedAtlasFont(FontSize size);
explicit FixedAtlasFont(FontSize size);
virtual ~FixedAtlasFont();
virtual const cvf::String& name() const;

View File

@ -56,7 +56,7 @@ using namespace cvf;
class RenderPassPreparator : public cvf::DynamicUniformSet
{
public:
RenderPassPreparator(TransparentWBRenderConfiguration* renderConfiguration)
explicit RenderPassPreparator(TransparentWBRenderConfiguration* renderConfiguration)
{
CVF_ASSERT(renderConfiguration);
m_renderConfiguration = renderConfiguration;