Gazebo Rendering

API Reference

6.6.3
gz/rendering/HeightmapDescriptor.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 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 #ifndef IGNITION_RENDERING_HEIGHTMAPDESCRIPTOR_HH_
18 #define IGNITION_RENDERING_HEIGHTMAPDESCRIPTOR_HH_
19 
20 #include <memory>
21 #include <string>
22 #include <ignition/common/HeightmapData.hh>
23 #include <ignition/common/SuppressWarning.hh>
24 
27 
28 namespace ignition
29 {
30 namespace rendering
31 {
32 inline namespace IGNITION_RENDERING_VERSION_NAMESPACE {
33  class HeightmapDescriptorPrivate;
34  class HeightmapTexturePrivate;
35  class HeightmapBlendPrivate;
36 
38  class IGNITION_RENDERING_VISIBLE HeightmapTexture
39  {
41  public: HeightmapTexture();
42 
45  public: HeightmapTexture(const HeightmapTexture &_texture);
46 
49  public: HeightmapTexture(HeightmapTexture &&_texture) noexcept;
50 
52  public: virtual ~HeightmapTexture();
53 
57  public: HeightmapTexture &operator=(HeightmapTexture &&_texture);
58 
62  public: HeightmapTexture &operator=(const HeightmapTexture &_texture);
63 
66  public: double Size() const;
67 
70  public: void SetSize(double _size);
71 
74  public: std::string Diffuse() const;
75 
78  public: void SetDiffuse(const std::string &_diffuse);
79 
82  public: std::string Normal() const;
83 
86  public: void SetNormal(const std::string &_normal);
87 
92  };
93 
95  class IGNITION_RENDERING_VISIBLE HeightmapBlend
96  {
98  public: HeightmapBlend();
99 
102  public: HeightmapBlend(const HeightmapBlend &_blend);
103 
106  public: HeightmapBlend(HeightmapBlend &&_blend) noexcept;
107 
109  public: virtual ~HeightmapBlend();
110 
114  public: HeightmapBlend &operator=(HeightmapBlend &&_blend);
115 
119  public: HeightmapBlend &operator=(const HeightmapBlend &_blend);
120 
123  public: double MinHeight() const;
124 
127  public: void SetMinHeight(double _minHeight);
128 
131  public: double FadeDistance() const;
132 
135  public: void SetFadeDistance(double _fadeDistance);
136 
141  };
142 
146  class IGNITION_RENDERING_VISIBLE HeightmapDescriptor
147  {
149  public: HeightmapDescriptor();
150 
153  public: HeightmapDescriptor(const HeightmapDescriptor &_desc);
154 
157  public: HeightmapDescriptor(HeightmapDescriptor &&_desc) noexcept;
158 
160  public: virtual ~HeightmapDescriptor();
161 
165  public: HeightmapDescriptor &operator=(HeightmapDescriptor &&_desc);
166 
170  public: HeightmapDescriptor &operator=(const HeightmapDescriptor &_desc);
171 
175  public: const std::string &Name() const;
176 
179  public: void SetName(const std::string &_name);
180 
183  public: std::shared_ptr<common::HeightmapData> Data() const;
184 
187  public: void SetData(const std::shared_ptr<common::HeightmapData> &_data);
188 
191  public: ignition::math::Vector3d Size() const;
192 
195  public: void SetSize(const ignition::math::Vector3d &_size);
196 
199  public: ignition::math::Vector3d Position() const;
200 
203  public: void SetPosition(const ignition::math::Vector3d &_position);
204 
207  public: bool UseTerrainPaging() const;
208 
211  public: void SetUseTerrainPaging(bool _use);
212 
215  public: unsigned int Sampling() const;
216 
219  public: void SetSampling(unsigned int _sampling);
220 
223  public: uint64_t TextureCount() const;
224 
231  public: const HeightmapTexture *TextureByIndex(uint64_t _index) const;
232 
235  public: void AddTexture(const HeightmapTexture &_texture);
236 
239  public: uint64_t BlendCount() const;
240 
247  public: const HeightmapBlend *BlendByIndex(uint64_t _index) const;
248 
251  public: void AddBlend(const HeightmapBlend &_blend);
252 
258  };
259 }
260 }
261 }
262 #endif
virtual ~HeightmapTexture()
Destructor.
void SetFadeDistance(double _fadeDistance)
Set the distance over which the blend occurs.
void SetUseTerrainPaging(bool _use)
Set whether the heightmap uses terrain paging. Defaults to false.
STL class.
STL class.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
void SetSize(const ignition::math::Vector3d &_size)
Set the heightmap's scaling factor. Defaults to 1x1x1.
Describes how a Heightmap should be loaded.
Definition: gz/rendering/HeightmapDescriptor.hh:146
ignition::math::Vector3d Size() const
Get the heightmap's scaling factor.
std::string Normal() const
Get the heightmap texture's normal map.
uint64_t TextureCount() const
Get the number of heightmap textures.
virtual ~HeightmapBlend()
Destructor.
const std::string & Name() const
Get the heightmap's name used for caching. This is different from its unique Heightmap::Name().
const HeightmapTexture * TextureByIndex(uint64_t _index) const
Get a heightmap texture based on an index.
std::shared_ptr< common::HeightmapData > Data() const
Get the heightfield data.
HeightmapTexture & operator=(HeightmapTexture &&_texture)
Move assignment operator.
std::string Diffuse() const
Get the heightmap texture's diffuse map.
void SetSampling(unsigned int _sampling)
Set the heightmap's sampling. Defaults to 1.
HeightmapDescriptor & operator=(HeightmapDescriptor &&_desc)
Move assignment operator.
double Size() const
Get the heightmap texture's size.
unsigned int Sampling() const
Get the heightmap's sampling per datum.
ignition::math::Vector3d Position() const
Get the heightmap's position offset.
void AddBlend(const HeightmapBlend &_blend)
Add a heightmap blend.
double MinHeight() const
Get the heightmap blend's minimum height.
Blend information to be used between textures on heightmaps.
Definition: gz/rendering/HeightmapDescriptor.hh:95
void SetName(const std::string &_name)
Set the heightmap's name.
void SetSize(double _size)
Set the size of the texture in meters.
bool UseTerrainPaging() const
Get whether the heightmap uses terrain paging.
uint64_t BlendCount() const
Get the number of heightmap blends.
void SetNormal(const std::string &_normal)
Set the filename of the normal map.
void SetPosition(const ignition::math::Vector3d &_position)
Set the heightmap's position offset.
void SetData(const std::shared_ptr< common::HeightmapData > &_data)
Set the heightfield data.
double FadeDistance() const
Get the heightmap blend's fade distance.
Texture to be used on heightmaps.
Definition: gz/rendering/HeightmapDescriptor.hh:38
HeightmapBlend & operator=(HeightmapBlend &&_blend)
Move assignment operator.
void AddTexture(const HeightmapTexture &_texture)
Add a heightmap texture.
void SetMinHeight(double _minHeight)
Set the minimum height of the blend in meters.
void SetDiffuse(const std::string &_diffuse)
Set the filename of the diffuse map.
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
const HeightmapBlend * BlendByIndex(uint64_t _index) const
Get a heightmap blend based on an index.