10#include <QGraphicsItem>
11#include <QGraphicsPathItem>
12#include <QGraphicsPolygonItem>
13#include <QGraphicsScene>
18 m_coordSystemIndexToBeRestored (coordSystemIndexToBeRestored)
30 QList<QGraphicsItem*>::iterator
itr;
35 QGraphicsEllipseItem *
itemEllipse =
dynamic_cast<QGraphicsEllipseItem*
> (item);
41 m_ellipses.push_back (
ghost);
45 QGraphicsPathItem *
itemPath =
dynamic_cast<QGraphicsPathItem*
> (item);
51 m_paths.push_back (
ghost);
55 QGraphicsPolygonItem *
itemPolygon =
dynamic_cast<QGraphicsPolygonItem*
> (item);
65 m_polygons.push_back (
ghost);
75 return m_coordSystemIndexToBeRestored;
82 for (
i = 0;
i < m_ellipses.count();
i++) {
85 QGraphicsEllipseItem *item = scene.addEllipse (
ghost.rect());
88 item->setPen (
ghost.pen());
89 item->setBrush (
ghost.brush());
91 item->setVisible (
true);
94 for (
i = 0;
i < m_paths.count();
i++) {
97 QGraphicsPathItem *item = scene.addPath (
ghost.path(),
103 item->setVisible (
true);
106 for (
i = 0;
i < m_polygons.count();
i++) {
109 QGraphicsPolygonItem *item = scene.addPolygon (
ghost.polygon(),
115 item->setVisible (
true);
122 QList<QGraphicsItem*>::iterator
itr;
127 if (!data.isNull()) {
129 scene.removeItem (item);
@ DATA_KEY_GHOST
True if item has changed since last mousePressEvent
const int INNER_RADIUS_MIN
Ghost for a QGraphicsEllipseItem.
Ghost for a QGraphicsPathItem.
Ghost for a QGraphicsPolygonItem.
unsigned int coordSystemIndexToBeRestored() const
Coordinate system index that was active before the ghosts.
void createGhosts(QGraphicsScene &scene)
Create ghosts from the path/rect/polygon lists.
void captureGraphicsItems(QGraphicsScene &scene)
Take a snapshot of the graphics items.
Ghosts(unsigned int coordSystemIndexToBeRestored)
Single constructor.
void destroyGhosts(QGraphicsScene &scene)
Destory ghosts. Called at end of algorithm.