Add point and line handling to generic QGraphicsScene. More...
#include <GraphicsScene.h>
Public Member Functions | |
GraphicsScene (MainWindow *mainWindow) | |
Single constructor. | |
void | addTemporaryPoint (const QString &identifier, GraphicsPoint *point) |
Add one temporary point to m_graphicsLinesForCurves. Non-temporary points are handled by the updateLineMembership functions. | |
GraphicsPoint * | createPoint (const QString &identifier, const PointStyle &pointStyle, const QPointF &posScreen) |
Create one QGraphicsItem-based object that represents one Point. It is NOT added to m_graphicsLinesForCurves (see addPoint) | |
void | hideAllItemsExceptImage () |
Hide all graphics items, except background image, in preparation for preview during IMPORT_TYPE_ADVANCED. | |
QStringList | positionHasChangedPointIdentifiers () const |
Return a list of identifiers for the points that have moved since the last call to resetPositionHasChanged. | |
void | printStream (QString indentation, QTextStream &str) |
Debugging method that supports print method of this class and printStream method of some other class(es) | |
void | removePoint (const QString &identifier) |
Remove specified point. This aborts if the point does not exist. | |
void | removeTemporaryPointIfExists () |
Remove temporary point if it exists. More... | |
void | resetOnLoad () |
Reset, when loading a document after the first, to same state that first document was at when loaded. | |
void | resetPositionHasChangedFlags () |
Reset positionHasChanged flag for all items. Typically this is done as part of mousePressEvent. | |
QStringList | selectedPointIdentifiers () const |
Return a list of identifiers for the currently selected points. | |
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 | updateAfterCommand (CmdMediator &cmdMediator) |
Update the Points and their Curves after executing a command. More... | |
void | updateCurveStyles (const CurveStyles &modelCurveStyles) |
Update curve styles after settings changed. | |
void | updateGraphicsLinesToMatchGraphicsPoints (const CurveStyles &modelCurveStyles, const Transformation &transformation) |
A mouse move has just occurred so move the selected points, since they were dragged. More... | |
Add point and line handling to generic QGraphicsScene.
The primary tasks are:
This class stores points and lines as QGraphicsItems, but also maintains identifier-to-QGraphicsItems mappings to the points and lines are accessible for updates (like when dragging points around and we need to update the attached lines).
Definition at line 31 of file GraphicsScene.h.
void GraphicsScene::removeTemporaryPointIfExists | ( | ) |
Remove temporary point if it exists.
Temporary point handling is so complicated that this method quietly allows redundant calls to this method, without complaining that the point has already been removed when called again
Definition at line 166 of file GraphicsScene.cpp.
void GraphicsScene::updateAfterCommand | ( | CmdMediator & | cmdMediator | ) |
Update the Points and their Curves after executing a command.
After a mouse drag, the lines are already updated and updating would be done on out of date information (since that would be brought up to date by the NEXT command)
Definition at line 270 of file GraphicsScene.cpp.
void GraphicsScene::updateGraphicsLinesToMatchGraphicsPoints | ( | const CurveStyles & | modelCurveStyles, |
const Transformation & | transformation | ||
) |
A mouse move has just occurred so move the selected points, since they were dragged.
The transformation is needed so the screen coordinates can be converted to graph coordinates when updating point ordinals
Definition at line 300 of file GraphicsScene.cpp.