libpappsomspp
Library for mass spectrometry
|
#include <selectionpolygon.h>
Public Member Functions | |
SelectionPolygon () | |
SelectionPolygon (QPointF top_left_point, QPointF top_right_point) | |
SelectionPolygon (QPointF top_left_point, QPointF top_right_point, QPointF bottom_right_point, QPointF bottom_left_point) | |
SelectionPolygon (const SelectionPolygon &other) | |
virtual | ~SelectionPolygon () |
void | setPoint (PointSpec point_spec, double x, double y) |
void | setPoint (PointSpec point_spec, QPointF point) |
void | copyPoint (PointSpec point_spec_src, PointSpec point_spec_dest) |
void | set1D (double x_range_start, double x_range_end) |
void | set2D (QPointF top_left, QPointF top_right, QPointF bottom_right, QPointF bottom_left) |
void | convertTo1D () |
const std::vector< QPointF > & | getPoints () const |
QPointF | getLeftMostPoint () const |
QPointF | getRightMostPoint () const |
QPointF | getTopMostPoint () const |
QPointF | getBottomMostPoint () const |
QPointF | getPoint (PointSpec point_spec) const |
bool | computeMinMaxCoordinates () |
bool | computeMinMaxCoordinates (double &min_x, double &max_x, double &min_y, double &max_y) const |
double | width (bool &ok) const |
double | height (bool &ok) const |
bool | rangeX (double &range_start, double &range_end) const |
bool | rangeY (double &range_start, double &range_end) const |
bool | range (Axis axis, double &range_start, double &range_end) const |
SelectionPolygon | transpose () const |
bool | contains (const QPointF &tested_point) const |
bool | contains (const SelectionPolygon &selection_polygon) const |
SelectionPolygon & | operator= (const SelectionPolygon &other) |
void | resetPoints () |
bool | is1D () const |
bool | is2D () const |
bool | isRectangle () const |
QString | toShort4PointsString () const |
QString | toString () const |
Static Public Member Functions | |
static void | debugAlgorithm (const SelectionPolygon &selection_polygon, const QPointF &tested_point) |
Protected Attributes | |
std::vector< QPointF > | m_points |
double | m_minX = std::numeric_limits<double>::min() |
double | m_minY = std::numeric_limits<double>::min() |
double | m_maxX = std::numeric_limits<double>::max() |
double | m_maxY = std::numeric_limits<double>::max() |
Definition at line 43 of file selectionpolygon.h.
pappso::SelectionPolygon::SelectionPolygon | ( | ) |
Definition at line 21 of file selectionpolygon.cpp.
pappso::SelectionPolygon::SelectionPolygon | ( | QPointF | top_left_point, |
QPointF | top_right_point ) |
Definition at line 31 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), and m_points.
pappso::SelectionPolygon::SelectionPolygon | ( | QPointF | top_left_point, |
QPointF | top_right_point, | ||
QPointF | bottom_right_point, | ||
QPointF | bottom_left_point ) |
Definition at line 70 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), and m_points.
pappso::SelectionPolygon::SelectionPolygon | ( | const SelectionPolygon & | other | ) |
Definition at line 91 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_maxX, m_maxY, m_minX, m_minY, and m_points.
|
virtual |
Definition at line 113 of file selectionpolygon.cpp.
bool pappso::SelectionPolygon::computeMinMaxCoordinates | ( | ) |
Definition at line 323 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_maxX, m_maxY, m_minX, m_minY, and m_points.
Referenced by SelectionPolygon(), SelectionPolygon(), convertTo1D(), copyPoint(), height(), rangeX(), rangeY(), set1D(), set2D(), setPoint(), setPoint(), and width().
bool pappso::SelectionPolygon::computeMinMaxCoordinates | ( | double & | min_x, |
double & | max_x, | ||
double & | min_y, | ||
double & | max_y ) const |
Definition at line 347 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, and m_points.
bool pappso::SelectionPolygon::contains | ( | const QPointF & | tested_point | ) | const |
Definition at line 489 of file selectionpolygon.cpp.
References isRectangle(), m_maxX, m_maxY, m_minX, m_minY, m_points, pappso::res, pappso::x, and pappso::y.
Referenced by contains(), and debugAlgorithm().
bool pappso::SelectionPolygon::contains | ( | const SelectionPolygon & | selection_polygon | ) | const |
Definition at line 574 of file selectionpolygon.cpp.
References contains(), pappso::ENUM_LAST, and getPoint().
void pappso::SelectionPolygon::convertTo1D | ( | ) |
Definition at line 216 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), m_maxX, m_minX, and set1D().
Definition at line 138 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), getPoint(), and setPoint().
|
static |
Definition at line 842 of file selectionpolygon.cpp.
References contains().
QPointF pappso::SelectionPolygon::getBottomMostPoint | ( | ) | const |
Definition at line 289 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::y.
QPointF pappso::SelectionPolygon::getLeftMostPoint | ( | ) | const |
Definition at line 229 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::x.
Referenced by toShort4PointsString().
QPointF pappso::SelectionPolygon::getPoint | ( | PointSpec | point_spec | ) | const |
Definition at line 316 of file selectionpolygon.cpp.
References m_points.
Referenced by contains(), copyPoint(), isRectangle(), and transpose().
const std::vector< QPointF > & pappso::SelectionPolygon::getPoints | ( | ) | const |
Definition at line 309 of file selectionpolygon.cpp.
References m_points.
QPointF pappso::SelectionPolygon::getRightMostPoint | ( | ) | const |
Definition at line 249 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::x.
Referenced by toShort4PointsString().
QPointF pappso::SelectionPolygon::getTopMostPoint | ( | ) | const |
Definition at line 269 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::y.
double pappso::SelectionPolygon::height | ( | bool & | ok | ) | const |
Definition at line 392 of file selectionpolygon.cpp.
References computeMinMaxCoordinates().
bool pappso::SelectionPolygon::is1D | ( | ) | const |
Definition at line 634 of file selectionpolygon.cpp.
References height(), and width().
Referenced by toShort4PointsString().
bool pappso::SelectionPolygon::is2D | ( | ) | const |
Definition at line 663 of file selectionpolygon.cpp.
bool pappso::SelectionPolygon::isRectangle | ( | ) | const |
Definition at line 689 of file selectionpolygon.cpp.
References pappso::BOTTOM_LEFT_POINT, pappso::BOTTOM_RIGHT_POINT, getPoint(), pappso::TOP_LEFT_POINT, pappso::TOP_RIGHT_POINT, pappso::x, and pappso::y.
Referenced by contains().
SelectionPolygon & pappso::SelectionPolygon::operator= | ( | const SelectionPolygon & | other | ) |
Definition at line 592 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_maxX, m_maxY, m_minX, m_minY, and m_points.
bool pappso::SelectionPolygon::range | ( | Axis | axis, |
double & | range_start, | ||
double & | range_end ) const |
Definition at line 427 of file selectionpolygon.cpp.
bool pappso::SelectionPolygon::rangeX | ( | double & | range_start, |
double & | range_end ) const |
Definition at line 407 of file selectionpolygon.cpp.
References computeMinMaxCoordinates().
Referenced by range().
bool pappso::SelectionPolygon::rangeY | ( | double & | range_start, |
double & | range_end ) const |
Definition at line 417 of file selectionpolygon.cpp.
References computeMinMaxCoordinates().
Referenced by range().
void pappso::SelectionPolygon::resetPoints | ( | ) |
Definition at line 617 of file selectionpolygon.cpp.
References m_points.
void pappso::SelectionPolygon::set1D | ( | double | x_range_start, |
double | x_range_end ) |
Definition at line 149 of file selectionpolygon.cpp.
References pappso::BOTTOM_LEFT_POINT, pappso::BOTTOM_RIGHT_POINT, computeMinMaxCoordinates(), resetPoints(), setPoint(), pappso::TOP_LEFT_POINT, and pappso::TOP_RIGHT_POINT.
Referenced by convertTo1D().
void pappso::SelectionPolygon::set2D | ( | QPointF | top_left, |
QPointF | top_right, | ||
QPointF | bottom_right, | ||
QPointF | bottom_left ) |
Definition at line 184 of file selectionpolygon.cpp.
References pappso::BOTTOM_LEFT_POINT, pappso::BOTTOM_RIGHT_POINT, computeMinMaxCoordinates(), resetPoints(), setPoint(), pappso::TOP_LEFT_POINT, and pappso::TOP_RIGHT_POINT.
void pappso::SelectionPolygon::setPoint | ( | PointSpec | point_spec, |
double | x, | ||
double | y ) |
Definition at line 119 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), m_points, pappso::x, and pappso::y.
Referenced by copyPoint(), set1D(), set2D(), setPoint(), and transpose().
void pappso::SelectionPolygon::setPoint | ( | PointSpec | point_spec, |
QPointF | point ) |
Definition at line 129 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), and setPoint().
QString pappso::SelectionPolygon::toShort4PointsString | ( | ) | const |
Definition at line 791 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, getLeftMostPoint(), getRightMostPoint(), is1D(), m_points, and pappso::x.
QString pappso::SelectionPolygon::toString | ( | ) | const |
Definition at line 732 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_maxX, m_maxY, m_minX, m_minY, and m_points.
Referenced by pappso::SelectionPolygonSpec::toString().
SelectionPolygon pappso::SelectionPolygon::transpose | ( | ) | const |
Definition at line 452 of file selectionpolygon.cpp.
References pappso::BOTTOM_LEFT_POINT, pappso::BOTTOM_RIGHT_POINT, pappso::ENUM_LAST, getPoint(), m_points, setPoint(), pappso::TOP_LEFT_POINT, pappso::TOP_RIGHT_POINT, pappso::x, and pappso::y.
double pappso::SelectionPolygon::width | ( | bool & | ok | ) | const |
Definition at line 377 of file selectionpolygon.cpp.
References computeMinMaxCoordinates().
|
protected |
Definition at line 134 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), convertTo1D(), operator=(), and toString().
|
protected |
Definition at line 135 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), operator=(), and toString().
|
protected |
Definition at line 131 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), convertTo1D(), operator=(), and toString().
|
protected |
Definition at line 132 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), operator=(), and toString().
|
protected |
Definition at line 122 of file selectionpolygon.h.
Referenced by SelectionPolygon(), SelectionPolygon(), SelectionPolygon(), computeMinMaxCoordinates(), computeMinMaxCoordinates(), contains(), getBottomMostPoint(), getLeftMostPoint(), getPoint(), getPoints(), getRightMostPoint(), getTopMostPoint(), operator=(), resetPoints(), setPoint(), toShort4PointsString(), toString(), and transpose().