|
|
@ -507,7 +507,9 @@ bool UBGraphicsScene::inputDeviceRelease() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UBDrawingController *dc = UBDrawingController::drawingController(); |
|
|
|
UBDrawingController *dc = UBDrawingController::drawingController(); |
|
|
|
if (dc->isDrawingTool())
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: Find a way to detect that we just did a compass drawing and replace the mArcPolygonItem just below
|
|
|
|
|
|
|
|
if (dc->isDrawingTool() || mDrawWithCompass) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (mCurrentStroke) |
|
|
|
if (mCurrentStroke) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -525,10 +527,7 @@ bool UBGraphicsScene::inputDeviceRelease() |
|
|
|
// TODO LATER : Generate well pressure-interpolated polygons and create the line group with them
|
|
|
|
// TODO LATER : Generate well pressure-interpolated polygons and create the line group with them
|
|
|
|
|
|
|
|
|
|
|
|
mAddedItems.clear(); |
|
|
|
mAddedItems.clear(); |
|
|
|
|
|
|
|
|
|
|
|
// Add the groupItem in mAddedItem
|
|
|
|
|
|
|
|
mAddedItems << pStrokes; |
|
|
|
mAddedItems << pStrokes; |
|
|
|
|
|
|
|
|
|
|
|
addItem(pStrokes); |
|
|
|
addItem(pStrokes); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -536,6 +535,28 @@ bool UBGraphicsScene::inputDeviceRelease() |
|
|
|
delete mCurrentStroke; |
|
|
|
delete mCurrentStroke; |
|
|
|
mCurrentStroke = 0; |
|
|
|
mCurrentStroke = 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}else if(mArcPolygonItem){ |
|
|
|
|
|
|
|
if(eDrawingMode_Vector == dc->drawingMode()){ |
|
|
|
|
|
|
|
UBGraphicsStrokesGroup* pStrokes = new UBGraphicsStrokesGroup(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the arc
|
|
|
|
|
|
|
|
mAddedItems.remove(mArcPolygonItem); |
|
|
|
|
|
|
|
removeItem(mArcPolygonItem); |
|
|
|
|
|
|
|
UBCoreGraphicsScene::removeItemFromDeletion(mArcPolygonItem); |
|
|
|
|
|
|
|
pStrokes->addToGroup(mArcPolygonItem); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the center cross
|
|
|
|
|
|
|
|
foreach(QGraphicsItem* item, mAddedItems){ |
|
|
|
|
|
|
|
removeItem(item); |
|
|
|
|
|
|
|
UBCoreGraphicsScene::removeItemFromDeletion(item); |
|
|
|
|
|
|
|
pStrokes->addToGroup(item); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mAddedItems.clear(); |
|
|
|
|
|
|
|
mAddedItems << pStrokes; |
|
|
|
|
|
|
|
addItem(pStrokes); |
|
|
|
|
|
|
|
mDrawWithCompass = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -635,6 +656,7 @@ void UBGraphicsScene::moveTo(const QPointF &pPoint) |
|
|
|
mPreviousWidth = -1.0; |
|
|
|
mPreviousWidth = -1.0; |
|
|
|
mPreviousPolygonItems.clear(); |
|
|
|
mPreviousPolygonItems.clear(); |
|
|
|
mArcPolygonItem = 0; |
|
|
|
mArcPolygonItem = 0; |
|
|
|
|
|
|
|
mDrawWithCompass = false; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -817,6 +839,7 @@ void UBGraphicsScene::eraseLineTo(const QPointF &pEndPoint, const qreal &pWidth) |
|
|
|
|
|
|
|
|
|
|
|
void UBGraphicsScene::drawArcTo(const QPointF& pCenterPoint, qreal pSpanAngle) |
|
|
|
void UBGraphicsScene::drawArcTo(const QPointF& pCenterPoint, qreal pSpanAngle) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
mDrawWithCompass = true; |
|
|
|
if (mArcPolygonItem) |
|
|
|
if (mArcPolygonItem) |
|
|
|
{ |
|
|
|
{ |
|
|
|
mAddedItems.remove(mArcPolygonItem); |
|
|
|
mAddedItems.remove(mArcPolygonItem); |
|
|
|