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_WidgetMultiSelector.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 <GeomValidators_Edge.h>
22 #include <GeomValidators_EdgeOrVertex.h>
23 #include <GeomValidators_Face.h>
24 #include <GeomValidators_ConstructionComposite.h>
27 #include <ModelAPI_Object.h>
28 #include <ModelAPI_Events.h>
29 #include <ModelAPI_Validator.h>
30 #include <ModelAPI_Data.h>
31 #include <ModelAPI_Session.h>
32 #include <ModelAPI_ShapeValidator.h>
34 #include <GeomDataAPI_Point2D.h>
35 #include <GeomDataAPI_Point.h>
36 #include <GeomDataAPI_Dir.h>
38 #include <XGUI_Displayer.h>
39 #include <XGUI_Workshop.h>
40 #include <XGUI_OperationMgr.h>
41 #include <XGUI_PropertyPanel.h>
42 #include <XGUI_ModuleConnector.h>
43 #include <XGUI_ContextMenuMgr.h>
44 #include <XGUI_Tools.h>
46 #include <SketchPlugin_Feature.h>
47 #include <SketchPlugin_Sketch.h>
48 #include <SketchPlugin_Line.h>
49 #include <SketchPlugin_Arc.h>
50 #include <SketchPlugin_Circle.h>
51 #include <SketchPlugin_Point.h>
52 #include <SketchPlugin_ConstraintLength.h>
53 #include <SketchPlugin_ConstraintDistance.h>
54 #include <SketchPlugin_ConstraintParallel.h>
55 #include <SketchPlugin_ConstraintPerpendicular.h>
56 #include <SketchPlugin_ConstraintRadius.h>
58 #include <SketcherPrs_SymbolPrs.h>
59 #include <SketcherPrs_Tools.h>
61 #include <Events_Loop.h>
62 #include <Config_PropManager.h>
63 #include <Config_Keywords.h>
65 #include <StdSelect_TypeOfFace.hxx>
66 #include <TopoDS_Vertex.hxx>
68 #include <TopoDS_Shape.hxx>
69 #include <BRep_Tool.hxx>
70 #include <AIS_Dimension.hxx>
73 #include <QMouseEvent>
76 #include <QApplication>
77 #include <QMessageBox>
78 #include <QMainWindow>
80 #include <GeomAlgoAPI_FaceBuilder.h>
81 #include <GeomDataAPI_Dir.h>
87 /*!Create and return new instance of XGUI_Module*/
88 extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(ModuleBase_IWorkshop* theWshop)
90 return new PartSet_Module(theWshop);
93 PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
94 : ModuleBase_IModule(theWshop),
95 myRestartingMode(RM_None), myVisualLayerId(0)
97 mySketchMgr = new PartSet_SketcherMgr(this);
99 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
100 XGUI_Workshop* aWorkshop = aConnector->workshop();
102 XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
103 connect(anOpMgr, SIGNAL(keyEnterReleased()), this, SLOT(onEnterReleased()));
104 connect(anOpMgr, SIGNAL(operationActivatedByPreselection()),
105 this, SLOT(onOperationActivatedByPreselection()));
107 ModuleBase_IViewer* aViewer = theWshop->viewer();
108 connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
109 this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
110 connect(aViewer, SIGNAL(viewTransformed(int)),
111 SLOT(onViewTransformed(int)));
113 myMenuMgr = new PartSet_MenuMgr(this);
116 PartSet_Module::~PartSet_Module()
118 if (!myDocumentShapeFilter.IsNull())
119 myDocumentShapeFilter.Nullify();
122 void PartSet_Module::registerValidators()
124 //Registering of validators
125 SessionPtr aMgr = ModelAPI_Session::get();
126 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
127 aFactory->registerValidator("PartSet_DistanceSelection", new PartSet_DistanceSelection);
128 aFactory->registerValidator("PartSet_LengthSelection", new PartSet_LengthSelection);
129 aFactory->registerValidator("PartSet_PerpendicularSelection", new PartSet_PerpendicularSelection);
130 aFactory->registerValidator("PartSet_ParallelSelection", new PartSet_ParallelSelection);
131 aFactory->registerValidator("PartSet_RadiusSelection", new PartSet_RadiusSelection);
132 aFactory->registerValidator("PartSet_RigidSelection", new PartSet_RigidSelection);
133 aFactory->registerValidator("PartSet_CoincidentSelection", new PartSet_CoincidentSelection);
134 aFactory->registerValidator("PartSet_HVDirSelection", new PartSet_HVDirSelection);
135 aFactory->registerValidator("PartSet_TangentSelection", new PartSet_TangentSelection);
136 aFactory->registerValidator("PartSet_FilletSelection", new PartSet_FilletSelection);
138 aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
139 aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
141 aFactory->registerValidator("GeomValidators_Edge", new GeomValidators_Edge);
142 aFactory->registerValidator("GeomValidators_EdgeOrVertex",
143 new GeomValidators_EdgeOrVertex);
144 aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
146 aFactory->registerValidator("GeomValidators_ConstructionComposite",
147 new GeomValidators_ConstructionComposite);
149 aFactory->registerValidator("PartSet_SketchEntityValidator",
150 new PartSet_SketchEntityValidator);
152 aFactory->registerValidator("PartSet_SameTypeAttr",
153 new PartSet_SameTypeAttrValidator);
156 void PartSet_Module::registerFilters()
158 //Registering of selection filters
159 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
160 ModuleBase_FilterFactory* aFactory = aConnector->selectionFilters();
163 void PartSet_Module::registerProperties()
165 Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
167 Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
168 Config_Prop::Integer, SKETCH_WIDTH);
171 void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation)
173 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
174 mySketchMgr->commitNestedSketch(theOperation);
177 if (theOperation->isEditOperation())
179 // the selection is cleared after commit the create operation
180 // in order to do not use the same selected objects in the restarted operation
181 // for common behaviour, the selection is cleared even if the operation is not restarted
182 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
183 if (!aContext.IsNull())
184 aContext->ClearSelected();
186 /// Restart sketcher operations automatically
187 FeaturePtr aFeature = theOperation->feature();
188 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
189 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
190 if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed ||
191 myRestartingMode == RM_EmptyFeatureUsed)) {
192 myLastOperationId = theOperation->id();
193 myLastFeature = myRestartingMode == RM_LastFeatureUsed ? theOperation->feature() : FeaturePtr();
195 launchOperation(myLastOperationId);
197 breakOperationSequence();
200 void PartSet_Module::breakOperationSequence()
202 myLastOperationId = "";
203 myLastFeature = FeaturePtr();
204 myRestartingMode = RM_None;
207 void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation)
209 breakOperationSequence();
212 void PartSet_Module::sendOperation(ModuleBase_Operation* theOperation)
214 // Install the document filter before any other filter
215 if (myDocumentShapeFilter.IsNull())
216 myDocumentShapeFilter = new PartSet_GlobalFilter(myWorkshop);
217 myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
219 ModuleBase_IModule::sendOperation(theOperation);
222 void PartSet_Module::operationStarted(ModuleBase_Operation* theOperation)
224 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
225 Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
226 aViewer->AddZLayer(myVisualLayerId);
227 mySketchMgr->startSketch(theOperation);
229 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
230 mySketchMgr->startNestedSketch(theOperation);
234 void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
236 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
237 mySketchMgr->stopSketch(theOperation);
238 Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
239 aViewer->RemoveZLayer(myVisualLayerId);
242 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
243 mySketchMgr->stopNestedSketch(theOperation);
245 myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
248 ModuleBase_Operation* PartSet_Module::currentOperation() const
250 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
251 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
252 return anOpMgr->currentOperation();
255 bool PartSet_Module::canUndo() const
257 bool aCanUndo = false;
258 SessionPtr aMgr = ModelAPI_Session::get();
259 if (aMgr->hasModuleDocument() && aMgr->canUndo()) {
260 aCanUndo = !aMgr->isOperation();
261 if (!aCanUndo) // check the enable state additionally by sketch manager
262 aCanUndo = aMgr->canUndo();
267 bool PartSet_Module::canRedo() const
269 bool aCanRedo = false;
270 SessionPtr aMgr = ModelAPI_Session::get();
271 if (aMgr->hasModuleDocument() && aMgr->canRedo()) {
272 aCanRedo = !aMgr->isOperation();
273 if (!aCanRedo) // check the enable state additionally by sketch manager
274 aCanRedo = aMgr->canRedo();
279 bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
281 // the sketch manager put the restriction to the objects display
282 return mySketchMgr->canDisplayObject(theObject);
286 bool PartSet_Module::addViewerItems(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const
288 return myMenuMgr->addViewerItems(theMenu, theStdActions);
291 bool PartSet_Module::isMouseOverWindow()
293 return mySketchMgr->isMouseOverWindow();
296 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
298 ModuleBase_IPropertyPanel* aPanel = theOperation->propertyPanel();
299 if (PartSet_SketcherMgr::isSketchOperation(theOperation) && (theOperation->isEditOperation())) {
300 // we have to manually activate the sketch label in edit mode
301 aPanel->activateWidget(aPanel->modelWidgets().first());
305 // Restart last operation type
306 if ((theOperation->id() == myLastOperationId) && myLastFeature) {
307 ModuleBase_ModelWidget* aWgt = aPanel->activeWidget();
308 if (theOperation->id().toStdString() == SketchPlugin_Line::ID()) {
309 // Initialise new line with first point equal to end of previous
310 PartSet_WidgetPoint2D* aPnt2dWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
312 std::shared_ptr<ModelAPI_Data> aData = myLastFeature->data();
313 std::shared_ptr<GeomDataAPI_Point2D> aPoint =
314 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID()));
316 aPnt2dWgt->setPoint(aPoint->x(), aPoint->y());
317 PartSet_Tools::setConstraints(mySketchMgr->activeSketch(), theOperation->feature(),
318 aWgt->attributeID(), aPoint->x(), aPoint->y());
319 aPanel->activateNextWidget(aPnt2dWgt);
324 // Start editing constraint
325 if (theOperation->isEditOperation()) {
326 // TODO: #391 - to be removed
327 std::string aId = theOperation->id().toStdString();
328 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation) &&
329 PartSet_SketcherMgr::isDistanceOperation(theOperation)) {
330 // Find and activate widget for management of point for dimension line position
331 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
332 foreach (ModuleBase_ModelWidget* aWgt, aWidgets) {
333 PartSet_WidgetPoint2D* aPntWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
335 aPanel->activateWidget(aPntWgt);
345 void PartSet_Module::onSelectionChanged()
347 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
351 bool isSketcherOp = false;
352 // An edit operation is enable only if the current opeation is the sketch operation
353 if (mySketchMgr->activeSketch()) {
354 if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch()))
355 isSketcherOp = PartSet_SketcherMgr::isSketchOperation(aOperation);
358 // Editing of constraints can be done on selection
359 ModuleBase_ISelection* aSelect = myWorkshop->selection();
360 QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
361 if (aSelected.size() == 1) {
362 ModuleBase_ViewerPrs aPrs = aSelected.first();
363 ObjectPtr aObject = aPrs.object();
364 FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
366 std::string aId = aFeature->getKind();
367 if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
368 (aId == SketchPlugin_ConstraintLength::ID()) ||
369 (aId == SketchPlugin_ConstraintDistance::ID())) {
370 editFeature(aFeature);
377 void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
379 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
380 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
381 anOpMgr->onKeyReleased(theEvent);
384 void PartSet_Module::onEnterReleased()
386 myRestartingMode = RM_EmptyFeatureUsed;
389 void PartSet_Module::onOperationActivatedByPreselection()
391 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
392 if(anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
393 // Set final definitions if they are necessary
394 //propertyPanelDefined(aOperation);
396 /// Commit sketcher operations automatically
397 anOperation->commit();
401 void PartSet_Module::onNoMoreWidgets()
403 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
405 if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
406 if (myRestartingMode != RM_Forbided)
407 myRestartingMode = RM_LastFeatureUsed;
408 anOperation->commit();
413 void PartSet_Module::onVertexSelected()
415 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
416 if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
417 /// If last line finished on vertex the lines creation sequence has to be break
418 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
419 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
420 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
421 QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
422 bool aFoundWidget = false;
423 bool aFoundObligatory = false;
424 for (; anIt != aLast && !aFoundObligatory; anIt++) {
426 aFoundWidget = *anIt == anActiveWidget;
428 aFoundObligatory = (*anIt)->isObligatory();
430 if (!aFoundObligatory)
431 myRestartingMode = RM_Forbided;
435 ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
436 Config_WidgetAPI* theWidgetApi, std::string theParentId)
438 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
439 XGUI_Workshop* aWorkshop = aConnector->workshop();
440 ModuleBase_ModelWidget* aWgt = NULL;
441 if (theType == "sketch-start-label") {
442 PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent,
443 theWidgetApi, theParentId, mySketchMgr->isConstraintsShown());
444 aLabelWgt->setWorkshop(aWorkshop);
445 connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
446 mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
447 connect(aLabelWgt, SIGNAL(showConstraintToggled(bool)),
448 mySketchMgr, SLOT(onShowConstraintsToggle(bool)));
450 } else if (theType == "sketch-2dpoint_selector") {
451 PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
452 aPointWgt->setWorkshop(aWorkshop);
453 aPointWgt->setSketch(mySketchMgr->activeSketch());
454 connect(aPointWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));
456 } if (theType == "point2ddistance") {
457 PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
458 aDistanceWgt->setWorkshop(aWorkshop);
459 aDistanceWgt->setSketch(mySketchMgr->activeSketch());
461 } if (theType == "sketch_shape_selector") {
462 PartSet_WidgetShapeSelector* aShapeSelectorWgt =
463 new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
464 aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
465 aWgt = aShapeSelectorWgt;
466 } if (theType == "sketch_multi_selector") {
467 PartSet_WidgetMultiSelector* aShapeSelectorWgt =
468 new PartSet_WidgetMultiSelector(theParent, workshop(), theWidgetApi, theParentId);
469 aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
470 aWgt = aShapeSelectorWgt;
472 if (theType == WDG_DOUBLEVALUE_EDITOR) {
473 aWgt = new PartSet_WidgetEditor(theParent, workshop(), theWidgetApi, theParentId);
479 bool PartSet_Module::deleteObjects()
481 // 1. check whether the delete should be processed in the module
482 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
483 bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation),
484 isNestedOp = PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
485 if (!isSketchOp && !isNestedOp)
488 // 2. find selected presentations
489 // selected objects should be collected before the current operation abort because
490 // the abort leads to selection lost on constraint objects. It can be corrected after #386 issue
491 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
492 XGUI_Workshop* aWorkshop = aConnector->workshop();
493 ModuleBase_ISelection* aSel = workshop()->selection();
494 QObjectPtrList aSelectedObj = aSel->selectedPresentations();
495 // if there are no selected objects in the viewer, that means that the selection in another
496 // place cased this method. It is necessary to return the false value to understande in above
497 // method that delete is not processed
498 if (aSelectedObj.count() == 0)
501 // avoid delete of the objects, which are not belong to the current sketch
502 // in order to do not delete results of other sketches
503 QObjectPtrList aSketchObjects;
504 QObjectPtrList::const_iterator anIt = aSelectedObj.begin(), aLast = aSelectedObj.end();
505 for ( ; anIt != aLast; anIt++) {
506 ObjectPtr anObject = *anIt;
507 if (mySketchMgr->isObjectOfSketch(anObject))
508 aSketchObjects.append(anObject);
510 // if the selection contains only local selected presentations from other sketches,
511 // the Delete operation should not be done at all
512 if (aSketchObjects.size() == 0)
515 // the active nested sketch operation should be aborted unconditionally
517 anOperation->abort();
519 // 3. start operation
520 QString aDescription = aWorkshop->contextMenuMgr()->action("DELETE_CMD")->text();
521 SessionPtr aMgr = ModelAPI_Session::get();
522 aMgr->startOperation(aDescription.toStdString());
524 // 4. delete features
525 // sketch feature should be skipped, only sub-features can be removed
526 // when sketch operation is active
527 std::set<FeaturePtr> anIgnoredFeatures;
528 anIgnoredFeatures.insert(mySketchMgr->activeSketch());
529 aWorkshop->deleteFeatures(aSketchObjects, anIgnoredFeatures);
532 aWorkshop->displayer()->updateViewer();
533 aMgr->finishOperation();
539 void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS)
541 Handle(AIS_InteractiveObject) anAIS = theAIS->impl<Handle(AIS_InteractiveObject)>();
542 if (!anAIS.IsNull()) {
543 Handle(AIS_InteractiveContext) aCtx = anAIS->GetContext();
544 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAIS);
545 if (!aDim.IsNull()) {
546 aCtx->SetZLayer(aDim, myVisualLayerId);
548 Handle(SketcherPrs_SymbolPrs) aCons = Handle(SketcherPrs_SymbolPrs)::DownCast(anAIS);
550 aCtx->SetZLayer(aCons, myVisualLayerId);
555 void PartSet_Module::onViewTransformed(int theTrsfType)
557 // Set length of arrows constant in pixel size
558 // if the operation is panning or rotate or panglobal then do nothing
559 if ((theTrsfType == 1) || (theTrsfType == 3) || (theTrsfType == 4))
562 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
563 Handle(V3d_View) aView = aViewer->activeView();
565 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
566 XGUI_Workshop* aWorkshop = aConnector->workshop();
567 XGUI_Displayer* aDisplayer = aWorkshop->displayer();
568 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
570 double aLen = aView->Convert(15);
572 SketcherPrs_Tools::setArrowSize(aLen);
573 bool isModified = false;
574 QList<AISObjectPtr> aPrsList = aDisplayer->displayedPresentations();
575 foreach (AISObjectPtr aAIS, aPrsList) {
576 Handle(AIS_InteractiveObject) aAisObj = aAIS->impl<Handle(AIS_InteractiveObject)>();
578 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(aAisObj);
579 if (!aDim.IsNull()) {
580 aDim->DimensionAspect()->ArrowAspect()->SetLength(aLen);
581 aContext->Redisplay(aDim, false);
586 aDisplayer->updateViewer();