GAMS  1.2.2
gams::pose::PrioritizedRegion Class Reference

A helper class for prioritized region information. More...

#include <PrioritizedRegion.h>

Inheritance diagram for gams::pose::PrioritizedRegion:
gams::pose::Region gams::utility::Containerize

Public Member Functions

 PrioritizedRegion (const std::vector< Position > &init_points=std::vector< Position >(), const unsigned int new_priority=1, const std::string &name="")
 Constructor. More...
 
 PrioritizedRegion (const Region &region, const unsigned int new_priority=1, const std::string &name="")
 Constructor. More...
 
virtual ~PrioritizedRegion ()
 Destructor. More...
 
bool contains (const Position &position) const
 Determines if GPSPosition is in region. More...
 
double distance (const Position &position) const
 Gets distance from any point in this region. More...
 
bool from_container (const std::string &name="")
 Load object from knowledge base. More...
 
bool from_container (madara::knowledge::KnowledgeBase &kb, const std::string &name="")
 Load object from knowledge base. More...
 
double get_area () const
 Gets area of the region. More...
 
Region get_bounding_box () const
 Gets bounding box. More...
 
std::string get_name () const
 Gets name of region. More...
 
void modify ()
 Resend the information in the container using same knowledge base as previous to_container. More...
 
bool operator!= (const PrioritizedRegion &rhs) const
 Inequality operator. More...
 
bool operator!= (const Region &rhs) const
 Inequality operator. More...
 
void operator= (const PrioritizedRegion &rhs)
 Assignment operator. More...
 
bool operator== (const PrioritizedRegion &rhs) const
 Equality operator. More...
 
bool operator== (const Region &rhs) const
 Equality operator. More...
 
void set_knowledge_base (madara::knowledge::KnowledgeBase *kb)
 Set knowledge base to use. More...
 
void set_name (const std::string &name)
 Sets name of region. More...
 
void to_container (const std::string &name="")
 Store object in knowledge base used previously. More...
 
void to_container (madara::knowledge::KnowledgeBase &kb, const std::string &name="")
 Store object in knowledge base. More...
 
std::string to_string (const std::string &delimiter=":") const
 Helper function for converting the position to a string. More...
 

Public Attributes

double max_alt_
 
double max_lat_
 
double max_lon_
 
double min_alt_
 
double min_lat_
 bounding box More...
 
double min_lon_
 
madara::knowledge::KnowledgeRecord::Integer priority
 priority More...
 
std::vector< Positionvertices
 the vertices of the region More...
 

Protected Types

enum  Class_ID { REGION_TYPE_ID = 0x00000001, PRIORITIZED_REGION_TYPE_ID = 0x00000002, SEARCH_AREA_TYPE_ID = 0x00000004, INVALID = 0x80000000 }
 These are used to check on the type of the object in from_container. More...
 

Protected Member Functions

void calculate_bounding_box ()
 populate bounding box values More...
 
bool is_valid_type (madara::knowledge::KnowledgeBase &kb, const std::string &name, const Class_ID &expected) const
 Check if the type is correct. More...
 

Static Protected Member Functions

static Class_ID get_type (madara::knowledge::KnowledgeBase &kb, const std::string &name)
 Gets type of object in database. More...
 

Protected Attributes

std::string name_
 name of this object More...
 
madara::knowledge::KnowledgeBase * prev_kb_
 previous knowledge base used for sending objects More...
 
unsigned int type_
 type for this region More...
 

Static Protected Attributes

static const std::string object_type_suffix_
 object type suffix More...
 

Private Member Functions

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...
 

Detailed Description

A helper class for prioritized region information.

Definition at line 72 of file PrioritizedRegion.h.

Member Enumeration Documentation

enum gams::utility::Containerize::Class_ID
protectedinherited

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.

Constructor & Destructor Documentation

gams::pose::PrioritizedRegion::PrioritizedRegion ( const std::vector< Position > &  init_points = std::vector< Position >(),
const unsigned int  new_priority = 1,
const std::string &  name = "" 
)

Constructor.

Parameters
init_pointsvector of points representing boundary polygon of region
new_priorityassociated priority
namename of the region
gams::pose::PrioritizedRegion::PrioritizedRegion ( const Region region,
const unsigned int  new_priority = 1,
const std::string &  name = "" 
)

Constructor.

Parameters
regionassociated region
new_priorityassociated priority
namename of the region
virtual gams::pose::PrioritizedRegion::~PrioritizedRegion ( )
virtual

Destructor.

Member Function Documentation

void gams::pose::Region::calculate_bounding_box ( )
protectedinherited

populate bounding box values

virtual bool gams::pose::PrioritizedRegion::check_valid_type ( madara::knowledge::KnowledgeBase &  kb,
const std::string &  name 
) const
privatevirtual

Check if object is of correct type.

Parameters
kbKnowledge Base with object
namePrefix of object in the KB

Reimplemented from gams::pose::Region.

bool gams::pose::Region::contains ( const Position position) const
inherited

Determines if GPSPosition is in region.

Parameters
positionpoint to check if in region
Returns
true if point is in region or on border, false otherwise
double gams::pose::Region::distance ( const Position position) const
inherited

Gets distance from any point in this region.

Parameters
positionpoint to check
Returns
0 if in region, otherwise distance from region
bool gams::utility::Containerize::from_container ( const std::string &  name = "")
inherited

Load object from knowledge base.

Parameters
namelocation 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
kbKnowledge Base with object
namelocation of object in Knowlege Base
Returns
true if object successfully loaded from knowledge base
virtual bool gams::pose::PrioritizedRegion::from_container_impl ( madara::knowledge::KnowledgeBase &  kb,
const std::string &  name 
)
privatevirtual

Load object from knowledge base.

Parameters
kbKnowledge Base with object
namelocation of object in Knowlege Base

Reimplemented from gams::pose::Region.

double gams::pose::Region::get_area ( ) const
inherited

Gets area of the region.

Returns
area of this region
Region gams::pose::Region::get_bounding_box ( ) const
inherited

Gets bounding box.

Returns
Region object corresponding to bounding box
std::string gams::pose::Region::get_name ( ) const
inherited

Gets name of region.

Returns
name of the region
static Class_ID gams::utility::Containerize::get_type ( madara::knowledge::KnowledgeBase &  kb,
const std::string &  name 
)
staticprotectedinherited

Gets type of object in database.

Parameters
kbKnowledge Base with object
namePrefix 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
kbKnowledge Base with object
namePrefix of object in the KB
expectedExpected 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::PrioritizedRegion::operator!= ( const PrioritizedRegion rhs) const

Inequality operator.

Uses operator== and inverses result

Parameters
rhsPrioritizedRegion to compare to
Returns
false if same vertices and same priority, true otherwise
bool gams::pose::Region::operator!= ( const Region rhs) const
inherited

Inequality operator.

Calls operator== and inverses result

Parameters
rhsRegion to compare with
void gams::pose::PrioritizedRegion::operator= ( const PrioritizedRegion rhs)

Assignment operator.

Parameters
rhsvalues to copy
bool gams::pose::PrioritizedRegion::operator== ( const PrioritizedRegion rhs) const

Equality operator.

Uses Region::operator== and checks if priority are equal

Parameters
rhsPrioritizedRegion to compare to
Returns
true if same vertices and same priority, false otherwise
bool gams::pose::Region::operator== ( const Region rhs) const
inherited

Equality operator.

Only checks if the vertices are the same

Parameters
rhsRegion to compare with
void gams::utility::Containerize::set_knowledge_base ( madara::knowledge::KnowledgeBase *  kb)
inherited

Set knowledge base to use.

void gams::pose::Region::set_name ( const std::string &  name)
inherited

Sets name of region.

Parameters
namenew name of the region
void gams::utility::Containerize::to_container ( const std::string &  name = "")
inherited

Store object in knowledge base used previously.

Parameters
namelocation 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
kbKnowledge Base to store object in
namelocation of object in Knowlege Base
virtual void gams::pose::PrioritizedRegion::to_container_impl ( madara::knowledge::KnowledgeBase &  kb,
const std::string &  name 
)
privatevirtual

Store object in knowledge base.

Parameters
kbKnowledge Base to store object in
namelocation of object in Knowlege Base

Reimplemented from gams::pose::Region.

std::string gams::pose::PrioritizedRegion::to_string ( const std::string &  delimiter = ":") const

Helper function for converting the position to a string.

Parameters
delimitercharacters to insert between position components
Returns
string representation of this PrioritizedRegion

Member Data Documentation

double gams::pose::Region::max_alt_
inherited

Definition at line 165 of file Region.h.

double gams::pose::Region::max_lat_
inherited

Definition at line 163 of file Region.h.

double gams::pose::Region::max_lon_
inherited

Definition at line 164 of file Region.h.

double gams::pose::Region::min_alt_
inherited

Definition at line 165 of file Region.h.

double gams::pose::Region::min_lat_
inherited

bounding box

Definition at line 163 of file Region.h.

double gams::pose::Region::min_lon_
inherited

Definition at line 164 of file Region.h.

std::string gams::utility::Containerize::name_
protectedinherited

name of this object

Definition at line 143 of file Containerize.h.

const std::string gams::utility::Containerize::object_type_suffix_
staticprotectedinherited

object type suffix

Definition at line 140 of file Containerize.h.

madara::knowledge::KnowledgeBase* gams::utility::Containerize::prev_kb_
protectedinherited

previous knowledge base used for sending objects

Definition at line 146 of file Containerize.h.

madara::knowledge::KnowledgeRecord::Integer gams::pose::PrioritizedRegion::priority

priority

Definition at line 125 of file PrioritizedRegion.h.

unsigned int gams::pose::Region::type_
protectedinherited

type for this region

Definition at line 174 of file Region.h.

std::vector<Position> gams::pose::Region::vertices
inherited

the vertices of the region

Definition at line 160 of file Region.h.


The documentation for this class was generated from the following file: