Gazebo Physics

API Reference

8.0.0
PlaneShape.hh
Go to the documentation of this file.
1/*
2 * Copyright (C) 2019 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 GZ_PHYSICS_PLANESHAPE_HH_
19#define GZ_PHYSICS_PLANESHAPE_HH_
20
21#include <string>
22
25
26namespace gz
27{
28namespace physics
29{
31
32
33 class GetPlaneShapeProperties
34 : public virtual FeatureWithRequirements<PlaneShapeCast>
35 {
36 public: template <typename PolicyT, typename FeaturesT>
37 class PlaneShape : public virtual Entity<PolicyT, FeaturesT>
38 {
39 public: using Normal =
40 typename FromPolicy<PolicyT>::template Use<LinearVector>;
41
42 public: using Point =
43 typename FromPolicy<PolicyT>::template Use<LinearVector>;
44
47 public: Normal GetNormal() const;
48
51 public: Point GetPoint() const;
52 };
53
54 public: template <typename PolicyT>
55 class Implementation : public virtual Feature::Implementation<PolicyT>
56 {
57 public: using Normal =
58 typename FromPolicy<PolicyT>::template Use<LinearVector>;
59
60 public: using Point =
61 typename FromPolicy<PolicyT>::template Use<LinearVector>;
62
63 // See PlaneShape::GetNormal()
64 public: virtual Normal GetPlaneShapeNormal(
65 const Identity &_planeID) const = 0;
66
67 // See PlaneShape::GetPoint()
68 public: virtual Point GetPlaneShapePoint(
69 const Identity &_planeID) const = 0;
70 };
71 };
72
75 : public virtual FeatureWithRequirements<PlaneShapeCast>
76 {
77 public: template <typename PolicyT, typename FeaturesT>
78 class PlaneShape : public virtual Entity<PolicyT, FeaturesT>
79 {
80 public: using Normal =
81 typename FromPolicy<PolicyT>::template Use<LinearVector>;
82
83 public: using Point =
84 typename FromPolicy<PolicyT>::template Use<LinearVector>;
85
89 public: void SetNormal(const Normal &_normal);
90
95 public: void SetPoint(const Point &_point);
96 };
97
98 public: template <typename PolicyT>
99 class Implementation : public virtual Feature::Implementation<PolicyT>
100 {
101 public: using Normal =
102 typename FromPolicy<PolicyT>::template Use<LinearVector>;
103
104 public: using Point =
105 typename FromPolicy<PolicyT>::template Use<LinearVector>;
106
107 public: virtual void SetPlaneShapeNormal(
108 const Identity &_planeID,
109 const Normal &_normal) = 0;
110
111 public: virtual void SetPlaneShapePoint(
112 const Identity &_planeID,
113 const Point &_point) = 0;
114 };
115 };
116
122 : public virtual FeatureWithRequirements<PlaneShapeCast>
123 {
124 public: template <typename PolicyT, typename FeaturesT>
125 class Link : public virtual Feature::Link<PolicyT, FeaturesT>
126 {
127 public: using Normal =
128 typename FromPolicy<PolicyT>::template Use<LinearVector>;
129
130 public: using Point =
131 typename FromPolicy<PolicyT>::template Use<LinearVector>;
132
141 public: PlaneShapePtr<PolicyT, FeaturesT> AttachPlaneShape(
142 const std::string &_name,
143 const Normal &_normal,
144 const Point &_point = Point::Zero());
145 };
146
147 public: template <typename PolicyT>
148 class Implementation : public virtual Feature::Implementation<PolicyT>
149 {
150 public: using Normal =
151 typename FromPolicy<PolicyT>::template Use<LinearVector>;
152
153 public: using Point =
154 typename FromPolicy<PolicyT>::template Use<LinearVector>;
155
156 public: virtual Identity AttachPlaneShape(
157 const Identity &_linkID,
158 const std::string &_name,
159 const Normal &_normal,
160 const Point &_point) = 0;
161 };
162 };
163}
164}
165
166#include <gz/physics/detail/PlaneShape.hh>
167
168#endif // GZ_PHYSICS_PLANESHAPE_HH_