}
void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
- const std::list<XGUI_ViewerPrs>& theSelected)
+ const std::list<XGUI_ViewerPrs>& /*theSelected*/,
+ const std::list<XGUI_ViewerPrs>& theHighlighted)
{
- myFeatures = theSelected;
-}
-
-void PartSet_OperationSketch::mouseReleased(QMouseEvent* theEvent, Handle_V3d_View theView,
- const std::list<XGUI_ViewerPrs>& theSelected)
-{
- if (theSelected.empty())
- return;
-
if (!myIsEditMode) {
- XGUI_ViewerPrs aPrs = theSelected.front();
+ XGUI_ViewerPrs aPrs = theHighlighted.front();
const TopoDS_Shape& aShape = aPrs.shape();
if (!aShape.IsNull()) {
setSketchPlane(aShape);
}
}
else {
- if (theSelected.size() == 1) {
- boost::shared_ptr<ModelAPI_Feature> aFeature = theSelected.front().feature();
+ if (theHighlighted.size() == 1) {
+ boost::shared_ptr<ModelAPI_Feature> aFeature = theHighlighted.front().feature();
if (aFeature)
emit launchOperation(PartSet_OperationEditLine::Type(), aFeature);
}
+ else
+ myFeatures = theHighlighted;
}
- myFeatures.clear();
}
void PartSet_OperationSketch::mouseMoved(QMouseEvent* theEvent, Handle(V3d_View) theView)
}
std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> >
- PartSet_OperationSketch::preview() const
+ PartSet_OperationSketch::subPreview() const
{
std::map<boost::shared_ptr<ModelAPI_Feature>, boost::shared_ptr<GeomAPI_Shape> > aPreviewMap;
return aPreviewMap;
}
+void PartSet_OperationSketch::stopOperation()
+{
+ PartSet_OperationSketchBase::stopOperation();
+ emit featureConstructed(feature(), FM_Hide);
+ emit closeLocalContext();
+}
+
void PartSet_OperationSketch::setSketchPlane(const TopoDS_Shape& theShape)
{
if (theShape.IsNull())
boost::dynamic_pointer_cast<GeomDataAPI_Dir>(aData->attribute(SKETCH_ATTR_DIRY));
aDirY->setValue(aC, anA, aB);
boost::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
+
+ flushUpdated();
+
+ emit featureConstructed(feature(), FM_Hide);
+ emit closeLocalContext();
emit planeSelected(aDir->x(), aDir->y(), aDir->z());
}