Fixed some cppcheck warnings
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
|
||||
typedef T value_type;
|
||||
|
||||
CmdOption(const T& _val) : val_(_val), valid_(true), enabled_(false) { }
|
||||
explicit CmdOption(const T& _val) : val_(_val), valid_(true), enabled_(false) { }
|
||||
CmdOption() : val_(T()),valid_(false), enabled_(false) { }
|
||||
|
||||
// has been set and has a value
|
||||
|
||||
@@ -123,7 +123,7 @@ public:
|
||||
|
||||
|
||||
/// default constructor
|
||||
DecimaterViewerWidget(QWidget* _parent=0)
|
||||
explicit DecimaterViewerWidget(QWidget* _parent=0)
|
||||
: MeshViewerWidget(_parent),
|
||||
animate_(false),
|
||||
timer_(0),
|
||||
|
||||
@@ -82,7 +82,7 @@ class MeshViewerWidget : public MeshViewerWidgetT<MyMesh>
|
||||
Q_OBJECT
|
||||
public:
|
||||
/// default constructor
|
||||
MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT<MyMesh>(parent)
|
||||
explicit MeshViewerWidget(QWidget* parent=0) : MeshViewerWidgetT<MyMesh>(parent)
|
||||
{}
|
||||
OpenMesh::IO::Options& options() { return _options; }
|
||||
const OpenMesh::IO::Options& options() const { return _options; }
|
||||
|
||||
@@ -139,17 +139,15 @@ void VDPMClientViewerWidget::mesh_coloring()
|
||||
vEnd(mesh_.vertices_end());
|
||||
|
||||
VHierarchyNodeHandle node_handle;
|
||||
float ratio;
|
||||
unsigned char r, g, b;
|
||||
|
||||
for (; vIt!=vEnd; ++vIt)
|
||||
{
|
||||
node_handle = mesh_.data(*vIt).vhierarchy_node_handle();
|
||||
ratio = vhierarchy_.node(node_handle).ratio();
|
||||
const float ratio = vhierarchy_.node(node_handle).ratio();
|
||||
|
||||
r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
|
||||
g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
|
||||
b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
|
||||
const unsigned char r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
|
||||
const unsigned char g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
|
||||
const unsigned char b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
|
||||
|
||||
mesh_.set_color(*vIt, OpenMesh::Vec3uc(r,g,b));
|
||||
}
|
||||
|
||||
@@ -138,17 +138,15 @@ void VDPMClientViewerWidget::mesh_coloring()
|
||||
vEnd(mesh_.vertices_end());
|
||||
|
||||
VHierarchyNodeHandle node_handle;
|
||||
float ratio;
|
||||
unsigned char r, g, b;
|
||||
|
||||
for (; vIt!=vEnd; ++vIt)
|
||||
{
|
||||
node_handle = mesh_.data(*vIt).vhierarchy_node_handle();
|
||||
ratio = vhierarchy_.node(node_handle).ratio();
|
||||
const float ratio = vhierarchy_.node(node_handle).ratio();
|
||||
|
||||
r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
|
||||
g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
|
||||
b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
|
||||
const unsigned char r = (unsigned char) ((1.0f - ratio) * myYellow[0] + ratio * myBlue[0]);
|
||||
const unsigned char g = (unsigned char) ((1.0f - ratio) * myYellow[1] + ratio * myBlue[1]);
|
||||
const unsigned char b = (unsigned char) ((1.0f - ratio) * myYellow[2] + ratio * myBlue[2]);
|
||||
|
||||
mesh_.set_color(*vIt, OpenMesh::Vec3uc(r,g,b));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user