cppcheck
This commit is contained in:
@@ -95,7 +95,11 @@ public:
|
||||
public:
|
||||
/// default constructor
|
||||
ProgViewerWidget(QWidget* _parent=0)
|
||||
: MeshViewerWidget(_parent)
|
||||
: MeshViewerWidget(_parent),
|
||||
n_base_vertices_(0),
|
||||
n_base_faces_(0),
|
||||
n_detail_vertices_(0),
|
||||
n_max_vertices_(0)
|
||||
{
|
||||
timer_ = new QTimer(this);
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
typedef QGLWidget Super;
|
||||
|
||||
// Default constructor.
|
||||
QGLViewerWidget( QWidget* _parent=0 );
|
||||
explicit QGLViewerWidget( QWidget* _parent=0 );
|
||||
|
||||
//
|
||||
QGLViewerWidget( QGLFormat& _fmt, QWidget* _parent=0 );
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
~MeshViewerWidget() {}
|
||||
|
||||
/// open mesh
|
||||
inline bool open_mesh(const char* _filename, OpenMesh::IO::Options _opt)
|
||||
inline bool open_mesh(const char* _filename, OpenMesh::IO::Options _opt) override
|
||||
{
|
||||
if ( Base::open_mesh( _filename, _opt ) )
|
||||
{
|
||||
|
||||
@@ -78,7 +78,14 @@ namespace OpenMesh {
|
||||
//== IMPLEMENTATION ==========================================================
|
||||
|
||||
VDPMSynthesizerViewerWidget::VDPMSynthesizerViewerWidget(QWidget* _parent, const char* _name)
|
||||
: MeshViewerWidget(_parent)
|
||||
: MeshViewerWidget(_parent),
|
||||
kappa_square_(0.0),
|
||||
adaptive_mode_(false),
|
||||
n_base_vertices_(0),
|
||||
n_base_edges_(0),
|
||||
n_base_faces_(0),
|
||||
n_details_(0)
|
||||
|
||||
{
|
||||
adaptive_mode_ = true;
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ namespace OMFormat {
|
||||
|
||||
PropertyName( ) { }
|
||||
|
||||
PropertyName( const std::string& _name ) { *this = _name; }
|
||||
explicit PropertyName( const std::string& _name ) { *this = _name; }
|
||||
|
||||
bool is_valid() const { return is_valid( size() ); }
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ class ExporterT : public BaseExporter
|
||||
public:
|
||||
|
||||
// Constructor
|
||||
ExporterT(const Mesh& _mesh) : mesh_(_mesh) {}
|
||||
explicit ExporterT(const Mesh& _mesh) : mesh_(_mesh) {}
|
||||
|
||||
|
||||
// get vertex data
|
||||
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
typedef std::vector<VertexHandle> VHandles;
|
||||
|
||||
|
||||
ImporterT(Mesh& _mesh) : mesh_(_mesh), halfedgeNormals_() {}
|
||||
explicit ImporterT(Mesh& _mesh) : mesh_(_mesh), halfedgeNormals_() {}
|
||||
|
||||
|
||||
virtual VertexHandle add_vertex(const Vec3f& _point) override
|
||||
|
||||
@@ -387,10 +387,12 @@ bool _OMReader_::read_binary_vertex_chunk(std::istream &_is, BaseImporter &_bi,
|
||||
default: // skip unknown chunks
|
||||
{
|
||||
omerr() << "Unknown chunk type ignored!\n";
|
||||
size_t size_of = header_.n_vertices_ * OMFormat::vector_size(chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = header_.n_vertices_ * OMFormat::vector_size(chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// all chunk data has been read..?!
|
||||
@@ -505,9 +507,9 @@ bool _OMReader_::read_binary_face_chunk(std::istream &_is, BaseImporter &_bi, Op
|
||||
default: // skip unknown chunks
|
||||
{
|
||||
omerr() << "Unknown chunk type ignore!\n";
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
}
|
||||
return fidx == header_.n_faces_;
|
||||
@@ -549,9 +551,9 @@ bool _OMReader_::read_binary_edge_chunk(std::istream &_is, BaseImporter &_bi, Op
|
||||
|
||||
default:
|
||||
// skip unknown type
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
|
||||
return b < bytes_;
|
||||
@@ -627,9 +629,9 @@ bool _OMReader_::read_binary_halfedge_chunk(std::istream &_is, BaseImporter &_bi
|
||||
default:
|
||||
// skip unknown chunk
|
||||
omerr() << "Unknown chunk type ignored!\n";
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
|
||||
return b < bytes_;
|
||||
@@ -655,9 +657,9 @@ bool _OMReader_::read_binary_mesh_chunk(std::istream &_is, BaseImporter &_bi, Op
|
||||
|
||||
default:
|
||||
// skip unknown chunk
|
||||
size_t size_of = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(size_of);
|
||||
bytes_ += size_of;
|
||||
size_t chunk_size = OMFormat::chunk_data_size(header_, chunk_header_);
|
||||
_is.ignore(chunk_size);
|
||||
bytes_ += chunk_size;
|
||||
}
|
||||
|
||||
return b < bytes_;
|
||||
|
||||
@@ -120,7 +120,7 @@ private:
|
||||
{
|
||||
ValueType type;
|
||||
const BaseProperty* property;
|
||||
CustomProperty(const BaseProperty* const _p):type(Unsupported),property(_p){}
|
||||
explicit CustomProperty(const BaseProperty* const _p):type(Unsupported),property(_p){}
|
||||
};
|
||||
|
||||
const char* nameOfType_[12];
|
||||
|
||||
@@ -340,10 +340,10 @@ public:
|
||||
void clean_keep_reservation();
|
||||
|
||||
// --- number of items ---
|
||||
size_t n_vertices() const { return vertices_.size(); }
|
||||
size_t n_halfedges() const { return 2*edges_.size(); }
|
||||
size_t n_edges() const { return edges_.size(); }
|
||||
size_t n_faces() const { return faces_.size(); }
|
||||
size_t n_vertices() const override { return vertices_.size(); }
|
||||
size_t n_halfedges() const override { return 2*edges_.size(); }
|
||||
size_t n_edges() const override { return edges_.size(); }
|
||||
size_t n_faces() const override { return faces_.size(); }
|
||||
|
||||
bool vertices_empty() const { return vertices_.empty(); }
|
||||
bool halfedges_empty() const { return edges_.empty(); }
|
||||
@@ -697,7 +697,7 @@ public:
|
||||
typedef StatusSetT<Handle> Base;
|
||||
|
||||
public:
|
||||
AutoStatusSetT(ArrayKernel& _kernel)
|
||||
explicit AutoStatusSetT(ArrayKernel& _kernel)
|
||||
: StatusSetT<Handle>(_kernel, _kernel.pop_bit_mask(Handle()))
|
||||
{ /*assert(size() == 0);*/ } //the set should be empty on creation
|
||||
|
||||
|
||||
@@ -1121,7 +1121,7 @@ public:
|
||||
typedef ITER_TYPE iterator;
|
||||
typedef ITER_TYPE const_iterator;
|
||||
|
||||
EntityRange(CONTAINER_TYPE &container) : container_(container) {}
|
||||
explicit EntityRange(CONTAINER_TYPE &container) : container_(container) {}
|
||||
ITER_TYPE begin() const { return (container_.*begin_fn)(); }
|
||||
ITER_TYPE end() const { return (container_.*end_fn)(); }
|
||||
|
||||
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
PropertyT(const std::string& _name = "<unknown>")
|
||||
explicit PropertyT(const std::string& _name = "<unknown>")
|
||||
: BaseProperty(_name)
|
||||
{ }
|
||||
|
||||
@@ -394,7 +394,7 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
PropertyT(const std::string& _name = "<unknown>")
|
||||
explicit PropertyT(const std::string& _name = "<unknown>")
|
||||
: BaseProperty(_name)
|
||||
{ }
|
||||
|
||||
|
||||
@@ -322,21 +322,21 @@ private:
|
||||
#ifndef DOXY_IGNORE_THIS
|
||||
struct Reserve
|
||||
{
|
||||
Reserve(size_t _n) : n_(_n) {}
|
||||
explicit Reserve(size_t _n) : n_(_n) {}
|
||||
void operator()(BaseProperty* _p) const { if (_p) _p->reserve(n_); }
|
||||
size_t n_;
|
||||
};
|
||||
|
||||
struct Resize
|
||||
{
|
||||
Resize(size_t _n) : n_(_n) {}
|
||||
explicit Resize(size_t _n) : n_(_n) {}
|
||||
void operator()(BaseProperty* _p) const { if (_p) _p->resize(n_); }
|
||||
size_t n_;
|
||||
};
|
||||
|
||||
struct ResizeIfSmaller
|
||||
{
|
||||
ResizeIfSmaller(size_t _n) : n_(_n) {}
|
||||
explicit ResizeIfSmaller(size_t _n) : n_(_n) {}
|
||||
void operator()(BaseProperty* _p) const { if (_p && _p->n_elements() < n_) _p->resize(n_); }
|
||||
size_t n_;
|
||||
};
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
/** Constructor
|
||||
* \internal
|
||||
*/
|
||||
ModQuadricT( MeshT &_mesh )
|
||||
explicit ModQuadricT( MeshT &_mesh )
|
||||
: Base(_mesh, false)
|
||||
{
|
||||
unset_max_err();
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
public: // inherited
|
||||
|
||||
/// Initalize the module and prepare the mesh for decimation.
|
||||
virtual void initialize(void);
|
||||
virtual void initialize(void) override;
|
||||
|
||||
/** Compute collapse priority based on error quadrics.
|
||||
*
|
||||
@@ -138,7 +138,7 @@ public: // inherited
|
||||
}
|
||||
|
||||
/// set the percentage of maximum quadric error
|
||||
void set_error_tolerance_factor(double _factor);
|
||||
void set_error_tolerance_factor(double _factor) override;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ struct RuleHandleT : public BaseHandle
|
||||
protected:\
|
||||
friend class CompositeT<mesh_type>; \
|
||||
public: \
|
||||
const char *type() const { return #classname; } \
|
||||
const char *type() const override { return #classname; } \
|
||||
typedef classname<mesh_type> Self; \
|
||||
typedef RuleHandleT< Self > Handle
|
||||
|
||||
|
||||
@@ -242,7 +242,7 @@ public:
|
||||
|
||||
explicit FVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); }
|
||||
|
||||
void raise(typename M::VertexHandle& _vh, state_t _target_state);
|
||||
void raise(typename M::VertexHandle& _vh, state_t _target_state) override;
|
||||
MIPS_WARN_WA(Face) // avoid warning
|
||||
MIPS_WARN_WA(Edge) // avoid warning
|
||||
|
||||
@@ -412,7 +412,7 @@ public:
|
||||
|
||||
explicit EVc(M& _mesh) : Inherited(_mesh) { init_coeffs(50); }
|
||||
|
||||
void raise(typename M::VertexHandle& _vh, state_t _target_state);
|
||||
void raise(typename M::VertexHandle& _vh, state_t _target_state) override;
|
||||
MIPS_WARN_WA(Face) // avoid warning
|
||||
MIPS_WARN_WA(Edge) // avoid warning
|
||||
|
||||
|
||||
@@ -114,15 +114,15 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
const char *name() const { return "Uniform CatmullClark"; }
|
||||
const char *name() const override { return "Uniform CatmullClark"; }
|
||||
|
||||
protected:
|
||||
|
||||
/// Initialize properties and weights
|
||||
virtual bool prepare( MeshType& _m );
|
||||
virtual bool prepare( MeshType& _m ) override;
|
||||
|
||||
/// Remove properties and weights
|
||||
virtual bool cleanup( MeshType& _m );
|
||||
virtual bool cleanup( MeshType& _m ) override;
|
||||
|
||||
/** \brief Execute n subdivision steps
|
||||
*
|
||||
@@ -131,7 +131,7 @@ protected:
|
||||
* @param _update_points Unused here
|
||||
* @return successful?
|
||||
*/
|
||||
virtual bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true);
|
||||
virtual bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true) override;
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -102,13 +102,13 @@ public:
|
||||
|
||||
public: // inherited interface
|
||||
|
||||
virtual const char *name( void ) const = 0;
|
||||
virtual const char *name( void ) const override = 0;
|
||||
|
||||
protected: // inherited interface
|
||||
|
||||
bool prepare( MeshType& _m );
|
||||
bool prepare( MeshType& _m ) override;
|
||||
|
||||
bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true )
|
||||
bool subdivide( MeshType& _m, size_t _n, const bool _update_points = true ) override
|
||||
{
|
||||
assert( p_mesh_ == &_m );
|
||||
|
||||
@@ -124,7 +124,7 @@ protected: // inherited interface
|
||||
#ifdef NDEBUG
|
||||
bool cleanup( MeshType& )
|
||||
#else
|
||||
bool cleanup( MeshType& _m )
|
||||
bool cleanup( MeshType& _m ) override
|
||||
#endif
|
||||
{
|
||||
assert( p_mesh_ == &_m );
|
||||
|
||||
@@ -87,11 +87,11 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
const char *name() const { return "Uniform Composite Loop"; }
|
||||
const char *name() const override { return "Uniform Composite Loop"; }
|
||||
|
||||
protected: // inherited interface
|
||||
|
||||
void apply_rules(void)
|
||||
void apply_rules(void) override
|
||||
{
|
||||
Inherited::Tvv4();
|
||||
Inherited::VdE();
|
||||
@@ -119,7 +119,7 @@ protected:
|
||||
weights_.end(), compute_weight() );
|
||||
}
|
||||
|
||||
double operator()(size_t _valence) { return weights_[_valence]; }
|
||||
double operator()(size_t _valence) override { return weights_[_valence]; }
|
||||
|
||||
/// \internal
|
||||
struct compute_weight
|
||||
|
||||
@@ -87,11 +87,11 @@ public:
|
||||
|
||||
public:
|
||||
|
||||
const char *name() const { return "Uniform Composite Sqrt3"; }
|
||||
const char *name() const override { return "Uniform Composite Sqrt3"; }
|
||||
|
||||
protected: // inherited interface
|
||||
|
||||
void apply_rules(void)
|
||||
void apply_rules(void) override
|
||||
{
|
||||
Inherited::Tvv3();
|
||||
Inherited::VF();
|
||||
@@ -117,7 +117,7 @@ protected:
|
||||
weights_.end(), compute_weight() );
|
||||
}
|
||||
|
||||
double operator()(size_t _valence) { return weights_[_valence]; }
|
||||
double operator()(size_t _valence) override { return weights_[_valence]; }
|
||||
|
||||
/** \internal
|
||||
*/
|
||||
|
||||
@@ -116,7 +116,7 @@ public:
|
||||
public:
|
||||
|
||||
|
||||
const char *name() const { return "Uniform Loop"; }
|
||||
const char *name() const override { return "Uniform Loop"; }
|
||||
|
||||
|
||||
/// Pre-compute weights
|
||||
@@ -130,7 +130,7 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
bool prepare( mesh_t& _m )
|
||||
bool prepare( mesh_t& _m ) override
|
||||
{
|
||||
_m.add_property( vp_pos_ );
|
||||
_m.add_property( ep_pos_ );
|
||||
@@ -138,7 +138,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
bool cleanup( mesh_t& _m )
|
||||
bool cleanup( mesh_t& _m ) override
|
||||
{
|
||||
_m.remove_property( vp_pos_ );
|
||||
_m.remove_property( ep_pos_ );
|
||||
@@ -146,7 +146,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
bool subdivide( mesh_t& _m, size_t _n, const bool _update_points = true)
|
||||
bool subdivide( mesh_t& _m, size_t _n, const bool _update_points = true) override
|
||||
{
|
||||
|
||||
///TODO:Implement fixed positions
|
||||
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
public:
|
||||
|
||||
|
||||
const char *name() const { return "Uniform Spectral"; }
|
||||
const char *name() const override { return "Uniform Spectral"; }
|
||||
|
||||
|
||||
/// Pre-compute weights
|
||||
@@ -158,7 +158,7 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
bool prepare( mesh_t& _m )
|
||||
bool prepare( mesh_t& _m ) override
|
||||
{
|
||||
_m.add_property( vp_pos_ );
|
||||
_m.add_property( ep_pos_ );
|
||||
@@ -166,7 +166,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
bool cleanup( mesh_t& _m )
|
||||
bool cleanup( mesh_t& _m ) override
|
||||
{
|
||||
_m.remove_property( vp_pos_ );
|
||||
_m.remove_property( ep_pos_ );
|
||||
@@ -174,7 +174,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true)
|
||||
bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true) override
|
||||
{
|
||||
|
||||
///TODO:Implement fixed positions
|
||||
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
public:
|
||||
|
||||
|
||||
const char *name() const { return "Uniform Interpolating Sqrt3"; }
|
||||
const char *name() const override { return "Uniform Interpolating Sqrt3"; }
|
||||
|
||||
/// Pre-compute weights
|
||||
void init_weights(size_t _max_valence=50)
|
||||
@@ -170,7 +170,7 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
bool prepare( MeshType& _m )
|
||||
bool prepare( MeshType& _m ) override
|
||||
{
|
||||
_m.request_edge_status();
|
||||
_m.add_property( fp_pos_ );
|
||||
@@ -183,7 +183,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
bool cleanup( MeshType& _m )
|
||||
bool cleanup( MeshType& _m ) override
|
||||
{
|
||||
_m.release_edge_status();
|
||||
_m.remove_property( fp_pos_ );
|
||||
@@ -193,7 +193,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true)
|
||||
bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true) override
|
||||
{
|
||||
|
||||
///TODO:Implement fixed positions
|
||||
|
||||
@@ -121,7 +121,7 @@ public:
|
||||
public:
|
||||
|
||||
|
||||
const char *name() const { return "Uniform Sqrt3"; }
|
||||
const char *name() const override { return "Uniform Sqrt3"; }
|
||||
|
||||
|
||||
/// Pre-compute weights
|
||||
@@ -135,7 +135,7 @@ public:
|
||||
protected:
|
||||
|
||||
|
||||
bool prepare( MeshType& _m )
|
||||
bool prepare( MeshType& _m ) override
|
||||
{
|
||||
_m.request_edge_status();
|
||||
_m.add_property( vp_pos_ );
|
||||
@@ -148,7 +148,7 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
bool cleanup( MeshType& _m )
|
||||
bool cleanup( MeshType& _m ) override
|
||||
{
|
||||
_m.release_edge_status();
|
||||
_m.remove_property( vp_pos_ );
|
||||
@@ -157,7 +157,7 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true)
|
||||
bool subdivide( MeshType& _m, size_t _n , const bool _update_points = true) override
|
||||
{
|
||||
|
||||
///TODO:Implement fixed positions
|
||||
|
||||
@@ -152,7 +152,7 @@ public:
|
||||
{}
|
||||
#else
|
||||
/// Construct with a given \c HeapIterface.
|
||||
HeapT(const HeapInterface &_interface)
|
||||
explicit HeapT(const HeapInterface &_interface)
|
||||
: HeapVector(), interface_(_interface)
|
||||
{}
|
||||
#endif
|
||||
|
||||
@@ -88,7 +88,7 @@ public:
|
||||
|
||||
|
||||
/// Default constructor
|
||||
StripifierT(Mesh& _mesh);
|
||||
explicit StripifierT(Mesh& _mesh);
|
||||
|
||||
/// Destructor
|
||||
~StripifierT();
|
||||
|
||||
Reference in New Issue
Block a user