gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), aView);
Point aMousePnt;
get2dPoint(theWnd, theEvent, aMousePnt);
+#ifndef SUPPORT_NEW_MOVE
double dX = aMousePnt.myCurX - myCurrentPoint.myCurX;
double dY = aMousePnt.myCurY - myCurrentPoint.myCurY;
-
+#else
+ std::shared_ptr<GeomAPI_Pnt2d> anOriginalPosition = std::shared_ptr<GeomAPI_Pnt2d>(
+ new GeomAPI_Pnt2d(myCurrentPoint.myCurX, myCurrentPoint.myCurY));
+ std::shared_ptr<GeomAPI_Pnt2d> aCurrentPosition = std::shared_ptr<GeomAPI_Pnt2d>(
+ new GeomAPI_Pnt2d(aMousePnt.myCurX, aMousePnt.myCurY));
+#endif
ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(aAttrId));
if (aPoint.get() != NULL) {
bool isImmutable = aPoint->setImmutable(true);
+#ifndef SUPPORT_NEW_MOVE
aPoint->move(dX, dY);
- isModified = true;
ModelAPI_EventCreator::get()->sendUpdated(aFeature, aMoveEvent);
+#else
+ std::shared_ptr<ModelAPI_ObjectMovedMessage> aMessage = std::shared_ptr
+ <ModelAPI_ObjectMovedMessage>(new ModelAPI_ObjectMovedMessage(this));
+ aMessage->setMovedAttribute(aPoint);
+ aMessage->setOriginalPosition(anOriginalPosition);
+ aMessage->setCurrentPosition(aCurrentPosition);
+ Events_Loop::loop()->send(aMessage);
+#endif
+ isModified = true;
aPoint->setImmutable(isImmutable);
}
}
std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
if (aSketchFeature) {
+#ifndef SUPPORT_NEW_MOVE
aSketchFeature->move(dX, dY);
- isModified = true;
ModelAPI_EventCreator::get()->sendUpdated(aSketchFeature, aMoveEvent);
+#else
+ std::shared_ptr<ModelAPI_ObjectMovedMessage> aMessage = std::shared_ptr
+ <ModelAPI_ObjectMovedMessage>(new ModelAPI_ObjectMovedMessage(this));
+ aMessage->setMovedObject(aFeature);
+ aMessage->setOriginalPosition(anOriginalPosition);
+ aMessage->setCurrentPosition(aCurrentPosition);
+ Events_Loop::loop()->send(aMessage);
+#endif
+ isModified = true;
}
}
}
// were changed here
if (isModified) {
aCurrentOperation->onValuesChanged();
+ Events_Loop::loop()->flush(aMoveEvent); // up all move events - to be processed in the solver
}
- Events_Loop::loop()->flush(aMoveEvent); // up all move events - to be processed in the solver
//Events_Loop::loop()->flush(aUpdateEvent); // up update events - to redisplay presentations
// 5. it is necessary to save current selection in order to restore it after the features moving