##

Region.hh
Go to the documentation of this file.
/*
* Copyright (C) 2015 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_PLUGIN_EVENTS_REGION_HH_
#define GAZEBO_PLUGIN_EVENTS_REGION_HH_
#include <string>
#include <vector>
#include <memory>
#include <sdf/sdf.hh>
#include <ignition/math/Vector3.hh>
#include <ignition/math/Box.hh>
namespace gazebo
{
class Region
{
public: Region() = default;
public: virtual ~Region() = default;
public: void Load(const sdf::ElementPtr &_sdf);
public: bool Contains(const ignition::math::Vector3d &_p) const;
public: friend std::ostream& operator<<(std::ostream &_out,
const Region &_region);
public: std::string name;
public: std::vector<ignition::math::Box> boxes;
};
typedef std::shared_ptr<Region> RegionPtr;
}
#endif
gazebo::Region::operator<<
friend std::ostream & operator<<(std::ostream &_out, const Region &_region)
Output operator to print a region to the console.
gazebo::Region::Region
Region()=default
Constructor.
gazebo
Forward declarations for the common classes.
Definition: Animation.hh:26
gazebo::Region
A region, made of a list of boxes.
Definition: Region.hh:31
gazebo::Region::name
std::string name
Name of the region (as defined in the world file)
Definition: Region.hh:56
gazebo::Region::~Region
virtual ~Region()=default
Destructor.
gazebo::Region::Load
void Load(const sdf::ElementPtr &_sdf)
Load from a world file (inside a SimEvent plugin element)
gazebo::Region::Contains
bool Contains(const ignition::math::Vector3d &_p) const
Check if a point lies inside the region.
gazebo::Region::boxes
std::vector< ignition::math::Box > boxes
The list of volumes inside this region.
Definition: Region.hh:59
gazebo::RegionPtr
std::shared_ptr< Region > RegionPtr
Definition: Region.hh:64