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::operationStarted(ModuleBase_Operation* theOperation)
214 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
215 Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
216 aViewer->AddZLayer(myVisualLayerId);
217 mySketchMgr->startSketch(theOperation);
219 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
220 mySketchMgr->startNestedSketch(theOperation);
223 if (myDocumentShapeFilter.IsNull())
224 myDocumentShapeFilter = new PartSet_GlobalFilter(myWorkshop);
225 myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
228 void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
230 if (PartSet_SketcherMgr::isSketchOperation(theOperation)) {
231 mySketchMgr->stopSketch(theOperation);
232 Handle(V3d_Viewer) aViewer = myWorkshop->viewer()->AISContext()->CurrentViewer();
233 aViewer->RemoveZLayer(myVisualLayerId);
236 else if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation)) {
237 mySketchMgr->stopNestedSketch(theOperation);
239 myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
242 ModuleBase_Operation* PartSet_Module::currentOperation() const
244 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
245 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
246 return anOpMgr->currentOperation();
249 bool PartSet_Module::canUndo() const
251 bool aCanUndo = false;
252 SessionPtr aMgr = ModelAPI_Session::get();
253 if (aMgr->hasModuleDocument() && aMgr->canUndo()) {
254 aCanUndo = !aMgr->isOperation();
255 if (!aCanUndo) // check the enable state additionally by sketch manager
256 aCanUndo = aMgr->canUndo();
261 bool PartSet_Module::canRedo() const
263 bool aCanRedo = false;
264 SessionPtr aMgr = ModelAPI_Session::get();
265 if (aMgr->hasModuleDocument() && aMgr->canRedo()) {
266 aCanRedo = !aMgr->isOperation();
267 if (!aCanRedo) // check the enable state additionally by sketch manager
268 aCanRedo = aMgr->canRedo();
273 bool PartSet_Module::canDisplayObject(const ObjectPtr& theObject) const
275 // the sketch manager put the restriction to the objects display
276 return mySketchMgr->canDisplayObject(theObject);
280 bool PartSet_Module::addViewerItems(QMenu* theMenu, const QMap<QString, QAction*>& theStdActions) const
282 return myMenuMgr->addViewerItems(theMenu, theStdActions);
285 bool PartSet_Module::isMouseOverWindow()
287 return mySketchMgr->isMouseOverWindow();
290 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
292 ModuleBase_IPropertyPanel* aPanel = theOperation->propertyPanel();
293 if (PartSet_SketcherMgr::isSketchOperation(theOperation) && (theOperation->isEditOperation())) {
294 // we have to manually activate the sketch label in edit mode
295 aPanel->activateWidget(aPanel->modelWidgets().first());
299 // Restart last operation type
300 if ((theOperation->id() == myLastOperationId) && myLastFeature) {
301 ModuleBase_ModelWidget* aWgt = aPanel->activeWidget();
302 if (theOperation->id().toStdString() == SketchPlugin_Line::ID()) {
303 // Initialise new line with first point equal to end of previous
304 PartSet_WidgetPoint2D* aPnt2dWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
306 std::shared_ptr<ModelAPI_Data> aData = myLastFeature->data();
307 std::shared_ptr<GeomDataAPI_Point2D> aPoint =
308 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID()));
310 aPnt2dWgt->setPoint(aPoint->x(), aPoint->y());
311 PartSet_Tools::setConstraints(mySketchMgr->activeSketch(), theOperation->feature(),
312 aWgt->attributeID(), aPoint->x(), aPoint->y());
313 aPanel->activateNextWidget(aPnt2dWgt);
318 // Start editing constraint
319 if (theOperation->isEditOperation()) {
320 // TODO: #391 - to be removed
321 std::string aId = theOperation->id().toStdString();
322 if (PartSet_SketcherMgr::isNestedSketchOperation(theOperation) &&
323 PartSet_SketcherMgr::isDistanceOperation(theOperation)) {
324 // Find and activate widget for management of point for dimension line position
325 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
326 foreach (ModuleBase_ModelWidget* aWgt, aWidgets) {
327 PartSet_WidgetPoint2D* aPntWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
329 aPanel->activateWidget(aPntWgt);
339 void PartSet_Module::onSelectionChanged()
341 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
345 bool isSketcherOp = false;
346 // An edit operation is enable only if the current opeation is the sketch operation
347 if (mySketchMgr->activeSketch()) {
348 if (PartSet_Tools::sketchPlane(mySketchMgr->activeSketch()))
349 isSketcherOp = PartSet_SketcherMgr::isSketchOperation(aOperation);
352 // Editing of constraints can be done on selection
353 ModuleBase_ISelection* aSelect = myWorkshop->selection();
354 QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
355 if (aSelected.size() == 1) {
356 ModuleBase_ViewerPrs aPrs = aSelected.first();
357 ObjectPtr aObject = aPrs.object();
358 FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
360 std::string aId = aFeature->getKind();
361 if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
362 (aId == SketchPlugin_ConstraintLength::ID()) ||
363 (aId == SketchPlugin_ConstraintDistance::ID())) {
364 editFeature(aFeature);
371 void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
373 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
374 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
375 anOpMgr->onKeyReleased(theEvent);
378 void PartSet_Module::onEnterReleased()
380 myRestartingMode = RM_EmptyFeatureUsed;
383 void PartSet_Module::onOperationActivatedByPreselection()
385 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
386 if(anOperation && PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
387 // Set final definitions if they are necessary
388 //propertyPanelDefined(aOperation);
390 /// Commit sketcher operations automatically
391 anOperation->commit();
395 void PartSet_Module::onNoMoreWidgets()
397 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
399 if (PartSet_SketcherMgr::isNestedSketchOperation(anOperation)) {
400 if (myRestartingMode != RM_Forbided)
401 myRestartingMode = RM_LastFeatureUsed;
402 anOperation->commit();
407 void PartSet_Module::onVertexSelected()
409 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
410 if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
411 /// If last line finished on vertex the lines creation sequence has to be break
412 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
413 ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
414 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
415 QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
416 bool aFoundWidget = false;
417 bool aFoundObligatory = false;
418 for (; anIt != aLast && !aFoundObligatory; anIt++) {
420 aFoundWidget = *anIt == anActiveWidget;
422 aFoundObligatory = (*anIt)->isObligatory();
424 if (!aFoundObligatory)
425 myRestartingMode = RM_Forbided;
429 ModuleBase_ModelWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
430 Config_WidgetAPI* theWidgetApi, std::string theParentId)
432 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
433 XGUI_Workshop* aWorkshop = aConnector->workshop();
434 ModuleBase_ModelWidget* aWgt = NULL;
435 if (theType == "sketch-start-label") {
436 PartSet_WidgetSketchLabel* aLabelWgt = new PartSet_WidgetSketchLabel(theParent,
437 theWidgetApi, theParentId, mySketchMgr->isConstraintsShown());
438 aLabelWgt->setWorkshop(aWorkshop);
439 connect(aLabelWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
440 mySketchMgr, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
441 connect(aLabelWgt, SIGNAL(showConstraintToggled(bool)),
442 mySketchMgr, SLOT(onShowConstraintsToggle(bool)));
444 } else if (theType == "sketch-2dpoint_selector") {
445 PartSet_WidgetPoint2D* aPointWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
446 aPointWgt->setWorkshop(aWorkshop);
447 aPointWgt->setSketch(mySketchMgr->activeSketch());
448 connect(aPointWgt, SIGNAL(vertexSelected()), this, SLOT(onVertexSelected()));
450 } if (theType == "point2ddistance") {
451 PartSet_WidgetPoint2dDistance* aDistanceWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
452 aDistanceWgt->setWorkshop(aWorkshop);
453 aDistanceWgt->setSketch(mySketchMgr->activeSketch());
455 } if (theType == "sketch_shape_selector") {
456 PartSet_WidgetShapeSelector* aShapeSelectorWgt =
457 new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
458 aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
459 aWgt = aShapeSelectorWgt;
460 } if (theType == "sketch_multi_selector") {
461 PartSet_WidgetMultiSelector* aShapeSelectorWgt =
462 new PartSet_WidgetMultiSelector(theParent, workshop(), theWidgetApi, theParentId);
463 aShapeSelectorWgt->setSketcher(mySketchMgr->activeSketch());
464 aWgt = aShapeSelectorWgt;
466 if (theType == WDG_DOUBLEVALUE_EDITOR) {
467 aWgt = new PartSet_WidgetEditor(theParent, workshop(), theWidgetApi, theParentId);
473 bool PartSet_Module::deleteObjects()
475 // 1. check whether the delete should be processed in the module
476 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
477 bool isSketchOp = PartSet_SketcherMgr::isSketchOperation(anOperation),
478 isNestedOp = PartSet_SketcherMgr::isNestedSketchOperation(anOperation);
479 if (!isSketchOp && !isNestedOp)
482 // 2. find selected presentations
483 // selected objects should be collected before the current operation abort because
484 // the abort leads to selection lost on constraint objects. It can be corrected after #386 issue
485 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
486 XGUI_Workshop* aWorkshop = aConnector->workshop();
487 ModuleBase_ISelection* aSel = workshop()->selection();
488 QObjectPtrList aSelectedObj = aSel->selectedPresentations();
489 // if there are no selected objects in the viewer, that means that the selection in another
490 // place cased this method. It is necessary to return the false value to understande in above
491 // method that delete is not processed
492 if (aSelectedObj.count() == 0)
495 // avoid delete of the objects, which are not belong to the current sketch
496 // in order to do not delete results of other sketches
497 QObjectPtrList aSketchObjects;
498 QObjectPtrList::const_iterator anIt = aSelectedObj.begin(), aLast = aSelectedObj.end();
499 for ( ; anIt != aLast; anIt++) {
500 ObjectPtr anObject = *anIt;
501 if (mySketchMgr->isObjectOfSketch(anObject))
502 aSketchObjects.append(anObject);
504 // if the selection contains only local selected presentations from other sketches,
505 // the Delete operation should not be done at all
506 if (aSketchObjects.size() == 0)
509 // the active nested sketch operation should be aborted unconditionally
511 anOperation->abort();
513 // 3. start operation
514 QString aDescription = aWorkshop->contextMenuMgr()->action("DELETE_CMD")->text();
515 SessionPtr aMgr = ModelAPI_Session::get();
516 aMgr->startOperation(aDescription.toStdString());
518 // 4. delete features
519 // sketch feature should be skipped, only sub-features can be removed
520 // when sketch operation is active
521 std::set<FeaturePtr> anIgnoredFeatures;
522 anIgnoredFeatures.insert(mySketchMgr->activeSketch());
523 aWorkshop->deleteFeatures(aSketchObjects, anIgnoredFeatures);
526 aWorkshop->displayer()->updateViewer();
527 aMgr->finishOperation();
533 void PartSet_Module::onObjectDisplayed(ObjectPtr theObject, AISObjectPtr theAIS)
535 Handle(AIS_InteractiveObject) anAIS = theAIS->impl<Handle(AIS_InteractiveObject)>();
536 if (!anAIS.IsNull()) {
537 Handle(AIS_InteractiveContext) aCtx = anAIS->GetContext();
538 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(anAIS);
539 if (!aDim.IsNull()) {
540 aCtx->SetZLayer(aDim, myVisualLayerId);
542 Handle(SketcherPrs_SymbolPrs) aCons = Handle(SketcherPrs_SymbolPrs)::DownCast(anAIS);
544 aCtx->SetZLayer(aCons, myVisualLayerId);
549 void PartSet_Module::onViewTransformed(int theTrsfType)
551 // Set length of arrows constant in pixel size
552 // if the operation is panning or rotate or panglobal then do nothing
553 if ((theTrsfType == 1) || (theTrsfType == 3) || (theTrsfType == 4))
556 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
557 Handle(V3d_View) aView = aViewer->activeView();
559 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
560 XGUI_Workshop* aWorkshop = aConnector->workshop();
561 XGUI_Displayer* aDisplayer = aWorkshop->displayer();
562 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
564 double aLen = aView->Convert(15);
566 SketcherPrs_Tools::setArrowSize(aLen);
567 bool isModified = false;
568 QList<AISObjectPtr> aPrsList = aDisplayer->displayedPresentations();
569 foreach (AISObjectPtr aAIS, aPrsList) {
570 Handle(AIS_InteractiveObject) aAisObj = aAIS->impl<Handle(AIS_InteractiveObject)>();
572 Handle(AIS_Dimension) aDim = Handle(AIS_Dimension)::DownCast(aAisObj);
573 if (!aDim.IsNull()) {
574 aDim->DimensionAspect()->ArrowAspect()->SetLength(aLen);
575 aContext->Redisplay(aDim, false);
580 aDisplayer->updateViewer();