Skip to content
GitLab
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
69c3ad5c
Commit
69c3ad5c
authored
Sep 10, 2019
by
Joseph Mirabel
Browse files
[BVH] Update MeshLoader
parent
ec397df2
Changes
2
Hide whitespace changes
Inline
Side-by-side
include/hpp/fcl/mesh_loader/loader.h
View file @
69c3ad5c
...
...
@@ -55,7 +55,7 @@ namespace fcl {
/// \param bvType ignored
/// \deprecated Use MeshLoader::load(const std::string&, const Vec3f&)
CollisionGeometry
Ptr_t
load
(
const
std
::
string
&
filename
,
BVHModel
Ptr_t
load
(
const
std
::
string
&
filename
,
const
Vec3f
&
scale
,
const
NODE_TYPE
&
bvType
)
HPP_FCL_DEPRECATED
{
...
...
@@ -63,7 +63,7 @@ namespace fcl {
return
load
(
filename
,
scale
);
}
virtual
CollisionGeometry
Ptr_t
load
(
const
std
::
string
&
filename
,
virtual
BVHModel
Ptr_t
load
(
const
std
::
string
&
filename
,
const
Vec3f
&
scale
);
MeshLoader
(
const
NODE_TYPE
&
bvType
=
BV_OBBRSS
)
:
bvType_
(
bvType
)
{}
...
...
@@ -83,7 +83,7 @@ namespace fcl {
CachedMeshLoader
(
const
NODE_TYPE
&
bvType
=
BV_OBBRSS
)
:
MeshLoader
(
bvType
)
{}
virtual
CollisionGeometry
Ptr_t
load
(
const
std
::
string
&
filename
,
virtual
BVHModel
Ptr_t
load
(
const
std
::
string
&
filename
,
const
Vec3f
&
scale
);
struct
Key
{
...
...
@@ -95,7 +95,7 @@ namespace fcl {
bool
operator
<
(
const
CachedMeshLoader
::
Key
&
b
)
const
;
};
typedef
std
::
map
<
Key
,
CollisionGeometry
Ptr_t
>
Cache_t
;
typedef
std
::
map
<
Key
,
BVHModel
Ptr_t
>
Cache_t
;
const
Cache_t
cache
()
const
{
return
cache_
;
}
private:
...
...
src/mesh_loader/loader.cpp
View file @
69c3ad5c
...
...
@@ -53,14 +53,14 @@ namespace fcl {
}
template
<
typename
BV
>
CollisionGeometry
Ptr_t
_load
(
const
std
::
string
&
filename
,
const
Vec3f
&
scale
)
BVHModel
Ptr_t
_load
(
const
std
::
string
&
filename
,
const
Vec3f
&
scale
)
{
boost
::
shared_ptr
<
BVHModel
<
BV
>
>
polyhedron
(
new
BVHModel
<
BV
>
);
loadPolyhedronFromResource
(
filename
,
scale
,
polyhedron
);
return
polyhedron
;
}
CollisionGeometry
Ptr_t
MeshLoader
::
load
(
const
std
::
string
&
filename
,
BVHModel
Ptr_t
MeshLoader
::
load
(
const
std
::
string
&
filename
,
const
Vec3f
&
scale
)
{
switch
(
bvType_
)
{
...
...
@@ -77,13 +77,13 @@ namespace fcl {
}
}
CollisionGeometry
Ptr_t
CachedMeshLoader
::
load
(
const
std
::
string
&
filename
,
BVHModel
Ptr_t
CachedMeshLoader
::
load
(
const
std
::
string
&
filename
,
const
Vec3f
&
scale
)
{
Key
key
(
filename
,
scale
);
Cache_t
::
const_iterator
_cached
=
cache_
.
find
(
key
);
if
(
_cached
==
cache_
.
end
())
{
CollisionGeometry
Ptr_t
geom
=
MeshLoader
::
load
(
filename
,
scale
);
BVHModel
Ptr_t
geom
=
MeshLoader
::
load
(
filename
,
scale
);
cache_
.
insert
(
std
::
make_pair
(
key
,
geom
));
return
geom
;
}
else
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment