hpp-fcl
1.6.0
HPP fork of FCL -- The Flexible Collision Library
loader.h
Go to the documentation of this file.
1
/*
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2011-2014, Willow Garage, Inc.
5
* Copyright (c) 2014-2015, Open Source Robotics Foundation
6
* Copyright (c) 2016, CNRS - LAAS
7
* Copyright (c) 2020, INRIA
8
* All rights reserved.
9
*
10
* Redistribution and use in source and binary forms, with or without
11
* modification, are permitted provided that the following conditions
12
* are met:
13
*
14
* * Redistributions of source code must retain the above copyright
15
* notice, this list of conditions and the following disclaimer.
16
* * Redistributions in binary form must reproduce the above
17
* copyright notice, this list of conditions and the following
18
* disclaimer in the documentation and/or other materials provided
19
* with the distribution.
20
* * Neither the name of Open Source Robotics Foundation nor the names of its
21
* contributors may be used to endorse or promote products derived
22
* from this software without specific prior written permission.
23
*
24
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
27
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
28
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
29
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
30
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
34
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35
* POSSIBILITY OF SUCH DAMAGE.
36
*/
37
38
#ifndef HPP_FCL_MESH_LOADER_LOADER_H
39
#define HPP_FCL_MESH_LOADER_LOADER_H
40
41
#include <boost/shared_ptr.hpp>
42
#include <
hpp/fcl/fwd.hh
>
43
#include <
hpp/fcl/config.hh
>
44
#include <
hpp/fcl/data_types.h
>
45
#include <
hpp/fcl/collision_object.h
>
46
47
#include <map>
48
49
namespace
hpp
50
{
51
namespace
fcl {
54
class
HPP_FCL_DLLAPI
MeshLoader
55
{
56
public
:
57
virtual
~MeshLoader
() {}
58
59
virtual
BVHModelPtr_t
load (
const
std::string& filename,
60
const
Vec3f
& scale = Vec3f::Ones());
61
64
virtual
CollisionGeometryPtr_t
loadOctree (
const
std::string& filename);
65
66
MeshLoader
(
const
NODE_TYPE
& bvType =
BV_OBBRSS
) : bvType_ (bvType) {}
67
68
private
:
69
const
NODE_TYPE
bvType_;
70
};
71
76
class
HPP_FCL_DLLAPI
CachedMeshLoader
:
public
MeshLoader
77
{
78
public
:
79
virtual
~CachedMeshLoader
() {}
80
81
CachedMeshLoader
(
const
NODE_TYPE
& bvType =
BV_OBBRSS
) :
MeshLoader
(bvType) {}
82
83
virtual
BVHModelPtr_t
load (
const
std::string& filename,
84
const
Vec3f
& scale);
85
86
struct
HPP_FCL_DLLAPI
Key
{
87
std::string
filename
;
88
Vec3f
scale
;
89
90
Key
(
const
std::string& f,
const
Vec3f
& s)
91
: filename (f), scale (s) {}
92
93
bool
operator< (
const
CachedMeshLoader::Key
& b)
const
;
94
};
95
typedef
std::map <Key, BVHModelPtr_t>
Cache_t
;
96
97
const
Cache_t
cache
()
const
{
return
cache_; }
98
private
:
99
Cache_t cache_;
100
};
101
}
102
103
}
// namespace hpp
104
105
#endif // FCL_MESH_LOADER_LOADER_H
hpp::fcl::CachedMeshLoader::Cache_t
std::map< Key, BVHModelPtr_t > Cache_t
Definition:
loader.h:95
hpp::fcl::MeshLoader::~MeshLoader
virtual ~MeshLoader()
Definition:
loader.h:57
hpp::fcl::CachedMeshLoader::CachedMeshLoader
CachedMeshLoader(const NODE_TYPE &bvType=BV_OBBRSS)
Definition:
loader.h:81
hpp::fcl::MeshLoader::MeshLoader
MeshLoader(const NODE_TYPE &bvType=BV_OBBRSS)
Definition:
loader.h:66
hpp::fcl::BV_OBBRSS
Definition:
collision_object.h:56
hpp
Main namespace.
Definition:
AABB.h:43
config.hh
hpp::fcl::CachedMeshLoader::Key
Definition:
loader.h:86
hpp::fcl::CollisionGeometryPtr_t
boost::shared_ptr< CollisionGeometry > CollisionGeometryPtr_t
Definition:
fwd.hh:49
hpp::fcl::MeshLoader
Definition:
loader.h:54
hpp::fcl::CachedMeshLoader::Key::filename
std::string filename
Definition:
loader.h:87
hpp::fcl::CachedMeshLoader::~CachedMeshLoader
virtual ~CachedMeshLoader()
Definition:
loader.h:79
hpp::fcl::CachedMeshLoader::Key::Key
Key(const std::string &f, const Vec3f &s)
Definition:
loader.h:90
hpp::fcl::CachedMeshLoader::cache
const Cache_t cache() const
Definition:
loader.h:97
hpp::fcl::BVHModelPtr_t
boost::shared_ptr< BVHModelBase > BVHModelPtr_t
Definition:
fwd.hh:57
hpp::fcl::NODE_TYPE
NODE_TYPE
traversal node type: bounding volume (AABB, OBB, RSS, kIOS, OBBRSS, KDOP16, KDOP18, kDOP24), basic shape (box, sphere, capsule, cone, cylinder, convex, plane, triangle), and octree
Definition:
collision_object.h:56
collision_object.h
hpp::fcl::Vec3f
Eigen::Matrix< FCL_REAL, 3, 1 > Vec3f
Definition:
data_types.h:67
fwd.hh
hpp::fcl::CachedMeshLoader::Key::scale
Vec3f scale
Definition:
loader.h:88
hpp::fcl::CachedMeshLoader
Definition:
loader.h:76
HPP_FCL_DLLAPI
#define HPP_FCL_DLLAPI
Definition:
config.hh:64
data_types.h
include
hpp
fcl
mesh_loader
loader.h
Generated by
1.8.13