data for constructing the formation
More...
#include <formation_data.h>
|
typedef std::shared_ptr< FormationData > | Ptr |
|
typedef std::shared_ptr< const FormationData > | ConstPtr |
|
typedef std::list< Data > | DataCont |
| data container type.
|
|
|
| FormationData () |
| default constructor.
|
|
virtual | ~FormationData () |
| virtual destructor.
|
|
void | clear () |
| clear all data.
|
|
const DataCont & | dataCont () const |
| create default data. / void createDefault(); More...
|
|
const Data * | data (const size_t idx) const |
| get the specified index data. More...
|
|
int | nearestDataIndex (const Vector2D &pos, const double dist_thr) const |
| get the data index nearest to the input point. More...
|
|
bool | existTooNearData (const Data &data) const |
| check if there are exsiting data near to input data. More...
|
|
std::string | addData (const Data &data) |
| append new data. More...
|
|
std::string | insertData (const size_t idx, const Data &data) |
| insert new data just before the input index. More...
|
|
std::string | replaceData (const size_t idx, const Data &data) |
| replace exsiting data at input index with input data. More...
|
|
std::string | removeData (const size_t idx) |
| delete exsiting data at input index. More...
|
|
std::string | changeDataIndex (const size_t old_idx, const size_t new_idx) |
| move the specified data to new index position. More...
|
|
std::ostream & | print (std::ostream &os) const |
| print data in JSON format More...
|
|
bool | read (std::istream &is) |
| read data in JSON format More...
|
|
|
static double | round_xy (const double xy) |
|
static rcsc::Vector2D | rounded_vector (const double x, const double y) |
|
|
static const double | PRECISION |
| coordinates value precision
|
|
static const size_t | MAX_DATA_SIZE |
| max data size
|
|
static const double | NEAR_DIST_THR |
| data distance threshold
|
|
data for constructing the formation
◆ addData()
std::string rcsc::FormationData::addData |
( |
const Data & |
data | ) |
|
append new data.
- Parameters
-
- Returns
- error message if error occurd. otherwise, empty string.
◆ changeDataIndex()
std::string rcsc::FormationData::changeDataIndex |
( |
const size_t |
old_idx, |
|
|
const size_t |
new_idx |
|
) |
| |
move the specified data to new index position.
- Parameters
-
old_idx | old index. |
new_idx | new index. |
- Returns
- error message if error occurd. otherwise, empty string.
◆ data()
const Data * rcsc::FormationData::data |
( |
const size_t |
idx | ) |
const |
get the specified index data.
- Returns
- const pointer to the data. if no matched data, NULL is returned.
◆ dataCont()
const DataCont & rcsc::FormationData::dataCont |
( |
| ) |
const |
|
inline |
create default data. / void createDefault();
/*!
\brief get the data container.
\return data container.
◆ existTooNearData()
bool rcsc::FormationData::existTooNearData |
( |
const Data & |
data | ) |
const |
check if there are exsiting data near to input data.
- Parameters
-
- Returns
- checked result.
◆ insertData()
std::string rcsc::FormationData::insertData |
( |
const size_t |
idx, |
|
|
const Data & |
data |
|
) |
| |
insert new data just before the input index.
- Parameters
-
idx | target index. |
data | new data. |
- Returns
- error message if error occurd. otherwise, empty string.
◆ nearestDataIndex()
int rcsc::FormationData::nearestDataIndex |
( |
const Vector2D & |
pos, |
|
|
const double |
dist_thr |
|
) |
| const |
get the data index nearest to the input point.
- Parameters
-
pos | input point. |
dist_thr | distance threshold |
- Returns
- index of the result data. -1 if no result
◆ print()
std::ostream & rcsc::FormationData::print |
( |
std::ostream & |
os | ) |
const |
print data in JSON format
- Parameters
-
- Returns
- output stream.
◆ read()
bool rcsc::FormationData::read |
( |
std::istream & |
is | ) |
|
read data in JSON format
- Parameters
-
- Returns
- input stream.
◆ removeData()
std::string rcsc::FormationData::removeData |
( |
const size_t |
idx | ) |
|
delete exsiting data at input index.
- Parameters
-
- Returns
- error message if error occurd. otherwise, empty string.
◆ replaceData()
std::string rcsc::FormationData::replaceData |
( |
const size_t |
idx, |
|
|
const Data & |
data |
|
) |
| |
replace exsiting data at input index with input data.
- Parameters
-
idx | target index. |
data | new data. |
- Returns
- error message if error occurd. otherwise, empty string.
The documentation for this class was generated from the following file: