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 (PointSpecs point_spec, double x, double y) |
void | setPoint (PointSpecs point_spec, QPointF point) |
void | copyPoint (PointSpecs point_spec_src, PointSpecs 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 (PointSpecs 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 60 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 30 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 67 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), and m_points.
pappso::SelectionPolygon::SelectionPolygon | ( | const SelectionPolygon & | other | ) |
Definition at line 88 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_maxX, m_maxY, m_minX, m_minY, and m_points.
|
virtual |
Definition at line 110 of file selectionpolygon.cpp.
bool pappso::SelectionPolygon::computeMinMaxCoordinates | ( | ) |
Definition at line 320 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_maxX, m_maxY, m_minX, m_minY, and m_points.
Referenced by SelectionPolygon(), convertTo1D(), copyPoint(), height(), rangeX(), rangeY(), set1D(), set2D(), setPoint(), and width().
bool pappso::SelectionPolygon::computeMinMaxCoordinates | ( | double & | min_x, |
double & | max_x, | ||
double & | min_y, | ||
double & | max_y | ||
) | const |
bool pappso::SelectionPolygon::contains | ( | const QPointF & | tested_point | ) | const |
Definition at line 486 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 571 of file selectionpolygon.cpp.
References contains(), pappso::ENUM_LAST, and getPoint().
void pappso::SelectionPolygon::convertTo1D | ( | ) |
Definition at line 213 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), m_maxX, m_minX, and set1D().
void pappso::SelectionPolygon::copyPoint | ( | PointSpecs | point_spec_src, |
PointSpecs | point_spec_dest | ||
) |
Definition at line 135 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), getPoint(), and setPoint().
|
static |
QPointF pappso::SelectionPolygon::getBottomMostPoint | ( | ) | const |
Definition at line 286 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::y.
Referenced by pappso::BasePlotWidget::drawYDeltaFeatures(), and pappso::BasePlotWidget::updateSelectionRectangle().
QPointF pappso::SelectionPolygon::getLeftMostPoint | ( | ) | const |
Definition at line 226 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::x.
Referenced by pappso::BasePlotWidget::drawXDeltaFeatures(), pappso::BasePlotWidget::drawYDeltaFeatures(), toShort4PointsString(), and pappso::BasePlotWidget::updateSelectionRectangle().
QPointF pappso::SelectionPolygon::getPoint | ( | PointSpecs | point_spec | ) | const |
Definition at line 313 of file selectionpolygon.cpp.
References m_points.
Referenced by contains(), copyPoint(), isRectangle(), transpose(), pappso::BasePlotWidget::update2DSelectionRectangleSkewed(), and pappso::BasePlotWidget::update2DSelectionRectangleSquare().
const std::vector< QPointF > & pappso::SelectionPolygon::getPoints | ( | ) | const |
Definition at line 306 of file selectionpolygon.cpp.
References m_points.
QPointF pappso::SelectionPolygon::getRightMostPoint | ( | ) | const |
Definition at line 246 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::x.
Referenced by pappso::BasePlotWidget::drawXDeltaFeatures(), pappso::BasePlotWidget::drawYDeltaFeatures(), toShort4PointsString(), and pappso::BasePlotWidget::updateSelectionRectangle().
QPointF pappso::SelectionPolygon::getTopMostPoint | ( | ) | const |
Definition at line 266 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_points, and pappso::y.
Referenced by pappso::BasePlotWidget::drawYDeltaFeatures(), and pappso::BasePlotWidget::updateSelectionRectangle().
double pappso::SelectionPolygon::height | ( | bool & | ok | ) | const |
bool pappso::SelectionPolygon::is1D | ( | ) | const |
Definition at line 631 of file selectionpolygon.cpp.
References height(), and width().
Referenced by pappso::BasePlotWidget::drawYDeltaFeatures(), and toShort4PointsString().
bool pappso::SelectionPolygon::is2D | ( | ) | const |
Definition at line 660 of file selectionpolygon.cpp.
bool pappso::SelectionPolygon::isRectangle | ( | ) | const |
Definition at line 686 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 589 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 424 of file selectionpolygon.cpp.
bool pappso::SelectionPolygon::rangeX | ( | double & | range_start, |
double & | range_end | ||
) | const |
Definition at line 404 of file selectionpolygon.cpp.
References computeMinMaxCoordinates().
Referenced by range().
bool pappso::SelectionPolygon::rangeY | ( | double & | range_start, |
double & | range_end | ||
) | const |
Definition at line 414 of file selectionpolygon.cpp.
References computeMinMaxCoordinates().
Referenced by range().
void pappso::SelectionPolygon::resetPoints | ( | ) |
Definition at line 614 of file selectionpolygon.cpp.
References m_points.
Referenced by pappso::BasePlotWidget::resetSelectionRectangle(), set1D(), set2D(), pappso::BasePlotWidget::update2DSelectionRectangleSkewed(), and pappso::BasePlotWidget::update2DSelectionRectangleSquare().
void pappso::SelectionPolygon::set1D | ( | double | x_range_start, |
double | x_range_end | ||
) |
Definition at line 146 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(), and pappso::BasePlotWidget::update1DSelectionRectangle().
void pappso::SelectionPolygon::set2D | ( | QPointF | top_left, |
QPointF | top_right, | ||
QPointF | bottom_right, | ||
QPointF | bottom_left | ||
) |
Definition at line 181 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 | ( | PointSpecs | point_spec, |
double | x, | ||
double | y | ||
) |
Definition at line 116 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), m_points, pappso::x, and pappso::y.
Referenced by copyPoint(), set1D(), set2D(), setPoint(), transpose(), pappso::BasePlotWidget::update2DSelectionRectangleSkewed(), and pappso::BasePlotWidget::update2DSelectionRectangleSquare().
void pappso::SelectionPolygon::setPoint | ( | PointSpecs | point_spec, |
QPointF | point | ||
) |
Definition at line 126 of file selectionpolygon.cpp.
References computeMinMaxCoordinates(), and setPoint().
QString pappso::SelectionPolygon::toShort4PointsString | ( | ) | const |
Definition at line 784 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, getLeftMostPoint(), getRightMostPoint(), is1D(), m_points, and pappso::x.
QString pappso::SelectionPolygon::toString | ( | ) | const |
Definition at line 729 of file selectionpolygon.cpp.
References pappso::ENUM_LAST, m_maxX, m_maxY, m_minX, m_minY, and m_points.
Referenced by pappso::SelectionPolygonSpec::toString(), and pappso::BasePlotContext::toString().
SelectionPolygon pappso::SelectionPolygon::transpose | ( | ) | const |
Definition at line 449 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 |
|
protected |
Definition at line 151 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), convertTo1D(), operator=(), and toString().
|
protected |
Definition at line 152 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), operator=(), and toString().
|
protected |
Definition at line 148 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), convertTo1D(), operator=(), and toString().
|
protected |
Definition at line 149 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), operator=(), and toString().
|
protected |
Definition at line 139 of file selectionpolygon.h.
Referenced by SelectionPolygon(), computeMinMaxCoordinates(), contains(), getBottomMostPoint(), getLeftMostPoint(), getPoint(), getPoints(), getRightMostPoint(), getTopMostPoint(), operator=(), resetPoints(), setPoint(), toShort4PointsString(), toString(), and transpose().