##

HeightmapData.hh
Go to the documentation of this file.
/*
* Copyright (C) 2012 Open Source Robotics Foundation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/
#ifndef GAZEBO_COMMON_HEIGHTMAPDATA_HH_
#define GAZEBO_COMMON_HEIGHTMAPDATA_HH_
#include <string>
#include <vector>
#include <ignition/math/Vector3.hh>
#include "gazebo/gazebo_config.h"
#include "gazebo/common/CommonTypes.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace common
{
class GZ_COMMON_VISIBLE HeightmapData
{
public: virtual ~HeightmapData() {}
public: virtual void FillHeightMap(int _subSampling,
unsigned int _vertSize, const ignition::math::Vector3d &_size,
const ignition::math::Vector3d &_scale, bool _flipY,
std::vector<float> &_heights) = 0;
public: virtual unsigned int GetHeight() const = 0;
public: virtual unsigned int GetWidth() const = 0;
public: virtual float GetMaxElevation() const = 0;
};
class GZ_COMMON_VISIBLE HeightmapDataLoader
{
public: static HeightmapData *LoadTerrainFile(
const std::string &_filename);
private: static HeightmapData *LoadDEMAsTerrain(
const std::string &_filename);
private: static HeightmapData *LoadImageAsTerrain(
const std::string &_filename);
};
}
}
#endif
gazebo::common::HeightmapData
Encapsulates a generic heightmap data file.
Definition: HeightmapData.hh:39
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::common::HeightmapData::GetWidth
virtual unsigned int GetWidth() const =0
Get the terrain's width.
common
common
Definition: FuelModelDatabase.hh:37
gazebo::common::HeightmapData::GetMaxElevation
virtual float GetMaxElevation() const =0
Get the maximum terrain's elevation.
system.hh
CommonTypes.hh
gazebo::common::HeightmapDataLoader
Helper class for loading heightmap data.
Definition: HeightmapData.hh:74
gazebo::common::HeightmapData::GetHeight
virtual unsigned int GetHeight() const =0
Get the terrain's height.
gazebo::common::HeightmapDataLoader::LoadTerrainFile
static HeightmapData * LoadTerrainFile(const std::string &_filename)
Load a terrain file specified by _filename.
gazebo::common::HeightmapData::FillHeightMap
virtual void FillHeightMap(int _subSampling, unsigned int _vertSize, const ignition::math::Vector3d &_size, const ignition::math::Vector3d &_scale, bool _flipY, std::vector< float > &_heights)=0
Create a lookup table of the terrain's height.
gazebo::common::HeightmapData::~HeightmapData
virtual ~HeightmapData()
Destructor.
Definition: HeightmapData.hh:42