Gazebo Common

API Reference

3.17.0
gz/common/Dem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2016 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 GZ_COMMON_DEM_HH_
18 #define GZ_COMMON_DEM_HH_
19 
20 #include <memory>
21 #include <gz/math/Vector3.hh>
22 #include <gz/math/Angle.hh>
23 
24 #include <gz/common/graphics/Export.hh>
26 
27 #ifdef HAVE_GDAL
28 # include <string>
29 # include <vector>
30 
32 
33 namespace ignition
34 {
35  namespace common
36  {
37  class DemPrivate;
38 
41  class IGNITION_COMMON_GRAPHICS_VISIBLE Dem : public HeightmapData
42  {
44  public: Dem();
45 
47  public: virtual ~Dem();
48 
52  public: int Load(const std::string &_filename = "");
53 
58  public: double Elevation(double _x, double _y);
59 
62  public: float MinElevation() const;
63 
66  public: float MaxElevation() const;
67 
72  public: void GeoReferenceOrigin(gz::math::Angle &_latitude,
73  gz::math::Angle &_longitude) const;
74 
82  public: unsigned int Height() const;
83 
91  public: unsigned int Width() const;
92 
95  public: double WorldWidth() const;
96 
99  public: double WorldHeight() const;
100 
111  public: void FillHeightMap(const int _subSampling,
112  const unsigned int _vertSize,
113  const gz::math::Vector3d &_size,
114  const gz::math::Vector3d &_scale,
115  const bool _flipY,
116  std::vector<float> &_heights);
117 
124  private: void GeoReference(double _x, double _y,
125  gz::math::Angle &_latitude,
126  gz::math::Angle &_longitude) const;
127 
132  private: int LoadData();
133 
137  private: std::unique_ptr<DemPrivate> dataPtr;
139  };
140  }
141 }
142 #endif
143 #endif
Forward declarations for the common classes.
STL class.
#define IGN_COMMON_WARN_IGNORE__DLL_INTERFACE_MISSING
Microsoft Visual Studio does not automatically export the interface information for member variables ...
Definition: gz/common/SuppressWarning.hh:65
STL class.
STL class.
#define IGN_COMMON_WARN_RESUME__DLL_INTERFACE_MISSING
Definition: gz/common/SuppressWarning.hh:68