Gazebo Physics

API Reference

8.0.0
SphereShape.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 GZ_PHYSICS_SPHERESHAPE_HH_
19#define GZ_PHYSICS_SPHERESHAPE_HH_
20
21#include <string>
22
25
26namespace gz
27{
28 namespace physics
29 {
31
32
33 class GZ_PHYSICS_VISIBLE GetSphereShapeProperties
34 : public virtual FeatureWithRequirements<SphereShapeCast>
35 {
36 public: template <typename PolicyT, typename FeaturesT>
37 class SphereShape : public virtual Entity<PolicyT, FeaturesT>
38 {
39 public: using Scalar = typename PolicyT::Scalar;
40
43 public: Scalar GetRadius() const;
44 };
45
46 public: template <typename PolicyT>
47 class Implementation : public virtual Feature::Implementation<PolicyT>
48 {
49 public: using Scalar = typename PolicyT::Scalar;
50
51 public: virtual Scalar GetSphereShapeRadius(
52 const Identity &_sphereID) const = 0;
53 };
54 };
55
57 class GZ_PHYSICS_VISIBLE SetSphereShapeProperties
58 : public virtual FeatureWithRequirements<SphereShapeCast>
59 {
60 public: template <typename PolicyT, typename FeaturesT>
61 class SphereShape : public virtual Entity<PolicyT, FeaturesT>
62 {
63 public: using Scalar = typename PolicyT::Scalar;
64
68 public: void SetRadius(Scalar _radius);
69 };
70
71 public: template <typename PolicyT>
72 class Implementation : public virtual Feature::Implementation<PolicyT>
73 {
74 public: using Scalar = typename PolicyT::Scalar;
75
76 public: virtual void SetSphereShapeRadius(
77 const Identity &_sphereID, Scalar _radius) = 0;
78 };
79 };
80
85 class GZ_PHYSICS_VISIBLE AttachSphereShapeFeature
86 : public virtual FeatureWithRequirements<SphereShapeCast>
87 {
88 public: template <typename PolicyT, typename FeaturesT>
89 class Link : public virtual Feature::Link<PolicyT, FeaturesT>
90 {
91 public: using Scalar = typename PolicyT::Scalar;
92
93 public: using PoseType =
94 typename FromPolicy<PolicyT>::template Use<Pose>;
95
96 public: using ShapePtrType = SphereShapePtr<PolicyT, FeaturesT>;
97
105 const std::string &_name,
106 Scalar _radius = 1.0,
107 const PoseType &_pose = PoseType::Identity());
108 };
109
110 public: template <typename PolicyT>
111 class Implementation : public virtual Feature::Implementation<PolicyT>
112 {
113 public: using Scalar = typename PolicyT::Scalar;
114
115 public: using PoseType =
116 typename FromPolicy<PolicyT>::template Use<Pose>;
117
118 public: virtual Identity AttachSphereShape(
119 const Identity &_linkID,
120 const std::string &_name,
121 Scalar _radius,
122 const PoseType &_pose) = 0;
123 };
124 };
125 }
126}
127
128#include <gz/physics/detail/SphereShape.hh>
129
130#endif