1 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // GEOM GEOMGUI : GUI for Geometry component
23 // File : GEOMToolsGUI_1.cxx
24 // Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
26 #define protected public
28 #include <PyConsole_Console.h>
30 #include "GEOMToolsGUI.h"
31 #include "GEOMToolsGUI_TransparencyDlg.h"
32 #include "GEOMToolsGUI_NbIsosDlg.h"
33 #include "GEOMToolsGUI_DeflectionDlg.h"
34 #include "GEOMToolsGUI_MarkerDlg.h"
35 #include "GEOMToolsGUI_PublishDlg.h"
36 #include "GEOMToolsGUI_MaterialPropertiesDlg.h"
37 #include "GEOMToolsGUI_LineWidthDlg.h"
39 #include <GeometryGUI.h>
40 #include <GeometryGUI_Operations.h>
41 #include <GEOM_Constants.h>
42 #include <GEOM_Displayer.h>
45 #include <GEOM_Actor.h>
47 #include <Basics_OCCTVersion.hxx>
49 #include <SALOME_ListIO.hxx>
50 #include <SALOME_ListIteratorOfListIO.hxx>
55 #include <SVTK_ViewModel.h>
56 #include <SVTK_ViewWindow.h>
57 #include <SVTK_View.h>
59 #include <OCCViewer_ViewModel.h>
61 #include <SUIT_ViewManager.h>
62 #include <SUIT_Desktop.h>
63 #include <SUIT_ResourceMgr.h>
64 #include <SUIT_Session.h>
65 #include <SUIT_OverrideCursor.h>
66 #include <SUIT_MessageBox.h>
67 #include <SUIT_Tools.h>
69 #include <SalomeApp_Application.h>
70 #include <SalomeApp_Study.h>
71 #include <SalomeApp_Module.h>
73 #include <LightApp_SelectionMgr.h>
74 #include <LightApp_NameDlg.h>
76 #include <GEOMImpl_Types.hxx>
78 #include "utilities.h"
81 #include <AIS_Drawer.hxx>
82 #include <Prs3d_IsoAspect.hxx>
83 #include <Prs3d_PointAspect.hxx>
84 #include <Graphic3d_AspectMarker3d.hxx>
85 #include <Graphic3d_AspectLine3d.hxx>
86 #include <AIS_ListIteratorOfListOfInteractive.hxx>
87 #include <AIS_ListOfInteractive.hxx>
90 #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
91 #include <TColStd_HArray1OfByte.hxx>
93 #include <Graphic3d_HArray1OfBytes.hxx>
98 #include <QColorDialog>
99 #include <QInputDialog>
100 #include <QFileDialog>
103 #include <QGridLayout>
106 #include <QPushButton>
110 #include <vtkRenderer.h>
112 void GEOMToolsGUI::OnCheckGeometry()
114 SalomeApp_Application* app =
115 dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication());
116 PyConsole_Console* pyConsole = app->pythonConsole();
119 pyConsole->exec("from GEOM_usinggeom import *");
122 void GEOMToolsGUI::OnAutoColor()
124 SALOME_ListIO selected;
125 SalomeApp_Application* app =
126 dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication());
130 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
131 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
132 if (!aSelMgr || !appStudy)
135 aSelMgr->selectedObjects(selected);
136 if (selected.IsEmpty())
139 Handle(SALOME_InteractiveObject) anIObject = selected.First();
141 _PTR(Study) aStudy = appStudy->studyDS();
142 _PTR(SObject) aMainSObject(aStudy->FindObjectID(anIObject->getEntry()));
143 GEOM::GEOM_Object_var aMainObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aMainSObject));
144 if (CORBA::is_nil(aMainObject))
147 aMainObject->SetAutoColor( true );
149 QList<SALOMEDS::Color> aReservedColors;
151 GEOM_Displayer aDisp (appStudy);
153 SALOME_View* vf = aDisp.GetActiveView();
155 SUIT_ViewWindow* window = app->desktop()->activeWindow();
156 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
157 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
159 for( _PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) ); it->More(); it->Next() )
161 _PTR(SObject) aChildSObject( it->Value() );
162 GEOM::GEOM_Object_var aChildObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aChildSObject));
163 if( CORBA::is_nil( aChildObject ) )
166 if( aChildObject->GetType() != GEOM_GROUP )
169 SALOMEDS::Color aColor = GEOM_Displayer::getUniqueColor( aReservedColors );
170 aChildObject->SetColor( aColor );
171 aReservedColors.append( aColor );
173 QColor c( (int)( aColor.R * 255.0 ), (int)( aColor.G * 255.0 ), (int)( aColor.B * 255.0 ) );
175 SALOME_Prs* aPrs = vf->CreatePrs( aChildSObject->GetID().c_str() );
179 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
182 SVTK_View* aView = vtkVW->getView();
183 SUIT_OverrideCursor();
184 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
185 aView->SetColor( It.Value(), c );
189 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
190 Handle(AIS_InteractiveContext) ic = vm->getAISContext();
192 SOCC_Prs* anOCCPrs = dynamic_cast<SOCC_Prs*>( aPrs );
196 AIS_ListOfInteractive aList;
197 anOCCPrs->GetObjects( aList );
198 if( !aList.Extent() )
201 Handle(AIS_InteractiveObject) io = aList.First();
205 Quantity_Color aQuanColor( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
207 // Set color for a point
208 Handle(AIS_Drawer) aCurDrawer = io->Attributes();
209 Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
210 Quantity_Color aCurColor;
211 Standard_Real aCurScale;
212 Aspect_TypeOfMarker aCurTypeOfMarker;
213 aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
214 if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
215 aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aQuanColor, aCurScale) );
218 Standard_Integer aWidth, aHeight;
219 aCurPointAspect->GetTextureSize( aWidth, aHeight );
221 #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
222 Handle(TColStd_HArray1OfByte) aTexture = aCurPointAspect->GetTexture();
224 Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
227 aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aQuanColor, 1, aWidth, aHeight, aTexture ) );
229 ic->SetLocalAttributes( io, aCurDrawer );
231 io->SetColor( aQuanColor );
232 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) {
233 Handle(GEOM_AISShape) aGAISShape = Handle(GEOM_AISShape)::DownCast( io );
234 aGAISShape->SetShadingColor( aQuanColor );
235 aGAISShape->storeBoundaryColors();
238 io->Redisplay( Standard_True );
242 app->updateActions(); //SRN: To update a Save button in the toolbar
245 void GEOMToolsGUI::OnDisableAutoColor()
247 SALOME_ListIO selected;
248 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
252 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
253 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
254 if( !aSelMgr || !appStudy )
257 aSelMgr->selectedObjects( selected );
258 if( selected.IsEmpty() )
261 Handle(SALOME_InteractiveObject) anIObject = selected.First();
263 _PTR(Study) aStudy = appStudy->studyDS();
264 _PTR(SObject) aMainSObject( aStudy->FindObjectID( anIObject->getEntry() ) );
265 GEOM::GEOM_Object_var aMainObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aMainSObject));
266 if( CORBA::is_nil( aMainObject ) )
269 aMainObject->SetAutoColor( false );
273 void GEOMToolsGUI::OnColor()
275 SALOME_ListIO selected;
276 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
277 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
278 if ( app && appStudy ) {
279 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
281 aSelMgr->selectedObjects( selected );
282 if ( !selected.IsEmpty() ) {
283 SUIT_ViewWindow* window = app->desktop()->activeWindow();
284 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
285 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
286 int mgrId = window->getViewManager()->getGlobalId();
288 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
291 SVTK_View* aView = vtkVW->getView();
292 QColor initcolor = aView->GetColor( selected.First() );
293 QColor c = QColorDialog::getColor( initcolor, app->desktop() );
295 SUIT_OverrideCursor();
296 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
297 aView->SetColor( It.Value(), c );
298 appStudy->setObjectProperty(mgrId,It.Value()->getEntry(),COLOR_PROP, c);
300 GeometryGUI::Modified();
304 Handle(AIS_InteractiveObject) io = GEOMBase::GetAIS( selected.First() );
305 if ( !io.IsNull() ) {
306 Quantity_Color aColor;
308 QColor ic = QColor((int )( aColor.Red() * 255.0 ),
309 (int)( aColor.Green() * 255.0 ),
310 (int)( aColor.Blue() * 255.0 ));
312 QVariant v = appStudy->getObjectProperty(mgrId,selected.First()->getEntry(), COLOR_PROP, ic);
314 QColor initcolor = v.value<QColor>();
315 QColor c = QColorDialog::getColor( initcolor, app->desktop() );
317 SUIT_OverrideCursor();
318 aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
319 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*> ( window->getViewManager()->getViewModel() );
320 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
321 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
322 io = GEOMBase::GetAIS( It.Value(), true );
323 if ( !io.IsNull() ) {
325 if ( io->IsKind( STANDARD_TYPE(AIS_Shape) ) ) {
326 TopoDS_Shape theShape = Handle(AIS_Shape)::DownCast( io )->Shape();
327 bool onlyVertex = (theShape.ShapeType() == TopAbs_VERTEX || GEOM_Displayer::isCompoundOfVertices( theShape ));
329 // Set color for a point
331 Handle(AIS_Drawer) aCurDrawer = io->Attributes();
332 Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
333 Quantity_Color aCurColor;
334 Standard_Real aCurScale;
335 Aspect_TypeOfMarker aCurTypeOfMarker;
336 aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
337 if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
338 aCurDrawer->SetPointAspect(new Prs3d_PointAspect(aCurTypeOfMarker, aColor, aCurScale));
341 Standard_Integer aWidth, aHeight;
342 aCurPointAspect->GetTextureSize( aWidth, aHeight );
344 #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
345 Handle(TColStd_HArray1OfByte) aTexture = aCurPointAspect->GetTexture();
347 Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
350 aCurDrawer->SetPointAspect(new Prs3d_PointAspect(aColor, 1, aWidth, aHeight, aTexture));
352 ic->SetLocalAttributes(io, aCurDrawer, Standard_False);
356 io->SetColor( aColor );
357 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) {
358 Handle(GEOM_AISShape) aGAISShape = Handle(GEOM_AISShape)::DownCast( io );
359 aGAISShape->SetShadingColor( aColor );
360 aGAISShape->storeBoundaryColors();
363 appStudy->setObjectProperty(mgrId,It.Value()->getEntry(), COLOR_PROP, c);
365 io->Redisplay( Standard_True );
367 // store color to GEOM_Object
368 _PTR(Study) aStudy = appStudy->studyDS();
369 _PTR(SObject) aSObject( aStudy->FindObjectID( It.Value()->getEntry() ) );
370 GEOM::GEOM_Object_var anObject =
371 GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObject));
374 SALOMEDS::Color aSColor;
375 aSColor.R = (double)c.red() / 255.0;
376 aSColor.G = (double)c.green() / 255.0;
377 aSColor.B = (double)c.blue() / 255.0;
378 anObject->SetColor( aSColor );
379 anObject->SetAutoColor( false );
382 ic->UpdateCurrentViewer();
383 GeometryGUI::Modified();
385 } // first IO is not null
387 } // if ( selection not empty )
391 app->updateActions(); //SRN: To update a Save button in the toolbar
394 void GEOMToolsGUI::OnTexture()
396 SALOME_ListIO selected;
397 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
398 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
399 if ( app && appStudy ) {
400 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
402 aSelMgr->selectedObjects( selected );
403 if ( !selected.IsEmpty() ) {
404 SUIT_ViewWindow* window = app->desktop()->activeWindow();
405 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
407 QString aTexture = QFileDialog::getOpenFileName(window,tr( "GEOM_SELECT_IMAGE"),QString(), tr("OCC_IMAGE_FILES"));
408 if( !aTexture.isEmpty() )
410 SUIT_OverrideCursor();
411 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*> ( window->getViewManager()->getViewModel() );
412 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
413 Handle(AIS_InteractiveObject) io ;
414 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
415 io = GEOMBase::GetAIS( It.Value(), true );
416 if ( !io.IsNull() ) {
417 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
418 Handle(GEOM_AISShape)::DownCast( io )->SetTextureFileName(TCollection_AsciiString(aTexture.toStdString().c_str()));
419 io->Redisplay( Standard_True );
420 } // if ( !io.IsNull() )
422 ic->UpdateCurrentViewer();
423 GeometryGUI::Modified();
424 GeometryGUI* myGeomGUI = getGeometryGUI();
425 myGeomGUI->OnGUIEvent(GEOMOp::OpTexture);
426 } // if ( !selFile.isEmpty() )
428 } // if ( selection not empty )
432 app->updateActions(); //SRN: To update a Save button in the toolbar
435 void GEOMToolsGUI::OnTransparency()
437 GEOMToolsGUI_TransparencyDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
441 void GEOMToolsGUI::OnChangeTransparency( bool increase )
443 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
446 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
449 SALOME_ListIO selected;
450 aSelMgr->selectedObjects( selected );
451 if ( selected.IsEmpty() )
454 Handle(SALOME_InteractiveObject) FirstIOS = selected.First();
455 if ( FirstIOS.IsNull() )
459 float delta = 0.1; // VSR: 23/11/2010 (transparency value <= 0.05 is ignored)
463 SUIT_ViewWindow* window = app->desktop()->activeWindow();
464 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
465 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
468 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
471 SVTK_View* aView = vtkVW->getView();
473 float transp = aView->GetTransparency(FirstIOS);
475 // Compute new transparency value
476 transp = transp + delta;
479 else if ( transp > 1 )
482 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
483 aView->SetTransparency( It.Value(), transp );
486 GeometryGUI::Modified();
490 GEOMBase* gb = new GEOMBase();
491 Handle(GEOM_AISShape) aisShape;
493 aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, true );
494 if( aisShape.IsNull() )
496 float transp = aisShape->Transparency();
498 // Compute new transparency value
499 transp = transp + delta;
502 else if ( transp > 1 )
505 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
508 Handle(AIS_InteractiveContext) ic = vm->getAISContext();
509 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
510 aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), true );
511 if ( !aisShape.IsNull() ) {
512 ic->SetTransparency( aisShape, transp, false );
513 ic->Redisplay( aisShape, Standard_False, Standard_True );
516 ic->UpdateCurrentViewer();
517 GeometryGUI::Modified();
521 void GEOMToolsGUI::OnNbIsos( ActionType actionType )
523 SalomeApp_Application* app =
524 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
525 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
526 SUIT_ViewWindow* window = app->desktop()->activeWindow();
528 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
529 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
531 if(isOCC){ // if is OCCViewer
533 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
534 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
537 if ( ic->MoreCurrent() ) {
538 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
539 CurObject->restoreIsoNumbers();
540 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
542 int UIso = CurDrawer->UIsoAspect()->Number();
543 int VIso = CurDrawer->VIsoAspect()->Number();
548 if ( actionType == SHOWDLG ) {
549 GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
550 new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
552 NbIsosDlg->setU( UIso );
553 NbIsosDlg->setV( VIso );
555 if ( NbIsosDlg->exec() ) {
556 SUIT_OverrideCursor();
558 newNbUIso = NbIsosDlg->getU();
559 newNbVIso = NbIsosDlg->getV();
563 else if ( actionType == INCR || actionType == DECR ) {
565 if (actionType == DECR)
568 newNbUIso = UIso + delta;
569 newNbVIso = VIso + delta;
571 if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 )
575 for(; ic->MoreCurrent(); ic->NextCurrent()) {
576 int aMgrId = window->getViewManager()->getGlobalId();
577 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
579 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
581 QVariant v = aStudy->getObjectProperty( aMgrId, CurObject->getIO()->getEntry(), EDGE_WIDTH_PROP , QVariant() );
583 int width = v.isValid() ? v.toInt() : 1;
585 CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, width , newNbUIso) );
586 CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, width , newNbVIso) );
588 CurObject->storeIsoNumbers();
590 ic->SetLocalAttributes(CurObject, CurDrawer);
591 ic->Redisplay(CurObject);
593 QString anIsos("%1%2%3");anIsos = anIsos.arg(newNbUIso);anIsos = anIsos.arg(DIGIT_SEPARATOR);anIsos = anIsos.arg(newNbVIso);
594 aStudy->setObjectProperty(aMgrId ,CurObject->getIO()->getEntry(), ISOS_WIDTH_PROP, anIsos);
597 GeometryGUI::Modified();
599 else if(isVTK){ // if is VTKViewer
601 // Warning. It's works incorrect. must be recheked.
603 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >
604 ( SUIT_Session::session()->activeApplication() );
607 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
610 SALOME_ListIO selected;
611 aSelMgr->selectedObjects( selected );
612 if ( selected.IsEmpty() )
615 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
619 SALOME_View* view = GEOM_Displayer::GetActiveView();
621 vtkActorCollection* aCollection = vtkActorCollection::New();
623 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
624 Handle(SALOME_InteractiveObject) anIObject = It.Value();
625 SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() );
626 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( aPrs );
628 vtkActorCollection* anActors = vtkPrs->GetObjects();
629 anActors->InitTraversal();
630 vtkActor* anAct = anActors->GetNextActor();
631 aCollection->AddItem(anAct);
636 aCollection->InitTraversal();
643 vtkActor* anAct = aCollection->GetNextActor();
644 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
645 anActor->RestoreIsoNumbers();
646 anActor->GetNbIsos(UIso,VIso);
654 if ( actionType == SHOWDLG ) {
655 GEOMToolsGUI_NbIsosDlg* NbIsosDlg =
656 new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
658 NbIsosDlg->setU( UIso );
659 NbIsosDlg->setV( VIso );
661 if ( NbIsosDlg->exec() ) {
662 SUIT_OverrideCursor();
664 newNbUIso = NbIsosDlg->getU();
665 newNbVIso = NbIsosDlg->getV();
667 return; //Cancel case
669 else if ( actionType == INCR || actionType == DECR ) {
671 if (actionType == DECR)
674 newNbUIso = UIso + delta;
675 newNbVIso = VIso + delta;
677 if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 )
681 while( anAct!=NULL ) {
682 if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){
683 // There are no casting to needed actor.
684 int aIsos[2]={newNbUIso,newNbVIso};
685 anActor->SetNbIsos(aIsos);
686 anActor->StoreIsoNumbers();
688 QString anIsos("%1%2%3");anIsos = anIsos.arg(newNbUIso);anIsos = anIsos.arg(DIGIT_SEPARATOR);anIsos = anIsos.arg(newNbVIso);
689 int aMgrId = window->getViewManager()->getGlobalId();
690 aStudy->setObjectProperty(aMgrId ,anActor->getIO()->getEntry(), ISOS_PROP, anIsos);
692 anAct = aCollection->GetNextActor();
695 GeometryGUI::Modified();
699 void GEOMToolsGUI::OnDeflection()
701 SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
702 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
705 bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type());
706 bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type());
707 int mgrId = window->getViewManager()->getGlobalId();
709 if (isOCC) { // if is OCCViewer
710 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>(window->getViewManager()->getViewModel());
711 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
714 if (ic->MoreCurrent()) {
715 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
717 Standard_Real aDC, aPrevDC;
718 Standard_Boolean isOwnDC = CurObject->OwnDeviationCoefficient(aDC, aPrevDC);
720 aDC = ic->DeviationCoefficient();
722 GEOMToolsGUI_DeflectionDlg * DeflectionDlg = new GEOMToolsGUI_DeflectionDlg
723 (SUIT_Session::session()->activeApplication()->desktop());
724 DeflectionDlg->setTheDC(aDC);
728 if (DeflectionDlg->exec()) {
729 SUIT_OverrideCursor();
730 aNewDC = DeflectionDlg->getTheDC();
731 ok = (1e-07 <= aNewDC && aNewDC <= 1.0); // spinbox can return zero
733 for (; ic->MoreCurrent(); ic->NextCurrent()) {
734 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
735 ic->SetDeviationCoefficient(CurObject, aNewDC, Standard_True);
736 ic->Redisplay(CurObject);
737 appStudy->setObjectProperty(mgrId,CurObject->getIO()->getEntry(), DEFLECTION_COEFF_PROP, aNewDC);
746 GeometryGUI::Modified();
748 else if (isVTK) { // if is VTKViewer
749 SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
750 (SUIT_Session::session()->activeApplication());
754 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
758 SALOME_ListIO selected;
759 aSelMgr->selectedObjects(selected);
760 if (selected.IsEmpty())
763 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>(window);
767 SALOME_View* view = GEOM_Displayer::GetActiveView();
769 vtkActorCollection* aCollection = vtkActorCollection::New();
771 for (SALOME_ListIteratorOfListIO It (selected); It.More(); It.Next()) {
772 Handle(SALOME_InteractiveObject) anIObject = It.Value();
773 SALOME_Prs* aPrs = view->CreatePrs(anIObject->getEntry());
774 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>(aPrs);
776 vtkActorCollection* anActors = vtkPrs->GetObjects();
777 anActors->InitTraversal();
778 vtkActor* anAct = anActors->GetNextActor();
779 aCollection->AddItem(anAct);
784 aCollection->InitTraversal();
790 vtkActor* anAct = aCollection->GetNextActor();
791 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct))
792 aDC = anActor->GetDeflection();
796 GEOMToolsGUI_DeflectionDlg* DeflectionDlg = new GEOMToolsGUI_DeflectionDlg
797 (SUIT_Session::session()->activeApplication()->desktop());
798 DeflectionDlg->setTheDC(aDC);
799 if (DeflectionDlg->exec()) {
800 SUIT_OverrideCursor();
801 aDC = DeflectionDlg->getTheDC();
802 while (anAct != NULL) {
803 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
804 // There are no casting to needed actor.
805 anActor->SetDeflection(aDC);
806 appStudy->setObjectProperty(mgrId, anActor->getIO()->getEntry(), DEFLECTION_COEFF_PROP, aDC);
808 anAct = aCollection->GetNextActor();
811 GeometryGUI::Modified();
815 void GEOMToolsGUI::OnSelectOnly(int mode)
817 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
819 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
820 GEOM_Displayer aDisp (appStudy);
821 aDisp.GlobalSelection(mode);
822 getGeometryGUI()->setLocalSelectionMode(mode);
826 void GEOMToolsGUI::OnShowHideChildren( bool show )
828 SALOME_ListIO selected;
829 SalomeApp_Application* app =
830 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
832 SalomeApp_Module* mod = app ? dynamic_cast<SalomeApp_Module*>(app->activeModule()) : 0;
834 GEOM_Displayer* disp = mod ? dynamic_cast<GEOM_Displayer*>(mod->displayer()) : 0;
837 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
838 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
839 if ( aSelMgr && appStudy ) {
840 aSelMgr->selectedObjects( selected );
841 if ( !selected.IsEmpty() ) {
842 _PTR(Study) aStudy = appStudy->studyDS();
843 _PTR(StudyBuilder) B = aStudy->NewBuilder();
845 bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
847 SUIT_MessageBox::warning( app->desktop(),
848 QObject::tr( "WRN_WARNING" ),
849 QObject::tr( "WRN_STUDY_LOCKED" ) );
853 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
854 Handle(SALOME_InteractiveObject) IObject = It.Value();
856 _PTR(SObject) obj ( aStudy->FindObjectID( IObject->getEntry() ) );
857 _PTR(GenericAttribute) anAttr;
859 _PTR(AttributeExpandable) aExp = B->FindOrCreateAttribute( obj, "AttributeExpandable" );
860 aExp->SetExpandable( show );
862 disp->EraseWithChildren(IObject,true);
867 app->updateObjectBrowser( false );
868 app->updateActions();
872 void GEOMToolsGUI::OnPointMarker()
874 GEOMToolsGUI_MarkerDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
878 void GEOMToolsGUI::OnMaterialProperties()
880 GEOMToolsGUI_MaterialPropertiesDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
884 void GEOMToolsGUI::OnUnpublishObject() {
885 SALOME_ListIO selected;
886 SalomeApp_Application* app =
887 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
889 SalomeApp_Module* mod = app ? dynamic_cast<SalomeApp_Module*>(app->activeModule()) : 0;
891 GEOM_Displayer* disp = mod ? dynamic_cast<GEOM_Displayer*>(mod->displayer()) : 0;
894 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
895 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
896 if ( aSelMgr && appStudy ) {
897 aSelMgr->selectedObjects( selected );
898 if ( !selected.IsEmpty() ) {
899 _PTR(Study) aStudy = appStudy->studyDS();
900 _PTR(StudyBuilder) B = aStudy->NewBuilder();
902 bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
904 SUIT_MessageBox::warning( app->desktop(),
905 QObject::tr( "WRN_WARNING" ),
906 QObject::tr( "WRN_STUDY_LOCKED" ) );
910 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
911 Handle(SALOME_InteractiveObject) IObject = It.Value();
913 _PTR(SObject) obj ( aStudy->FindObjectID( IObject->getEntry() ) );
914 _PTR(GenericAttribute) anAttr;
916 _PTR(AttributeDrawable) aDrw = B->FindOrCreateAttribute( obj, "AttributeDrawable" );
917 aDrw->SetDrawable( false );
918 disp->EraseWithChildren(IObject);
921 aSelMgr->clearSelected();
924 app->updateObjectBrowser( false );
925 app->updateActions();
930 void GEOMToolsGUI::OnPublishObject() {
931 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
935 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
939 _PTR(Study) aStudy = appStudy->studyDS();
944 //Check lock of the study
945 bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
947 SUIT_MessageBox::warning( app->desktop(),
948 QObject::tr( "WRN_WARNING" ),
949 QObject::tr( "WRN_STUDY_LOCKED" ) );
953 GEOMToolsGUI_PublishDlg * publishDlg =
954 new GEOMToolsGUI_PublishDlg( SUIT_Session::session()->activeApplication()->desktop() );
959 void GEOMToolsGUI::OnEdgeWidth()
961 SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
962 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
965 bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type());
966 bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type());
967 int mgrId = window->getViewManager()->getGlobalId();
969 if (isOCC) { // if is OCCViewer
970 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>(window->getViewManager()->getViewModel());
971 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
973 if (ic->MoreCurrent()) {
974 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
976 int aWidth = (int)CurObject->Width();
978 GEOMToolsGUI_LineWidthDlg * Dlg = new GEOMToolsGUI_LineWidthDlg
979 (SUIT_Session::session()->activeApplication()->desktop(),"EDGE_WIDTH_TLT");
980 Dlg->setTheLW(aWidth);
983 aNewWidth = Dlg->getTheLW();
984 bool ok = (aNewWidth != aWidth && aNewWidth != 0 );
986 for(; ic->MoreCurrent(); ic->NextCurrent()) {
987 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
988 CurObject->SetWidth(aNewWidth);
989 ic->Redisplay(CurObject);
990 appStudy->setObjectProperty(mgrId,CurObject->getIO()->getEntry(), EDGE_WIDTH_PROP, aNewWidth);
998 GeometryGUI::Modified();
1000 else if (isVTK) { // if is VTKViewer
1001 SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
1002 (SUIT_Session::session()->activeApplication());
1006 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
1010 SALOME_ListIO selected;
1011 aSelMgr->selectedObjects(selected);
1012 if (selected.IsEmpty())
1015 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>(window);
1019 SALOME_View* view = GEOM_Displayer::GetActiveView();
1021 vtkActorCollection* aCollection = vtkActorCollection::New();
1023 for (SALOME_ListIteratorOfListIO It (selected); It.More(); It.Next()) {
1024 Handle(SALOME_InteractiveObject) anIObject = It.Value();
1025 SALOME_Prs* aPrs = view->CreatePrs(anIObject->getEntry());
1026 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>(aPrs);
1028 vtkActorCollection* anActors = vtkPrs->GetObjects();
1029 anActors->InitTraversal();
1030 vtkActor* anAct = anActors->GetNextActor();
1031 aCollection->AddItem(anAct);
1036 aCollection->InitTraversal();
1042 vtkActor* anAct = aCollection->GetNextActor();
1043 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct))
1044 aWidth = anActor->GetWidth();
1048 GEOMToolsGUI_LineWidthDlg * Dlg = new GEOMToolsGUI_LineWidthDlg
1049 (SUIT_Session::session()->activeApplication()->desktop(),"EDGE_WIDTH_TLT");
1051 Dlg->setTheLW(aWidth);
1053 SUIT_OverrideCursor();
1054 aWidth = Dlg->getTheLW();
1055 while (anAct != NULL) {
1056 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
1057 // There are no casting to needed actor.
1058 anActor->SetWidth(aWidth);
1059 appStudy->setObjectProperty(mgrId, anActor->getIO()->getEntry(), EDGE_WIDTH_PROP, aWidth);
1061 anAct = aCollection->GetNextActor();
1064 GeometryGUI::Modified();
1069 void GEOMToolsGUI::OnIsosWidth() {
1070 SalomeApp_Application* app =
1071 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
1072 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
1073 SUIT_ViewWindow* window = app->desktop()->activeWindow();
1075 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
1076 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
1078 if(isOCC){ // if is OCCViewer
1080 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
1081 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
1084 if ( ic->MoreCurrent() ) {
1085 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
1086 CurObject->restoreIsoNumbers();
1087 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
1089 Handle(Graphic3d_AspectLine3d) asp = CurDrawer->UIsoAspect()->Aspect();
1092 Aspect_TypeOfLine T;
1096 int aWidth = (int)W;
1098 GEOMToolsGUI_LineWidthDlg * Dlg =
1099 new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(),"ISOS_WIDTH_TLT" );
1101 Dlg->setTheLW( aWidth );
1103 if ( Dlg->exec() ) {
1104 SUIT_OverrideCursor();
1105 aWidth = Dlg->getTheLW();
1106 } else //Cancel case
1109 for(; ic->MoreCurrent(); ic->NextCurrent()) {
1110 int aMgrId = window->getViewManager()->getGlobalId();
1111 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
1113 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
1115 CurObject->Attributes()->UIsoAspect()->SetWidth(aWidth);
1116 CurObject->Attributes()->VIsoAspect()->SetWidth(aWidth);
1118 ic->Redisplay(CurObject);
1120 aStudy->setObjectProperty(aMgrId ,CurObject->getIO()->getEntry(), ISOS_WIDTH_PROP, aWidth);
1122 GeometryGUI::Modified();
1125 else if(isVTK){ // if is VTKViewer
1127 // Warning. It's works incorrect. must be recheked.
1129 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >
1130 ( SUIT_Session::session()->activeApplication() );
1133 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
1136 SALOME_ListIO selected;
1137 aSelMgr->selectedObjects( selected );
1138 if ( selected.IsEmpty() )
1141 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
1145 SALOME_View* view = GEOM_Displayer::GetActiveView();
1147 vtkActorCollection* aCollection = vtkActorCollection::New();
1149 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
1150 Handle(SALOME_InteractiveObject) anIObject = It.Value();
1151 SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() );
1152 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( aPrs );
1154 vtkActorCollection* anActors = vtkPrs->GetObjects();
1155 anActors->InitTraversal();
1156 vtkActor* anAct = anActors->GetNextActor();
1157 aCollection->AddItem(anAct);
1162 aCollection->InitTraversal();
1168 vtkActor* anAct = aCollection->GetNextActor();
1169 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
1170 aWidth = anActor->GetIsosWidth();
1175 GEOMToolsGUI_LineWidthDlg* Dlg =
1176 new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), "ISOS_WIDTH_TLT" );
1178 Dlg->setTheLW( aWidth );
1180 SUIT_OverrideCursor();
1181 aWidth = Dlg->getTheLW();
1183 return; //Cancel case
1185 while( anAct!= NULL ) {
1186 if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
1187 // There are no casting to needed actor.
1188 anActor->SetIsosWidth(aWidth);
1189 int aMgrId = window->getViewManager()->getGlobalId();
1190 aStudy->setObjectProperty(aMgrId ,anActor->getIO()->getEntry(), ISOS_WIDTH_PROP, aWidth);
1192 anAct = aCollection->GetNextActor();
1196 GeometryGUI::Modified();
1200 void GEOMToolsGUI::OnBringToFront() {
1201 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
1205 SalomeApp_Module* mod = dynamic_cast<SalomeApp_Module*>(app->activeModule());
1209 GEOM_Displayer* disp = dynamic_cast<GEOM_Displayer*>(mod->displayer());
1214 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
1218 SALOME_ListIO selected;
1219 aSelMgr->selectedObjects( selected );
1220 if ( selected.IsEmpty() )
1223 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
1227 SUIT_ViewWindow* window = app->desktop()->activeWindow();
1229 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
1233 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
1235 QAction* a = getGeometryGUI()->action( GEOMOp::OpBringToFront );
1236 bool checked = a->isChecked();
1239 GEOMBase* gb = new GEOMBase();
1240 Handle(GEOM_AISShape) aisShape;
1242 Handle(AIS_InteractiveContext) ic = vm->getAISContext();
1243 SALOME_ListIO anIOlst;
1244 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
1245 aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), true );
1246 if ( !aisShape.IsNull() ) {
1247 aisShape->setTopLevel(checked);
1248 int aMgrId = window->getViewManager()->getGlobalId();
1249 appStudy->setObjectProperty( aMgrId, aisShape->getIO()->getEntry(), TOP_LEVEL_PROP, checked );
1250 anIOlst.Append(aisShape->getIO());
1253 disp->Redisplay(anIOlst);
1254 GeometryGUI::Modified();
1258 void GEOMToolsGUI::OnClsBringToFront() {
1259 SalomeApp_Application* app =
1260 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
1264 SalomeApp_Module* mod = dynamic_cast<SalomeApp_Module*>(app->activeModule());
1268 GEOM_Displayer* disp = dynamic_cast<GEOM_Displayer*>(mod->displayer());
1274 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
1278 SUIT_ViewWindow* window = app->desktop()->activeWindow();
1280 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
1282 if(isOCC){ // if is OCCViewer
1284 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
1285 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
1287 SALOME_ListIO anIOlst;
1288 AIS_ListOfInteractive aList;
1289 ic->DisplayedObjects( aList );
1290 for ( AIS_ListIteratorOfListOfInteractive it( aList ); it.More(); it.Next() ) {
1292 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(it.Value());
1294 if(CurObject.IsNull())
1297 CurObject->setTopLevel(Standard_False);
1299 int aMgrId = window->getViewManager()->getGlobalId();
1300 appStudy->setObjectProperty( aMgrId, QString(CurObject->getIO()->getEntry()), TOP_LEVEL_PROP, Standard_False );
1301 anIOlst.Append(CurObject->getIO());
1303 disp->Redisplay(anIOlst);
1304 GeometryGUI::Modified();