aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
aFactory->registerValidator("PartSet_RigidValidator", new PartSet_RigidValidator);
aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
aFactory->registerValidator("PartSet_RigidValidator", new PartSet_RigidValidator);
aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
+ // the selection is cleared after commit the create operation
+ // in order to do not use the same selected objects in the restarted operation
+ // for common behaviour, the selection is cleared even if the operation is not restarted
+ myWorkshop->viewer()->AISContext()->ClearSelected();
+
/// Restart sketcher operations automatically
FeaturePtr aFeature = theOperation->feature();
std::shared_ptr<SketchPlugin_Feature> aSPFeature =
/// Restart sketcher operations automatically
FeaturePtr aFeature = theOperation->feature();
std::shared_ptr<SketchPlugin_Feature> aSPFeature =
myRestartingMode == RM_EmptyFeatureUsed)) {
myLastOperationId = theOperation->id();
myLastFeature = myRestartingMode == RM_LastFeatureUsed ? theOperation->feature() : FeaturePtr();
myRestartingMode == RM_EmptyFeatureUsed)) {
myLastOperationId = theOperation->id();
myLastFeature = myRestartingMode == RM_LastFeatureUsed ? theOperation->feature() : FeaturePtr();
void PartSet_Module::onSelectionChanged()
{
ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
void PartSet_Module::onSelectionChanged()
{
ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
bool isSketcherOp = false;
// An edit operation is enable only if the current opeation is the sketch operation
bool isSketcherOp = false;
// An edit operation is enable only if the current opeation is the sketch operation
if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch()))
isSketcherOp = (aOperation->id().toStdString() == SketchPlugin_Sketch::ID());
}
if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch()))
isSketcherOp = (aOperation->id().toStdString() == SketchPlugin_Sketch::ID());
}
- if (!isSketcherOp)
- return;
-
- // Editing of constraints can be done on selection
- ModuleBase_ISelection* aSelect = myWorkshop->selection();
- QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
- if (aSelected.size() == 1) {
- ModuleBase_ViewerPrs aPrs = aSelected.first();
- ObjectPtr aObject = aPrs.object();
- FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
- if (aFeature) {
- std::string aId = aFeature->getKind();
- if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
- (aId == SketchPlugin_ConstraintLength::ID()) ||
- (aId == SketchPlugin_ConstraintDistance::ID())) {
- editFeature(aFeature);
+ if (isSketcherOp) {
+ // Editing of constraints can be done on selection
+ ModuleBase_ISelection* aSelect = myWorkshop->selection();
+ QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
+ if (aSelected.size() == 1) {
+ ModuleBase_ViewerPrs aPrs = aSelected.first();
+ ObjectPtr aObject = aPrs.object();
+ FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
+ if (aFeature) {
+ std::string aId = aFeature->getKind();
+ if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
+ (aId == SketchPlugin_ConstraintLength::ID()) ||
+ (aId == SketchPlugin_ConstraintDistance::ID())) {
+ editFeature(aFeature);
+ }
void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
{
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
{
XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
{
ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
{
ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
- connect(aWgt, SIGNAL(vertexSelected(ObjectPtr, const TopoDS_Shape&)),
- this, SLOT(onVertexSelected(ObjectPtr, const TopoDS_Shape&)));
+ connect(aWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));