{
}
-std::list<int> PartSet_OperationSketch::getSelectionModes(ObjectPtr theFeature) const
+CompositeFeaturePtr PartSet_OperationSketch::sketch() const
{
- std::list<int> aModes;
- if (!hasSketchPlane())
- aModes.push_back(TopAbs_FACE);
- else
- aModes = PartSet_OperationSketchBase::getSelectionModes(theFeature);
-
- return aModes;
-}
-
-/// Initializes the operation with previously created feature. It is used in sequental operations
-void PartSet_OperationSketch::initFeature(FeaturePtr theFeature)
-{
- if (theFeature)
- setEditingFeature(theFeature);
-}
-
-FeaturePtr PartSet_OperationSketch::sketch() const
-{
- return feature();
+ return boost::dynamic_pointer_cast<ModelAPI_CompositeFeature>(feature());
}
void PartSet_OperationSketch::mousePressed(QMouseEvent* theEvent, Handle_V3d_View theView,
/// It is empty and we have to use the process mouse release to start edition operation
/// for these objects
if (theSelected.size() == 1) {
- ObjectPtr aFeature = theSelected.front().object();
- if (aFeature)
- restartOperation(PartSet_OperationFeatureEdit::Type(), aFeature);
+ ObjectPtr aObject = theSelected.front().object();
+ if (aObject) {
+ restartOperation(PartSet_OperationFeatureEdit::Type(), aObject);
+ }
}
}
}
{
PartSet_OperationSketchBase::stopOperation();
emit featureConstructed(feature(), FM_Hide);
- emit closeLocalContext();
+}
+void PartSet_OperationSketch::afterCommitOperation()
+{
FeaturePtr aFeature = feature();
std::list<ResultPtr> aResults = aFeature->results();
std::list<ResultPtr>::const_iterator aIt;
+ Events_ID anEvent = Events_Loop::loop()->eventByName(EVENT_OBJECT_TOSHOW);
for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
- ModelAPI_EventCreator::get()->sendUpdated(
- *aIt, Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ ModelAPI_EventCreator::get()->sendUpdated(*aIt, anEvent);
}
- //ModelAPI_EventCreator::get()->sendUpdated(aFeature,
- // Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ Events_Loop::loop()->flush(anEvent);
}
bool PartSet_OperationSketch::isNestedOperationsEnabled() const
flushUpdated();
emit featureConstructed(feature(), FM_Hide);
- emit closeLocalContext();
emit planeSelected(aDir->x(), aDir->y(), aDir->z());
}
+
+
+bool PartSet_OperationSketch::isGranted(ModuleBase_Operation* theOperation) const
+{
+ PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(theOperation);
+ return aPreviewOp != NULL;
+}
+