Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenMesh
OpenMesh
Commits
669b1b78
Commit
669b1b78
authored
May 29, 2019
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cppcheck
parent
4afdd5ad
Changes
16
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
43 additions
and
41 deletions
+43
-41
src/OpenMesh/Apps/Decimating/decimater.cc
src/OpenMesh/Apps/Decimating/decimater.cc
+5
-5
src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.hh
src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.hh
+1
-1
src/OpenMesh/Core/Geometry/LoopSchemeMaskT.hh
src/OpenMesh/Core/Geometry/LoopSchemeMaskT.hh
+6
-6
src/OpenMesh/Core/Geometry/QuadricT.hh
src/OpenMesh/Core/Geometry/QuadricT.hh
+1
-1
src/OpenMesh/Core/IO/writer/BaseWriter.hh
src/OpenMesh/Core/IO/writer/BaseWriter.hh
+7
-5
src/OpenMesh/Core/IO/writer/OBJWriter.cc
src/OpenMesh/Core/IO/writer/OBJWriter.cc
+8
-8
src/OpenMesh/Core/IO/writer/VTKWriter.cc
src/OpenMesh/Core/IO/writer/VTKWriter.cc
+2
-2
src/OpenMesh/Core/System/mostream.hh
src/OpenMesh/Core/System/mostream.hh
+1
-1
src/OpenMesh/Core/Utils/Property.hh
src/OpenMesh/Core/Utils/Property.hh
+1
-1
src/OpenMesh/Tools/Decimater/BaseDecimaterT.hh
src/OpenMesh/Tools/Decimater/BaseDecimaterT.hh
+1
-1
src/OpenMesh/Tools/Decimater/DecimaterT.hh
src/OpenMesh/Tools/Decimater/DecimaterT.hh
+1
-1
src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh
src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh
+1
-1
src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh
src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh
+2
-2
src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh
src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh
+3
-3
src/OpenMesh/Tools/Decimater/ModRoundnessT.hh
src/OpenMesh/Tools/Decimater/ModRoundnessT.hh
+1
-1
src/OpenMesh/Tools/Utils/HeapT.hh
src/OpenMesh/Tools/Utils/HeapT.hh
+2
-2
No files found.
src/OpenMesh/Apps/Decimating/decimater.cc
View file @
669b1b78
...
...
@@ -216,7 +216,7 @@ decimate(const std::string &_ifname,
using
namespace
std
;
Mesh
mesh
;
OpenMesh
::
IO
::
Options
opt
;
OpenMesh
::
IO
::
Options
read
opt
;
OpenMesh
::
Utils
::
Timer
timer
;
// ---------------------------------------- read source mesh
...
...
@@ -227,7 +227,7 @@ decimate(const std::string &_ifname,
if
(
gverbose
)
clog
<<
_ifname
<<
endl
;
if
(
!
(
rc
=
OpenMesh
::
IO
::
read_mesh
(
mesh
,
_ifname
,
opt
))
)
if
(
!
(
rc
=
OpenMesh
::
IO
::
read_mesh
(
mesh
,
_ifname
,
read
opt
))
)
{
cerr
<<
" ERROR: read failed!"
<<
endl
;
return
rc
;
...
...
@@ -238,7 +238,7 @@ decimate(const std::string &_ifname,
{
// ---- 0 - For module NormalFlipping one needs face normals
if
(
!
opt
.
check
(
OpenMesh
::
IO
::
Options
::
FaceNormal
)
)
if
(
!
read
opt
.
check
(
OpenMesh
::
IO
::
Options
::
FaceNormal
)
)
{
if
(
!
mesh
.
has_face_normals
()
)
mesh
.
request_face_normals
();
...
...
@@ -420,11 +420,11 @@ decimate(const std::string &_ifname,
ofname
.
insert
(
++
pos
,
n
);
}
OpenMesh
::
IO
::
Options
opt
;
OpenMesh
::
IO
::
Options
write
opt
;
//opt += OpenMesh::IO::Options::Binary;
if
(
!
OpenMesh
::
IO
::
write_mesh
(
mesh
,
ofname
,
opt
)
)
if
(
!
OpenMesh
::
IO
::
write_mesh
(
mesh
,
ofname
,
write
opt
)
)
{
std
::
cerr
<<
" Cannot write decimated mesh to file '"
<<
ofname
<<
"'
\n
"
;
...
...
src/OpenMesh/Apps/ProgViewer/ProgViewerWidget.hh
View file @
669b1b78
...
...
@@ -137,7 +137,7 @@ private:
/// coarsen mesh down to _n vertices
void
coarsen
(
unsigned
int
_n
);
virtual
void
keyPressEvent
(
QKeyEvent
*
_event
);
virtual
void
keyPressEvent
(
QKeyEvent
*
_event
)
override
;
// mesh data
bool
animateRefinement_
;
...
...
src/OpenMesh/Core/Geometry/LoopSchemeMaskT.hh
View file @
669b1b78
...
...
@@ -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
;
}
...
...
src/OpenMesh/Core/Geometry/QuadricT.hh
View file @
669b1b78
...
...
@@ -112,7 +112,7 @@ public:
{}
template
<
class
_Point
>
QuadricT
(
const
_Point
&
_pt
)
explicit
QuadricT
(
const
_Point
&
_pt
)
{
set_distance_to_point
(
_pt
);
}
...
...
src/OpenMesh/Core/IO/writer/BaseWriter.hh
View file @
669b1b78
...
...
@@ -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
());
}
};
...
...
src/OpenMesh/Core/IO/writer/OBJWriter.cc
View file @
669b1b78
...
...
@@ -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
dot
position
=
_filename
.
find_last_of
(
"
\\
/"
);
#else
std
::
string
::
size_type
dot
=
_filename
.
rfind
(
"/"
);
std
::
string
::
size_type
dot
position
=
_filename
.
rfind
(
"/"
);
#endif
if
(
dot
==
std
::
string
::
npos
){
if
(
dot
position
==
std
::
string
::
npos
){
path_
=
"./"
;
objName_
=
_filename
;
}
else
{
path_
=
_filename
.
substr
(
0
,
dot
+
1
);
objName_
=
_filename
.
substr
(
dot
+
1
);
path_
=
_filename
.
substr
(
0
,
dot
position
+
1
);
objName_
=
_filename
.
substr
(
dot
position
+
1
);
}
//remove the file extension
dot
=
objName_
.
find_last_of
(
"."
);
dot
position
=
objName_
.
find_last_of
(
"."
);
if
(
dot
!=
std
::
string
::
npos
)
objName_
=
objName_
.
substr
(
0
,
dot
);
if
(
dot
position
!=
std
::
string
::
npos
)
objName_
=
objName_
.
substr
(
0
,
dot
position
);
}
bool
result
=
write
(
out
,
_be
,
_opt
,
_precision
);
...
...
src/OpenMesh/Core/IO/writer/VTKWriter.cc
View file @
669b1b78
...
...
@@ -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'
;
}
...
...
src/OpenMesh/Core/System/mostream.hh
View file @
669b1b78
...
...
@@ -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_
;
};
...
...
src/OpenMesh/Core/Utils/Property.hh
View file @
669b1b78
...
...
@@ -99,7 +99,7 @@ public:
public:
/// Default constructor
PropertyT
(
const
std
::
string
&
_name
=
"<unknown>"
)
explicit
PropertyT
(
const
std
::
string
&
_name
=
"<unknown>"
)
:
BaseProperty
(
_name
)
{}
...
...
src/OpenMesh/Tools/Decimater/BaseDecimaterT.hh
View file @
669b1b78
...
...
@@ -94,7 +94,7 @@ public: //-------------------------------------------------------- public types
typedef
typename
ModuleList
::
iterator
ModuleListIterator
;
public:
//------------------------------------------------------ public methods
BaseDecimaterT
(
Mesh
&
_mesh
);
explicit
BaseDecimaterT
(
Mesh
&
_mesh
);
virtual
~
BaseDecimaterT
();
/** Initialize decimater and decimating modules.
...
...
src/OpenMesh/Tools/Decimater/DecimaterT.hh
View file @
669b1b78
...
...
@@ -89,7 +89,7 @@ public: //-------------------------------------------------------- public types
public:
//------------------------------------------------------ public methods
/// Constructor
DecimaterT
(
Mesh
&
_mesh
);
explicit
DecimaterT
(
Mesh
&
_mesh
);
/// Destructor
~
DecimaterT
();
...
...
src/OpenMesh/Tools/Decimater/ModIndependentSetsT.hh
View file @
669b1b78
...
...
@@ -72,7 +72,7 @@ class ModIndependentSetsT: public ModBaseT<MeshT> {
;
/// Constructor
ModIndependentSetsT
(
MeshT
&
_mesh
)
:
explicit
ModIndependentSetsT
(
MeshT
&
_mesh
)
:
Base
(
_mesh
,
true
)
{
}
...
...
src/OpenMesh/Tools/Decimater/ModNormalDeviationT.hh
View file @
669b1b78
...
...
@@ -208,9 +208,9 @@ public:
// the smaller the factor, the smaller normal_deviation_ gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
Scalar
normal_deviation
=
normal_deviation_
*
static_cast
<
Scalar
>
(
180.0
/
M_PI
*
_factor
/
this
->
error_tolerance_factor_
);
Scalar
normal_deviation
_value
=
normal_deviation_
*
static_cast
<
Scalar
>
(
180.0
/
M_PI
*
_factor
/
this
->
error_tolerance_factor_
);
set_normal_deviation
(
normal_deviation
);
set_normal_deviation
(
normal_deviation
_value
);
this
->
error_tolerance_factor_
=
_factor
;
}
}
...
...
src/OpenMesh/Tools/Decimater/ModNormalFlippingT.hh
View file @
669b1b78
...
...
@@ -86,7 +86,7 @@ public:
public:
/// Constructor
ModNormalFlippingT
(
MeshT
&
_mesh
)
:
Base
(
_mesh
,
true
)
explicit
ModNormalFlippingT
(
MeshT
&
_mesh
)
:
Base
(
_mesh
,
true
)
{
set_max_normal_deviation
(
90.0
f
);
const
bool
mesh_has_normals
=
_mesh
.
has_face_normals
();
...
...
@@ -159,8 +159,8 @@ public:
// the smaller the factor, the smaller max_deviation_ gets
// thus creating a stricter constraint
// division by error_tolerance_factor_ is for normalization
double
max_normal_deviation
=
(
max_deviation_
*
180.0
/
M_PI
)
*
_factor
/
this
->
error_tolerance_factor_
;
set_max_normal_deviation
(
max_normal_deviation
);
double
max_normal_deviation
_value
=
(
max_deviation_
*
180.0
/
M_PI
)
*
_factor
/
this
->
error_tolerance_factor_
;
set_max_normal_deviation
(
max_normal_deviation
_value
);
this
->
error_tolerance_factor_
=
_factor
;
}
}
...
...
src/OpenMesh/Tools/Decimater/ModRoundnessT.hh
View file @
669b1b78
...
...
@@ -97,7 +97,7 @@ class ModRoundnessT : public ModBaseT<MeshT>
public:
/// Constructor
ModRoundnessT
(
MeshT
&
_dec
)
:
explicit
ModRoundnessT
(
MeshT
&
_dec
)
:
Base
(
_dec
,
false
),
min_r_
(
-
1.0
)
{
}
...
...
src/OpenMesh/Tools/Utils/HeapT.hh
View file @
669b1b78
...
...
@@ -258,9 +258,9 @@ public:
bool
check
()
{
bool
ok
(
true
);
unsigned
int
i
,
j
;
for
(
i
=
0
;
i
<
size
();
++
i
)
for
(
unsigned
int
i
=
0
;
i
<
size
();
++
i
)
{
unsigned
int
j
;
if
(((
j
=
left
(
i
))
<
size
())
&&
interface_
.
greater
(
entry
(
i
),
entry
(
j
)))
{
omerr
()
<<
"Heap condition violated
\n
"
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment