9 #include "GraphicsItemsExtractor.h" 10 #include "GraphicsItemType.h" 13 #include <QGraphicsItem> 19 GraphicsItemsExtractor::~GraphicsItemsExtractor()
24 AxisOrGraph axisOrGraph)
const 26 bool allAreEitherAxisOrGraph =
true;
28 QList<QGraphicsItem*>::const_iterator itr;
29 for (itr = items.begin(); itr != items.end(); itr++) {
31 QGraphicsItem *item = *itr;
32 GraphicsItemType type = (GraphicsItemType) item->data (DATA_KEY_GRAPHICS_ITEM_TYPE).toInt ();
34 if (type == GRAPHICS_ITEM_TYPE_POINT) {
36 QString pointIdentifier = item->data (DATA_KEY_IDENTIFIER).toString ();
39 bool unwantedAxisPoint = ((curveName == AXIS_CURVE_NAME) && (axisOrGraph == GRAPH_POINTS));
40 bool unwantedCurvePoint = ((curveName != AXIS_CURVE_NAME) && (axisOrGraph == AXIS_POINTS));
42 if (unwantedAxisPoint || unwantedCurvePoint) {
44 allAreEitherAxisOrGraph =
false;
50 allAreEitherAxisOrGraph =
false;
56 return allAreEitherAxisOrGraph;
61 LOG4CPP_INFO_S ((*mainCat)) <<
"GraphicsScene::selectedPointIdentifiers" 62 <<
" selectedItems=" << items.count();
64 QStringList selectedIds;
65 QList<QGraphicsItem*>::const_iterator itr;
66 for (itr = items.begin(); itr != items.end(); itr++) {
68 const QGraphicsItem* item = *itr;
71 bool isPoint = (item->data (DATA_KEY_GRAPHICS_ITEM_TYPE).toInt () == GRAPHICS_ITEM_TYPE_POINT);
75 selectedIds << item->data(DATA_KEY_IDENTIFIER).toString ();
static QString curveNameFromPointIdentifier(const QString &pointIdentifier)
Parse the curve name from the specified point identifier. This does the opposite of uniqueIdentifierG...