Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Guilhem Saurel
hpp-fcl
Commits
5d328482
Commit
5d328482
authored
Mar 22, 2019
by
Joseph Mirabel
Browse files
Update class Convex.
parent
9fcf0655
Changes
2
Show whitespace changes
Inline
Side-by-side
include/hpp/fcl/shape/geometric_shapes.h
View file @
5d328482
...
...
@@ -269,22 +269,23 @@ class Convex : public ShapeBase
{
public:
/// @brief Constructing a convex, providing normal and offset of each polytype surface, and the points and shape topology information
Convex
(
Vec3f
*
plane_normals_
,
FCL_REAL
*
plane_dis_
,
int
num_planes_
,
Vec3f
*
points_
,
/// \param points_ list of 3D points
/// \param num_points_ number of 3D points
/// \param polygons_ \copydoc Convex::polygons
/// \param num_polygons_ the number of polygons.
/// \note num_polygons_ is not the allocated size of polygons_.
Convex
(
Vec3f
*
points_
,
int
num_points_
,
int
*
polygons_
)
:
ShapeBase
()
int
*
polygons_
,
int
num_polygons_
)
:
ShapeBase
()
{
plane_normals
=
plane_normals_
;
plane_dis
=
plane_dis_
;
num_planes
=
num_planes_
;
num_polygons
=
num_polygons_
;
points
=
points_
;
num_points
=
num_points_
;
polygons
=
polygons_
;
edges
=
NULL
;
Vec3f
sum
;
Vec3f
sum
(
0
,
0
,
0
)
;
for
(
int
i
=
0
;
i
<
num_points
;
++
i
)
{
sum
+=
points
[
i
];
...
...
@@ -298,9 +299,7 @@ public:
/// @brief Copy constructor
Convex
(
const
Convex
&
other
)
:
ShapeBase
(
other
)
{
plane_normals
=
other
.
plane_normals
;
plane_dis
=
other
.
plane_dis
;
num_planes
=
other
.
num_planes
;
num_polygons
=
other
.
num_polygons
;
points
=
other
.
points
;
num_points
=
other
.
num_points
;
polygons
=
other
.
polygons
;
...
...
@@ -320,10 +319,6 @@ public:
/// @brief Get node type: a conex polytope
NODE_TYPE
getNodeType
()
const
{
return
GEOM_CONVEX
;
}
Vec3f
*
plane_normals
;
FCL_REAL
*
plane_dis
;
/// @brief An array of indices to the points of each polygon, it should be the number of vertices
/// followed by that amount of indices to "points" in counter clockwise order
int
*
polygons
;
...
...
@@ -331,7 +326,7 @@ public:
Vec3f
*
points
;
int
num_points
;
int
num_edges
;
int
num_p
lane
s
;
int
num_p
olygon
s
;
struct
Edge
{
...
...
@@ -356,7 +351,7 @@ public:
int
*
points_in_poly
=
polygons
;
int
*
index
=
polygons
+
1
;
for
(
int
i
=
0
;
i
<
num_p
lane
s
;
++
i
)
for
(
int
i
=
0
;
i
<
num_p
olygon
s
;
++
i
)
{
Vec3f
plane_center
(
0
,
0
,
0
);
...
...
@@ -390,7 +385,7 @@ public:
FCL_REAL
vol
=
0
;
int
*
points_in_poly
=
polygons
;
int
*
index
=
polygons
+
1
;
for
(
int
i
=
0
;
i
<
num_p
lane
s
;
++
i
)
for
(
int
i
=
0
;
i
<
num_p
olygon
s
;
++
i
)
{
Vec3f
plane_center
(
0
,
0
,
0
);
...
...
@@ -424,7 +419,7 @@ public:
FCL_REAL
vol
=
0
;
int
*
points_in_poly
=
polygons
;
int
*
index
=
polygons
+
1
;
for
(
int
i
=
0
;
i
<
num_p
lane
s
;
++
i
)
for
(
int
i
=
0
;
i
<
num_p
olygon
s
;
++
i
)
{
Vec3f
plane_center
(
0
,
0
,
0
);
...
...
src/shape/geometric_shapes.cpp
View file @
5d328482
...
...
@@ -50,7 +50,7 @@ void Convex::fillEdges()
if
(
edges
)
delete
[]
edges
;
int
num_edges_alloc
=
0
;
for
(
int
i
=
0
;
i
<
num_p
lane
s
;
++
i
)
for
(
int
i
=
0
;
i
<
num_p
olygon
s
;
++
i
)
{
num_edges_alloc
+=
*
points_in_poly
;
points_in_poly
+=
(
*
points_in_poly
+
1
);
...
...
@@ -63,7 +63,7 @@ void Convex::fillEdges()
num_edges
=
0
;
Edge
e
;
bool
isinset
;
for
(
int
i
=
0
;
i
<
num_p
lane
s
;
++
i
)
for
(
int
i
=
0
;
i
<
num_p
olygon
s
;
++
i
)
{
for
(
int
j
=
0
;
j
<
*
points_in_poly
;
++
j
)
{
...
...
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