Container for one set of digitized Points.
More...
#include <Curve.h>
|
| | Curve (const QString &curveName, const ColorFilterSettings &colorFilterSettings, const CurveStyle &curveStyle) |
| | Constructor from scratch. More...
|
| |
| | Curve (QDataStream &str) |
| | Constructor from serialized binary pre-version 6 file. More...
|
| |
| | Curve (QXmlStreamReader &reader) |
| | Constructor for use when loading from serialized xml. More...
|
| |
| | Curve (const Curve &curve) |
| | Copy constructor. Copying a Curve only helps for making a copy, since access to any Points inside must be via functor. More...
|
| |
| Curve & | operator= (const Curve &curve) |
| | Assignment constructor. More...
|
| |
| void | addPoint (const Point &point) |
| | Add Point to this Curve. More...
|
| |
| ColorFilterSettings | colorFilterSettings () const |
| | Return the color filter. More...
|
| |
| QString | curveName () const |
| | Name of this Curve. More...
|
| |
| CurveStyle | curveStyle () const |
| | Return the curve style. More...
|
| |
| void | editPointAxis (const QPointF &posGraph, const QString &identifier) |
| | Edit the graph coordinates of an axis point. This method does not apply to a graph point. More...
|
| |
| void | editPointGraph (bool isX, bool isY, double x, double y, const QStringList &identifiers, const Transformation &transformation) |
| | Edit the graph coordinates of one or more graph points. This method does not apply to an axis point. More...
|
| |
| void | exportToClipboard (const QHash< QString, bool > &selectedHash, const Transformation &transformation, QTextStream &strCsv, QTextStream &strHtml, CurvesGraphs &curvesGraphs) const |
| | Export points in this Curve found in the specified point list. More...
|
| |
| bool | isXOnly (const QString &pointIdentifier) const |
| | Determine if specified point has just x coordinate. Otherwise has just y coordinate, or both x and y coordinates. More...
|
| |
| void | iterateThroughCurvePoints (const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > &ftorWithCallback) const |
| | Apply functor to Points on Curve. More...
|
| |
| void | iterateThroughCurveSegments (const Functor2wRet< const Point &, const Point &, CallbackSearchReturn > &ftorWithCallback) const |
| | Apply functor to successive Points, as line segments, on Curve. This could be a bit slow. More...
|
| |
| void | movePoint (const QString &pointIdentifier, const QPointF &deltaScreen) |
| | Translate the position of a point by the specified distance vector. More...
|
| |
| int | numPoints () const |
| | Number of points. More...
|
| |
| const Points | points () const |
| | Return a shallow copy of the Points. More...
|
| |
| QPointF | positionGraph (const QString &pointIdentifier) const |
| | Return the position, in graph coordinates, of the specified Point. More...
|
| |
| QPointF | positionScreen (const QString &pointIdentifier) const |
| | Return the position, in screen coordinates, of the specified Point. More...
|
| |
| void | printStream (QString indentation, QTextStream &str) const |
| | Debugging method that supports print method of this class and printStream method of some other class(es) More...
|
| |
| void | removePoint (const QString &identifier) |
| | Perform the opposite of addPointAtEnd. More...
|
| |
| void | saveXml (QXmlStreamWriter &writer) const |
| | Serialize curve. More...
|
| |
| void | setColorFilterSettings (const ColorFilterSettings &colorFilterSettings) |
| | Set color filter. More...
|
| |
| void | setCurveName (const QString &curveName) |
| | Change the curve name. More...
|
| |
| void | setCurveStyle (const CurveStyle &curveStyle) |
| | Set curve style. More...
|
| |
| void | updatePointOrdinals (const Transformation &transformation) |
| | See CurveGraphs::updatePointOrdinals. More...
|
| |
Container for one set of digitized Points.
Definition at line 32 of file Curve.h.
◆ Curve() [1/4]
Constructor from scratch.
Definition at line 36 of file Curve.cpp.
◆ Curve() [2/4]
| Curve::Curve |
( |
QDataStream & |
str | ) |
|
Constructor from serialized binary pre-version 6 file.
Definition at line 53 of file Curve.cpp.
55 const int CONVERT_ENUM_TO_RADIUS = 6;
58 qint32 int32, xScreen, yScreen;
59 double xGraph, yGraph;
91 for (
int i = 0; i < count; i++) {
100 Point point (m_curveName,
101 QPointF (xScreen, yScreen),
102 QPointF (xGraph, yGraph),
110 Point point (m_curveName,
111 QPointF (xScreen, yScreen));
112 point.setOrdinal (ordinal++);
◆ Curve() [3/4]
| Curve::Curve |
( |
QXmlStreamReader & |
reader | ) |
|
Constructor for use when loading from serialized xml.
Definition at line 119 of file Curve.cpp.
◆ Curve() [4/4]
| Curve::Curve |
( |
const Curve & |
curve | ) |
|
Copy constructor. Copying a Curve only helps for making a copy, since access to any Points inside must be via functor.
Definition at line 45 of file Curve.cpp.
47 m_points (curve.
points ()),
◆ addPoint()
| void Curve::addPoint |
( |
const Point & |
point | ) |
|
◆ colorFilterSettings()
Return the color filter.
Definition at line 139 of file Curve.cpp.
141 return m_colorFilterSettings;
◆ curveName()
| QString Curve::curveName |
( |
| ) |
const |
◆ curveStyle()
Return the curve style.
Definition at line 149 of file Curve.cpp.
◆ editPointAxis()
| void Curve::editPointAxis |
( |
const QPointF & |
posGraph, |
|
|
const QString & |
identifier |
|
) |
| |
Edit the graph coordinates of an axis point. This method does not apply to a graph point.
Definition at line 154 of file Curve.cpp.
158 QList<Point>::iterator itr;
159 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
◆ editPointGraph()
| void Curve::editPointGraph |
( |
bool |
isX, |
|
|
bool |
isY, |
|
|
double |
x, |
|
|
double |
y, |
|
|
const QStringList & |
identifiers, |
|
|
const Transformation & |
transformation |
|
) |
| |
Edit the graph coordinates of one or more graph points. This method does not apply to an axis point.
Definition at line 171 of file Curve.cpp.
179 <<
" identifiers=" << identifiers.join(
" ").toLatin1().data();
184 QList<Point>::iterator itr;
185 for (itr = m_points.begin(); itr != m_points.end(); itr++) {
189 if (identifiers.contains (point.
identifier ())) {
◆ exportToClipboard()
| void Curve::exportToClipboard |
( |
const QHash< QString, bool > & |
selectedHash, |
|
|
const Transformation & |
transformation, |
|
|
QTextStream & |
strCsv, |
|
|
QTextStream & |
strHtml, |
|
|
CurvesGraphs & |
curvesGraphs |
|
) |
| const |
Export points in this Curve found in the specified point list.
Definition at line 220 of file Curve.cpp.
227 <<
" hashCount=" << selectedHash.count();
232 QList<Point>::const_iterator itr;
233 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
235 const Point &point = *itr;
236 if (selectedHash.contains (point.
identifier ())) {
243 strHtml <<
"<table>\n"
244 <<
"<tr><th>X</th><th>" << m_curveName <<
"</th></tr>\n";
254 Curve curve(m_curveName,
273 strHtml <<
"<tr><td>" << pos.x() <<
"</td><td>" << pos.y() <<
"</td></tr>\n";
281 strHtml <<
"</table>\n";
◆ isXOnly()
| bool Curve::isXOnly |
( |
const QString & |
pointIdentifier | ) |
const |
Determine if specified point has just x coordinate. Otherwise has just y coordinate, or both x and y coordinates.
Definition at line 285 of file Curve.cpp.
288 Points::const_iterator itr;
289 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
290 const Point &point = *itr;
◆ iterateThroughCurvePoints()
| void Curve::iterateThroughCurvePoints |
( |
const Functor2wRet< const QString &, const Point &, CallbackSearchReturn > & |
ftorWithCallback | ) |
const |
Apply functor to Points on Curve.
Definition at line 301 of file Curve.cpp.
303 QList<Point>::const_iterator itr;
304 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
306 const Point &point = *itr;
◆ iterateThroughCurveSegments()
Apply functor to successive Points, as line segments, on Curve. This could be a bit slow.
Definition at line 316 of file Curve.cpp.
320 QList<Point>::const_iterator itr;
321 const Point *pointBefore =
nullptr;
322 for (itr = m_points.begin(); itr != m_points.end(); itr++) {
324 const Point &point = *itr;
326 if (pointBefore !=
nullptr) {
336 pointBefore = &point;
◆ movePoint()
| void Curve::movePoint |
( |
const QString & |
pointIdentifier, |
|
|
const QPointF & |
deltaScreen |
|
) |
| |
Translate the position of a point by the specified distance vector.
Definition at line 423 of file Curve.cpp.
426 Point *point = pointForPointIdentifier (pointIdentifier);
428 QPointF posScreen = deltaScreen + point->
posScreen ();
◆ numPoints()
| int Curve::numPoints |
( |
| ) |
const |
Number of points.
Definition at line 432 of file Curve.cpp.
434 return m_points.count ();
◆ operator=()
Assignment constructor.
Definition at line 124 of file Curve.cpp.
127 m_points = curve.
points ();
◆ points()
| const Points Curve::points |
( |
| ) |
const |
Return a shallow copy of the Points.
Definition at line 451 of file Curve.cpp.
◆ positionGraph()
| QPointF Curve::positionGraph |
( |
const QString & |
pointIdentifier | ) |
const |
Return the position, in graph coordinates, of the specified Point.
Definition at line 456 of file Curve.cpp.
461 Points::const_iterator itr;
462 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
463 const Point &point = *itr;
◆ positionScreen()
| QPointF Curve::positionScreen |
( |
const QString & |
pointIdentifier | ) |
const |
Return the position, in screen coordinates, of the specified Point.
Definition at line 473 of file Curve.cpp.
478 Points::const_iterator itr;
479 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
480 const Point &point = *itr;
◆ printStream()
| void Curve::printStream |
( |
QString |
indentation, |
|
|
QTextStream & |
str |
|
) |
| const |
Debugging method that supports print method of this class and printStream method of some other class(es)
Definition at line 490 of file Curve.cpp.
493 str << indentation <<
"Curve=" << m_curveName <<
"\n";
497 Points::const_iterator itr;
498 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
499 const Point &point = *itr;
◆ removePoint()
| void Curve::removePoint |
( |
const QString & |
identifier | ) |
|
Perform the opposite of addPointAtEnd.
Definition at line 510 of file Curve.cpp.
513 Points::iterator itr;
514 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
517 m_points.erase (itr);
◆ saveXml()
| void Curve::saveXml |
( |
QXmlStreamWriter & |
writer | ) |
const |
Serialize curve.
Definition at line 523 of file Curve.cpp.
529 m_colorFilterSettings.
saveXml (writer,
536 Points::const_iterator itr;
537 for (itr = m_points.begin (); itr != m_points.end (); itr++) {
538 const Point &point = *itr;
541 writer.writeEndElement();
543 writer.writeEndElement();
◆ setColorFilterSettings()
◆ setCurveName()
| void Curve::setCurveName |
( |
const QString & |
curveName | ) |
|
Change the curve name.
Definition at line 551 of file Curve.cpp.
556 QList<Point>::iterator itr;
557 for (itr = m_points.begin(); itr != m_points.end(); itr++) {
◆ setCurveStyle()
| void Curve::setCurveStyle |
( |
const CurveStyle & |
curveStyle | ) |
|
◆ updatePointOrdinals()
| void Curve::updatePointOrdinals |
( |
const Transformation & |
transformation | ) |
|
See CurveGraphs::updatePointOrdinals.
Same algorithm as GraphicsLinesForCurve::updatePointOrdinalsAfterDrag, although graph coordinates of points have been updated before this is called so the graph coordinates are not updated by this method
Definition at line 568 of file Curve.cpp.
573 <<
" curve=" << m_curveName.toLatin1().data()
581 updatePointOrdinalsFunctions (transformation);
586 updatePointOrdinalsRelations ();
595 qSort (m_points.begin(),
The documentation for this class was generated from the following files:
ColorFilterSettings colorFilterSettings() const
Return the color filter.
const QString TAB_DELIMITER("\t")
bool isXOnly() const
In DOCUMENT_AXES_POINTS_REQUIRED_4 modes, this is true/false if y/x coordinate is undefined.
Immediately terminate the current search.
const QString DOCUMENT_SERIALIZE_CURVE
static PointStyle defaultGraphCurve(int index)
Initial default for index'th graph curve.
LineStyle lineStyle() const
Get method for LineStyle.
CallbackSearchReturn
Return values for search callback methods.
const QString SCALE_CURVE_NAME("Scale")
void saveXml(QXmlStreamWriter &writer, const QString &curveName) const
Save curve filter to stream.
void setPointColor(ColorPalette curveColor)
Set method curve point color in specified curve.
const QString DOCUMENT_SERIALIZE_CURVE_NAME
void setLineColor(ColorPalette lineColor)
Set method for line color in specified curve.
void saveXml(QXmlStreamWriter &writer, const QString &curveName) const
Serialize to xml.
Comparator for sorting Point class.
#define LOG4CPP_ERROR_S(logger)
const Points points() const
Return a shallow copy of the Points.
Container for one set of digitized Points.
Container for LineStyle and PointStyle for one Curve.
void setLineWidth(int width)
Set method for line width in specified curve.
void setPointStyle(const PointStyle &pointStyle)
Set method for PointStyle.
QPointF posScreen() const
Accessor for screen position.
void setPosGraph(const QPointF &posGraph)
Set method for position in graph coordinates.
static ColorFilterSettings defaultFilter()
Initial default for any Curve.
const QString DOCUMENT_SERIALIZE_CURVE_POINTS
#define LOG4CPP_INFO_S(logger)
static LineStyle defaultAxesCurve()
Initial default for axes curve.
void addPoint(const Point &point)
Add Point to this Curve.
CurveConnectAs curveConnectAs(int preVersion6) const
Line drawn between points.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Converts old (=pre version 6) enums to new (=version 6) enums, for reading of old document files.
QString identifier() const
Unique identifier for a specific Point.
QPointF posGraph(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Accessor for graph position. Skip check if copying one instance to another.
QString curveName() const
Name of this Curve.
log4cpp::Category * mainCat
void setLineStyle(const LineStyle &lineStyle)
Set method for LineStyle.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setPosScreen(const QPointF &posScreen)
Set method for position in screen coordinates.
PointShape pointShape(int preVersion6) const
Point shape.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
Curve * curveForCurveName(const QString &curveName)
Return the axis or graph curve for the specified curve name.
const QString INDENTATION_DELTA
ColorPalette colorPalette(int preVersion6) const
Color from color palette.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
int numCurves() const
Current number of graphs curves.
void setPointLineWidth(int width)
Set method for curve point perimeter line width.
void addGraphCurveAtEnd(const Curve &curve)
Append new graph Curve to end of Curve list.
void saveXml(QXmlStreamWriter &writer) const
Serialize to stream.
CurveConnectAs curveConnectAs() const
Get method for connect type.
void setLineConnectAs(CurveConnectAs curveConnectAs)
Set method for connect as method for lines in specified curve.
QString curveConnectAsToString(CurveConnectAs curveConnectAs)
CurveStyle curveStyle() const
Return the curve style.
void setCurveName(const QString &curveName)
Update the point identifer to match the specified curve name.
const QString AXIS_CURVE_NAME("Axes")
void setPointShape(PointShape shape)
Set method for curve point shape in specified curve.
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
void setPointRadius(int radius)
Set method for curve point radius.