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/math/Vector3.hh"
29 #include "gazebo/util/system.hh"
30 
31 namespace gazebo
32 {
33  namespace common
34  {
37 
40  class GZ_COMMON_VISIBLE HeightmapData
41  {
43  public: virtual ~HeightmapData() {}
44 
55  public: virtual void FillHeightMap(int _subSampling,
56  unsigned int _vertSize, const ignition::math::Vector3d &_size,
57  const ignition::math::Vector3d &_scale, bool _flipY,
58  std::vector<float> &_heights) = 0;
59 
62  public: virtual unsigned int GetHeight() const = 0;
63 
66  public: virtual unsigned int GetWidth() const = 0;
67 
70  public: virtual float GetMaxElevation() const = 0;
71  };
72 
75  class GZ_COMMON_VISIBLE HeightmapDataLoader
76  {
83  public: static HeightmapData *LoadTerrainFile(
84  const std::string &_filename);
85 
89  private: static HeightmapData *LoadDEMAsTerrain(
90  const std::string &_filename);
91 
95  private: static HeightmapData *LoadImageAsTerrain(
96  const std::string &_filename);
97  };
99  }
100 }
101 #endif
Forward declarations for the common classes.
Definition: Animation.hh:33
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:40
Helper class for loading heightmap data.
Definition: HeightmapData.hh:75
virtual ~HeightmapData()
Destructor.
Definition: HeightmapData.hh:43