Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hpp-fcl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Guilhem Saurel
hpp-fcl
Commits
5d328482
Commit
5d328482
authored
6 years ago
by
Joseph Mirabel
Browse files
Options
Downloads
Patches
Plain Diff
Update class Convex.
parent
9fcf0655
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/hpp/fcl/shape/geometric_shapes.h
+15
-20
15 additions, 20 deletions
include/hpp/fcl/shape/geometric_shapes.h
src/shape/geometric_shapes.cpp
+2
-2
2 additions, 2 deletions
src/shape/geometric_shapes.cpp
with
17 additions
and
22 deletions
include/hpp/fcl/shape/geometric_shapes.h
+
15
−
20
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
);
...
...
This diff is collapsed.
Click to expand it.
src/shape/geometric_shapes.cpp
+
2
−
2
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
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment