Ignition Physics

API Reference

5.1.0
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 IGNITION_PHYSICS_HEIGHTMAP_HEIGHTMAPSHAPE_HH_
19 #define IGNITION_PHYSICS_HEIGHTMAP_HEIGHTMAPSHAPE_HH_
20 
21 #include <string>
22 
24 
27 
28 namespace ignition
29 {
30 namespace physics
31 {
32 namespace heightmap
33 {
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 
84  public: ShapePtrType AttachHeightmapShape(
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 <ignition/physics/heightmap/detail/HeightmapShape.hh>
115 
116 #endif // IGNITION_PHYSICS_HEIGHTMAP_HEIGHTMAPSHAPE_HH_
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< LinearVector > Dimensions
Definition: HeightmapShape.hh:99
This struct is used to conveniently convert from a policy to a geometric type. Example usage: ...
Definition: Geometry.hh:77
STL class.
typename FromPolicy< PolicyT >::template Use< Pose > PoseType
Definition: HeightmapShape.hh:96
Attach a heightmap shape to a link.
Definition: HeightmapShape.hh:64
IGN_PHYSICS_DECLARE_SHAPE_TYPE(HeightmapShape) class GetHeightmapShapeProperties
Definition: HeightmapShape.hh:34