92 qFatal(
"The rhomboid has not four points.");
94 double top_most_y_value = std::numeric_limits<double>::min();
98 if(the_point.y() > top_most_y_value)
100 top_most_y_value = the_point.y();
113 qFatal(
"The rhomboid has not four points.");
123 qFatal(
"Failed to get the top most point.");
126 points.push_back(point);
137 if(the_point == point)
140 if(the_point.y() == point.y())
143 points.push_back(the_point);
149 if(points.size() == 1)
151 else if(points.size() == 2)
153 else if(points.size() > 2)
165 qFatal(
"The rhomboid has not four points.");
167 double bottom_most_y_value = std::numeric_limits<double>::max();
171 if(the_point.y() < bottom_most_y_value)
173 bottom_most_y_value = the_point.y();
185 qFatal(
"The rhomboid has not four points.");
195 qFatal(
"Failed to get the bottom most point.");
198 points.push_back(point);
209 if(the_point == point)
212 if(the_point.y() == point.y())
215 points.push_back(the_point);
221 if(points.size() == 1)
223 else if(points.size() == 2)
225 else if(points.size() > 2)
237 qFatal(
"The rhomboid has not four points.");
239 double left_most_x = std::numeric_limits<double>::max();
243 if(the_point.x() < left_most_x)
245 left_most_x = the_point.x();
257 qFatal(
"The rhomboid has not four points.");
267 qFatal(
"Failed to get at least one left most point.");
270 points.push_back(point);
281 if(the_point == point)
284 if(the_point.x() == point.x())
287 points.push_back(the_point);
293 if(points.size() == 1)
295 else if(points.size() == 2)
297 else if(points.size() > 2)
309 qFatal(
"The rhomboid has not four points.");
311 double greatest_x = std::numeric_limits<double>::min();
315 if(the_point.x() > greatest_x)
317 greatest_x = the_point.x();
329 qFatal(
"The rhomboid has not four points.");
339 qFatal(
"Failed to get at least one left most point.");
342 points.push_back(point);
353 if(the_point == point)
356 if(the_point.x() == point.x())
359 points.push_back(the_point);
365 if(points.size() == 1)
367 else if(points.size() == 2)
369 else if(points.size() > 2)
381 qFatal(
"The rhomboid has not four points.");
383 std::vector<QPointF> points;
391 qFatal(
"Failed to get the top most points.");
397 if(points.size() != 2)
398 qFatal(
"We should have gotten two points.");
400 if(points.at(0).x() < points.at(1).x())
401 point = points.at(0);
403 point = points.at(1);
414 qFatal(
"Failed to get the left most points.");
420 if(points.size() != 2)
421 qFatal(
"We should have gotten two points.");
423 if(points.at(0).y() > points.at(1).y())
424 point = points.at(0);
426 point = points.at(1);
436 qFatal(
"This point should never be reached.");
444 qFatal(
"This point should never be reached.");
446 return scope_features;
453 qFatal(
"The rhomboid has not four points.");
455 std::vector<QPointF> points;
463 qFatal(
"Failed to get the bottom most points.");
469 if(points.size() != 2)
470 qFatal(
"We should have gotten two points.");
472 if(points.at(0).x() < points.at(1).x())
473 point = points.at(0);
475 point = points.at(1);
485 qFatal(
"Failed to get the left most points.");
491 if(points.size() != 2)
492 qFatal(
"We should have gotten two points.");
494 if(points.at(0).y() < points.at(1).y())
495 point = points.at(0);
497 point = points.at(1);
507 qFatal(
"This point should never be reached.");
515 qFatal(
"This point should never be reached.");
517 return scope_features;
524 qFatal(
"The rhomboid has not four points.");
526 std::vector<QPointF> points;
534 qFatal(
"Failed to get the top most points.");
540 if(points.size() != 2)
541 qFatal(
"We should have gotten two points.");
543 if(points.at(0).x() > points.at(1).x())
544 point = points.at(0);
546 point = points.at(1);
556 qFatal(
"Failed to get the right most points.");
562 if(points.size() != 2)
563 qFatal(
"We should have gotten two points.");
565 if(points.at(0).y() > points.at(1).y())
566 point = points.at(0);
568 point = points.at(1);
578 qFatal(
"This point should never be reached.");
586 qFatal(
"This point should never be reached.");
588 return scope_features;
595 qFatal(
"The rhomboid has not four points.");
597 std::vector<QPointF> points;
605 qFatal(
"Failed to get the bottom most points.");
611 if(points.size() != 2)
612 qFatal(
"We should have gotten two points.");
614 if(points.at(0).x() > points.at(1).x())
615 point = points.at(0);
617 point = points.at(1);
627 qFatal(
"Failed to get the right most points.");
633 if(points.size() != 2)
634 qFatal(
"We should have gotten two points.");
636 if(points.at(0).y() < points.at(1).y())
637 point = points.at(0);
639 point = points.at(1);
649 qFatal(
"This point should never be reached.");
657 qFatal(
"This point should never be reached.");
659 return scope_features;
666 qFatal(
"The IntegrationScopeRhomb has less than four points.");
713 QPointF left_most_point;
714 QPointF right_most_point;
717 qFatal(
"Failed to get the left most point.");
720 qFatal(
"Failed to get the right most point.");
722 width = fabs(right_most_point.x() - left_most_point.x());
733 qFatal(
"The IntegrationScopeRhomb has less than four points.");
737 QPointF top_most_point;
738 QPointF bottom_most_point;
741 qFatal(
"Failed to get the top most point.");
744 qFatal(
"Failed to get the bottom most point.");
746 height = fabs(top_most_point.y() - bottom_most_point.y());
755 qFatal(
"The IntegrationScopeRhomb has less than four points.");
814 std::vector<QPointF> points;
824 qFatal(
"Failed to get top most points.");
836 size = fabs(points.at(0).x() - points.at(1).x());
844 return scope_features;
863 std::vector<QPointF> points;
873 qFatal(
"Failed to get left most points.");
890 size = fabs(points.at(0).y() - points.at(1).y());
893 return scope_features;
901 QPointF left_most_point;
903 qFatal(
"Failed to get left-most point.");
905 QPointF right_most_point;
907 qFatal(
"Failed to get right-most point.");
909 start = left_most_point.x();
910 end = right_most_point.x();
916 QPointF bottom_most_point;
918 qFatal(
"Failed to get bottom-most point.");
920 QPointF top_most_point;
922 qFatal(
"Failed to get top-most point.");
924 start = bottom_most_point.y();
925 end = top_most_point.y();
991 std::vector<QPointF> transposed_points;
994 transposed_points.push_back(QPointF(point.y(), point.x()));
997 m_points.assign(transposed_points.begin(), transposed_points.end());
1015 bool is_inside =
false;
1017 int vertex_count =
m_points.size();
1019 for(i = 0, j = vertex_count - 1; i < vertex_count; j = i++)
1021 if(((
m_points.at(i).y() > point.y()) != (
m_points.at(j).y() > point.y())) &&
1025 is_inside = !is_inside;
1050 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1053 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1057 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1060 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
1065 text.append(QString(
"(%1, %2)").arg(point.x()).arg(point.y()));
IntegrationScopeBase(QObject *parent_p=nullptr)
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 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...