23#include <QApplication>
24#include <QGraphicsItem>
30 QGraphicsScene(mainWindow),
43 <<
" identifer=" << identifier.toLatin1().data();
76 <<
" identifier=" << identifier.toLatin1().
data();
94QString GraphicsScene::dumpCursors ()
const
112 for (
int index = 0; index < QGraphicsScene::items().count(); index++) {
131 QList<QGraphicsItem*>::iterator
itr;
151 QList<QGraphicsItem*>::const_iterator
itr;
164 <<
" identifier=" << identifier.toLatin1().data()
188 LOG4CPP_INFO_S ((*
mainCat)) <<
"GraphicsScene::removePoint identifier=" << identifier.toLatin1().data();
225 QList<QGraphicsItem*>::const_iterator
itr;
238 <<
" show=" << (
show ?
"true" :
"false")
239 <<
" showAll=" << (
showAll ?
"true" :
"false")
243 QList<QGraphicsItem*>::const_iterator
itr;
277 double highlightOpacity,
285 updateCurves (cmdMediator);
288 updatePointMembership (cmdMediator,
293void GraphicsScene::updateCurves (
CmdMediator &cmdMediator)
345 delete m_pathItemMultiValued;
346 m_pathItemMultiValued = this->
addPath (pathMultiValued);
350 m_pathItemMultiValued->setAcceptHoverEvents (
true);
351 m_pathItemMultiValued->setToolTip (
tr (
"Function currently has multiple Y values for one X value. Please adjust nearby points, "
352 "or change the curve type in Curve Properties"));
355void GraphicsScene::updatePointMembership (
CmdMediator &cmdMediator,
const QString AXIS_CURVE_NAME
@ DATA_KEY_POSITION_HAS_CHANGED
Item type (i.e. image versus point)
@ DATA_KEY_GRAPHICS_ITEM_TYPE
Unique identifier for QGraphicsItem object
const int INNER_RADIUS_MIN
@ GRAPHICS_ITEM_TYPE_IMAGE
@ GRAPHICS_ITEM_TYPE_LINE
@ GRAPHICS_ITEM_TYPE_POINT
log4cpp::Category * mainCat
QString QtCursorToString(Qt::CursorShape cursorShape)
Callback for updating the QGraphicsItems in the scene after a command may have modified Points in Cur...
CallbackSearchReturn callback(const QString &, const Point &point)
Callback method.
Model for DlgSettingsCurveProperties and CmdSettingsCurveProperties.
QStringList curvesGraphsNames() const
See CurvesGraphs::curvesGraphsNames.
CurveStyles modelCurveStyles() const
Get method for CurveStyles.
Window that displays the geometry information, as a table, for the current curve.
void updateHighlightOpacity(double highlightOpacity)
Update the highlight opacity value. This may or may not affect the current display immediately depend...
void updatePointOrdinalsAfterDrag(const CurveStyles &curveStyles, const Transformation &transformation)
See GraphicsScene::updateOrdinalsAfterDrag.
void removePoint(const QString &identifier)
Remove the specified point. The act of deleting it will automatically remove it from the GraphicsScen...
void updateCurveStyles(const CurveStyles &modelCurveStyles)
Update the curve style for every curve.
void printStream(QString indentation, QTextStream &str) const
Debugging method that supports print method of this class and printStream method of some other class(...
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded.
void removeTemporaryPointIfExists()
Remove temporary point if it exists.
void lineMembershipPurge(const CurveStyles &curveStyles, SplineDrawer &splineDrawer, QPainterPath &pathMultiValued, LineStyle &lineMultiValued)
Mark the end of addPoint calls. Remove stale lines, insert missing lines, and draw the graphics lines...
void addRemoveCurves(GraphicsScene &scene, const QStringList &curveNames)
Add new curves and remove expired curves to match the specified list.
void addPoint(const QString &curveName, const QString &pointIdentifier, double ordinal, GraphicsPoint &point)
Add new point.
void updateGraphicsLinesToMatchGraphicsPoints(const CurveStyles &curveStyles, SplineDrawer &splineDrawer, QPainterPath &pathMultiValued, LineStyle &lineMultiValued)
Calls to moveLinesWithDraggedPoint have finished so update the lines correspondingly.
void lineMembershipReset()
Mark points as unwanted. Afterwards, lineMembershipPurge gets called.
Factor for generating GraphicsPointAbstractBase class objects.
Graphics item for drawing a circular or polygonal Point.
void setData(int key, const QVariant &data)
Proxy method for QGraphicsItem::setData.
QVariant data(int key) const
Proxy method for QGraphicsItem::data.
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...
void updateGraphicsLinesToMatchGraphicsPoints(const CurveStyles &modelCurveStyles, const Transformation &transformation)
A mouse move has just occurred so move the selected points, since they were dragged.
void resetOnLoad()
Reset, when loading a document after the first, to same state that first document was at when loaded.
void removeTemporaryScaleBarIfExists()
Remove temporary scale bar, composed of two points and the line between them.
GraphicsScene(MainWindow *mainWindow)
Single constructor.
virtual ~GraphicsScene()
Virtual destructor needed since using Q_OBJECT.
void updateAfterCommand(CmdMediator &cmdMediator, double highlightOpacity, GeometryWindow *geometryWindow, const Transformation &transformation)
Update the Points and their Curves after executing a command.
void hideAllItemsExceptImage()
Hide all graphics items, except background image, in preparation for preview during IMPORT_TYPE_ADVAN...
void addTemporaryPoint(const QString &identifier, GraphicsPoint *point)
Add one temporary point to m_graphicsLinesForCurves. Non-temporary points are handled by the updateLi...
void addTemporaryScaleBar(GraphicsPoint *point0, GraphicsPoint *point1, const QString &pointIdentifier0, const QString &pointIdentifier1)
Add temporary scale bar to scene.
QStringList positionHasChangedPointIdentifiers() const
Return a list of identifiers for the points that have moved since the last call to resetPositionHasCh...
void showCurves(bool show, bool showAll=false, const QString &curveName="")
Show or hide all Curves (if showAll is true) or just the selected Curve (if showAll is false);.
void resetPositionHasChangedFlags()
Reset positionHasChanged flag for all items. Typically this is done as part of mousePressEvent.
void printStream(QString indentation, QTextStream &str)
Debugging method that supports print method of this class and printStream method of some other class(...
void removeTemporaryPointIfExists()
Remove temporary point if it exists.
void removePoint(const QString &identifier)
Remove specified point. This aborts if the point does not exist.
void updateCurveStyles(const CurveStyles &modelCurveStyles)
Update curve styles after settings changed.
Details for a specific Line.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...
Details for a specific Point.
static QString curveNameFromPointIdentifier(const QString &pointIdentifier)
Parse the curve name from the specified point identifier. This does the opposite of uniqueIdentifierG...
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,...
#define LOG4CPP_INFO_S(logger)
#define LOG4CPP_DEBUG_S(logger)