GAMS  1.2.2
Region.h
Go to the documentation of this file.
1 
54 #include "ReferenceFrame.h"
55 
56 #ifndef _GAMS_UTILITY_REGION_H_
57 #define _GAMS_UTILITY_REGION_H_
58 
59 #include <vector>
60 #include <string>
61 
62 #include "gams/GamsExport.h"
63 #include "madara/knowledge/containers/StringVector.h"
64 
65 #include "gams/pose/Position.h"
66 #include "gams/pose/GPSFrame.h"
68 
70 
71 namespace gams
72 {
73  namespace pose
74  {
79  {
80  public:
87  Region (const std::vector <Position> & init_vertices =
88  std::vector<Position> (), unsigned int type = 0,
89  const std::string& name = "");
90 
94  virtual ~Region ();
95 
100  void operator= (const Region& rhs);
101 
106  bool operator== (const Region& rhs) const;
107 
112  bool operator!= (const Region& rhs) const;
113 
118  std::string get_name () const;
119 
124  void set_name (const std::string& name);
125 
131  bool contains (const Position & position) const;
132 
138  double distance (const Position & position) const;
139 
144  Region get_bounding_box () const;
145 
150  double get_area () const;
151 
157  std::string to_string (const std::string & delimiter = ":") const;
158 
160  std::vector <Position> vertices;
161 
163  double min_lat_, max_lat_;
164  double min_lon_, max_lon_;
165  double min_alt_, max_alt_;
166 
167  protected:
171  void calculate_bounding_box ();
172 
174  unsigned int type_;
175 
176  private:
183  virtual bool check_valid_type (madara::knowledge::KnowledgeBase& kb,
184  const std::string& name) const;
185 
191  virtual void to_container_impl (
192  madara::knowledge::KnowledgeBase& kb,
193  const std::string& name);
194 
200  virtual bool from_container_impl (
201  madara::knowledge::KnowledgeBase& kb,
202  const std::string& name);
203  }; // class Region
204  } // namespace utility
205 } // namespace gams
206 
207 #endif // _GAMS_UTILITY_REGION_H_
std::vector< Position > vertices
the vertices of the region
Definition: Region.h:160
double min_lat_
bounding box
Definition: Region.h:163
A class meant to assist with retrieving information into GAMS containers.
Definition: Containerize.h:71
Contains all GAMS-related tools, classes and code.
#define GAMS_EXPORT
Definition: GamsExport.h:20
double min_lon_
Definition: Region.h:164
Copyright (c) 2014 Carnegie Mellon University.
bool operator!=(const BasicVector< LDerived, Units > &lhs, const BasicVector< RDerived, Units > &rhs)
Definition: Coordinate.h:956
A helper class for region information.
Definition: Region.h:78
unsigned int type_
type for this region
Definition: Region.h:174
double min_alt_
Definition: Region.h:165
bool operator==(const BasicVector< LDerived, Units > &lhs, const BasicVector< RDerived, Units > &rhs)
Definition: Coordinate.h:955