cppcheck
This commit is contained in:
@@ -89,17 +89,17 @@ protected:
|
||||
|
||||
inline static Scalar compute_limit_weight(uint _valence)
|
||||
{
|
||||
double proj_weight = compute_proj_weight(_valence);
|
||||
proj_weight = proj_weight/(proj_weight + _valence);//normalize the proj_weight
|
||||
double weight = (3.0/8.0)/(1.0 - proj_weight + (3.0/8.0));
|
||||
double proj_weight_value = compute_proj_weight(_valence);
|
||||
proj_weight_value = proj_weight_value/(proj_weight_value + _valence);//normalize the proj_weight
|
||||
double weight = (3.0/8.0)/(1.0 - proj_weight_value + (3.0/8.0));
|
||||
return (Scalar)weight;
|
||||
}
|
||||
|
||||
inline static Scalar compute_step_weight(uint _valence)
|
||||
{
|
||||
double proj_weight = compute_proj_weight(_valence);
|
||||
proj_weight = proj_weight/(proj_weight + _valence);//normalize the proj_weight
|
||||
double weight = proj_weight - (3.0/8.0);
|
||||
double proj_weight_value = compute_proj_weight(_valence);
|
||||
proj_weight_value = proj_weight_value/(proj_weight_value + _valence);//normalize the proj_weight
|
||||
double weight = proj_weight_value - (3.0/8.0);
|
||||
return (Scalar)weight;
|
||||
}
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ public:
|
||||
{}
|
||||
|
||||
template <class _Point>
|
||||
QuadricT(const _Point& _pt)
|
||||
explicit QuadricT(const _Point& _pt)
|
||||
{
|
||||
set_distance_to_point(_pt);
|
||||
}
|
||||
|
||||
@@ -133,11 +133,13 @@ protected:
|
||||
|
||||
bool check(BaseExporter& _be, Options _opt) const
|
||||
{
|
||||
return (_opt.check(Options::VertexNormal ) <= _be.has_vertex_normals())
|
||||
&& (_opt.check(Options::VertexTexCoord)<= _be.has_vertex_texcoords())
|
||||
&& (_opt.check(Options::VertexColor) <= _be.has_vertex_colors())
|
||||
&& (_opt.check(Options::FaceNormal) <= _be.has_face_normals())
|
||||
&& (_opt.check(Options::FaceColor) <= _be.has_face_colors());
|
||||
// Check for all Options. When we want to write them (_opt.check() ) , they have to be available ( has_ )
|
||||
// Converts to not A (write them) or B (available)
|
||||
return ( !_opt.check(Options::VertexNormal ) || _be.has_vertex_normals())
|
||||
&& ( !_opt.check(Options::VertexTexCoord)|| _be.has_vertex_texcoords())
|
||||
&& ( !_opt.check(Options::VertexColor) || _be.has_vertex_colors())
|
||||
&& ( !_opt.check(Options::FaceNormal) || _be.has_face_normals())
|
||||
&& ( !_opt.check(Options::FaceColor) || _be.has_face_colors());
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -100,24 +100,24 @@ write(const std::string& _filename, BaseExporter& _be, Options _opt, std::stream
|
||||
|
||||
{
|
||||
#if defined(WIN32)
|
||||
std::string::size_type dot = _filename.find_last_of("\\/");
|
||||
std::string::size_type dotposition = _filename.find_last_of("\\/");
|
||||
#else
|
||||
std::string::size_type dot = _filename.rfind("/");
|
||||
std::string::size_type dotposition = _filename.rfind("/");
|
||||
#endif
|
||||
|
||||
if (dot == std::string::npos){
|
||||
if (dotposition == std::string::npos){
|
||||
path_ = "./";
|
||||
objName_ = _filename;
|
||||
}else{
|
||||
path_ = _filename.substr(0,dot+1);
|
||||
objName_ = _filename.substr(dot+1);
|
||||
path_ = _filename.substr(0,dotposition+1);
|
||||
objName_ = _filename.substr(dotposition+1);
|
||||
}
|
||||
|
||||
//remove the file extension
|
||||
dot = objName_.find_last_of(".");
|
||||
dotposition = objName_.find_last_of(".");
|
||||
|
||||
if(dot != std::string::npos)
|
||||
objName_ = objName_.substr(0,dot);
|
||||
if(dotposition != std::string::npos)
|
||||
objName_ = objName_.substr(0,dotposition);
|
||||
}
|
||||
|
||||
bool result = write(out, _be, _opt, _precision);
|
||||
|
||||
@@ -40,7 +40,7 @@ bool _VTKWriter_::write(const std::string& _filename, BaseExporter& _be, Options
|
||||
|
||||
bool _VTKWriter_::write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const
|
||||
{
|
||||
Vec3f v, n;
|
||||
Vec3f n;
|
||||
Vec2f t;
|
||||
VertexHandle vh;
|
||||
OpenMesh::Vec3f c;
|
||||
@@ -78,7 +78,7 @@ bool _VTKWriter_::write(std::ostream& _out, BaseExporter& _be, Options _opt, std
|
||||
_out << "POINTS " << _be.n_vertices() << " float\n";
|
||||
size_t nv = _be.n_vertices();
|
||||
for (size_t i = 0; i < nv; ++i) {
|
||||
Vec3f v = _be.point(VertexHandle(int(i)));
|
||||
const Vec3f v = _be.point(VertexHandle(int(i)));
|
||||
_out << v[0] << ' ' << v[1] << ' ' << v[2] << '\n';
|
||||
}
|
||||
|
||||
|
||||
@@ -92,7 +92,7 @@ class multiplex_target : public basic_multiplex_target
|
||||
{
|
||||
public:
|
||||
explicit multiplex_target(T& _t) : target_(_t) {}
|
||||
virtual void operator<<(const std::string& _s) { target_ << _s; }
|
||||
virtual void operator<<(const std::string& _s) override { target_ << _s; }
|
||||
private:
|
||||
T& target_;
|
||||
};
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
public:
|
||||
|
||||
/// Default constructor
|
||||
PropertyT(const std::string& _name = "<unknown>")
|
||||
explicit PropertyT(const std::string& _name = "<unknown>")
|
||||
: BaseProperty(_name)
|
||||
{}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user