A utility class for search areas.
More...
#include <SearchArea.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 utility class for search areas.
Definition at line 71 of file SearchArea.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.
◆ SearchArea() [1/3]
gams::pose::SearchArea::SearchArea |
( |
| ) |
|
◆ SearchArea() [2/3]
gams::pose::SearchArea::SearchArea |
( |
const PrioritizedRegion & |
region, |
|
|
const std::string & |
name = "" |
|
) |
| |
Constructor.
- Parameters
-
region | the initial region of the search area |
name | name for this search area |
◆ SearchArea() [3/3]
gams::pose::SearchArea::SearchArea |
( |
const std::vector< PrioritizedRegion > & |
regions, |
|
|
const std::string & |
name = "" |
|
) |
| |
Constructor.
- Parameters
-
regions | regions in this search area |
name | name for this search area |
◆ ~SearchArea()
gams::pose::SearchArea::~SearchArea |
( |
| ) |
|
◆ add_prioritized_region()
Add prioritized region to search area.
- Parameters
-
r | prioritized region to add |
◆ calculate_bounding_box()
void gams::pose::SearchArea::calculate_bounding_box |
( |
| ) |
|
|
protected |
populate bounding box values
◆ check_valid_type()
virtual bool gams::pose::SearchArea::check_valid_type |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| const |
|
privatevirtual |
Check if object is of correct type.
- Parameters
-
kb | Knowledge Base with object |
name | Name of object in the KB |
Implements gams::utility::Containerize.
◆ contains()
bool gams::pose::SearchArea::contains |
( |
const Position & |
p | ) |
const |
Determine if Position is in region.
- Parameters
-
p | point to check if in region |
- Returns
- true if point is in the search area, false otherwise
◆ cross()
Helper function for convex hull calculations.
- Parameters
-
gp1 | start point |
gp2 | pivot point |
gp3 | end point |
- Returns
- cross product of the points
◆ 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::SearchArea::from_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatevirtual |
Load object from knowledge base.
- Parameters
-
kb | Knowledge Base with object |
name | location of object in Knowlege Base |
Implements gams::utility::Containerize.
◆ get_convex_hull()
Region gams::pose::SearchArea::get_convex_hull |
( |
| ) |
const |
Find the convex hull.
- Returns
- Convex hull of the regions
◆ get_name()
std::string gams::utility::Containerize::get_name |
( |
| ) |
const |
|
inherited |
Get name of the object.
- Returns
- name of the object
◆ get_priority()
madara::knowledge::KnowledgeRecord::Integer gams::pose::SearchArea::get_priority |
( |
const Position & |
pos | ) |
const |
Get priority of a gps position.
- Parameters
-
pos | position to get priority of |
- Returns
- priority of position
◆ get_regions()
Get region data.
- Returns
- const reference to regions
◆ 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::SearchArea::operator!= |
( |
const SearchArea & |
rhs | ) |
const |
Inequality operator, uses Equality operator and inverses it.
- Parameters
-
- Returns
- false if SearchAreas have same PrioritizedRegion, true otherwise
◆ operator=()
void gams::pose::SearchArea::operator= |
( |
const SearchArea & |
rhs | ) |
|
Assignment operator.
- Parameters
-
◆ operator==()
bool gams::pose::SearchArea::operator== |
( |
const SearchArea & |
rhs | ) |
const |
Equality operator.
- Parameters
-
- Returns
- true if SearchAreas have same PrioritizedRegion, false otherwise
◆ set_knowledge_base()
void gams::utility::Containerize::set_knowledge_base |
( |
madara::knowledge::KnowledgeBase * |
kb | ) |
|
|
inherited |
Set knowledge base to use.
◆ set_name()
void gams::utility::Containerize::set_name |
( |
const std::string & |
n | ) |
|
|
inherited |
Set name of the object.
- Parameters
-
◆ 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::SearchArea::to_container_impl |
( |
madara::knowledge::KnowledgeBase & |
kb, |
|
|
const std::string & |
name |
|
) |
| |
|
privatevirtual |
Store object in knowledge base.
- Parameters
-
kb | Knowledge Base to store object in |
name | location of object in Knowlege Base |
Implements gams::utility::Containerize.
◆ to_string()
std::string gams::pose::SearchArea::to_string |
( |
| ) |
const |
Create string representation of SearchArea.
- Returns
- string representation of this object
◆ max_alt_
double gams::pose::SearchArea::max_alt_ |
◆ max_lat_
double gams::pose::SearchArea::max_lat_ |
◆ max_lon_
double gams::pose::SearchArea::max_lon_ |
◆ min_alt_
double gams::pose::SearchArea::min_alt_ |
◆ min_lat_
double gams::pose::SearchArea::min_lat_ |
◆ min_lon_
double gams::pose::SearchArea::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.
◆ regions_
collection of prioritized regions
Definition at line 180 of file SearchArea.h.
The documentation for this class was generated from the following file: