Public Types | Public Member Functions | Protected Attributes | List of all members
omip::FeaturesDataBase Class Reference

#include <FeaturesDataBase.h>

Public Types

typedef boost::unordered_map< Feature::Id, Feature::LocationPairMapOfFeatureLocationPairs
 
typedef boost::unordered_map< Feature::Id, Feature::LocationMapOfFeatureLocations
 
typedef boost::unordered_map< Feature::Id, Feature::PtrMapOfFeatures
 
typedef boost::shared_ptr< FeaturesDataBasePtr
 

Public Member Functions

bool addFeatureLocation (Feature::Id f_id, Feature::Location f_loc)
 
Feature::Id addFeatureLocation (Feature::Location f_loc)
 
void clearListOfAliveFeatureIds ()
 
 FeaturesDataBase ()
 
MapOfFeatures getAllFeatures () const
 
MapOfFeatureLocations getAllFeaturesLastLocation () const
 
MapOfFeatureLocations getAllFeaturesNextToLastLocation () const
 
MapOfFeatureLocationPairs getAllFeaturesTwoLastLocations () const
 
Feature::Ptr getFeature (Feature::Id f_id) const
 
size_t getFeatureAge (Feature::Id f_id) const
 
Feature::Ptr getFeatureClone (Feature::Id f_id) const
 
Feature::Location getFeatureFirstLocation (Feature::Id f_id) const
 
Feature::Location getFeatureLastLocation (Feature::Id f_id) const
 
double getFeatureLastX (Feature::Id f_id) const
 
double getFeatureLastY (Feature::Id f_id) const
 
double getFeatureLastZ (Feature::Id f_id) const
 
Feature::Location getFeatureNextToLastLocation (Feature::Id f_id) const
 
Feature::Location getFeatureNToLastLocation (Feature::Id f_id, int frames_to_last) const
 
Feature::Trajectory getFeatureTrajectory (Feature::Id f_id) const
 
Feature::LocationPair getFeatureTwoLastLocations (Feature::Id f_id) const
 
std::vector< Feature::IdgetListOfAliveFeatureIds () const
 
int getTime () const
 
bool isFeatureStored (Feature::Id f_id) const
 
void step ()
 
virtual ~FeaturesDataBase ()
 

Protected Attributes

std::vector< Feature::Id_alive_feat_ids
 
MapOfFeatures _map_of_features
 
int _time
 

Detailed Description

Definition at line 41 of file FeaturesDataBase.h.

Member Typedef Documentation

Definition at line 55 of file FeaturesDataBase.h.

Definition at line 52 of file FeaturesDataBase.h.

Definition at line 49 of file FeaturesDataBase.h.

Definition at line 46 of file FeaturesDataBase.h.

Constructor & Destructor Documentation

FeaturesDataBase::FeaturesDataBase ( )

Constructor

Definition at line 9 of file FeaturesDataBase.cpp.

FeaturesDataBase::~FeaturesDataBase ( )
virtual

Destructor

Definition at line 15 of file FeaturesDataBase.cpp.

Member Function Documentation

bool FeaturesDataBase::addFeatureLocation ( Feature::Id  f_id,
Feature::Location  f_loc 
)

Add a new location of a Feature that could be already in the data base or not The Id of the Feature is added to the alive Features list

Parameters
f_id- Id of the Feature that gets a new Location
f_loc- New Location of the Feature
Returns
- TRUE if the Feature is new and FALSE if it was already contained int he data base

Definition at line 20 of file FeaturesDataBase.cpp.

Feature::Id FeaturesDataBase::addFeatureLocation ( Feature::Location  f_loc)

Add the first location of a new Feature, requiring to create first the new Feature The Id of the Feature is added to the alive Features list

Parameters
f_loc- First location of the new Feature
Returns
- Feature Id of the new Feature

Definition at line 42 of file FeaturesDataBase.cpp.

void FeaturesDataBase::clearListOfAliveFeatureIds ( )

Clear the list of Ids of alive Features Every time a new Location of a contained Feature or the first Location of a new Feature is added, the Id of that Feature gets into the list of alive Features This Function MUST be called before the next iteration!!!! (before it was done internally in the step function)

Definition at line 68 of file FeaturesDataBase.cpp.

FeaturesDataBase::MapOfFeatures FeaturesDataBase::getAllFeatures ( ) const

Get a map of Feature::Ids -> Feature::Ptr

Returns
- Map with the shared pointers of all contained Features

Definition at line 324 of file FeaturesDataBase.cpp.

FeaturesDataBase::MapOfFeatureLocations FeaturesDataBase::getAllFeaturesLastLocation ( ) const

Get a map of Feature::Ids -> Feature last location

Returns
- Map with the last locations of all contained Features

Definition at line 274 of file FeaturesDataBase.cpp.

FeaturesDataBase::MapOfFeatureLocations FeaturesDataBase::getAllFeaturesNextToLastLocation ( ) const

Get a map of Feature::Ids -> Feature next to last location

Returns
- Map with the next to last locations of all contained Features

Definition at line 285 of file FeaturesDataBase.cpp.

FeaturesDataBase::MapOfFeatureLocationPairs FeaturesDataBase::getAllFeaturesTwoLastLocations ( ) const

Get a map of Feature::Ids -> Feature last and next to last location

Returns
- Map with last and the next to last locations of all contained Features

Definition at line 296 of file FeaturesDataBase.cpp.

Feature::Ptr FeaturesDataBase::getFeature ( Feature::Id  f_id) const

Get a shared pointer to a Feature

Parameters
f_id- Id of the Feature to get the shared pointer from
Returns
- Shared pointer to the Feature

Definition at line 93 of file FeaturesDataBase.cpp.

size_t FeaturesDataBase::getFeatureAge ( Feature::Id  f_id) const

Get the age of a Feature

Parameters
f_id- Id of the Feature to get the age from
Returns
- Age of a Feature

Definition at line 202 of file FeaturesDataBase.cpp.

Feature::Ptr FeaturesDataBase::getFeatureClone ( Feature::Id  f_id) const

Get the clone of a Feature

Parameters
f_id- Id of the Feature to get the clone from
Returns
- Shared pointer to the cloned Feature

Definition at line 78 of file FeaturesDataBase.cpp.

Feature::Location FeaturesDataBase::getFeatureFirstLocation ( Feature::Id  f_id) const

Get first Location of a Feature

Parameters
f_id- Id of the Feature to get the first Location from
Returns
- First Location of a Feature

Definition at line 106 of file FeaturesDataBase.cpp.

Feature::Location FeaturesDataBase::getFeatureLastLocation ( Feature::Id  f_id) const

Get last location of a Feature

Parameters
f_id- Id of the Feature to get the last Location from
Returns
- Last Location of a Feature

Definition at line 122 of file FeaturesDataBase.cpp.

double FeaturesDataBase::getFeatureLastX ( Feature::Id  f_id) const

Get the x coordinate of the last Location of a Feature

Parameters
f_id- Id of the Feature to get the x coordinate from
Returns
- x coordinate of the last Location of a Feature

Definition at line 229 of file FeaturesDataBase.cpp.

double FeaturesDataBase::getFeatureLastY ( Feature::Id  f_id) const

Get the y coordinate of the last Location of a Feature

Parameters
f_id- Id of the Feature to get the y coordinate from
Returns
- y coordinate of the last Location of a Feature

Definition at line 244 of file FeaturesDataBase.cpp.

double FeaturesDataBase::getFeatureLastZ ( Feature::Id  f_id) const

Get the z coordinate of the last Location of a Feature

Parameters
f_id- Id of the Feature to get the z coordinate from
Returns
- z coordinate of the last Location of a Feature

Definition at line 259 of file FeaturesDataBase.cpp.

Feature::Location FeaturesDataBase::getFeatureNextToLastLocation ( Feature::Id  f_id) const

Get next to last location of a Feature

Parameters
f_id- Id of the Feature to get the next to last Location from
Returns
- Next to last Location of a Feature

Definition at line 138 of file FeaturesDataBase.cpp.

Feature::Location FeaturesDataBase::getFeatureNToLastLocation ( Feature::Id  f_id,
int  frames_to_last 
) const

Get the Location of a Feature N frames before the last Location

Parameters
f_id- Id of the Feature to get the two last Locations from
frames_to_last- Number of frames before the last frame where we want the Location from
Returns
- Location of a Feature in the last minus N frame

Definition at line 170 of file FeaturesDataBase.cpp.

Feature::Trajectory FeaturesDataBase::getFeatureTrajectory ( Feature::Id  f_id) const

Get the Trajectory of a Feature

Parameters
f_id- Id of the Feature to get the Trajectory from
Returns
- Trajectory of a Feature

Definition at line 186 of file FeaturesDataBase.cpp.

Feature::LocationPair FeaturesDataBase::getFeatureTwoLastLocations ( Feature::Id  f_id) const

Get the two last Locations (last and next to last) of a Feature

Parameters
f_id- Id of the Feature to get the two last Locations from
Returns
- two last Locations of a Feature

Definition at line 154 of file FeaturesDataBase.cpp.

std::vector< Feature::Id > FeaturesDataBase::getListOfAliveFeatureIds ( ) const

Get a vector containing the Ids of the Features that are still alive

Returns
- vector of Ids of alive Features

Definition at line 73 of file FeaturesDataBase.cpp.

int FeaturesDataBase::getTime ( ) const

Get the frame counter of this Database (the number of times that this->step() was called()

Returns
- Frame counter

Definition at line 329 of file FeaturesDataBase.cpp.

bool FeaturesDataBase::isFeatureStored ( Feature::Id  f_id) const

Check if a Feature is stored in the Data base

Parameters
f_id- Id of the Feature we want to know if is stored or not
Returns
- TRUE if the Feature with the given Id is in the Database

Definition at line 217 of file FeaturesDataBase.cpp.

void FeaturesDataBase::step ( )

Step the Data base: 1: Update the frame counter (used to set the Feature birthdays) 2: Delete from the Data base all Features that have not been updated (get a new Location) in the last step

Definition at line 50 of file FeaturesDataBase.cpp.

Member Data Documentation

std::vector<Feature::Id> omip::FeaturesDataBase::_alive_feat_ids
protected

Definition at line 235 of file FeaturesDataBase.h.

MapOfFeatures omip::FeaturesDataBase::_map_of_features
protected

Definition at line 233 of file FeaturesDataBase.h.

int omip::FeaturesDataBase::_time
protected

Definition at line 237 of file FeaturesDataBase.h.


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


omip_common
Author(s): Roberto Martín-Martín
autogenerated on Mon Jun 10 2019 14:06:05