Gazebo Physics

API Reference

5.3.2
gz/physics/heightmap/HeightmapShape.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 GZ_PHYSICS_HEIGHTMAP_HEIGHTMAPSHAPE_HH_
19 #define GZ_PHYSICS_HEIGHTMAP_HEIGHTMAPSHAPE_HH_
20 
21 #include <string>
22 
23 #include <gz/common/HeightmapData.hh>
24 
26 #include <gz/physics/Geometry.hh>
27 
28 namespace ignition
29 {
30 namespace physics
31 {
32 namespace heightmap
33 {
34  IGN_PHYSICS_DECLARE_SHAPE_TYPE(HeightmapShape)
35 
36 
37  class GetHeightmapShapeProperties
38  : public virtual FeatureWithRequirements<HeightmapShapeCast>
39  {
40  public: template <typename PolicyT, typename FeaturesT>
41  class HeightmapShape : public virtual Entity<PolicyT, FeaturesT>
42  {
43  public: using Dimensions =
44  typename FromPolicy<PolicyT>::template Use<LinearVector>;
45 
48  public: Dimensions GetSize() const;
49  };
50 
51  public: template <typename PolicyT>
52  class Implementation : public virtual Feature::Implementation<PolicyT>
53  {
54  public: using Dimensions =
55  typename FromPolicy<PolicyT>::template Use<LinearVector>;
56 
57  public: virtual Dimensions GetHeightmapShapeSize(
58  const Identity &_heightmapID) const = 0;
59  };
60  };
61 
65  : public virtual FeatureWithRequirements<HeightmapShapeCast>
66  {
67  public: template <typename PolicyT, typename FeaturesT>
68  class Link : public virtual Feature::Link<PolicyT, FeaturesT>
69  {
70  public: using PoseType =
71  typename FromPolicy<PolicyT>::template Use<Pose>;
72 
73  public: using Dimensions =
74  typename FromPolicy<PolicyT>::template Use<LinearVector>;
75 
76  public: using ShapePtrType = HeightmapShapePtr<PolicyT, FeaturesT>;
77 
85  const std::string &_name,
86  const common::HeightmapData &_heightmapData,
87  const PoseType &_pose,
88  const Dimensions &_size,
89  int _subSampling = 1);
90  };
91 
92  public: template <typename PolicyT>
93  class Implementation : public virtual Feature::Implementation<PolicyT>
94  {
95  public: using PoseType =
96  typename FromPolicy<PolicyT>::template Use<Pose>;
97 
98  public: using Dimensions =
99  typename FromPolicy<PolicyT>::template Use<LinearVector>;
100 
101  public: virtual Identity AttachHeightmapShape(
102  const Identity &_linkID,
103  const std::string &_name,
104  const common::HeightmapData &_heightmapData,
105  const PoseType &_pose,
106  const Dimensions &_size,
107  int _subSampling) = 0;
108  };
109  };
110 }
111 }
112 }
113 
114 #include <gz/physics/heightmap/detail/HeightmapShape.hh>
115 
116 #endif // GZ_PHYSICS_HEIGHTMAP_HEIGHTMAPSHAPE_HH_
typename FromPolicy< PolicyT >::template Use< LinearVector > Dimensions
Definition: gz/physics/heightmap/HeightmapShape.hh:99
This is the base class of all "proxy objects". The "proxy objects" are essentially interfaces into th...
Definition: gz/physics/Entity.hh:216
virtual Identity AttachHeightmapShape(const Identity &_linkID, const std::string &_name, const common::HeightmapData &_heightmapData, const PoseType &_pose, const Dimensions &_size, int _subSampling)=0
If your feature is known to require any other features, then you should have your feature class inher...
Definition: gz/physics/FeatureList.hh:118
STL class.
This struct is used to conveniently convert from a policy to a geometric type. Example usage:
Definition: gz/physics/Geometry.hh:77
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: gz/physics/heightmap/HeightmapShape.hh:96
#define IGN_PHYSICS_DECLARE_SHAPE_TYPE(CustomShapeType)
Given a shape type named CustomShapeType, this macro creates the following classes:
Definition: gz/physics/DeclareShapeType.hh:52
Definition: gz/physics/Feature.hh:92
Definition: gz/physics/heightmap/HeightmapShape.hh:93
Attach a heightmap shape to a link.
Definition: gz/physics/heightmap/HeightmapShape.hh:64