coal/shape/convex.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  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * * Redistributions in binary form must reproduce the above
15  * copyright notice, this list of conditions and the following
16  * disclaimer in the documentation and/or other materials provided
17  * with the distribution.
18  * * Neither the name of Open Source Robotics Foundation nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
28  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
29  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
30  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
32  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  */
35 
38 #ifndef COAL_SHAPE_CONVEX_H
39 #define COAL_SHAPE_CONVEX_H
40 
42 
43 namespace coal {
44 
48 template <typename PolygonT>
49 class Convex : public ConvexBase {
50  public:
53 
63  Convex(std::shared_ptr<std::vector<Vec3s>> points_, unsigned int num_points_,
64  std::shared_ptr<std::vector<PolygonT>> polygons_,
65  unsigned int num_polygons_);
66 
69  Convex(const Convex& other);
70 
71  ~Convex();
72 
75 
76  Vec3s computeCOM() const;
77 
78  CoalScalar computeVolume() const;
79 
91  void set(std::shared_ptr<std::vector<Vec3s>> points, unsigned int num_points,
92  std::shared_ptr<std::vector<PolygonT>> polygons,
93  unsigned int num_polygons);
94 
96  virtual Convex<PolygonT>* clone() const;
97 
101  std::shared_ptr<std::vector<PolygonT>> polygons;
102  unsigned int num_polygons;
103 
104  protected:
105  void fillNeighbors();
106 };
107 
108 } // namespace coal
109 
110 #include "coal/shape/details/convex.hxx"
111 
112 #endif
coal::Convex::num_polygons
unsigned int num_polygons
Definition: coal/shape/convex.h:102
coal::Vec3s
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
Definition: coal/data_types.h:77
coal
Main namespace.
Definition: coal/broadphase/broadphase_bruteforce.h:44
coal::Convex::clone
virtual Convex< PolygonT > * clone() const
Clone (deep copy)
coal::Convex::Convex
Convex()
Construct an uninitialized convex object.
Definition: coal/shape/convex.h:52
coal::Convex
Convex polytope.
Definition: coal/serialization/collision_object.h:51
coal::Convex::set
void set(std::shared_ptr< std::vector< Vec3s >> points, unsigned int num_points, std::shared_ptr< std::vector< PolygonT >> polygons, unsigned int num_polygons)
Set the current Convex from a list of points and polygons.
coal::Convex::~Convex
~Convex()
coal::Convex::computeVolume
CoalScalar computeVolume() const
coal::Matrix3s
Eigen::Matrix< CoalScalar, 3, 3 > Matrix3s
Definition: coal/data_types.h:81
coal::Convex::computeCOM
Vec3s computeCOM() const
coal::Convex::computeMomentofInertia
Matrix3s computeMomentofInertia() const
based on http://number-none.com/blow/inertia/bb_inertia.doc
coal::Convex::polygons
std::shared_ptr< std::vector< PolygonT > > polygons
An array of PolygonT object. PolygonT should contains a list of vertices for each polygon,...
Definition: coal/shape/convex.h:101
geometric_shapes.h
coal::CoalScalar
double CoalScalar
Definition: coal/data_types.h:76
coal::Convex::fillNeighbors
void fillNeighbors()
coal::ConvexBase
Base for convex polytope.
Definition: coal/shape/geometric_shapes.h:645


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:57