Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
OpenMesh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
11
Issues
11
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenMesh
OpenMesh
Commits
4afdd5ad
Commit
4afdd5ad
authored
May 29, 2019
by
Jan Möbius
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cppcheck
parent
8cffe1c3
Pipeline
#10641
canceled with stage
in 31 minutes and 53 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
186 additions
and
186 deletions
+186
-186
CI/ci-cppcheck.sh
CI/ci-cppcheck.sh
+2
-2
src/OpenMesh/Apps/Subdivider/MeshViewerWidget.hh
src/OpenMesh/Apps/Subdivider/MeshViewerWidget.hh
+1
-1
src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
+1
-1
src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeTraits.hh
...esh/Tools/Subdivider/Uniform/Composite/CompositeTraits.hh
+1
-0
src/OpenMesh/Tools/Utils/HeapT.hh
src/OpenMesh/Tools/Utils/HeapT.hh
+1
-2
src/OpenMesh/Tools/VDPM/VHierarchyWindow.hh
src/OpenMesh/Tools/VDPM/VHierarchyWindow.hh
+180
-180
No files found.
CI/ci-cppcheck.sh
View file @
4afdd5ad
...
...
@@ -20,7 +20,7 @@ echo -e "${NC}"
echo
"Please Wait ..."
# Run cppcheck and output into file
cppcheck
--enable
=
all
.
-I
src
-i
Doc/
--force
--suppress
=
unusedFunction
-UCTIME
--suppress
=
missingIncludeSystem
--inline-suppr
--quiet
-Umin
-Umax
-DOPENMESHDLLEXPORT
=
""
-UPRIVATE_NODE_TYPESYSTEM_SOURCE
-USO_NODE_ABSTRACT_SOURCE
-USO_NODE_SOURCE
-UCLOCK_REALTIME_HR
-i
src/OpenMesh/Apps/Unsupported/ 2>&1 |
tee
cppcheck.log
cppcheck
--enable
=
all
.
-I
src
-i
Doc/
-
i
src/Unittests
-
-force
--suppress
=
unusedFunction
-UCTIME
--suppress
=
missingIncludeSystem
--inline-suppr
--quiet
-Umin
-Umax
-DOPENMESHDLLEXPORT
=
""
-UPRIVATE_NODE_TYPESYSTEM_SOURCE
-USO_NODE_ABSTRACT_SOURCE
-USO_NODE_SOURCE
-UCLOCK_REALTIME_HR
-i
src/OpenMesh/Apps/Unsupported/ 2>&1 |
tee
cppcheck.log
COUNT
=
$(
wc
-l
< cppcheck.log
)
...
...
@@ -30,7 +30,7 @@ echo "CPPCHECK Summary"
echo
"=============================================================================="
echo
-e
"
${
NC
}
"
MAX_COUNT
=
0
MAX_COUNT
=
10
0
if
[
$COUNT
-gt
$MAX_COUNT
]
;
then
echo
-e
${
WARNING
}
...
...
src/OpenMesh/Apps/Subdivider/MeshViewerWidget.hh
View file @
4afdd5ad
...
...
@@ -72,7 +72,7 @@ public:
typedef
MeshViewerWidgetT
<
Mesh
>
Base
;
/// default constructor
MeshViewerWidget
(
QWidget
*
_parent
=
0
)
explicit
MeshViewerWidget
(
QWidget
*
_parent
=
0
)
:
Base
(
_parent
)
{}
...
...
src/OpenMesh/Apps/VDProgMesh/mkbalancedpm/mkbalancedpm.cc
View file @
4afdd5ad
...
...
@@ -107,7 +107,7 @@ public:
public:
// inherited
void
initialize
(
void
)
void
initialize
(
void
)
override
{
BaseModQ
::
initialize
();
n_vertices_
=
BaseModQ
::
mesh
().
n_vertices
();
...
...
src/OpenMesh/Tools/Subdivider/Uniform/Composite/CompositeTraits.hh
View file @
4afdd5ad
...
...
@@ -86,6 +86,7 @@ struct CompositeTraits : public OpenMesh::DefaultTraits
FaceTraits
{
private:
typedef
typename
Refs
::
HalfedgeHandle
HalfedgeHandle
;
typedef
typename
Refs
::
Scalar
Scalar
;
...
...
src/OpenMesh/Tools/Utils/HeapT.hh
View file @
4afdd5ad
...
...
@@ -351,12 +351,11 @@ HeapT<HeapEntry, HeapInterface>::
downheap
(
size_t
_idx
)
{
const
HeapEntry
h
=
entry
(
_idx
);
size_t
childIdx
;
const
size_t
s
=
size
();
while
(
_idx
<
s
)
{
childIdx
=
left
(
_idx
);
size_t
childIdx
=
left
(
_idx
);
if
(
childIdx
>=
s
)
break
;
if
((
childIdx
+
1
<
s
)
&&
(
interface_
.
less
(
entry
(
childIdx
+
1
),
entry
(
childIdx
))))
...
...
src/OpenMesh/Tools/VDPM/VHierarchyWindow.hh
View file @
4afdd5ad
...
...
@@ -37,183 +37,183 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
* ========================================================================= */
//=============================================================================
//
// CLASS newClass
//
//=============================================================================
#ifndef OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
#define OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
//== INCLUDES =================================================================
#include <OpenMesh/Tools/VDPM/VHierarchy.hh>
#include <algorithm>
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
namespace
OpenMesh
{
namespace
VDPM
{
//== CLASS DEFINITION =========================================================
/** \todo VHierarchyWindow documentation
*/
class
VHierarchyWindow
{
private:
// reference of vertex hierarchy
VHierarchy
*
vhierarchy_
;
// bits buffer (byte units)
unsigned
char
*
buffer_
;
int
buffer_min_
;
size_t
buffer_max_
;
int
current_pos_
;
// window (byte units)
int
window_min_
;
int
window_max_
;
// # of right shift (bit units)
unsigned
char
n_shift_
;
// [0, 7]
unsigned
char
flag8
(
unsigned
char
n_shift
)
const
{
return
0x80
>>
n_shift
;
}
unsigned
char
flag8
(
VHierarchyNodeHandle
_node_handle
)
const
{
assert
(
_node_handle
.
idx
()
>=
0
);
return
0x80
>>
(
unsigned
int
)
(
_node_handle
.
idx
()
%
8
);
}
int
byte_idx
(
VHierarchyNodeHandle
_node_handle
)
const
{
assert
(
_node_handle
.
idx
()
>=
0
);
return
_node_handle
.
idx
()
/
8
;
}
int
buffer_idx
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
byte_idx
(
_node_handle
)
-
buffer_min_
;
}
bool
before_window
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
window_min_
)
?
true
:
false
;
}
bool
after_window
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
window_max_
)
?
false
:
true
;
}
bool
underflow
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
buffer_min_
)
?
true
:
false
;
}
bool
overflow
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
int
(
buffer_max_
)
)
?
false
:
true
;
}
bool
update_buffer
(
VHierarchyNodeHandle
_node_handle
);
public:
VHierarchyWindow
();
VHierarchyWindow
(
VHierarchy
&
_vhierarchy
);
~
VHierarchyWindow
(
void
);
void
set_vertex_hierarchy
(
VHierarchy
&
_vhierarchy
)
{
vhierarchy_
=
&
_vhierarchy
;
}
void
begin
()
{
int
new_window_min
=
window_min_
;
for
(
current_pos_
=
window_min_
-
buffer_min_
;
current_pos_
<
window_size
();
++
current_pos_
)
{
if
(
buffer_
[
current_pos_
]
==
0
)
++
new_window_min
;
else
{
n_shift_
=
0
;
while
((
buffer_
[
current_pos_
]
&
flag8
(
n_shift_
))
==
0
)
++
n_shift_
;
break
;
}
}
window_min_
=
new_window_min
;
}
void
next
()
{
++
n_shift_
;
if
(
n_shift_
==
8
)
{
n_shift_
=
0
;
++
current_pos_
;
}
while
(
current_pos_
<
window_max_
-
buffer_min_
)
{
if
(
buffer_
[
current_pos_
]
!=
0
)
// if the current byte has non-zero bits
{
while
(
n_shift_
!=
8
)
{
if
((
buffer_
[
current_pos_
]
&
flag8
(
n_shift_
))
!=
0
)
return
;
// find 1 bit in the current byte
++
n_shift_
;
}
}
n_shift_
=
0
;
++
current_pos_
;
}
}
bool
end
()
{
return
!
(
current_pos_
<
window_max_
-
buffer_min_
);
}
int
window_size
()
const
{
return
window_max_
-
window_min_
;
}
size_t
buffer_size
()
const
{
return
buffer_max_
-
buffer_min_
;
}
VHierarchyNodeHandle
node_handle
()
{
return
VHierarchyNodeHandle
(
8
*
(
buffer_min_
+
current_pos_
)
+
(
int
)
n_shift_
);
}
void
activate
(
VHierarchyNodeHandle
_node_handle
)
{
update_buffer
(
_node_handle
);
buffer_
[
buffer_idx
(
_node_handle
)]
|=
flag8
(
_node_handle
);
window_min_
=
std
::
min
(
window_min_
,
byte_idx
(
_node_handle
));
window_max_
=
std
::
max
(
window_max_
,
1
+
byte_idx
(
_node_handle
));
}
void
inactivate
(
VHierarchyNodeHandle
_node_handle
)
{
if
(
is_active
(
_node_handle
)
!=
true
)
return
;
buffer_
[
buffer_idx
(
_node_handle
)]
^=
flag8
(
_node_handle
);
}
bool
is_active
(
VHierarchyNodeHandle
_node_handle
)
const
{
if
(
before_window
(
_node_handle
)
==
true
||
after_window
(
_node_handle
)
==
true
)
return
false
;
return
((
buffer_
[
buffer_idx
(
_node_handle
)]
&
flag8
(
_node_handle
))
>
0
);
}
void
init
(
VHierarchyNodeHandleContainer
&
_roots
);
void
update_with_vsplit
(
VHierarchyNodeHandle
_parent_handle
);
void
update_with_ecol
(
VHierarchyNodeHandle
_parent_handle
);
};
//=============================================================================
}
// namespace VDPM
}
// namespace OpenMesh
//=============================================================================
#endif // OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
//=============================================================================
* ========================================================================= */
//=============================================================================
//
// CLASS newClass
//
//=============================================================================
#ifndef OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
#define OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
//== INCLUDES =================================================================
#include <OpenMesh/Tools/VDPM/VHierarchy.hh>
#include <algorithm>
//== FORWARDDECLARATIONS ======================================================
//== NAMESPACES ===============================================================
namespace
OpenMesh
{
namespace
VDPM
{
//== CLASS DEFINITION =========================================================
/** \todo VHierarchyWindow documentation
*/
class
VHierarchyWindow
{
private:
// reference of vertex hierarchy
VHierarchy
*
vhierarchy_
;
// bits buffer (byte units)
unsigned
char
*
buffer_
;
int
buffer_min_
;
size_t
buffer_max_
;
int
current_pos_
;
// window (byte units)
int
window_min_
;
int
window_max_
;
// # of right shift (bit units)
unsigned
char
n_shift_
;
// [0, 7]
unsigned
char
flag8
(
unsigned
char
n_shift
)
const
{
return
0x80
>>
n_shift
;
}
unsigned
char
flag8
(
VHierarchyNodeHandle
_node_handle
)
const
{
assert
(
_node_handle
.
idx
()
>=
0
);
return
0x80
>>
(
unsigned
int
)
(
_node_handle
.
idx
()
%
8
);
}
int
byte_idx
(
VHierarchyNodeHandle
_node_handle
)
const
{
assert
(
_node_handle
.
idx
()
>=
0
);
return
_node_handle
.
idx
()
/
8
;
}
int
buffer_idx
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
byte_idx
(
_node_handle
)
-
buffer_min_
;
}
bool
before_window
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
window_min_
)
?
true
:
false
;
}
bool
after_window
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
window_max_
)
?
false
:
true
;
}
bool
underflow
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
buffer_min_
)
?
true
:
false
;
}
bool
overflow
(
VHierarchyNodeHandle
_node_handle
)
const
{
return
(
_node_handle
.
idx
()
/
8
<
int
(
buffer_max_
)
)
?
false
:
true
;
}
bool
update_buffer
(
VHierarchyNodeHandle
_node_handle
);
public:
VHierarchyWindow
();
explicit
VHierarchyWindow
(
VHierarchy
&
_vhierarchy
);
~
VHierarchyWindow
(
void
);
void
set_vertex_hierarchy
(
VHierarchy
&
_vhierarchy
)
{
vhierarchy_
=
&
_vhierarchy
;
}
void
begin
()
{
int
new_window_min
=
window_min_
;
for
(
current_pos_
=
window_min_
-
buffer_min_
;
current_pos_
<
window_size
();
++
current_pos_
)
{
if
(
buffer_
[
current_pos_
]
==
0
)
++
new_window_min
;
else
{
n_shift_
=
0
;
while
((
buffer_
[
current_pos_
]
&
flag8
(
n_shift_
))
==
0
)
++
n_shift_
;
break
;
}
}
window_min_
=
new_window_min
;
}
void
next
()
{
++
n_shift_
;
if
(
n_shift_
==
8
)
{
n_shift_
=
0
;
++
current_pos_
;
}
while
(
current_pos_
<
window_max_
-
buffer_min_
)
{
if
(
buffer_
[
current_pos_
]
!=
0
)
// if the current byte has non-zero bits
{
while
(
n_shift_
!=
8
)
{
if
((
buffer_
[
current_pos_
]
&
flag8
(
n_shift_
))
!=
0
)
return
;
// find 1 bit in the current byte
++
n_shift_
;
}
}
n_shift_
=
0
;
++
current_pos_
;
}
}
bool
end
()
{
return
!
(
current_pos_
<
window_max_
-
buffer_min_
);
}
int
window_size
()
const
{
return
window_max_
-
window_min_
;
}
size_t
buffer_size
()
const
{
return
buffer_max_
-
buffer_min_
;
}
VHierarchyNodeHandle
node_handle
()
{
return
VHierarchyNodeHandle
(
8
*
(
buffer_min_
+
current_pos_
)
+
(
int
)
n_shift_
);
}
void
activate
(
VHierarchyNodeHandle
_node_handle
)
{
update_buffer
(
_node_handle
);
buffer_
[
buffer_idx
(
_node_handle
)]
|=
flag8
(
_node_handle
);
window_min_
=
std
::
min
(
window_min_
,
byte_idx
(
_node_handle
));
window_max_
=
std
::
max
(
window_max_
,
1
+
byte_idx
(
_node_handle
));
}
void
inactivate
(
VHierarchyNodeHandle
_node_handle
)
{
if
(
is_active
(
_node_handle
)
!=
true
)
return
;
buffer_
[
buffer_idx
(
_node_handle
)]
^=
flag8
(
_node_handle
);
}
bool
is_active
(
VHierarchyNodeHandle
_node_handle
)
const
{
if
(
before_window
(
_node_handle
)
==
true
||
after_window
(
_node_handle
)
==
true
)
return
false
;
return
((
buffer_
[
buffer_idx
(
_node_handle
)]
&
flag8
(
_node_handle
))
>
0
);
}
void
init
(
VHierarchyNodeHandleContainer
&
_roots
);
void
update_with_vsplit
(
VHierarchyNodeHandle
_parent_handle
);
void
update_with_ecol
(
VHierarchyNodeHandle
_parent_handle
);
};
//=============================================================================
}
// namespace VDPM
}
// namespace OpenMesh
//=============================================================================
#endif // OPENMESH_VDPROGMESH_VHIERARCHYWINDOWS_HH
//=============================================================================
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