GAMS  1.4.0
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 
95  Region(const Region& rhs);
96 
100  virtual ~Region();
101 
106  void operator=(const Region& rhs);
107 
112  bool operator==(const Region& rhs) const;
113 
118  bool operator!=(const Region& rhs) const;
119 
124  std::string get_name() const;
125 
130  void set_name(const std::string& name);
131 
137  bool contains(const Position & position) const;
138 
144  double distance(const Position & position) const;
145 
151 
156  double get_area() const;
157 
163  std::string to_string(const std::string & delimiter = ":") const;
164 
166  std::vector <Position> vertices;
167 
169  double min_lat_, max_lat_;
170  double min_lon_, max_lon_;
171  double min_alt_, max_alt_;
172 
173  protected:
178 
180  unsigned int type_;
181 
182  private:
189  virtual bool check_valid_type(madara::knowledge::KnowledgeBase& kb,
190  const std::string& name) const;
191 
197  virtual void to_container_impl(
198  madara::knowledge::KnowledgeBase& kb,
199  const std::string& name);
200 
206  virtual bool from_container_impl(
207  madara::knowledge::KnowledgeBase& kb,
208  const std::string& name);
209  }; // class Region
210  } // namespace utility
211 } // namespace gams
212 
213 #endif // _GAMS_UTILITY_REGION_H_
Copyright(c) 2014 Carnegie Mellon University.
#define GAMS_EXPORT
Definition: GamsExport.h:20
A helper class for region information.
Definition: Region.h:79
Region(const Region &rhs)
Copy constructor.
void operator=(const Region &rhs)
Assignment operator.
bool operator!=(const Region &rhs) const
Inequality operator.
virtual bool from_container_impl(madara::knowledge::KnowledgeBase &kb, const std::string &name)
Load object from knowledge base.
Region(const std::vector< Position > &init_vertices=std::vector< Position >(), unsigned int type=0, const std::string &name="")
Constructor.
double get_area() const
Gets area of the region.
void set_name(const std::string &name)
Sets name of region.
double max_alt_
Definition: Region.h:171
std::vector< Position > vertices
the vertices of the region
Definition: Region.h:166
virtual void to_container_impl(madara::knowledge::KnowledgeBase &kb, const std::string &name)
Store object in knowledge base.
double distance(const Position &position) const
Gets distance from any point in this region.
bool contains(const Position &position) const
Determines if GPSPosition is in region.
void calculate_bounding_box()
populate bounding box values
virtual ~Region()
Destructor.
bool operator==(const Region &rhs) const
Equality operator.
double max_lat_
Definition: Region.h:169
std::string to_string(const std::string &delimiter=":") const
Converts the position to a string.
std::string get_name() const
Gets name of region.
double max_lon_
Definition: Region.h:170
unsigned int type_
type for this region
Definition: Region.h:180
virtual bool check_valid_type(madara::knowledge::KnowledgeBase &kb, const std::string &name) const
Check if object is of correct type.
Region get_bounding_box() const
Gets bounding box.
A class meant to assist with retrieving information into GAMS containers.
Definition: Containerize.h:72
Contains all GAMS-related tools, classes and code.
Copyright (c) 2015 Carnegie Mellon University.
Copyright (c) 2015 Carnegie Mellon University.
Copyright (c) 2015-2018 Carnegie Mellon University.
Copyright (c) 2015 Carnegie Mellon University.