Dem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-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 
18 #ifndef _GAZEBO_DEM_HH_
19 #define _GAZEBO_DEM_HH_
20 
21 #include <ignition/math/Vector3.hh>
22 #include <ignition/math/Angle.hh>
23 
24 #include <gazebo/gazebo_config.h>
25 #include <gazebo/util/system.hh>
26 
27 #ifdef HAVE_GDAL
28 # include <string>
29 # include <vector>
30 
32 # include "gazebo/math/Angle.hh"
33 
34 namespace gazebo
35 {
36  namespace common
37  {
38  class DemPrivate;
39 
42 
45  class GZ_COMMON_VISIBLE Dem : public HeightmapData
46  {
48  public: Dem();
49 
51  public: virtual ~Dem();
52 
56  public: int Load(const std::string &_filename="");
57 
62  public: double GetElevation(double _x, double _y);
63 
66  public: float GetMinElevation() const;
67 
70  public: float GetMaxElevation() const;
71 
76  public: void GetGeoReferenceOrigin(ignition::math::Angle &_latitude,
77  ignition::math::Angle &_longitude) const;
78 
86  public: unsigned int GetHeight() const;
87 
95  public: unsigned int GetWidth() const;
96 
99  public: double GetWorldWidth() const;
100 
103  public: double GetWorldHeight() const;
104 
115  public: void FillHeightMap(const int _subSampling,
116  const unsigned int _vertSize,
117  const ignition::math::Vector3d &_size,
118  const ignition::math::Vector3d &_scale,
119  const bool _flipY,
120  std::vector<float> &_heights);
121 
128  private: void GetGeoReference(double _x, double _y,
129  ignition::math::Angle &_latitude,
130  ignition::math::Angle &_longitude) const;
131 
136  private: int LoadData();
137 
140  private: DemPrivate *dataPtr;
141  };
143  }
144 }
145 #endif
146 #endif
Definition: Dem.hh:45
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:37