HeightmapData.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012 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_COMMON_HEIGHTMAPDATA_HH_
19 #define GAZEBO_COMMON_HEIGHTMAPDATA_HH_
20 
21 #include <string>
22 #include <vector>
23 #include <ignition/math/Vector3.hh>
24 
25 #include "gazebo/gazebo_config.h"
26 
28 #include "gazebo/util/system.hh"
29 
30 namespace gazebo
31 {
32  namespace common
33  {
36 
39  class GZ_COMMON_VISIBLE HeightmapData
40  {
42  public: virtual ~HeightmapData() {}
43 
54  public: virtual void FillHeightMap(int _subSampling,
55  unsigned int _vertSize, const ignition::math::Vector3d &_size,
56  const ignition::math::Vector3d &_scale, bool _flipY,
57  std::vector<float> &_heights) = 0;
58 
61  public: virtual unsigned int GetHeight() const = 0;
62 
65  public: virtual unsigned int GetWidth() const = 0;
66 
69  public: virtual float GetMaxElevation() const = 0;
70  };
71 
74  class GZ_COMMON_VISIBLE HeightmapDataLoader
75  {
82  public: static HeightmapData *LoadTerrainFile(
83  const std::string &_filename);
84 
88  private: static HeightmapData *LoadDEMAsTerrain(
89  const std::string &_filename);
90 
94  private: static HeightmapData *LoadImageAsTerrain(
95  const std::string &_filename);
96  };
98  }
99 }
100 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:39
Helper class for loading heightmap data.
Definition: HeightmapData.hh:74
virtual ~HeightmapData()
Destructor.
Definition: HeightmapData.hh:42