Ignition Physics

API Reference

2.0.0
CylinderShape.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2018 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 
18 #ifndef IGNITION_PHYSICS_CYLINDERSHAPE_HH_
19 #define IGNITION_PHYSICS_CYLINDERSHAPE_HH_
20 
21 #include <string>
22 
25 
26 namespace ignition
27 {
28  namespace physics
29  {
31 
32  class IGNITION_PHYSICS_VISIBLE GetCylinderShapeProperties
33  : public virtual FeatureWithRequirements<CylinderShapeCast>
34  {
35  public: template <typename PolicyT, typename FeaturesT>
36  class CylinderShape : public virtual Entity<PolicyT, FeaturesT>
37  {
38  public: using Scalar = typename PolicyT::Scalar;
39 
42  public: Scalar GetRadius() const;
43 
47  public: Scalar GetHeight() const;
48  };
49 
50  public: template <typename PolicyT>
51  class Implementation : public virtual Feature::Implementation<PolicyT>
52  {
53  public: using Scalar = typename PolicyT::Scalar;
54 
55  public: virtual Scalar GetCylinderShapeRadius(
56  const Identity &_cylinderID) const = 0;
57 
58  public: virtual Scalar GetCylinderShapeHeight(
59  const Identity &_cylinderID) const = 0;
60  };
61  };
62 
63  class IGNITION_PHYSICS_VISIBLE SetCylinderShapeProperties
64  : public virtual FeatureWithRequirements<CylinderShapeCast>
65  {
66  public: template <typename PolicyT, typename FeaturesT>
67  class CylinderShape : public virtual Entity<PolicyT, FeaturesT>
68  {
69  public: using Scalar = typename PolicyT::Scalar;
70 
74  public: void SetRadius(Scalar _radius);
75 
79  public: void SetHeight(Scalar _height);
80  };
81 
82  public: template <typename PolicyT>
83  class Implementation : public virtual Feature::Implementation<PolicyT>
84  {
85  public: using Scalar = typename PolicyT::Scalar;
86 
87  public: virtual void SetCylinderShapeRadius(
88  const Identity &_cylinderID, Scalar _radius) = 0;
89 
90  public: virtual void SetCylinderShapeHeight(
91  const Identity &_cylinderID, Scalar _height) = 0;
92  };
93  };
94 
95  class IGNITION_PHYSICS_VISIBLE AttachCylinderShapeFeature
96  : public virtual FeatureWithRequirements<CylinderShapeCast>
97  {
98  public: template <typename PolicyT, typename FeaturesT>
99  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
100  {
101  public: using Scalar = typename PolicyT::Scalar;
102 
103  public: using PoseType =
104  typename FromPolicy<PolicyT>::template Use<Pose>;
105 
106  public: using ShapePtrType = CylinderShapePtr<PolicyT, FeaturesT>;
107 
108  public: ShapePtrType AttachCylinderShape(
109  const std::string &_name = "cylinder",
110  Scalar _radius = 1.0,
111  Scalar _height = 1.0,
112  const PoseType &_pose = PoseType::Identity());
113  };
114 
115  public: template <typename PolicyT>
116  class Implementation : public virtual Feature::Implementation<PolicyT>
117  {
118  public: using Scalar = typename PolicyT::Scalar;
119 
120  public: using PoseType =
121  typename FromPolicy<PolicyT>::template Use<Pose>;
122 
123  public: virtual Identity AttachCylinderShape(
124  const Identity &_linkID,
125  const std::string &_name,
126  Scalar _radius,
127  Scalar _height,
128  const PoseType &_pose) = 0;
129  };
130  };
131  }
132 }
133 
134 #include <ignition/physics/detail/CylinderShape.hh>
135 
136 #endif
If your feature is known to require any other features, then you should have your feature class inher...
Definition: FeatureList.hh:108
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: Entity.hh:216
IGN_PHYSICS_DECLARE_SHAPE_TYPE(BoxShape) class GetBoxShapeProperties
Definition: BoxShape.hh:30
typename PolicyT::Scalar Scalar
Definition: CylinderShape.hh:85
This struct is used to conveniently convert from a policy to a geometric type. Example usage: ...
Definition: Geometry.hh:69
STL class.
typename PolicyT::Scalar Scalar
Definition: CylinderShape.hh:118
Definition: CylinderShape.hh:63
typename PolicyT::Scalar Scalar
Definition: CylinderShape.hh:69
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: CylinderShape.hh:121
Definition: CylinderShape.hh:95