19#include <QGraphicsItem>
21#include <QPainterPath>
35 m_curveName (curveName)
46 OrdinalToGraphicsPoint::iterator
itr;
47 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
52 m_graphicsPoints.clear();
60 <<
" curve=" << m_curveName.toLatin1().data()
62 <<
" ordinal=" << ordinal
64 <<
" newPointCount=" << (m_graphicsPoints.count() + 1);
75 <<
" curve=" << m_curveName.toLatin1().data();
82 OrdinalToGraphicsPoint::const_iterator
itr;
83 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
85 double ordinal =
itr.key();
88 t.push_back (ordinal);
100 m_graphicsPoints.count(),
106 OrdinalToGraphicsPoint::const_iterator
itr = m_graphicsPoints.begin();
109 path.moveTo (point->
pos ());
114 itr != m_graphicsPoints.end();
139 path.moveTo (point->
pos ());
142 OrdinalToGraphicsPoint::const_iterator
itrBefore =
itr - 1;
164 <<
" curve=" << m_curveName.toLatin1().data();
170 OrdinalToGraphicsPoint::const_iterator
itr;
171 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
177 path.moveTo (point->
pos ());
179 path.lineTo (point->
pos ());
189 <<
" identifier=" << identifier.toLatin1().
data();
191 OrdinalToGraphicsPoint::const_iterator
itr;
192 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
212 <<
" curve=" << m_curveName.toLatin1().data();
214 OrdinalToGraphicsPoint::iterator
itr,
itrNext;
215 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr =
itrNext) {
224 double ordinal =
itr.key ();
227 m_graphicsPoints.remove (ordinal);
235 pen =
QPen (Qt::NoPen);
255 <<
" curve=" << m_curveName.toLatin1().data();
257 OrdinalToGraphicsPoint::iterator
itr;
258 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
266bool GraphicsLinesForCurve::needOrdinalRenumbering ()
const
297 OrdinalToGraphicsPoint::const_iterator
itr;
298 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
312 <<
" point=" << ordinal
313 <<
" pointCount=" << m_graphicsPoints.count();
318 m_graphicsPoints.remove (ordinal);
329 OrdinalToGraphicsPoint::iterator
itr;
330 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
334 m_graphicsPoints.remove (
itr.key());
342void GraphicsLinesForCurve::renumberOrdinals ()
357 m_graphicsPoints.clear ();
372 <<
" curve=" << m_curveName.toLatin1().data()
373 <<
" pointCount=" << m_graphicsPoints.count();
376 if (m_graphicsPoints.contains (point.
ordinal())) {
407 OrdinalToGraphicsPoint::const_iterator
itr;
408 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
418 <<
" curve=" << m_curveName.toLatin1().data()
419 <<
" highlightOpacity=" << highlightOpacity;
421 OrdinalToGraphicsPoint::const_iterator
itr;
422 for (
itr = m_graphicsPoints.begin();
itr != m_graphicsPoints.end();
itr++) {
444 <<
" numberPoints=" << m_graphicsPoints.count()
454 m_graphicsPoints.count () < 3) {
458 path = drawLinesSmooth (lineStyle,
474 <<
" curve=" << m_curveName.toLatin1().data()
484 OrdinalToGraphicsPoint::iterator
itrP;
485 for (
itrP = m_graphicsPoints.begin();
itrP != m_graphicsPoints.end();
itrP++) {
487 double ordinal =
itrP.key();
501 XOrThetaToOrdinal::const_iterator
itrX;
511 m_graphicsPoints.clear();
514 double ordinal =
itrP.key();
517 m_graphicsPoints [ordinal] = point;
@ COLOR_PALETTE_TRANSPARENT
QString curveConnectAsToString(CurveConnectAs curveConnectAs)
@ CONNECT_AS_FUNCTION_STRAIGHT
@ CONNECT_AS_RELATION_STRAIGHT
@ CONNECT_SKIP_FOR_AXIS_CURVE
@ CONNECT_AS_FUNCTION_SMOOTH
QString dataKeyToString(DataKey dataKey)
DataKey
Index values for storing item details in QGraphicsItem using setData/data.
@ DATA_KEY_GRAPHICS_ITEM_TYPE
Unique identifier for QGraphicsItem object
const int INNER_RADIUS_MIN
#define ENGAUGE_ASSERT(cond)
Drop in replacement for Q_ASSERT if defined(QT_NO_DEBUG) && !defined(QT_FORCE_ASSERTS) define ENGAUGE...
#define ENGAUGE_CHECK_PTR(ptr)
#endif
QColor ColorPaletteToQColor(ColorPalette color)
@ GRAPHICS_ITEM_TYPE_LINE
QMap< double, double > XOrThetaToOrdinal
log4cpp::Category * mainCat
const QString INDENTATION_DELTA
QMap< double, GraphicsPoint * > OrdinalToGraphicsPoint
QString QPointFToString(const QPointF &pos)
@ SPLINE_DRAWER_ENUM_INVISIBLE_MOVE
@ SPLINE_DRAWER_ENUM_VISIBLE_DRAW
Container for LineStyle and PointStyle for one Curve.
Window that displays the geometry information, as a table, for the current curve.
double identifierToOrdinal(const QString &identifier) const
Get ordinal for specified identifier.
void updateAfterCommand(GraphicsScene &scene, const PointStyle &pointStyle, const Point &point, GeometryWindow *geometryWindow)
Update the GraphicsScene with the specified Point from the Document. If it does not exist yet in the ...
void updateCurveStyle(const CurveStyle &curveStyle)
Update the curve style for this curve.
void lineMembershipPurge(const LineStyle &lineStyle, SplineDrawer &splineDrawer, QPainterPath &pathMultiValued, LineStyle &lineMultiValued)
Mark the end of addPoint calls. Remove stale lines, insert missing lines, and draw the graphics lines...
void updateHighlightOpacity(double highlightOpacity)
Update the highlight opacity value. This may or may not affect the current display immediately depend...
void removePoint(double ordinal)
Remove the specified point. The act of deleting it will automatically remove it from the GraphicsScen...
void addPoint(const QString &pointIdentifier, double ordinal, GraphicsPoint &point)
Add new line.
void lineMembershipReset()
Mark points as unwanted. Afterwards, lineMembershipPurge gets called.
void removeTemporaryPointIfExists()
Remove temporary point if it exists.
void updatePointOrdinalsAfterDrag(const LineStyle &lineStyle, const Transformation &transformation)
See GraphicsScene::updateOrdinalsAfterDrag. Pretty much the same steps as Curve::updatePointOrdinals.
GraphicsLinesForCurve(const QString &curveName)
Single constructor.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void updateGraphicsLinesToMatchGraphicsPoints(const LineStyle &lineStyle, SplineDrawer &splineDrawer, QPainterPath &pathMultiValued, LineStyle &lineMultiValued)
Calls to moveLinesWithDraggedPoint have finished so update the lines correspondingly.
Graphics item for drawing a circular or polygonal Point.
QPointF pos() const
Proxy method for QGraphicsItem::pos.
void updateCurveStyle(const CurveStyle &curveStyle)
Update point and line styles that comprise the curve style.
void reset()
Mark point as unwanted, and unbind any bound lines.
bool wanted() const
Identify point as wanted//unwanted.
void printStream(QString indentation, QTextStream &str, double ordinalKey) const
Debugging method that supports print method of this class and printStream method of some other class(...
void setHighlightOpacity(double highlightOpacity)
Set method for highlight opacity.
QVariant data(int key) const
Proxy method for QGraphicsItem::data.
Add point and line handling to generic QGraphicsScene.
GraphicsPoint * createPoint(const QString &identifier, const PointStyle &pointStyle, const QPointF &posScreen, GeometryWindow *geometryWindow)
Create one QGraphicsItem-based object that represents one Point. It is NOT added to m_graphicsLinesFo...
Details for a specific Line.
CurveConnectAs curveConnectAs() const
Get method for connect type.
unsigned int width() const
Width of line.
ColorPalette paletteColor() const
Line color.
Details for a specific Point.
Class that represents one digitized point. The screen-to-graph coordinate transformation is always ex...
QPointF posScreen() const
Accessor for screen position.
QString identifier() const
Unique identifier for a specific Point.
double ordinal(ApplyHasCheck applyHasCheck=KEEP_HAS_CHECK) const
Get method for ordinal. Skip check if copying one instance to another.
static double UNDEFINED_ORDINAL()
Get method for undefined ordinal constant.
This class takes the output from Spline and uses that to draw the curve in the graphics window,...
Single X/Y pair for cubic spline interpolation initialization and calculations.
Cubic interpolation given independent and dependent value vectors.
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)