Dem.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 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 
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 
78  public: void GetGeoReferenceOrigin(math::Angle &_latitude,
79  math::Angle &_longitude) GAZEBO_DEPRECATED(6.0);
80 
85  public: void GetGeoReferenceOrigin(ignition::math::Angle &_latitude,
86  ignition::math::Angle &_longitude) const;
87 
95  public: unsigned int GetHeight() const;
96 
104  public: unsigned int GetWidth() const;
105 
108  public: double GetWorldWidth() const;
109 
112  public: double GetWorldHeight() const;
113 
126  public: void FillHeightMap(int _subSampling, unsigned int _vertSize,
127  const math::Vector3 &_size, const math::Vector3 &_scale, bool _flipY,
128  std::vector<float> &_heights) GAZEBO_DEPRECATED(6.0);
129 
140  public: void FillHeightMap(const int _subSampling,
141  const unsigned int _vertSize,
142  const ignition::math::Vector3d &_size,
143  const ignition::math::Vector3d &_scale,
144  const bool _flipY,
145  std::vector<float> &_heights);
146 
153  private: void GetGeoReference(double _x, double _y,
154  ignition::math::Angle &_latitude,
155  ignition::math::Angle &_longitude) const;
156 
161  private: int LoadData();
162 
165  private: DemPrivate *dataPtr;
166  };
168  }
169 }
170 #endif
171 #endif
Definition: Dem.hh:45
Private data for the Dem class.
Definition: DemPrivate.hh:37
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:37
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:47
#define GZ_COMMON_VISIBLE
Definition: system.hh:91
An angle and related functions.
Definition: Angle.hh:53