1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include "PartSet_Module.h"
4 #include <PartSet_WidgetSketchLabel.h>
5 #include <PartSet_Validators.h>
6 #include <PartSet_Tools.h>
7 #include <PartSet_WidgetPoint2d.h>
8 #include <PartSet_WidgetPoint2dDistance.h>
9 #include <PartSet_WidgetShapeSelector.h>
10 #include <PartSet_WidgetConstraintShapeSelector.h>
11 #include <PartSet_WidgetEditor.h>
12 #include "PartSet_SketcherMgr.h"
13 #include "PartSet_MenuMgr.h"
15 #include <ModuleBase_Operation.h>
16 #include <ModuleBase_IViewer.h>
17 #include <ModuleBase_IViewWindow.h>
18 #include <ModuleBase_IPropertyPanel.h>
19 #include <ModuleBase_WidgetEditor.h>
20 #include <ModuleBase_FilterFactory.h>
21 #include <ModuleBase_FilterLinearEdge.h>
22 #include <ModuleBase_FilterFace.h>
23 #include <ModuleBase_FilterMulti.h>
24 #include <ModuleBase_FilterCustom.h>
25 #include <ModuleBase_FilterNoConsructionSubShapes.h>
26 #include <GeomValidators_Edge.h>
27 #include <GeomValidators_EdgeOrVertex.h>
28 #include <GeomValidators_Face.h>
29 #include <GeomValidators_ConstructionComposite.h>
31 #include <PartSet_FilterSketchEntity.h>
33 #include <ModelAPI_Object.h>
34 #include <ModelAPI_Events.h>
35 #include <ModelAPI_Validator.h>
36 #include <ModelAPI_Data.h>
37 #include <ModelAPI_Session.h>
38 #include <ModelAPI_ShapeValidator.h>
40 #include <GeomDataAPI_Point2D.h>
41 #include <GeomDataAPI_Point.h>
42 #include <GeomDataAPI_Dir.h>
44 #include <XGUI_Displayer.h>
45 #include <XGUI_Workshop.h>
46 #include <XGUI_OperationMgr.h>
47 #include <XGUI_PropertyPanel.h>
48 #include <XGUI_ModuleConnector.h>
49 #include <XGUI_ContextMenuMgr.h>
50 #include <XGUI_Tools.h>
52 #include <SketchPlugin_Feature.h>
53 #include <SketchPlugin_Sketch.h>
54 #include <SketchPlugin_Line.h>
55 #include <SketchPlugin_Arc.h>
56 #include <SketchPlugin_Circle.h>
57 #include <SketchPlugin_Point.h>
58 #include <SketchPlugin_ConstraintLength.h>
59 #include <SketchPlugin_ConstraintDistance.h>
60 #include <SketchPlugin_ConstraintParallel.h>
61 #include <SketchPlugin_ConstraintPerpendicular.h>
62 #include <SketchPlugin_ConstraintRadius.h>
64 #include <SketcherPrs_SymbolPrs.h>
65 #include <SketcherPrs_Tools.h>
67 #include <Events_Loop.h>
68 #include <Config_PropManager.h>
69 #include <Config_Keywords.h>
71 #include <StdSelect_TypeOfFace.hxx>
72 #include <TopoDS_Vertex.hxx>
74 #include <TopoDS_Shape.hxx>
75 #include <BRep_Tool.hxx>
76 #include <AIS_Dimension.hxx>
79 #include <QMouseEvent>
82 #include <QApplication>
83 #include <QMessageBox>
84 #include <QMainWindow>
86 #include <GeomAlgoAPI_FaceBuilder.h>
87 #include <GeomDataAPI_Dir.h>
93 /*!Create and return new instance of XGUI_Module*/
94 extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(ModuleBase_IWorkshop* theWshop)
96 return new PartSet_Module(theWshop);
99 PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
100 : ModuleBase_IModule(theWshop),
101 myRestartingMode(RM_None), myVisualLayerId(0)
103 mySketchMgr = new PartSet_SketcherMgr(this);
105 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
106 XGUI_Workshop* aWorkshop = aConnector->workshop();
108 XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
109 connect(anOpMgr, SIGNAL(keyEnterReleased()), this, SLOT(onEnterReleased()));
110 connect(anOpMgr, SIGNAL(operationActivatedByPreselection()),
111 this, SLOT(onOperationActivatedByPreselection()));
113 ModuleBase_IViewer* aViewer = theWshop->viewer();
114 connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
115 this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
116 connect(aViewer, SIGNAL(viewTransformed(int)),
117 SLOT(onViewTransformed(int)));
119 myMenuMgr = new PartSet_MenuMgr(this);
122 PartSet_Module::~PartSet_Module()
124 if (!myDocumentShapeFilter.IsNull())
125 myDocumentShapeFilter.Nullify();
128 void PartSet_Module::registerValidators()
130 //Registering of validators
131 SessionPtr aMgr = ModelAPI_Session::get();
132 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
133 aFactory->registerValidator("PartSet_DistanceSelection", new PartSet_DistanceSelection);
134 aFactory->registerValidator("PartSet_LengthSelection", new PartSet_LengthSelection);
135 aFactory->registerValidator("PartSet_PerpendicularSelection", new PartSet_PerpendicularSelection);
136 aFactory->registerValidator("PartSet_ParallelSelection", new PartSet_ParallelSelection);
137 aFactory->registerValidator("PartSet_RadiusSelection", new PartSet_RadiusSelection);
138 aFactory->registerValidator("PartSet_RigidSelection", new PartSet_RigidSelection);
139 aFactory->registerValidator("PartSet_CoincidentSelection", new PartSet_CoincidentSelection);
140 aFactory->registerValidator("PartSet_HVDirSelection", new PartSet_HVDirSelection);
141 aFactory->registerValidator("PartSet_TangentSelection", new PartSet_TangentSelection);
143 aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
144 aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
146 aFactory->registerValidator("GeomValidators_Edge", new GeomValidators_Edge);
147 aFactory->registerValidator("GeomValidators_EdgeOrVertex",
148 new GeomValidators_EdgeOrVertex);
149 aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
151 aFactory->registerValidator("GeomValidators_ConstructionComposite",
152 new GeomValidators_ConstructionComposite);
154 aFactory->registerValidator("PartSet_SketchEntityValidator",
155 new PartSet_SketchEntityValidator);
157 aFactory->registerValidator("PartSet_SameTypeAttr",
158 new PartSet_SameTypeAttrValidator);
161 void PartSet_Module::registerFilters()
163 //Registering of selection filters
164 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
165 ModuleBase_FilterFactory* aFactory = aConnector->selectionFilters();
167 //aFactory->registerFilter("EdgeFilter", new ModuleBase_FilterLinearEdge);
168 //aFactory->registerFilter("FaceFilter", new ModuleBase_FilterFace);
169 //aFactory->registerFilter("MultiFilter", new ModuleBase_FilterMulti);
170 //Handle(SelectMgr_Filter) aSelectFilter = new ModuleBase_FilterNoConsructionSubShapes(workshop());
171 //aFactory->registerFilter("NoConstructionSubShapesFilter",
172 // new ModuleBase_FilterCustom(aSelectFilter));
173 //Handle(SelectMgr_Filter) aSelectFilter = new PartSet_FilterSketchEntity(workshop());
174 //aFactory->registerFilter("SketchEntityFilter", new ModuleBase_FilterCustom(aSelectFilter));
177 void PartSet_Module::registerProperties()
179 Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
181 Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
182 Config_Prop::Integer, SKETCH_WIDTH);
185 void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation)
187 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
188 mySketchMgr->commitNestedSketch(theOperation);
191 if (theOperation->isEditOperation())
193 // the selection is cleared after commit the create operation
194 // in order to do not use the same selected objects in the restarted operation
195 // for common behaviour, the selection is cleared even if the operation is not restarted
196 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
197 if (!aContext.IsNull())
198 aContext->ClearSelected();
200 /// Restart sketcher operations automatically
201 FeaturePtr aFeature = theOperation->feature();
202 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
203 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
204 if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed ||
205 myRestartingMode == RM_EmptyFeatureUsed)) {
206 myLastOperationId = theOperation->id();
207 myLastFeature = myRestartingMode == RM_LastFeatureUsed ? theOperation->feature() : FeaturePtr();
209 launchOperation(myLastOperationId);
211 breakOperationSequence();
214 void PartSet_Module::breakOperationSequence()
216 myLastOperationId = "";
217 myLastFeature = FeaturePtr();
218 myRestartingMode = RM_None;
221 void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation)
223 breakOperationSequence();
226 void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation)
228 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
229 Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
230 aViewer->AddZLayer(myVisualLayerId);
231 mySketchMgr->startSketch(theOperation);
233 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
234 mySketchMgr->startNestedSketch(theOperation);
237 if (myDocumentShapeFilter.IsNull())
238 myDocumentShapeFilter = new PartSet_GlobalFilter(myWorkshop);
239 myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
242 void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
244 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
245 mySketchMgr->stopSketch(theOperation);
246 Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
247 aViewer->RemoveZLayer(myVisualLayerId);
250 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
251 mySketchMgr->stopNestedSketch(theOperation);
253 myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
256 ModuleBase_Operation* PartSet_Module::currentOperation() const
258 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
259 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
260 return anOpMgr->currentOperation();
263 bool PartSet_Module::canUndo() const
265 bool aCanUndo = false;
266 SessionPtr aMgr = ModelAPI_Session::get();
267 if (aMgr->hasModuleDocument() && aMgr->canUndo()) {
268 aCanUndo = !aMgr->isOperation();
269 if (!aCanUndo) // check the enable state additionally by sketch manager
270 aCanUndo = aMgr->canUndo();
275 bool PartSet_Module::canRedo() const
277 bool aCanRedo = false;
278 SessionPtr aMgr = ModelAPI_Session::get();
279 if (aMgr->hasModuleDocument() && aMgr->canRedo()) {
280 aCanRedo = !aMgr->isOperation();
281 if (!aCanRedo) // check the enable state additionally by sketch manager
282 aCanRedo = aMgr->canRedo();
287 bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
289 // the sketch manager put the restriction to the objects display
290 return mySketchMgr->canDisplayObject(theObject);
294 bool PartSet_Module::addViewerItems(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const
296 return myMenuMgr->addViewerItems(theMenu, theStdActions);
299 bool PartSet_Module::isMouseOverWindow()
301 return mySketchMgr->isMouseOverWindow();
304 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
306 ModuleBase_IPropertyPanel* aPanel = theOperation->propertyPanel();
307 if (PartSet_SketcherMgr::isSketchOperation(theOperation) && (theOperation->isEditOperation())) {
308 // we have to manually activate the sketch label in edit mode
309 aPanel->activateWidget(aPanel->modelWidgets().first());
313 // Restart last operation type
314 if ((theOperation->id() == myLastOperationId) && myLastFeature) {
315 ModuleBase_ModelWidget* aWgt = aPanel->activeWidget();
316 if (theOperation->id().toStdString() == SketchPlugin_Line::ID()) {
317 // Initialise new line with first point equal to end of previous
318 PartSet_WidgetPoint2D* aPnt2dWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
320 std::shared_ptr<ModelAPI_Data> aData = myLastFeature->data();
321 std::shared_ptr<GeomDataAPI_Point2D> aPoint =
322 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID()));
324 aPnt2dWgt->setPoint(aPoint->x(), aPoint->y());
325 PartSet_Tools::setConstraints(mySketchMgr->activeSketch(), theOperation->feature(),
326 aWgt->attributeID(), aPoint->x(), aPoint->y());
327 aPanel->activateNextWidget(aPnt2dWgt);
332 // Start editing constraint
333 if (theOperation->isEditOperation()) {
334 // TODO: #391 - to be removed
335 std::string aId = theOperation->id().toStdString();
336 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation) &&
337 PartSet_SketcherMgr::isDistanceOperation(theOperation)) {
338 // Find and activate widget for management of point for dimension line position
339 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
340 foreach (ModuleBase_ModelWidget* aWgt, aWidgets) {
341 PartSet_WidgetPoint2D* aPntWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
343 aPanel->activateWidget(aPntWgt);
353 void PartSet_Module::onSelectionChanged()
355 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
359 bool isSketcherOp = false;
360 // An edit operation is enable only if the current opeation is the sketch operation
361 if (mySketchMgr->activeSketch()) {
362 if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch()))
363 isSketcherOp = PartSet_SketcherMgr::isSketchOperation(aOperation);
366 // Editing of constraints can be done on selection
367 ModuleBase_ISelection* aSelect = myWorkshop->selection();
368 QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
369 if (aSelected.size() == 1) {
370 ModuleBase_ViewerPrs aPrs = aSelected.first();
371 ObjectPtr aObject = aPrs.object();
372 FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
374 std::string aId = aFeature->getKind();
375 if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
376 (aId == SketchPlugin_ConstraintLength::ID()) ||
377 (aId == SketchPlugin_ConstraintDistance::ID())) {
378 editFeature(aFeature);
385 void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
387 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
388 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
389 anOpMgr->onKeyReleased(theEvent);
392 void PartSet_Module::onEnterReleased()
394 myRestartingMode = RM_EmptyFeatureUsed;
397 void PartSet_Module::onOperationActivatedByPreselection()
399 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
400 if(anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
401 // Set final definitions if they are necessary
402 //propertyPanelDefined(aOperation);
404 /// Commit sketcher operations automatically
405 anOperation->commit();
409 void PartSet_Module::onNoMoreWidgets()
411 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
413 if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
414 if (myRestartingMode != RM_Forbided)
415 myRestartingMode = RM_LastFeatureUsed;
416 anOperation->commit();
421 void PartSet_Module::onVertexSelected()
423 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
424 if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
425 /// If last line finished on vertex the lines creation sequence has to be break
426 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
427 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
428 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
429 QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
430 bool aFoundWidget = false;
431 bool aFoundObligatory = false;
432 for (; anIt != aLast && !aFoundObligatory; anIt++) {
434 aFoundWidget = *anIt == anActiveWidget;
436 aFoundObligatory = (*anIt)->isObligatory();
438 if (!aFoundObligatory)
439 myRestartingMode = RM_Forbided;
443 ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
444 Config_WidgetAPI* theWidgetApi, std::string theParentId)
446 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
447 XGUI_Workshop* aWorkshop = aConnector->workshop();
448 ModuleBase_ModelWidget* aWgt = NULL;
449 if (theType == "sketch-start-label") {
450 PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent,
451 theWidgetApi, theParentId, mySketchMgr->isConstraintsShown());
452 aLabelWgt->setWorkshop(aWorkshop);
453 connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
454 mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
455 connect(aLabelWgt, SIGNAL(showConstraintToggled(bool)),
456 mySketchMgr, SLOT(onShowConstraintsToggle(bool)));
458 } else if (theType == "sketch-2dpoint_selector") {
459 PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
460 aPointWgt->setWorkshop(aWorkshop);
461 aPointWgt->setSketch(mySketchMgr->activeSketch());
462 connect(aPointWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));
464 } if (theType == "point2ddistance") {
465 PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
466 aDistanceWgt->setWorkshop(aWorkshop);
467 aDistanceWgt->setSketch(mySketchMgr->activeSketch());
469 } if (theType == "sketch_shape_selector") {
470 PartSet_WidgetShapeSelector* aShapeSelectorWgt =
471 new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
472 aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
473 aWgt = aShapeSelectorWgt;
474 } if (theType == "sketch_constraint_shape_selector") {
475 PartSet_WidgetConstraintShapeSelector* aConstraintShapeSelectorWgt =
476 new PartSet_WidgetConstraintShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
477 aConstraintShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
478 aWgt = aConstraintShapeSelectorWgt;
479 } if (theType == WDG_DOUBLEVALUE_EDITOR) {
480 aWgt = new PartSet_WidgetEditor(theParent, workshop(), theWidgetApi, theParentId);
486 bool PartSet_Module::deleteObjects()
488 // 1. check whether the delete should be processed in the module
489 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
490 bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation),
491 isNestedOp = PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
492 if (!isSketchOp && !isNestedOp)
495 // 2. find selected presentations
496 // selected objects should be collected before the current operation abort because
497 // the abort leads to selection lost on constraint objects. It can be corrected after #386 issue
498 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
499 XGUI_Workshop* aWorkshop = aConnector->workshop();
500 ModuleBase_ISelection* aSel = workshop()->selection();
501 QObjectPtrList aSelectedObj = aSel->selectedPresentations();
502 // if there are no selected objects in the viewer, that means that the selection in another
503 // place cased this method. It is necessary to return the false value to understande in above
504 // method that delete is not processed
505 if (aSelectedObj.count() == 0)
508 // the active nested sketch operation should be aborted unconditionally
510 anOperation->abort();
512 // 3. start operation
513 QString aDescription = aWorkshop->contextMenuMgr()->action("DELETE_CMD")->text();
514 SessionPtr aMgr = ModelAPI_Session::get();
515 aMgr->startOperation(aDescription.toStdString());
517 // 4. delete features
518 // sketch feature should be skipped, only sub-features can be removed
519 // when sketch operation is active
520 std::set<FeaturePtr> anIgnoredFeatures;
521 anIgnoredFeatures.insert(mySketchMgr->activeSketch());
522 aWorkshop->deleteFeatures(aSelectedObj, anIgnoredFeatures);
525 aWorkshop->displayer()->updateViewer();
526 aMgr->finishOperation();
532 void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS)
534 Handle(AIS_InteractiveObject) anAIS = theAIS->impl<Handle(AIS_InteractiveObject)>();
535 if (!anAIS.IsNull()) {
536 Handle(AIS_InteractiveContext) aCtx = anAIS->GetContext();
537 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAIS);
538 if (!aDim.IsNull()) {
539 aCtx->SetZLayer(aDim, myVisualLayerId);
541 Handle(SketcherPrs_SymbolPrs) aCons = Handle(SketcherPrs_SymbolPrs)::DownCast(anAIS);
543 aCtx->SetZLayer(aCons, myVisualLayerId);
548 void PartSet_Module::onViewTransformed(int theTrsfType)
550 // Set length of arrows constant in pixel size
551 // if the operation is panning or rotate or panglobal then do nothing
552 if ((theTrsfType == 1) || (theTrsfType == 3) || (theTrsfType == 4))
555 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
556 Handle(V3d_View) aView = aViewer->activeView();
558 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
559 XGUI_Workshop* aWorkshop = aConnector->workshop();
560 XGUI_Displayer* aDisplayer = aWorkshop->displayer();
561 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
563 double aLen = aView->Convert(15);
565 SketcherPrs_Tools::setArrowSize(aLen);
566 bool isModified = false;
567 QList<AISObjectPtr> aPrsList = aDisplayer->displayedPresentations();
568 foreach (AISObjectPtr aAIS, aPrsList) {
569 Handle(AIS_InteractiveObject) aAisObj = aAIS->impl<Handle(AIS_InteractiveObject)>();
571 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(aAisObj);
572 if (!aDim.IsNull()) {
573 aDim->DimensionAspect()->ArrowAspect()->SetLength(aLen);
574 aContext->Redisplay(aDim, false);
579 aDisplayer->updateViewer();