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_DistanceValidator", new PartSet_DistanceValidator);
134 aFactory->registerValidator("PartSet_LengthValidator", new PartSet_LengthValidator);
135 aFactory->registerValidator("PartSet_PerpendicularValidator", new PartSet_PerpendicularValidator);
136 aFactory->registerValidator("PartSet_ParallelValidator", new PartSet_ParallelValidator);
137 aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
138 aFactory->registerValidator("PartSet_RigidValidator", new PartSet_RigidValidator);
139 aFactory->registerValidator("PartSet_DifferentObjects", new PartSet_DifferentObjectsValidator);
140 aFactory->registerValidator("PartSet_DifferentShapes", new ModelAPI_ShapeValidator);
142 aFactory->registerValidator("GeomValidators_Edge", new GeomValidators_Edge);
143 aFactory->registerValidator("GeomValidators_EdgeOrVertex",
144 new GeomValidators_EdgeOrVertex);
145 aFactory->registerValidator("GeomValidators_Face", new GeomValidators_Face);
147 aFactory->registerValidator("GeomValidators_ConstructionComposite",
148 new GeomValidators_ConstructionComposite);
150 aFactory->registerValidator("PartSet_SketchEntityValidator",
151 new PartSet_SketchEntityValidator);
153 aFactory->registerValidator("PartSet_SameTypeAttr",
154 new PartSet_SameTypeAttrValidator);
157 void PartSet_Module::registerFilters()
159 //Registering of selection filters
160 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
161 ModuleBase_FilterFactory* aFactory = aConnector->selectionFilters();
163 //aFactory->registerFilter("EdgeFilter", new ModuleBase_FilterLinearEdge);
164 //aFactory->registerFilter("FaceFilter", new ModuleBase_FilterFace);
165 //aFactory->registerFilter("MultiFilter", new ModuleBase_FilterMulti);
166 //Handle(SelectMgr_Filter) aSelectFilter = new ModuleBase_FilterNoConsructionSubShapes(workshop());
167 //aFactory->registerFilter("NoConstructionSubShapesFilter",
168 // new ModuleBase_FilterCustom(aSelectFilter));
169 //Handle(SelectMgr_Filter) aSelectFilter = new PartSet_FilterSketchEntity(workshop());
170 //aFactory->registerFilter("SketchEntityFilter", new ModuleBase_FilterCustom(aSelectFilter));
173 void PartSet_Module::registerProperties()
175 Config_PropManager::registerProp("Sketch planes", "planes_size", "Size", Config_Prop::Double,
177 Config_PropManager::registerProp("Sketch planes", "planes_thickness", "Thickness",
178 Config_Prop::Integer, SKETCH_WIDTH);
181 void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation)
183 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
184 mySketchMgr->commitNestedSketch(theOperation);
187 if (theOperation->isEditOperation())
189 // the selection is cleared after commit the create operation
190 // in order to do not use the same selected objects in the restarted operation
191 // for common behaviour, the selection is cleared even if the operation is not restarted
192 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
193 if (!aContext.IsNull())
194 aContext->ClearSelected();
196 /// Restart sketcher operations automatically
197 FeaturePtr aFeature = theOperation->feature();
198 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
199 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
200 if (aSPFeature && (myRestartingMode == RM_LastFeatureUsed ||
201 myRestartingMode == RM_EmptyFeatureUsed)) {
202 myLastOperationId = theOperation->id();
203 myLastFeature = myRestartingMode == RM_LastFeatureUsed ? theOperation->feature() : FeaturePtr();
205 launchOperation(myLastOperationId);
207 breakOperationSequence();
210 void PartSet_Module::breakOperationSequence()
212 myLastOperationId = "";
213 myLastFeature = FeaturePtr();
214 myRestartingMode = RM_None;
217 void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation)
219 breakOperationSequence();
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);
233 if (myDocumentShapeFilter.IsNull())
234 myDocumentShapeFilter = new PartSet_GlobalFilter(myWorkshop);
235 myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
238 void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
240 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
241 mySketchMgr->stopSketch(theOperation);
242 Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
243 aViewer->RemoveZLayer(myVisualLayerId);
246 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
247 mySketchMgr->stopNestedSketch(theOperation);
249 myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
252 ModuleBase_Operation* PartSet_Module::currentOperation() const
254 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
255 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
256 return anOpMgr->currentOperation();
259 bool PartSet_Module::canUndo() const
261 bool aCanUndo = false;
262 SessionPtr aMgr = ModelAPI_Session::get();
263 if (aMgr->hasModuleDocument() && aMgr->canUndo()) {
264 aCanUndo = !aMgr->isOperation();
265 if (!aCanUndo) // check the enable state additionally by sketch manager
266 aCanUndo = aMgr->canUndo();
271 bool PartSet_Module::canRedo() const
273 bool aCanRedo = false;
274 SessionPtr aMgr = ModelAPI_Session::get();
275 if (aMgr->hasModuleDocument() && aMgr->canRedo()) {
276 aCanRedo = !aMgr->isOperation();
277 if (!aCanRedo) // check the enable state additionally by sketch manager
278 aCanRedo = aMgr->canRedo();
283 bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
285 // the sketch manager put the restriction to the objects display
286 return mySketchMgr->canDisplayObject(theObject);
290 bool PartSet_Module::addViewerItems(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const
292 return myMenuMgr->addViewerItems(theMenu, theStdActions);
295 bool PartSet_Module::isMouseOverWindow()
297 return mySketchMgr->isMouseOverWindow();
300 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
302 ModuleBase_IPropertyPanel* aPanel = theOperation->propertyPanel();
303 if (PartSet_SketcherMgr::isSketchOperation(theOperation) && (theOperation->isEditOperation())) {
304 // we have to manually activate the sketch label in edit mode
305 aPanel->activateWidget(aPanel->modelWidgets().first());
309 // Restart last operation type
310 if ((theOperation->id() == myLastOperationId) && myLastFeature) {
311 ModuleBase_ModelWidget* aWgt = aPanel->activeWidget();
312 if (theOperation->id().toStdString() == SketchPlugin_Line::ID()) {
313 // Initialise new line with first point equal to end of previous
314 PartSet_WidgetPoint2D* aPnt2dWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
316 std::shared_ptr<ModelAPI_Data> aData = myLastFeature->data();
317 std::shared_ptr<GeomDataAPI_Point2D> aPoint =
318 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID()));
320 aPnt2dWgt->setPoint(aPoint->x(), aPoint->y());
321 PartSet_Tools::setConstraints(mySketchMgr->activeSketch(), theOperation->feature(),
322 aWgt->attributeID(), aPoint->x(), aPoint->y());
323 aPanel->activateNextWidget(aPnt2dWgt);
328 // Start editing constraint
329 if (theOperation->isEditOperation()) {
330 // TODO: #391 - to be removed
331 std::string aId = theOperation->id().toStdString();
332 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation) &&
333 PartSet_SketcherMgr::isDistanceOperation(theOperation)) {
334 // Find and activate widget for management of point for dimension line position
335 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
336 foreach (ModuleBase_ModelWidget* aWgt, aWidgets) {
337 PartSet_WidgetPoint2D* aPntWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
339 aPanel->activateWidget(aPntWgt);
349 void PartSet_Module::onSelectionChanged()
351 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
355 bool isSketcherOp = false;
356 // An edit operation is enable only if the current opeation is the sketch operation
357 if (mySketchMgr->activeSketch()) {
358 if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch()))
359 isSketcherOp = PartSet_SketcherMgr::isSketchOperation(aOperation);
362 // Editing of constraints can be done on selection
363 ModuleBase_ISelection* aSelect = myWorkshop->selection();
364 QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
365 if (aSelected.size() == 1) {
366 ModuleBase_ViewerPrs aPrs = aSelected.first();
367 ObjectPtr aObject = aPrs.object();
368 FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
370 std::string aId = aFeature->getKind();
371 if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
372 (aId == SketchPlugin_ConstraintLength::ID()) ||
373 (aId == SketchPlugin_ConstraintDistance::ID())) {
374 editFeature(aFeature);
381 void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
383 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
384 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
385 anOpMgr->onKeyReleased(theEvent);
388 void PartSet_Module::onEnterReleased()
390 myRestartingMode = RM_EmptyFeatureUsed;
393 void PartSet_Module::onOperationActivatedByPreselection()
395 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
396 if(anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
397 // Set final definitions if they are necessary
398 //propertyPanelDefined(aOperation);
400 /// Commit sketcher operations automatically
401 anOperation->commit();
405 void PartSet_Module::onNoMoreWidgets()
407 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
409 if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
410 if (myRestartingMode != RM_Forbided)
411 myRestartingMode = RM_LastFeatureUsed;
412 anOperation->commit();
417 void PartSet_Module::onVertexSelected()
419 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
420 if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
421 /// If last line finished on vertex the lines creation sequence has to be break
422 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
423 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
424 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
425 QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
426 bool aFoundWidget = false;
427 bool aFoundObligatory = false;
428 for (; anIt != aLast && !aFoundObligatory; anIt++) {
430 aFoundWidget = *anIt == anActiveWidget;
432 aFoundObligatory = (*anIt)->isObligatory();
434 if (!aFoundObligatory)
435 myRestartingMode = RM_Forbided;
439 ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
440 Config_WidgetAPI* theWidgetApi, std::string theParentId)
442 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
443 XGUI_Workshop* aWorkshop = aConnector->workshop();
444 ModuleBase_ModelWidget* aWgt = NULL;
445 if (theType == "sketch-start-label") {
446 PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent,
447 theWidgetApi, theParentId, mySketchMgr->isConstraintsShown());
448 aLabelWgt->setWorkshop(aWorkshop);
449 connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
450 mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
451 connect(aLabelWgt, SIGNAL(showConstraintToggled(bool)),
452 mySketchMgr, SLOT(onShowConstraintsToggle(bool)));
454 } else if (theType == "sketch-2dpoint_selector") {
455 PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
456 aPointWgt->setWorkshop(aWorkshop);
457 aPointWgt->setSketch(mySketchMgr->activeSketch());
458 connect(aPointWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));
460 } if (theType == "point2ddistance") {
461 PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
462 aDistanceWgt->setWorkshop(aWorkshop);
463 aDistanceWgt->setSketch(mySketchMgr->activeSketch());
465 } if (theType == "sketch_shape_selector") {
466 PartSet_WidgetShapeSelector* aShapeSelectorWgt =
467 new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
468 aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
469 aWgt = aShapeSelectorWgt;
470 } if (theType == "sketch_constraint_shape_selector") {
471 PartSet_WidgetConstraintShapeSelector* aConstraintShapeSelectorWgt =
472 new PartSet_WidgetConstraintShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
473 aConstraintShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
474 aWgt = aConstraintShapeSelectorWgt;
475 } if (theType == WDG_DOUBLEVALUE_EDITOR) {
476 aWgt = new PartSet_WidgetEditor(theParent, workshop(), theWidgetApi, theParentId);
482 bool PartSet_Module::deleteObjects()
484 // 1. check whether the delete should be processed in the module
485 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
486 bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation),
487 isNestedOp = PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
488 if (!isSketchOp && !isNestedOp)
491 // 2. find selected presentations
492 // selected objects should be collected before the current operation abort because
493 // the abort leads to selection lost on constraint objects. It can be corrected after #386 issue
494 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
495 XGUI_Workshop* aWorkshop = aConnector->workshop();
496 ModuleBase_ISelection* aSel = workshop()->selection();
497 QObjectPtrList aSelectedObj = aSel->selectedPresentations();
498 // if there are no selected objects in the viewer, that means that the selection in another
499 // place cased this method. It is necessary to return the false value to understande in above
500 // method that delete is not processed
501 if (aSelectedObj.count() == 0)
504 // the active nested sketch operation should be aborted unconditionally
506 anOperation->abort();
508 // 3. start operation
509 QString aDescription = aWorkshop->contextMenuMgr()->action("DELETE_CMD")->text();
510 SessionPtr aMgr = ModelAPI_Session::get();
511 aMgr->startOperation(aDescription.toStdString());
513 // 4. delete features
514 // sketch feature should be skipped, only sub-features can be removed
515 // when sketch operation is active
516 std::set<FeaturePtr> anIgnoredFeatures;
517 anIgnoredFeatures.insert(mySketchMgr->activeSketch());
518 aWorkshop->deleteFeatures(aSelectedObj, anIgnoredFeatures);
521 aWorkshop->displayer()->updateViewer();
522 aMgr->finishOperation();
528 void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS)
530 Handle(AIS_InteractiveObject) anAIS = theAIS->impl<Handle(AIS_InteractiveObject)>();
531 if (!anAIS.IsNull()) {
532 Handle(AIS_InteractiveContext) aCtx = anAIS->GetContext();
533 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAIS);
534 if (!aDim.IsNull()) {
535 aCtx->SetZLayer(aDim, myVisualLayerId);
537 Handle(SketcherPrs_SymbolPrs) aCons = Handle(SketcherPrs_SymbolPrs)::DownCast(anAIS);
539 aCtx->SetZLayer(aCons, myVisualLayerId);
544 void PartSet_Module::onViewTransformed(int theTrsfType)
546 // Set length of arrows constant in pixel size
547 // if the operation is panning or rotate or panglobal then do nothing
548 if ((theTrsfType == 1) || (theTrsfType == 3) || (theTrsfType == 4))
551 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
552 Handle(V3d_View) aView = aViewer->activeView();
554 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
555 XGUI_Workshop* aWorkshop = aConnector->workshop();
556 XGUI_Displayer* aDisplayer = aWorkshop->displayer();
557 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
559 double aLen = aView->Convert(15);
561 SketcherPrs_Tools::setArrowSize(aLen);
562 bool isModified = false;
563 QList<AISObjectPtr> aPrsList = aDisplayer->displayedPresentations();
564 foreach (AISObjectPtr aAIS, aPrsList) {
565 Handle(AIS_InteractiveObject) aAisObj = aAIS->impl<Handle(AIS_InteractiveObject)>();
567 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(aAisObj);
568 if (!aDim.IsNull()) {
569 aDim->DimensionAspect()->ArrowAspect()->SetLength(aLen);
570 aContext->Redisplay(aDim, false);
575 aDisplayer->updateViewer();