Ignition Physics

API Reference

5.1.0
EllipsoidShape.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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_ELLIPSOIDSHAPE_HH_
19 #define IGNITION_PHYSICS_ELLIPSOIDSHAPE_HH_
20 
21 #include <string>
22 
25 
26 namespace ignition
27 {
28  namespace physics
29  {
31 
32  class IGNITION_PHYSICS_VISIBLE GetEllipsoidShapeProperties
33  : public virtual FeatureWithRequirements<EllipsoidShapeCast>
34  {
35  public: template <typename PolicyT, typename FeaturesT>
36  class EllipsoidShape : public virtual Entity<PolicyT, FeaturesT>
37  {
38  public: using Dimensions =
39  typename FromPolicy<PolicyT>::template Use<LinearVector>;
40 
43  public: Dimensions GetRadii() const;
44  };
45 
46  public: template <typename PolicyT>
47  class Implementation : public virtual Feature::Implementation<PolicyT>
48  {
49  public: using Dimensions =
50  typename FromPolicy<PolicyT>::template Use<LinearVector>;
51 
52  public: virtual Dimensions GetEllipsoidShapeRadii(
53  const Identity &_ellipsoidID) const = 0;
54  };
55  };
56 
60  class IGNITION_PHYSICS_VISIBLE SetEllipsoidShapeProperties
61  : public virtual FeatureWithRequirements<EllipsoidShapeCast>
62  {
63  public: template <typename PolicyT, typename FeaturesT>
64  class EllipsoidShape : public virtual Entity<PolicyT, FeaturesT>
65  {
66  public: using Dimensions =
67  typename FromPolicy<PolicyT>::template Use<LinearVector>;
68 
72  public: void SetRadii(Dimensions _radii);
73  };
74 
75  public: template <typename PolicyT>
76  class Implementation : public virtual Feature::Implementation<PolicyT>
77  {
78  public: using Dimensions =
79  typename FromPolicy<PolicyT>::template Use<LinearVector>;
80 
81  public: virtual void SetEllipsoidShapeRadii(
82  const Identity &_ellipsoidID, Dimensions _radii) = 0;
83  };
84  };
85 
90  class IGNITION_PHYSICS_VISIBLE AttachEllipsoidShapeFeature
91  : public virtual FeatureWithRequirements<EllipsoidShapeCast>
92  {
93  public: template <typename PolicyT, typename FeaturesT>
94  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
95  {
96  public: using Dimensions =
97  typename FromPolicy<PolicyT>::template Use<LinearVector>;
98 
99  public: using PoseType =
100  typename FromPolicy<PolicyT>::template Use<Pose>;
101 
102  public: using ShapePtrType = EllipsoidShapePtr<PolicyT, FeaturesT>;
103 
110  public: ShapePtrType AttachEllipsoidShape(
111  const std::string &_name = "ellipsoid",
112  Dimensions _radii = Dimensions::Constant(1.0),
113  const PoseType &_pose = PoseType::Identity());
114  };
115 
116  public: template <typename PolicyT>
117  class Implementation : public virtual Feature::Implementation<PolicyT>
118  {
119  public: using Dimensions =
120  typename FromPolicy<PolicyT>::template Use<LinearVector>;
121 
122  public: using PoseType =
123  typename FromPolicy<PolicyT>::template Use<Pose>;
124 
125  public: virtual Identity AttachEllipsoidShape(
126  const Identity &_linkID,
127  const std::string &_name,
128  Dimensions _radii,
129  const PoseType &_pose) = 0;
130  };
131  };
132  }
133 }
134 
135 #include <ignition/physics/detail/EllipsoidShape.hh>
136 
137 #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
This struct is used to conveniently convert from a policy to a geometric type. Example usage: ...
Definition: Geometry.hh:77
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: EllipsoidShape.hh:120
STL class.
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: EllipsoidShape.hh:79
This feature constructs a new ellipsoid shape and attaches the desired pose in the link frame...
Definition: EllipsoidShape.hh:90
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: EllipsoidShape.hh:123
This feature sets the EllipsoidShape properties such as the ellipsoid radii.
Definition: EllipsoidShape.hh:60
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: EllipsoidShape.hh:67