Commit f468efac authored by Jan Möbius's avatar Jan Möbius

cppcheck

parent 87d2161c
Pipeline #10617 canceled with stage
in 18 minutes and 2 seconds
......@@ -77,7 +77,7 @@ public:
public:
/// default constructor
MeshViewerWidgetT(QWidget* _parent=0)
explicit MeshViewerWidgetT(QWidget* _parent=0)
: QGLViewerWidget(_parent),
f_strips_(false),
tex_id_(0),
......@@ -85,7 +85,8 @@ public:
strips_(mesh_),
use_color_(true),
show_vnormals_(false),
show_fnormals_(false)
show_fnormals_(false),
normal_scale_(1.0)
{
add_draw_mode("Points");
add_draw_mode("Hidden-Line");
......
......@@ -147,7 +147,7 @@ public:
bool write(const std::string& _filename,
BaseExporter& _be,
Options _opt=Options::Default,
std::streamsize _precision = 6);
std::streamsize _precision = 6);
/** Write a mesh to open std::ostream _os. The source data structure is specified
by the given BaseExporter. The \c save method consecutively queries all
......@@ -159,7 +159,7 @@ public:
const std::string& _ext,
BaseExporter& _be,
Options _opt=Options::Default,
std::streamsize _precision = 6);
std::streamsize _precision = 6);
/// Returns true if the format is supported by one of the reader modules.
......
......@@ -135,13 +135,13 @@ read(const std::string& _filename, BaseImporter& _bi, Options& _opt)
{
#if defined(WIN32)
std::string::size_type dot = _filename.find_last_of("\\/");
std::string::size_type dot_pos = _filename.find_last_of("\\/");
#else
std::string::size_type dot = _filename.rfind("/");
std::string::size_type dot_pos = _filename.rfind("/");
#endif
path_ = (dot == std::string::npos)
path_ = (dot_pos == std::string::npos)
? "./"
: std::string(_filename.substr(0,dot+1));
: std::string(_filename.substr(0,dot_pos+1));
}
bool result = read(in, _bi, _opt);
......
......@@ -206,7 +206,7 @@ _OBJWriter_::
write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const
{
unsigned int idx;
size_t i, j,nV, nF;
size_t nV, nF;
Vec3f v, n;
Vec2f t;
VertexHandle vh;
......@@ -273,7 +273,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
std::vector<Vec2f> texCoords;
//add all texCoords to map
unsigned int num = _be.get_face_texcoords(texCoords);
for(unsigned int i = 0; i < num ; ++i)
for(size_t i = 0; i < num ; ++i)
{
texMap[texCoords[i]] = i;
}
......@@ -303,7 +303,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
}
// vertex data (point, normals, texcoords)
for (i=0, nV=_be.n_vertices(); i<nV; ++i)
for (size_t i=0, nV=_be.n_vertices(); i<nV; ++i)
{
vh = VertexHandle(int(i));
v = _be.point(vh);
......@@ -324,7 +324,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
&& !_opt.check(Options::FaceTexCoord);
// faces (indices starting at 1 not 0)
for (i=0, nF=_be.n_faces(); i<nF; ++i)
for (size_t i=0, nF=_be.n_faces(); i<nF; ++i)
{
if (useMatrial && _opt.check(Options::FaceColor) ){
......@@ -351,7 +351,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
_be.get_vhandles(FaceHandle(int(i)), vhandles);
for (j=0; j< vhandles.size(); ++j)
for (size_t j=0; j< vhandles.size(); ++j)
{
// Write vertex index
......
......@@ -97,7 +97,7 @@ class PolyMesh_ArrayKernelT
public:
PolyMesh_ArrayKernelT() {}
template<class OtherTraits>
PolyMesh_ArrayKernelT( const TriMesh_ArrayKernelT<OtherTraits> & t)
explicit PolyMesh_ArrayKernelT( const TriMesh_ArrayKernelT<OtherTraits> & t)
{
//assign the connectivity and standard properties
this->assign(t, true);
......
......@@ -97,7 +97,7 @@ class TriMesh_ArrayKernelT
public:
TriMesh_ArrayKernelT() {}
template<class OtherTraits>
TriMesh_ArrayKernelT( const PolyMesh_ArrayKernelT<OtherTraits> & t)
explicit TriMesh_ArrayKernelT( const PolyMesh_ArrayKernelT<OtherTraits> & t)
{
//assign the connectivity and standard properties
this->assign(t,true);
......
......@@ -90,7 +90,7 @@ public:
{
/// Initializing constructor copies appropriate handles from
/// collapse information \c _ci.
Info( const CollapseInfo& _ci )
explicit Info( const CollapseInfo& _ci )
: v0(_ci.v0), v1(_ci.v1), vl(_ci.vl),vr(_ci.vr)
{}
......@@ -108,7 +108,7 @@ public:
public:
/// Constructor
ModProgMeshT( MeshT &_mesh ) : Base(_mesh, true)
explicit ModProgMeshT( MeshT &_mesh ) : Base(_mesh, true)
{
Base::mesh().add_property( idx_ );
}
......
......@@ -134,7 +134,6 @@ compute_weights(LaplaceWeighting _weighting)
typename Mesh::EdgeIter e_it, e_end(Base::mesh_.edges_end());
typename Mesh::HalfedgeHandle heh0, heh1, heh2;
typename Mesh::VertexHandle v0, v1;
const typename Mesh::Point *p0, *p1, *p2;
typename Mesh::Normal d0, d1;
typename Mesh::Scalar weight, lb(-1.0), ub(1.0);
......@@ -171,7 +170,9 @@ compute_weights(LaplaceWeighting _weighting)
case CotWeighting:
{
for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it)
{
{
const typename Mesh::Point *p0, *p1, *p2;
weight = 0.0;
heh0 = Base::mesh_.halfedge_handle(*e_it, 0);
......
......@@ -82,7 +82,7 @@ public:
public:
CompositeLoopT() : Inherited() {};
CompositeLoopT(MeshType& _mesh) : Inherited(_mesh) {};
explicit CompositeLoopT(MeshType& _mesh) : Inherited(_mesh) {};
~CompositeLoopT() {}
public:
......
......@@ -82,7 +82,7 @@ public:
public:
CompositeSqrt3T() : Inherited() {};
CompositeSqrt3T(MeshType& _mesh) : Inherited(_mesh) {};
explicit CompositeSqrt3T(MeshType& _mesh) : Inherited(_mesh) {};
~CompositeSqrt3T() {}
public:
......
......@@ -106,7 +106,7 @@ public:
{ init_weights(); }
LoopT( mesh_t& _m ) : parent_t(_m), _1over8( 1.0/8.0 ), _3over8( 3.0/8.0 )
explicit LoopT( mesh_t& _m ) : parent_t(_m), _1over8( 1.0/8.0 ), _3over8( 3.0/8.0 )
{ init_weights(); }
......
......@@ -107,7 +107,7 @@ public:
{ init_weights(); }
ModifiedButterflyT( mesh_t& _m) : parent_t(_m)
explicit ModifiedButterflyT( mesh_t& _m) : parent_t(_m)
{ init_weights(); }
......
......@@ -119,7 +119,7 @@ public:
InterpolatingSqrt3LGT(void) : parent_t()
{ init_weights(); }
InterpolatingSqrt3LGT(MeshType &_m) : parent_t(_m)
explicit InterpolatingSqrt3LGT(MeshType &_m) : parent_t(_m)
{ init_weights(); }
virtual ~InterpolatingSqrt3LGT() {}
......
......@@ -112,7 +112,7 @@ public:
Sqrt3T(void) : parent_t(), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) )
{ init_weights(); }
Sqrt3T(MeshType &_m) : parent_t(_m), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) )
explicit Sqrt3T(MeshType &_m) : parent_t(_m), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) )
{ init_weights(); }
virtual ~Sqrt3T() {}
......
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