Ignition Physics

API Reference

2.0.0
BoxShape.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_BOXSHAPE_HH_
19 #define IGNITION_PHYSICS_BOXSHAPE_HH_
20 
21 #include <string>
22 
25 
26 namespace ignition
27 {
28  namespace physics
29  {
31 
32  class IGNITION_PHYSICS_VISIBLE GetBoxShapeProperties
33  : public virtual FeatureWithRequirements<BoxShapeCast>
34  {
35  public: template <typename PolicyT, typename FeaturesT>
36  class BoxShape : public virtual Entity<PolicyT, FeaturesT>
37  {
38  public: using Dimensions =
39  typename FromPolicy<PolicyT>::template Use<LinearVector>;
40 
43  public: Dimensions GetSize() 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 GetBoxShapeSize(
53  const Identity &_boxID) const = 0;
54  };
55  };
56 
57  class IGNITION_PHYSICS_VISIBLE SetBoxShapeProperties
58  : public virtual FeatureWithRequirements<BoxShapeCast>
59  {
60  public: template <typename PolicyT, typename FeaturesT>
61  class BoxShape : public virtual Entity<PolicyT, FeaturesT>
62  {
63  public: using Dimensions =
64  typename FromPolicy<PolicyT>::template Use<LinearVector>;
65 
69  public: void SetSize(const Dimensions &_size);
70  };
71 
72  public: template <typename PolicyT>
73  class Implementation : public virtual Feature::Implementation<PolicyT>
74  {
75  public: using Dimensions =
76  typename FromPolicy<PolicyT>::template Use<LinearVector>;
77 
78  public: virtual void SetBoxShapeSize(
79  const Identity &_boxID, const Dimensions &_size) = 0;
80  };
81  };
82 
83  class IGNITION_PHYSICS_VISIBLE AttachBoxShapeFeature
84  : public virtual FeatureWithRequirements<BoxShapeCast>
85  {
86  public: template <typename PolicyT, typename FeaturesT>
87  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
88  {
89  public: using Dimensions =
90  typename FromPolicy<PolicyT>::template Use<LinearVector>;
91 
92  public: using PoseType =
93  typename FromPolicy<PolicyT>::template Use<Pose>;
94 
95  public: using ShapePtrType = BoxShapePtr<PolicyT, FeaturesT>;
96 
103  // TODO(MXG): Create a struct that contains all the relevant properties,
104  // and pass that in here.
105  public: ShapePtrType AttachBoxShape(
106  const std::string &_name = "box",
107  const Dimensions &_size = Dimensions::Constant(1.0),
108  const PoseType &_pose = PoseType::Identity());
109  };
110 
111  public: template <typename PolicyT>
112  class Implementation : public virtual Feature::Implementation<PolicyT>
113  {
114  public: using Dimensions =
115  typename FromPolicy<PolicyT>::template Use<LinearVector>;
116 
117  public: using PoseType =
118  typename FromPolicy<PolicyT>::template Use<Pose>;
119 
120  public: virtual Identity AttachBoxShape(
121  const Identity &_linkID,
122  const std::string &_name,
123  const Dimensions &_size,
124  const PoseType &_pose) = 0;
125  };
126  };
127  }
128 }
129 
130 #include <ignition/physics/detail/BoxShape.hh>
131 
132 #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
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: BoxShape.hh:118
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:69
STL class.
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: BoxShape.hh:115
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: BoxShape.hh:64
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: BoxShape.hh:76