Gazebo Rendering

API Reference

6.6.4
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 
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 
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  {
150 
154 
157  public: HeightmapDescriptor(HeightmapDescriptor &&_desc) noexcept;
158 
160  public: virtual ~HeightmapDescriptor();
161 
166 
171 
175  public: const std::string &Name() const;
176 
179  public: void SetName(const std::string &_name);
180 
184 
188 
192 
195  public: void SetSize(const ignition::math::Vector3d &_size);
196 
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
Blend information to be used between textures on heightmaps.
Definition: gz/rendering/HeightmapDescriptor.hh:96
double MinHeight() const
Get the heightmap blend's minimum height.
void SetFadeDistance(double _fadeDistance)
Set the distance over which the blend occurs.
HeightmapBlend(HeightmapBlend &&_blend) noexcept
Move constructor.
double FadeDistance() const
Get the heightmap blend's fade distance.
virtual ~HeightmapBlend()
Destructor.
HeightmapBlend & operator=(HeightmapBlend &&_blend)
Move assignment operator.
void SetMinHeight(double _minHeight)
Set the minimum height of the blend in meters.
HeightmapBlend(const HeightmapBlend &_blend)
Copy constructor.
HeightmapBlend & operator=(const HeightmapBlend &_blend)
Copy Assignment operator.
Describes how a Heightmap should be loaded.
Definition: gz/rendering/HeightmapDescriptor.hh:147
HeightmapDescriptor(HeightmapDescriptor &&_desc) noexcept
Move constructor.
void SetName(const std::string &_name)
Set the heightmap's name.
HeightmapDescriptor(const HeightmapDescriptor &_desc)
Copy constructor.
const std::string & Name() const
Get the heightmap's name used for caching. This is different from its unique Heightmap::Name().
void SetUseTerrainPaging(bool _use)
Set whether the heightmap uses terrain paging. Defaults to false.
uint64_t BlendCount() const
Get the number of heightmap blends.
void AddBlend(const HeightmapBlend &_blend)
Add a heightmap blend.
void SetSampling(unsigned int _sampling)
Set the heightmap's sampling. Defaults to 1.
void SetSize(const ignition::math::Vector3d &_size)
Set the heightmap's scaling factor. Defaults to 1x1x1.
ignition::math::Vector3d Position() const
Get the heightmap's position offset.
std::shared_ptr< common::HeightmapData > Data() const
Get the heightfield data.
void SetPosition(const ignition::math::Vector3d &_position)
Set the heightmap's position offset.
HeightmapDescriptor & operator=(HeightmapDescriptor &&_desc)
Move assignment operator.
ignition::math::Vector3d Size() const
Get the heightmap's scaling factor.
void AddTexture(const HeightmapTexture &_texture)
Add a heightmap texture.
HeightmapDescriptor & operator=(const HeightmapDescriptor &_desc)
Copy Assignment operator.
uint64_t TextureCount() const
Get the number of heightmap textures.
unsigned int Sampling() const
Get the heightmap's sampling per datum.
bool UseTerrainPaging() const
Get whether the heightmap uses terrain paging.
const HeightmapTexture * TextureByIndex(uint64_t _index) const
Get a heightmap texture based on an index.
void SetData(const std::shared_ptr< common::HeightmapData > &_data)
Set the heightfield data.
const HeightmapBlend * BlendByIndex(uint64_t _index) const
Get a heightmap blend based on an index.
Texture to be used on heightmaps.
Definition: gz/rendering/HeightmapDescriptor.hh:39
virtual ~HeightmapTexture()
Destructor.
HeightmapTexture(const HeightmapTexture &_texture)
Copy constructor.
std::string Diffuse() const
Get the heightmap texture's diffuse map.
HeightmapTexture & operator=(HeightmapTexture &&_texture)
Move assignment operator.
HeightmapTexture & operator=(const HeightmapTexture &_texture)
Copy Assignment operator.
std::string Normal() const
Get the heightmap texture's normal map.
HeightmapTexture(HeightmapTexture &&_texture) noexcept
Move constructor.
double Size() const
Get the heightmap texture's size.
void SetDiffuse(const std::string &_diffuse)
Set the filename of the diffuse map.
void SetNormal(const std::string &_normal)
Set the filename of the normal map.
void SetSize(double _size)
Set the size of the texture in meters.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING