abstraction class of two dimention coordinate data More...
#include <XYData.h>

Public Member Functions | |
| XYData () | |
| constructor | |
| virtual | ~XYData () |
| destructor | |
| double | getMinX () |
| gets minimum x More... | |
| double | getMaxX () |
| gets maximum x More... | |
| double | getMinY () |
| gets minimum y More... | |
| double | getMaxY () |
| gets maximum y More... | |
| void | clearPoints () |
| clear all data points | |
| void | addPoint (const double x, const double y) |
| adds point More... | |
| void | insertPoint (const unsigned int index, const double x, const double y) |
| insertts point More... | |
| void | updatePoint (const unsigned int index, const double x, const double y) |
| updates points More... | |
| void | deletePoint (const unsigned int index) |
| delete point More... | |
| unsigned int | getLength () |
| gets the number of points @return the number of points | |
| double | getX (const unsigned int index) |
| gets x coordinate More... | |
| double | getY (const unsigned int index) |
| gets y coordinate More... | |
| void | reserve (const unsigned int num) |
| reserves enough contiguous memory of array More... | |
| unsigned long | getVersion () |
| gets the version More... | |
| int | searchIndex (const double x) |
| searches index of specified x value. More... | |
| int | getNearestIndex (const double x) |
| gets nearest index More... | |
| void | filter (const double absY=0.0, const double relY=0.0) |
| executes filter More... | |
| void | getPoints (std::vector< Point< double > > &points, const bool ySort, const bool desc) |
| gets points array More... | |
| bool | importData (boost::function< int(void *, int) > readFun) |
| imports data More... | |
| bool | exportData (boost::function< int(void *, int) > writeFun) |
| exports data More... | |
Protected Member Functions | |
| void | updateRange () |
| updates range | |
| virtual bool | onLoadData (boost::function< int(void *, int) > readFun) |
| loads data from file More... | |
| virtual bool | onSaveData (boost::function< int(void *, int) > writeFun) |
| saves data to file More... | |
| virtual void | onClearPoints ()=0 |
| This method is called by clearPoints method. (abstract method) | |
| virtual void | onAddPoint (const double x, const double y)=0 |
| This method is called by addPoint method. (abstract method) More... | |
| virtual void | onInsertPoint (const unsigned int index, const double x, const double y)=0 |
| This method is called by insertPoint method. (abstract method) More... | |
| virtual void | onDeletePoint (const unsigned int index)=0 |
| This method is called by deletePoint method. (abstract method) More... | |
| virtual unsigned int | onGetLength ()=0 |
| this method is called by getLength method (abstract method) More... | |
| virtual double | onGetX (const unsigned int index)=0 |
| This method is called by getX method. (abstract method) More... | |
| virtual double | onGetY (const unsigned int index)=0 |
| This method is called by getY method. (abstract method) More... | |
| virtual void | onReserve (const unsigned int num)=0 |
| This method is called by reserve method. (abstract method) More... | |
Protected Attributes | |
| bool | m_updated |
| double | m_minX |
| double | m_maxX |
| double | m_minY |
| double | m_maxY |
| unsigned long | m_version |
Static Protected Attributes | |
| static unsigned long | m_currentVersion = 0 |
| version More... | |
| void kome::core::XYData::addPoint | ( | const double | x, |
| const double | y | ||
| ) |
adds point
| [in] | x | x coordinate of point to be added |
| [in] | y | y coordinate of point to be added |
Definition at line 149 of file XYData.cpp.
| void kome::core::XYData::deletePoint | ( | const unsigned int | index | ) |
delete point
| [in] | index | point index |
Definition at line 199 of file XYData.cpp.
| bool kome::core::XYData::exportData | ( | boost::function< int(void *, int) > | writeFun | ) |
exports data
| [in] | writeFun | write function |
Definition at line 414 of file XYData.cpp.
| void kome::core::XYData::filter | ( | const double | absY = 0.0, |
| const double | relY = 0.0 |
||
| ) |
executes filter
| [in] | absY | absolute y value |
| [in] | relY | relative y value |
Definition at line 345 of file XYData.cpp.
| double kome::core::XYData::getMaxX | ( | ) |
| double kome::core::XYData::getMaxY | ( | ) |
| double kome::core::XYData::getMinX | ( | ) |
| double kome::core::XYData::getMinY | ( | ) |
| int kome::core::XYData::getNearestIndex | ( | const double | x | ) |
gets nearest index
| [in] | x | x value |
Definition at line 313 of file XYData.cpp.
| void kome::core::XYData::getPoints | ( | std::vector< Point< double > > & | points, |
| const bool | ySort, | ||
| const bool | desc | ||
| ) |
gets points array
| [in] | points | points array to store points data |
| [in] | ySort |
|
| [in] | desc | descending order flag |
Definition at line 372 of file XYData.cpp.
| unsigned long kome::core::XYData::getVersion | ( | ) |
| double kome::core::XYData::getX | ( | const unsigned int | index | ) |
gets x coordinate
| [in] | index | the index of point |
Definition at line 224 of file XYData.cpp.
| double kome::core::XYData::getY | ( | const unsigned int | index | ) |
gets y coordinate
| [in] | index | the index of point |
Definition at line 243 of file XYData.cpp.
| bool kome::core::XYData::importData | ( | boost::function< int(void *, int) > | readFun | ) |
imports data
| [in] | readFun | read function |
Definition at line 403 of file XYData.cpp.
| void kome::core::XYData::insertPoint | ( | const unsigned int | index, |
| const double | x, | ||
| const double | y | ||
| ) |
insertts point
| [in] | index | insert position |
| [in] | x | x coordinate of point |
| [in] | y | y coordinate of point |
Definition at line 161 of file XYData.cpp.
|
protectedpure virtual |
This method is called by addPoint method. (abstract method)
| [in] | x | x coordinate of point to be added |
| [in] | y | y coordinate of point to be added |
Implemented in kome::objects::Peaks, kome::core::DataPoints, and kome::core::PointArray.
|
protectedpure virtual |
This method is called by deletePoint method. (abstract method)
| [in] | index | point index |
Implemented in kome::objects::Peaks, kome::core::DataPoints, and kome::core::PointArray.
|
protectedpure virtual |
this method is called by getLength method (abstract method)
Implemented in kome::objects::Peaks, kome::core::DataPoints, and kome::core::PointArray.
|
protectedpure virtual |
This method is called by getX method. (abstract method)
| [in] | index | the index of point |
Implemented in kome::objects::Peaks, kome::core::DataPoints, and kome::core::PointArray.
|
protectedpure virtual |
This method is called by getY method. (abstract method)
| [in] | index | the index of point |
Implemented in kome::objects::Peaks, kome::core::DataPoints, and kome::core::PointArray.
|
protectedpure virtual |
This method is called by insertPoint method. (abstract method)
| [in] | index | insert position |
| [in] | x | x coordinate of point |
| [in] | y | y coordinate of point |
Implemented in kome::objects::Peaks, kome::core::DataPoints, and kome::core::PointArray.
|
protectedvirtual |
loads data from file
| [in] | readFun | read function |
Reimplemented in kome::objects::Peaks.
Definition at line 481 of file XYData.cpp.
|
protectedpure virtual |
This method is called by reserve method. (abstract method)
| [in] | num | of points to be reserved |
Implemented in kome::objects::Peaks, kome::core::DataPoints, and kome::core::PointArray.
|
protectedvirtual |
saves data to file
| [in] | writeFun | write function |
Reimplemented in kome::objects::Peaks.
Definition at line 503 of file XYData.cpp.
| void kome::core::XYData::reserve | ( | const unsigned int | num | ) |
reserves enough contiguous memory of array
| [in] | num | the number of points to be reserved |
Definition at line 262 of file XYData.cpp.
| int kome::core::XYData::searchIndex | ( | const double | x | ) |
searches index of specified x value.
Definition at line 276 of file XYData.cpp.

| void kome::core::XYData::updatePoint | ( | const unsigned int | index, |
| const double | x, | ||
| const double | y | ||
| ) |
updates points
| [in] | index | update position |
| [in] | x | x coordinate of point |
| [in] | y | y coordinate of point |
Definition at line 173 of file XYData.cpp.
|
staticprotected |
|
protected |
1.8.6