##

ImageHeightmap.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_IMAGE_HEIGHTMAP_DATA_HH_
#define _GAZEBO_IMAGE_HEIGHTMAP_DATA_HH_
#include <string>
#include <vector>
#include <ignition/math/Vector3.hh>
#include "gazebo/common/HeightmapData.hh"
#include "gazebo/common/Image.hh"
#include "gazebo/util/system.hh"
namespace gazebo
{
namespace common
{
class GZ_COMMON_VISIBLE ImageHeightmap
: public gazebo::common::HeightmapData
{
public: ImageHeightmap();
public: int Load(const std::string &_filename="");
// Documentation inherited.
public: void FillHeightMap(int _subSampling, unsigned int _vertSize,
const ignition::math::Vector3d &_size,
const ignition::math::Vector3d &_scale, bool _flipY,
std::vector<float> &_heights);
public: std::string GetFilename() const;
// Documentation inherited.
public: unsigned int GetHeight() const;
// Documentation inherited.
public: unsigned int GetWidth() const;
// Documentation inherited.
public: float GetMaxElevation() const;
private: gazebo::common::Image img;
};
}
}
#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::ImageHeightmap::FillHeightMap
void FillHeightMap(int _subSampling, unsigned int _vertSize, const ignition::math::Vector3d &_size, const ignition::math::Vector3d &_scale, bool _flipY, std::vector< float > &_heights)
Create a lookup table of the terrain's height.
gazebo::common::ImageHeightmap::GetFilename
std::string GetFilename() const
Get the full filename of the image.
common
common
Definition: FuelModelDatabase.hh:37
HeightmapData.hh
system.hh
gazebo::common::Image
Encapsulates an image.
Definition: Image.hh:66
Image.hh
gazebo::common::ImageHeightmap::Load
int Load(const std::string &_filename="")
Load an image file as a heightmap.
gazebo::common::ImageHeightmap::ImageHeightmap
ImageHeightmap()
Constructor.
gazebo::common::ImageHeightmap::GetMaxElevation
float GetMaxElevation() const
Get the maximum terrain's elevation.
gazebo::common::ImageHeightmap::GetWidth
unsigned int GetWidth() const
Get the terrain's width.
gazebo::common::ImageHeightmap::GetHeight
unsigned int GetHeight() const
Get the terrain's height.
gazebo::common::ImageHeightmap
Encapsulates an image that will be interpreted as a heightmap.
Definition: ImageHeightmap.hh:38