98 qFatal(
"The rhomboid has not four points.");
100 double top_most_y_value = std::numeric_limits<double>::min();
104 if(the_point.y() > top_most_y_value)
106 top_most_y_value = the_point.y();
119 qFatal(
"The rhomboid has not four points.");
129 qFatal(
"Failed to get the top most point.");
132 points.push_back(point);
143 if(the_point == point)
146 if(the_point.y() == point.y())
149 points.push_back(the_point);
155 if(points.size() == 1)
157 else if(points.size() == 2)
159 else if(points.size() > 2)
171 qFatal(
"The rhomboid has not four points.");
173 double bottom_most_y_value = std::numeric_limits<double>::max();
177 if(the_point.y() < bottom_most_y_value)
179 bottom_most_y_value = the_point.y();
191 qFatal(
"The rhomboid has not four points.");
201 qFatal(
"Failed to get the bottom most point.");
204 points.push_back(point);
215 if(the_point == point)
218 if(the_point.y() == point.y())
221 points.push_back(the_point);
227 if(points.size() == 1)
229 else if(points.size() == 2)
231 else if(points.size() > 2)
243 qFatal(
"The rhomboid has not four points.");
245 double left_most_x = std::numeric_limits<double>::max();
249 if(the_point.x() < left_most_x)
251 left_most_x = the_point.x();
263 qFatal(
"The rhomboid has not four points.");
273 qFatal(
"Failed to get at least one left most point.");
276 points.push_back(point);
287 if(the_point == point)
290 if(the_point.x() == point.x())
293 points.push_back(the_point);
299 if(points.size() == 1)
301 else if(points.size() == 2)
303 else if(points.size() > 2)
315 qFatal(
"The rhomboid has not four points.");
317 double greatest_x = std::numeric_limits<double>::min();
321 if(the_point.x() > greatest_x)
323 greatest_x = the_point.x();
335 qFatal(
"The rhomboid has not four points.");
345 qFatal(
"Failed to get at least one left most point.");
348 points.push_back(point);
359 if(the_point == point)
362 if(the_point.x() == point.x())
365 points.push_back(the_point);
371 if(points.size() == 1)
373 else if(points.size() == 2)
375 else if(points.size() > 2)
387 qFatal(
"The rhomboid has not four points.");
389 std::vector<QPointF> points;
397 qFatal(
"Failed to get the top most points.");
403 if(points.size() != 2)
404 qFatal(
"We should have gotten two points.");
406 if(points.at(0).x() < points.at(1).x())
407 point = points.at(0);
409 point = points.at(1);
420 qFatal(
"Failed to get the left most points.");
426 if(points.size() != 2)
427 qFatal(
"We should have gotten two points.");
429 if(points.at(0).y() > points.at(1).y())
430 point = points.at(0);
432 point = points.at(1);
442 qFatal(
"This point should never be reached.");
450 qFatal(
"This point should never be reached.");
452 return scope_features;
459 qFatal(
"The rhomboid has not four points.");
461 std::vector<QPointF> points;
469 qFatal(
"Failed to get the bottom most points.");
475 if(points.size() != 2)
476 qFatal(
"We should have gotten two points.");
478 if(points.at(0).x() < points.at(1).x())
479 point = points.at(0);
481 point = points.at(1);
491 qFatal(
"Failed to get the left most points.");
497 if(points.size() != 2)
498 qFatal(
"We should have gotten two points.");
500 if(points.at(0).y() < points.at(1).y())
501 point = points.at(0);
503 point = points.at(1);
513 qFatal(
"This point should never be reached.");
521 qFatal(
"This point should never be reached.");
523 return scope_features;
530 qFatal(
"The rhomboid has not four points.");
532 std::vector<QPointF> points;
540 qFatal(
"Failed to get the top most points.");
546 if(points.size() != 2)
547 qFatal(
"We should have gotten two points.");
549 if(points.at(0).x() > points.at(1).x())
550 point = points.at(0);
552 point = points.at(1);
562 qFatal(
"Failed to get the right most points.");
568 if(points.size() != 2)
569 qFatal(
"We should have gotten two points.");
571 if(points.at(0).y() > points.at(1).y())
572 point = points.at(0);
574 point = points.at(1);
584 qFatal(
"This point should never be reached.");
592 qFatal(
"This point should never be reached.");
594 return scope_features;
601 qFatal(
"The rhomboid has not four points.");
603 std::vector<QPointF> points;
611 qFatal(
"Failed to get the bottom most points.");
617 if(points.size() != 2)
618 qFatal(
"We should have gotten two points.");
620 if(points.at(0).x() > points.at(1).x())
621 point = points.at(0);
623 point = points.at(1);
633 qFatal(
"Failed to get the right most points.");
639 if(points.size() != 2)
640 qFatal(
"We should have gotten two points.");
642 if(points.at(0).y() < points.at(1).y())
643 point = points.at(0);
645 point = points.at(1);
655 qFatal(
"This point should never be reached.");
663 qFatal(
"This point should never be reached.");
665 return scope_features;
672 qFatal(
"The IntegrationScopeRhomb has less than four points.");
719 QPointF left_most_point;
720 QPointF right_most_point;
723 qFatal(
"Failed to get the left most point.");
726 qFatal(
"Failed to get the right most point.");
728 width = fabs(right_most_point.x() - left_most_point.x());
739 qFatal(
"The IntegrationScopeRhomb has less than four points.");
743 QPointF top_most_point;
744 QPointF bottom_most_point;
747 qFatal(
"Failed to get the top most point.");
750 qFatal(
"Failed to get the bottom most point.");
752 height = fabs(top_most_point.y() - bottom_most_point.y());
761 qFatal(
"The IntegrationScopeRhomb has less than four points.");
820 std::vector<QPointF> points;
830 qFatal(
"Failed to get top most points.");
842 size = fabs(points.at(0).x() - points.at(1).x());
850 return scope_features;
869 std::vector<QPointF> points;
879 qFatal(
"Failed to get left most points.");
896 size = fabs(points.at(0).y() - points.at(1).y());
899 return scope_features;
907 QPointF left_most_point;
909 qFatal(
"Failed to get left-most point.");
911 QPointF right_most_point;
913 qFatal(
"Failed to get right-most point.");
915 start = left_most_point.x();
916 end = right_most_point.x();
922 QPointF bottom_most_point;
924 qFatal(
"Failed to get bottom-most point.");
926 QPointF top_most_point;
928 qFatal(
"Failed to get top-most point.");
930 start = bottom_most_point.y();
931 end = top_most_point.y();
997 std::vector<QPointF> transposed_points;
1000 transposed_points.push_back(QPointF(point.y(), point.x()));
1003 m_points.assign(transposed_points.begin(), transposed_points.end());
1021 bool is_inside =
false;
1023 int vertex_count =
m_points.size();
1025 for(i = 0, j = vertex_count - 1; i < vertex_count; j = i++)
1027 if(((
m_points.at(i).y() > point.y()) != (
m_points.at(j).y() > point.y())) &&
1031 is_inside = !is_inside;
1056 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1059 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1063 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1066 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1071 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
virtual bool getPoints(std::vector< QPointF > &points) const override
virtual bool getDataKindX(Enums::DataKind &data_kind) override
virtual IntegrationScopeFeatures getWidth(double &width) const override
virtual IntegrationScopeFeatures getBottomMostPoints(std::vector< QPointF > &points) const override
virtual void reset() override
std::vector< QPointF > m_points
virtual QString toString() const override
virtual IntegrationScopeFeatures getBottomMostPoint(QPointF &point) const override
virtual IntegrationScopeFeatures getRightMostPoints(std::vector< QPointF > &points) const override
virtual bool isRhomboid() const override
virtual IntegrationScopeFeatures getTopMostPoints(std::vector< QPointF > &points) const override
virtual IntegrationScopeFeatures getRightMostTopPoint(QPointF &point) const override
virtual void setDataKindX(Enums::DataKind data_kind) override
bool is2D() const override
Enums::DataKind m_dataKindX
virtual bool range(Enums::Axis axis, double &start, double &end) const override
virtual IntegrationScopeFeatures getTopMostPoint(QPointF &point) const override
virtual std::size_t addPoint(QPointF point)
virtual IntegrationScopeFeatures getRhombVerticalSize(double &size) const override
virtual bool getDataKindY(Enums::DataKind &data_kind) override
virtual void setDataKindY(Enums::DataKind data_kind) override
virtual IntegrationScopeFeatures getHeight(double &height) const override
virtual IntegrationScopeFeatures getLeftMostPoint(QPointF &point) const override
Enums::DataKind m_dataKindY
virtual bool transpose() override
bool is1D() const override
virtual IntegrationScopeRhomb * clone() const
virtual IntegrationScopeFeatures getLeftMostPoints(std::vector< QPointF > &points) const override
virtual bool getPoint(QPointF &point) const override
virtual IntegrationScopeFeatures getLeftMostTopPoint(QPointF &point) const override
virtual ~IntegrationScopeRhomb() override
virtual IntegrationScopeRhomb & operator=(const IntegrationScopeRhomb &other)
virtual IntegrationScopeFeatures getLeftMostBottomPoint(QPointF &point) const override
virtual IntegrationScopeFeatures getRhombHorizontalSize(double &size) const override
virtual IntegrationScopeFeatures getRightMostPoint(QPointF &point) const override
virtual IntegrationScopeFeatures getRightMostBottomPoint(QPointF &point) const override
virtual bool contains(const QPointF &point) const override
virtual bool isRectangle() const override
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...