A helper class for region information.
More...
#include <Region.h>
|
static Class_ID | get_type (madara::knowledge::KnowledgeBase &kb, const std::string &name) |
| Gets type of object in database. More...
|
|
|
virtual bool | check_valid_type (madara::knowledge::KnowledgeBase &kb, const std::string &name) const |
| Check if object is of correct type. More...
|
|
virtual bool | from_container_impl (madara::knowledge::KnowledgeBase &kb, const std::string &name) |
| Load object from knowledge base. More...
|
|
virtual void | to_container_impl (madara::knowledge::KnowledgeBase &kb, const std::string &name) |
| Store object in knowledge base. More...
|
|
A helper class for region information.
Definition at line 78 of file Region.h.
◆ Class_ID
These are used to check on the type of the object in from_container.
When inheriting from this class, add your new class to this list to check for your unique ID. Assign this value in the knowledge base to "prefix + object_type_suffix"
Enumerator |
---|
REGION_TYPE_ID | |
PRIORITIZED_REGION_TYPE_ID | |
SEARCH_AREA_TYPE_ID | |
INVALID | |
Definition at line 154 of file Containerize.h.
◆ Region() [1/2]
gams::pose::Region::Region |
( |
const std::vector< Position > & |
init_vertices = std::vector< Position >() , |
|
|
unsigned int |
type = 0 , |
|
|
const std::string & |
name = "" |
|
) |
| |
Constructor.
- Parameters
-
init_vertices | the vertices of the region |
type | the type of region |
name | name of the region |
◆ Region() [2/2]
gams::pose::Region::Region |
( |
const Region & |
rhs | ) |
|
Copy constructor.
- Parameters
-
◆ ~Region()
virtual gams::pose::Region::~Region |
( |
| ) |
|
|
virtual |
◆ calculate_bounding_box()
void gams::pose::Region::calculate_bounding_box |
( |
| ) |
|
|
protected |
populate bounding box values
◆ check_valid_type()
virtual bool gams::pose::Region::check_valid_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| const |
|
privatevirtual |
◆ contains()
bool gams::pose::Region::contains |
( |
const Position & |
position | ) |
const |
Determines if GPSPosition is in region.
- Parameters
-
position | point to check if in region |
- Returns
- true if point is in region or on border, false otherwise
◆ distance()
double gams::pose::Region::distance |
( |
const Position & |
position | ) |
const |
Gets distance from any point in this region.
- Parameters
-
- Returns
- 0 if in region, otherwise distance from region
◆ from_container() [1/2]
bool gams::utility::Containerize::from_container |
( |
const std::string & |
name = "" | ) |
|
|
inherited |
Load object from knowledge base.
- Parameters
-
name | location of object in Knowlege Base |
- Returns
- true if object successfully loaded from knowledge base
◆ from_container() [2/2]
bool gams::utility::Containerize::from_container |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name = "" |
|
) |
| |
|
inherited |
Load object from knowledge base.
- Parameters
-
kb | Knowledge Base with object |
name | location of object in Knowlege Base |
- Returns
- true if object successfully loaded from knowledge base
◆ from_container_impl()
virtual bool gams::pose::Region::from_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatevirtual |
◆ get_area()
double gams::pose::Region::get_area |
( |
| ) |
const |
Gets area of the region.
- Returns
- area of this region
◆ get_bounding_box()
Region gams::pose::Region::get_bounding_box |
( |
| ) |
const |
Gets bounding box.
- Returns
- Region object corresponding to bounding box
◆ get_name()
std::string gams::pose::Region::get_name |
( |
| ) |
const |
Gets name of region.
- Returns
- name of the region
◆ get_type()
static Class_ID gams::utility::Containerize::get_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
staticprotectedinherited |
Gets type of object in database.
- Parameters
-
kb | Knowledge Base with object |
name | Prefix of object in the KB |
- Returns
- Class_ID of object in kb
◆ is_valid_type()
bool gams::utility::Containerize::is_valid_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name, |
|
|
const Class_ID & |
expected |
|
) |
| const |
|
protectedinherited |
Check if the type is correct.
- Parameters
-
kb | Knowledge Base with object |
name | Prefix of object in the KB |
expected | Expected value |
- Returns
- true if correct type, false otherwise
◆ modify()
void gams::utility::Containerize::modify |
( |
| ) |
|
|
inherited |
Resend the information in the container using same knowledge base as previous to_container.
◆ operator!=()
bool gams::pose::Region::operator!= |
( |
const Region & |
rhs | ) |
const |
Inequality operator.
Calls operator== and inverses result
- Parameters
-
◆ operator=()
void gams::pose::Region::operator= |
( |
const Region & |
rhs | ) |
|
Assignment operator.
- Parameters
-
◆ operator==()
bool gams::pose::Region::operator== |
( |
const Region & |
rhs | ) |
const |
Equality operator.
Only checks if the vertices are the same
- Parameters
-
◆ set_knowledge_base()
void gams::utility::Containerize::set_knowledge_base |
( |
madara::knowledge::KnowledgeBase * |
kb | ) |
|
|
inherited |
Set knowledge base to use.
◆ set_name()
void gams::pose::Region::set_name |
( |
const std::string & |
name | ) |
|
Sets name of region.
- Parameters
-
name | new name of the region |
◆ to_container() [1/2]
void gams::utility::Containerize::to_container |
( |
const std::string & |
name = "" | ) |
|
|
inherited |
Store object in knowledge base used previously.
- Parameters
-
name | location of object in Knowlege Base |
◆ to_container() [2/2]
void gams::utility::Containerize::to_container |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name = "" |
|
) |
| |
|
inherited |
Store object in knowledge base.
- Parameters
-
kb | Knowledge Base to store object in |
name | location of object in Knowlege Base |
◆ to_container_impl()
virtual void gams::pose::Region::to_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatevirtual |
◆ to_string()
std::string gams::pose::Region::to_string |
( |
const std::string & |
delimiter = ":" | ) |
const |
Converts the position to a string.
- Parameters
-
delimiter | characters to insert between position components |
- Returns
- string representation of this Region
◆ max_alt_
double gams::pose::Region::max_alt_ |
◆ max_lat_
double gams::pose::Region::max_lat_ |
◆ max_lon_
double gams::pose::Region::max_lon_ |
◆ min_alt_
double gams::pose::Region::min_alt_ |
◆ min_lat_
double gams::pose::Region::min_lat_ |
◆ min_lon_
double gams::pose::Region::min_lon_ |
◆ name_
std::string gams::utility::Containerize::name_ |
|
protectedinherited |
◆ object_type_suffix_
const std::string gams::utility::Containerize::object_type_suffix_ |
|
staticprotectedinherited |
◆ prev_kb_
madara::knowledge::KnowledgeBase* gams::utility::Containerize::prev_kb_ |
|
protectedinherited |
previous knowledge base used for sending objects
Definition at line 146 of file Containerize.h.
◆ type_
unsigned int gams::pose::Region::type_ |
|
protected |
type for this region
Definition at line 180 of file Region.h.
◆ vertices
std::vector<Position> gams::pose::Region::vertices |
the vertices of the region
Definition at line 166 of file Region.h.
The documentation for this class was generated from the following file: