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.
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.
gams::pose::SearchArea::SearchArea |
( |
| ) |
|
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 |
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 |
gams::pose::SearchArea::~SearchArea |
( |
| ) |
|
Add prioritized region to search area.
- Parameters
-
r | prioritized region to add |
void gams::pose::SearchArea::calculate_bounding_box |
( |
| ) |
|
|
protected |
populate bounding box values
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.
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
Helper function for convex hull calculations.
- Parameters
-
gp1 | start point |
gp2 | pivot point |
gp3 | end point |
- Returns
- cross product of the points
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
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
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.
Region gams::pose::SearchArea::get_convex_hull |
( |
| ) |
const |
Find the convex hull.
- Returns
- Convex hull of the regions
std::string gams::utility::Containerize::get_name |
( |
| ) |
const |
|
inherited |
Get name of the object.
- Returns
- name of the object
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 region data.
- Returns
- const reference to regions
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
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
void gams::utility::Containerize::modify |
( |
| ) |
|
|
inherited |
Resend the information in the container using same knowledge base as previous to_container.
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
void gams::pose::SearchArea::operator= |
( |
const SearchArea & |
rhs | ) |
|
Assignment operator.
- Parameters
-
bool gams::pose::SearchArea::operator== |
( |
const SearchArea & |
rhs | ) |
const |
Equality operator.
- Parameters
-
- Returns
- true if SearchAreas have same PrioritizedRegion, false otherwise
void gams::utility::Containerize::set_knowledge_base |
( |
madara::knowledge::KnowledgeBase * |
kb | ) |
|
|
inherited |
Set knowledge base to use.
void gams::utility::Containerize::set_name |
( |
const std::string & |
n | ) |
|
|
inherited |
Set name of the object.
- Parameters
-
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 |
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 |
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.
std::string gams::pose::SearchArea::to_string |
( |
| ) |
const |
Create string representation of SearchArea.
- Returns
- string representation of this object
double gams::pose::SearchArea::max_alt_ |
double gams::pose::SearchArea::max_lat_ |
double gams::pose::SearchArea::max_lon_ |
double gams::pose::SearchArea::min_alt_ |
double gams::pose::SearchArea::min_lat_ |
double gams::pose::SearchArea::min_lon_ |
std::string gams::utility::Containerize::name_ |
|
protectedinherited |
const std::string gams::utility::Containerize::object_type_suffix_ |
|
staticprotectedinherited |
madara::knowledge::KnowledgeBase* gams::utility::Containerize::prev_kb_ |
|
protectedinherited |
previous knowledge base used for sending objects
Definition at line 146 of file Containerize.h.
collection of prioritized regions
Definition at line 180 of file SearchArea.h.
The documentation for this class was generated from the following file: