This commit is contained in:
Jan Möbius
2019-05-28 14:04:58 +02:00
parent 87d2161c5d
commit f468efacd0
14 changed files with 27 additions and 25 deletions

View File

@@ -77,7 +77,7 @@ public:
public: public:
/// default constructor /// default constructor
MeshViewerWidgetT(QWidget* _parent=0) explicit MeshViewerWidgetT(QWidget* _parent=0)
: QGLViewerWidget(_parent), : QGLViewerWidget(_parent),
f_strips_(false), f_strips_(false),
tex_id_(0), tex_id_(0),
@@ -85,7 +85,8 @@ public:
strips_(mesh_), strips_(mesh_),
use_color_(true), use_color_(true),
show_vnormals_(false), show_vnormals_(false),
show_fnormals_(false) show_fnormals_(false),
normal_scale_(1.0)
{ {
add_draw_mode("Points"); add_draw_mode("Points");
add_draw_mode("Hidden-Line"); add_draw_mode("Hidden-Line");

View File

@@ -135,13 +135,13 @@ read(const std::string& _filename, BaseImporter& _bi, Options& _opt)
{ {
#if defined(WIN32) #if defined(WIN32)
std::string::size_type dot = _filename.find_last_of("\\/"); std::string::size_type dot_pos = _filename.find_last_of("\\/");
#else #else
std::string::size_type dot = _filename.rfind("/"); std::string::size_type dot_pos = _filename.rfind("/");
#endif #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); bool result = read(in, _bi, _opt);

View File

@@ -206,7 +206,7 @@ _OBJWriter_::
write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _precision) const
{ {
unsigned int idx; unsigned int idx;
size_t i, j,nV, nF; size_t nV, nF;
Vec3f v, n; Vec3f v, n;
Vec2f t; Vec2f t;
VertexHandle vh; VertexHandle vh;
@@ -273,7 +273,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
std::vector<Vec2f> texCoords; std::vector<Vec2f> texCoords;
//add all texCoords to map //add all texCoords to map
unsigned int num = _be.get_face_texcoords(texCoords); 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; texMap[texCoords[i]] = i;
} }
@@ -303,7 +303,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
} }
// vertex data (point, normals, texcoords) // 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)); vh = VertexHandle(int(i));
v = _be.point(vh); v = _be.point(vh);
@@ -324,7 +324,7 @@ write(std::ostream& _out, BaseExporter& _be, Options _opt, std::streamsize _prec
&& !_opt.check(Options::FaceTexCoord); && !_opt.check(Options::FaceTexCoord);
// faces (indices starting at 1 not 0) // 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) ){ 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); _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 // Write vertex index

View File

@@ -97,7 +97,7 @@ class PolyMesh_ArrayKernelT
public: public:
PolyMesh_ArrayKernelT() {} PolyMesh_ArrayKernelT() {}
template<class OtherTraits> template<class OtherTraits>
PolyMesh_ArrayKernelT( const TriMesh_ArrayKernelT<OtherTraits> & t) explicit PolyMesh_ArrayKernelT( const TriMesh_ArrayKernelT<OtherTraits> & t)
{ {
//assign the connectivity and standard properties //assign the connectivity and standard properties
this->assign(t, true); this->assign(t, true);

View File

@@ -97,7 +97,7 @@ class TriMesh_ArrayKernelT
public: public:
TriMesh_ArrayKernelT() {} TriMesh_ArrayKernelT() {}
template<class OtherTraits> template<class OtherTraits>
TriMesh_ArrayKernelT( const PolyMesh_ArrayKernelT<OtherTraits> & t) explicit TriMesh_ArrayKernelT( const PolyMesh_ArrayKernelT<OtherTraits> & t)
{ {
//assign the connectivity and standard properties //assign the connectivity and standard properties
this->assign(t,true); this->assign(t,true);

View File

@@ -90,7 +90,7 @@ public:
{ {
/// Initializing constructor copies appropriate handles from /// Initializing constructor copies appropriate handles from
/// collapse information \c _ci. /// 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) : v0(_ci.v0), v1(_ci.v1), vl(_ci.vl),vr(_ci.vr)
{} {}
@@ -108,7 +108,7 @@ public:
public: public:
/// Constructor /// Constructor
ModProgMeshT( MeshT &_mesh ) : Base(_mesh, true) explicit ModProgMeshT( MeshT &_mesh ) : Base(_mesh, true)
{ {
Base::mesh().add_property( idx_ ); Base::mesh().add_property( idx_ );
} }

View File

@@ -134,7 +134,6 @@ compute_weights(LaplaceWeighting _weighting)
typename Mesh::EdgeIter e_it, e_end(Base::mesh_.edges_end()); typename Mesh::EdgeIter e_it, e_end(Base::mesh_.edges_end());
typename Mesh::HalfedgeHandle heh0, heh1, heh2; typename Mesh::HalfedgeHandle heh0, heh1, heh2;
typename Mesh::VertexHandle v0, v1; typename Mesh::VertexHandle v0, v1;
const typename Mesh::Point *p0, *p1, *p2;
typename Mesh::Normal d0, d1; typename Mesh::Normal d0, d1;
typename Mesh::Scalar weight, lb(-1.0), ub(1.0); typename Mesh::Scalar weight, lb(-1.0), ub(1.0);
@@ -172,6 +171,8 @@ compute_weights(LaplaceWeighting _weighting)
{ {
for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it) for (e_it=Base::mesh_.edges_begin(); e_it!=e_end; ++e_it)
{ {
const typename Mesh::Point *p0, *p1, *p2;
weight = 0.0; weight = 0.0;
heh0 = Base::mesh_.halfedge_handle(*e_it, 0); heh0 = Base::mesh_.halfedge_handle(*e_it, 0);

View File

@@ -82,7 +82,7 @@ public:
public: public:
CompositeLoopT() : Inherited() {}; CompositeLoopT() : Inherited() {};
CompositeLoopT(MeshType& _mesh) : Inherited(_mesh) {}; explicit CompositeLoopT(MeshType& _mesh) : Inherited(_mesh) {};
~CompositeLoopT() {} ~CompositeLoopT() {}
public: public:

View File

@@ -82,7 +82,7 @@ public:
public: public:
CompositeSqrt3T() : Inherited() {}; CompositeSqrt3T() : Inherited() {};
CompositeSqrt3T(MeshType& _mesh) : Inherited(_mesh) {}; explicit CompositeSqrt3T(MeshType& _mesh) : Inherited(_mesh) {};
~CompositeSqrt3T() {} ~CompositeSqrt3T() {}
public: public:

View File

@@ -106,7 +106,7 @@ public:
{ init_weights(); } { 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(); } { init_weights(); }

View File

@@ -107,7 +107,7 @@ public:
{ init_weights(); } { init_weights(); }
ModifiedButterflyT( mesh_t& _m) : parent_t(_m) explicit ModifiedButterflyT( mesh_t& _m) : parent_t(_m)
{ init_weights(); } { init_weights(); }

View File

@@ -119,7 +119,7 @@ public:
InterpolatingSqrt3LGT(void) : parent_t() InterpolatingSqrt3LGT(void) : parent_t()
{ init_weights(); } { init_weights(); }
InterpolatingSqrt3LGT(MeshType &_m) : parent_t(_m) explicit InterpolatingSqrt3LGT(MeshType &_m) : parent_t(_m)
{ init_weights(); } { init_weights(); }
virtual ~InterpolatingSqrt3LGT() {} virtual ~InterpolatingSqrt3LGT() {}

View File

@@ -112,7 +112,7 @@ public:
Sqrt3T(void) : parent_t(), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) ) Sqrt3T(void) : parent_t(), _1over3( real_t(1.0/3.0) ), _1over27( real_t(1.0/27.0) )
{ init_weights(); } { 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(); } { init_weights(); }
virtual ~Sqrt3T() {} virtual ~Sqrt3T() {}