Region.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 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 #ifndef GAZEBO_PLUGIN_EVENTS_REGION_HH_
18 #define GAZEBO_PLUGIN_EVENTS_REGION_HH_
19 
20 #include <string>
21 #include <vector>
22 #include <memory>
23 
24 #include <sdf/sdf.hh>
25 #include <gazebo/math/Vector3.hh>
26 #include <ignition/math/Vector3.hh>
27 #include <ignition/math/Box.hh>
28 
29 namespace gazebo
30 {
32  class Region
33  {
35  public: Region() = default;
36 
38  public: virtual ~Region() = default;
39 
42  public: void Load(const sdf::ElementPtr &_sdf);
43 
48  public: bool Contains(const math::Vector3 &_p) const GAZEBO_DEPRECATED(8.0);
49 
53  public: bool Contains(const ignition::math::Vector3d &_p) const;
54 
59  public: friend std::ostream& operator<<(std::ostream &_out,
60  const Region &_region);
61 
63  public: std::string name;
64 
66  public: std::vector<ignition::math::Box> boxes;
67  };
68 
71  typedef std::shared_ptr<Region> RegionPtr;
72 }
73 #endif
std::vector< ignition::math::Box > boxes
The list of volumes inside this region.
Definition: Region.hh:66
void Load(const sdf::ElementPtr &_sdf)
Load from a world file (inside a SimEvent plugin element)
Region()=default
Constructor.
bool Contains(const math::Vector3 &_p) const GAZEBO_DEPRECATED(8.0)
Check if a point lies inside the region.
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:44
std::string name
Name of the region (as defined in the world file)
Definition: Region.hh:63
friend std::ostream & operator<<(std::ostream &_out, const Region &_region)
Output operator to print a region to the console.
#define GAZEBO_DEPRECATED(version)
Definition: system.hh:302
std::shared_ptr< Region > RegionPtr
Definition: Region.hh:71
virtual ~Region()=default
Destructor.
A region, made of a list of boxes.
Definition: Region.hh:32