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 #include <PyConsole_Console.h>
28 #include "GEOMToolsGUI.h"
29 #include "GEOMToolsGUI_TransparencyDlg.h"
30 #include "GEOMToolsGUI_NbIsosDlg.h"
31 #include "GEOMToolsGUI_DeflectionDlg.h"
32 #include "GEOMToolsGUI_MarkerDlg.h"
33 #include "GEOMToolsGUI_PublishDlg.h"
34 #include "GEOMToolsGUI_MaterialPropertiesDlg.h"
35 #include "GEOMToolsGUI_LineWidthDlg.h"
37 #include <GeometryGUI.h>
38 #include <GeometryGUI_Operations.h>
39 #include <GEOM_Constants.h>
40 #include <GEOM_Displayer.h>
43 #include <GEOM_Actor.h>
45 #include <Basics_OCCTVersion.hxx>
47 #include <SALOME_ListIO.hxx>
48 #include <SALOME_ListIteratorOfListIO.hxx>
53 #include <SVTK_ViewModel.h>
54 #include <SVTK_ViewWindow.h>
55 #include <SVTK_View.h>
57 #include <OCCViewer_ViewModel.h>
59 #include <SUIT_ViewManager.h>
60 #include <SUIT_Desktop.h>
61 #include <SUIT_ResourceMgr.h>
62 #include <SUIT_Session.h>
63 #include <SUIT_OverrideCursor.h>
64 #include <SUIT_MessageBox.h>
65 #include <SUIT_Tools.h>
67 #include <SalomeApp_Application.h>
68 #include <SalomeApp_Study.h>
69 #include <SalomeApp_Module.h>
71 #include <LightApp_SelectionMgr.h>
72 #include <LightApp_NameDlg.h>
74 #include <GEOMImpl_Types.hxx>
76 #include "utilities.h"
79 #include <AIS_Drawer.hxx>
80 #include <Prs3d_IsoAspect.hxx>
81 #include <Prs3d_PointAspect.hxx>
82 #include <Graphic3d_AspectMarker3d.hxx>
83 #include <Graphic3d_AspectLine3d.hxx>
84 #include <AIS_ListIteratorOfListOfInteractive.hxx>
85 #include <AIS_ListOfInteractive.hxx>
88 #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
89 #include <TColStd_HArray1OfByte.hxx>
91 #include <Graphic3d_HArray1OfBytes.hxx>
96 #include <QColorDialog>
97 #include <QInputDialog>
98 #include <QFileDialog>
101 #include <QGridLayout>
104 #include <QPushButton>
108 #include <vtkRenderer.h>
110 void GEOMToolsGUI::OnCheckGeometry()
112 SalomeApp_Application* app =
113 dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication());
114 PyConsole_Console* pyConsole = app->pythonConsole();
117 pyConsole->exec("from GEOM_usinggeom import *");
120 void GEOMToolsGUI::OnAutoColor()
122 SALOME_ListIO selected;
123 SalomeApp_Application* app =
124 dynamic_cast< SalomeApp_Application* >(SUIT_Session::session()->activeApplication());
128 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
129 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
130 if (!aSelMgr || !appStudy)
133 aSelMgr->selectedObjects(selected);
134 if (selected.IsEmpty())
137 Handle(SALOME_InteractiveObject) anIObject = selected.First();
139 _PTR(Study) aStudy = appStudy->studyDS();
140 _PTR(SObject) aMainSObject(aStudy->FindObjectID(anIObject->getEntry()));
141 GEOM::GEOM_Object_var aMainObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aMainSObject));
142 if (CORBA::is_nil(aMainObject))
145 aMainObject->SetAutoColor( true );
147 QList<SALOMEDS::Color> aReservedColors;
149 GEOM_Displayer aDisp (appStudy);
151 SALOME_View* vf = aDisp.GetActiveView();
153 SUIT_ViewWindow* window = app->desktop()->activeWindow();
154 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
155 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
157 for( _PTR(ChildIterator) it( aStudy->NewChildIterator( aMainSObject ) ); it->More(); it->Next() )
159 _PTR(SObject) aChildSObject( it->Value() );
160 GEOM::GEOM_Object_var aChildObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aChildSObject));
161 if( CORBA::is_nil( aChildObject ) )
164 if( aChildObject->GetType() != GEOM_GROUP )
167 SALOMEDS::Color aColor = GEOM_Displayer::getUniqueColor( aReservedColors );
168 aChildObject->SetColor( aColor );
169 aReservedColors.append( aColor );
171 QColor c( (int)( aColor.R * 255.0 ), (int)( aColor.G * 255.0 ), (int)( aColor.B * 255.0 ) );
173 SALOME_Prs* aPrs = vf->CreatePrs( aChildSObject->GetID().c_str() );
177 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
180 SVTK_View* aView = vtkVW->getView();
181 SUIT_OverrideCursor();
182 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() )
183 aView->SetColor( It.Value(), c );
187 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
188 Handle(AIS_InteractiveContext) ic = vm->getAISContext();
190 SOCC_Prs* anOCCPrs = dynamic_cast<SOCC_Prs*>( aPrs );
194 AIS_ListOfInteractive aList;
195 anOCCPrs->GetObjects( aList );
196 if( !aList.Extent() )
199 Handle(AIS_InteractiveObject) io = aList.First();
203 Quantity_Color aQuanColor( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
205 // Set color for a point
206 Handle(AIS_Drawer) aCurDrawer = io->Attributes();
207 Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
208 Quantity_Color aCurColor;
209 Standard_Real aCurScale;
210 Aspect_TypeOfMarker aCurTypeOfMarker;
211 aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
212 if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
213 aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aCurTypeOfMarker, aQuanColor, aCurScale) );
216 Standard_Integer aWidth, aHeight;
217 aCurPointAspect->GetTextureSize( aWidth, aHeight );
219 #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
220 Handle(TColStd_HArray1OfByte) aTexture = aCurPointAspect->GetTexture();
222 Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
225 aCurDrawer->SetPointAspect( new Prs3d_PointAspect( aQuanColor, 1, aWidth, aHeight, aTexture ) );
227 ic->SetLocalAttributes( io, aCurDrawer );
229 io->SetColor( aQuanColor );
230 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) {
231 Handle(GEOM_AISShape) aGAISShape = Handle(GEOM_AISShape)::DownCast( io );
232 aGAISShape->SetShadingColor( aQuanColor );
233 aGAISShape->storeBoundaryColors();
236 io->Redisplay( Standard_True );
240 app->updateActions(); //SRN: To update a Save button in the toolbar
243 void GEOMToolsGUI::OnDisableAutoColor()
245 SALOME_ListIO selected;
246 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
250 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
251 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
252 if( !aSelMgr || !appStudy )
255 aSelMgr->selectedObjects( selected );
256 if( selected.IsEmpty() )
259 Handle(SALOME_InteractiveObject) anIObject = selected.First();
261 _PTR(Study) aStudy = appStudy->studyDS();
262 _PTR(SObject) aMainSObject( aStudy->FindObjectID( anIObject->getEntry() ) );
263 GEOM::GEOM_Object_var aMainObject = GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aMainSObject));
264 if( CORBA::is_nil( aMainObject ) )
267 aMainObject->SetAutoColor( false );
271 void GEOMToolsGUI::OnColor()
273 SALOME_ListIO selected;
274 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
275 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
276 if ( app && appStudy ) {
277 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
279 aSelMgr->selectedObjects( selected );
280 if ( !selected.IsEmpty() ) {
281 SUIT_ViewWindow* window = app->desktop()->activeWindow();
282 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
283 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
284 int mgrId = window->getViewManager()->getGlobalId();
286 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
289 SVTK_View* aView = vtkVW->getView();
290 QColor initcolor = aView->GetColor( selected.First() );
291 QColor c = QColorDialog::getColor( initcolor, app->desktop() );
293 SUIT_OverrideCursor();
294 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
295 aView->SetColor( It.Value(), c );
296 appStudy->setObjectProperty(mgrId,It.Value()->getEntry(),COLOR_PROP, c);
298 GeometryGUI::Modified();
302 Handle(AIS_InteractiveObject) io = GEOMBase::GetAIS( selected.First() );
303 if ( !io.IsNull() ) {
304 Quantity_Color aColor;
306 QColor ic = QColor((int )( aColor.Red() * 255.0 ),
307 (int)( aColor.Green() * 255.0 ),
308 (int)( aColor.Blue() * 255.0 ));
310 QVariant v = appStudy->getObjectProperty(mgrId,selected.First()->getEntry(), COLOR_PROP, ic);
312 QColor initcolor = v.value<QColor>();
313 QColor c = QColorDialog::getColor( initcolor, app->desktop() );
315 SUIT_OverrideCursor();
316 aColor = Quantity_Color( c.red() / 255., c.green() / 255., c.blue() / 255., Quantity_TOC_RGB );
317 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*> ( window->getViewManager()->getViewModel() );
318 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
319 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
320 io = GEOMBase::GetAIS( It.Value(), true );
321 if ( !io.IsNull() ) {
323 if ( io->IsKind( STANDARD_TYPE(AIS_Shape) ) ) {
324 TopoDS_Shape theShape = Handle(AIS_Shape)::DownCast( io )->Shape();
325 bool onlyVertex = (theShape.ShapeType() == TopAbs_VERTEX || GEOM_Displayer::isCompoundOfVertices( theShape ));
327 // Set color for a point
329 Handle(AIS_Drawer) aCurDrawer = io->Attributes();
330 Handle(Prs3d_PointAspect) aCurPointAspect = aCurDrawer->PointAspect();
331 Quantity_Color aCurColor;
332 Standard_Real aCurScale;
333 Aspect_TypeOfMarker aCurTypeOfMarker;
334 aCurPointAspect->Aspect()->Values( aCurColor, aCurTypeOfMarker, aCurScale );
335 if ( aCurTypeOfMarker != Aspect_TOM_USERDEFINED ) {
336 aCurDrawer->SetPointAspect(new Prs3d_PointAspect(aCurTypeOfMarker, aColor, aCurScale));
339 Standard_Integer aWidth, aHeight;
340 aCurPointAspect->GetTextureSize( aWidth, aHeight );
342 #if OCC_VERSION_LARGE > 0x06040000 // Porting to OCCT6.5.1
343 Handle(TColStd_HArray1OfByte) aTexture = aCurPointAspect->GetTexture();
345 Handle(Graphic3d_HArray1OfBytes) aTexture = aCurPointAspect->GetTexture();
348 aCurDrawer->SetPointAspect(new Prs3d_PointAspect(aColor, 1, aWidth, aHeight, aTexture));
350 ic->SetLocalAttributes(io, aCurDrawer, Standard_False);
354 io->SetColor( aColor );
355 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) ) {
356 Handle(GEOM_AISShape) aGAISShape = Handle(GEOM_AISShape)::DownCast( io );
357 aGAISShape->SetShadingColor( aColor );
358 aGAISShape->storeBoundaryColors();
361 appStudy->setObjectProperty(mgrId,It.Value()->getEntry(), COLOR_PROP, c);
363 io->Redisplay( Standard_True );
365 // store color to GEOM_Object
366 _PTR(Study) aStudy = appStudy->studyDS();
367 _PTR(SObject) aSObject( aStudy->FindObjectID( It.Value()->getEntry() ) );
368 GEOM::GEOM_Object_var anObject =
369 GEOM::GEOM_Object::_narrow(GeometryGUI::ClientSObjectToObject(aSObject));
372 SALOMEDS::Color aSColor;
373 aSColor.R = (double)c.red() / 255.0;
374 aSColor.G = (double)c.green() / 255.0;
375 aSColor.B = (double)c.blue() / 255.0;
376 anObject->SetColor( aSColor );
377 anObject->SetAutoColor( false );
380 ic->UpdateCurrentViewer();
381 GeometryGUI::Modified();
383 } // first IO is not null
385 } // if ( selection not empty )
389 app->updateActions(); //SRN: To update a Save button in the toolbar
392 void GEOMToolsGUI::OnTexture()
394 SALOME_ListIO selected;
395 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
396 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
397 if ( app && appStudy ) {
398 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
400 aSelMgr->selectedObjects( selected );
401 if ( !selected.IsEmpty() ) {
402 SUIT_ViewWindow* window = app->desktop()->activeWindow();
403 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
405 QString aTexture = QFileDialog::getOpenFileName(window,tr( "GEOM_SELECT_IMAGE"),QString(), tr("OCC_IMAGE_FILES"));
406 if( !aTexture.isEmpty() )
408 SUIT_OverrideCursor();
409 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*> ( window->getViewManager()->getViewModel() );
410 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
411 Handle(AIS_InteractiveObject) io ;
412 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
413 io = GEOMBase::GetAIS( It.Value(), true );
414 if ( !io.IsNull() ) {
415 if ( io->IsKind( STANDARD_TYPE(GEOM_AISShape) ) )
416 Handle(GEOM_AISShape)::DownCast( io )->SetTextureFileName(TCollection_AsciiString(aTexture.toStdString().c_str()));
417 io->Redisplay( Standard_True );
418 } // if ( !io.IsNull() )
420 ic->UpdateCurrentViewer();
421 GeometryGUI::Modified();
422 GeometryGUI* myGeomGUI = getGeometryGUI();
423 myGeomGUI->OnGUIEvent(GEOMOp::OpTexture);
424 } // if ( !selFile.isEmpty() )
426 } // if ( selection not empty )
430 app->updateActions(); //SRN: To update a Save button in the toolbar
433 void GEOMToolsGUI::OnTransparency()
435 GEOMToolsGUI_TransparencyDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
439 void GEOMToolsGUI::OnChangeTransparency( bool increase )
441 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
444 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
447 SALOME_ListIO selected;
448 aSelMgr->selectedObjects( selected );
449 if ( selected.IsEmpty() )
452 Handle(SALOME_InteractiveObject) FirstIOS = selected.First();
453 if ( FirstIOS.IsNull() )
457 float delta = 0.1; // VSR: 23/11/2010 (transparency value <= 0.05 is ignored)
461 SUIT_ViewWindow* window = app->desktop()->activeWindow();
462 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
463 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
466 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
469 SVTK_View* aView = vtkVW->getView();
471 float transp = aView->GetTransparency(FirstIOS);
473 // Compute new transparency value
474 transp = transp + delta;
477 else if ( transp > 1 )
480 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
481 aView->SetTransparency( It.Value(), transp );
484 GeometryGUI::Modified();
488 GEOMBase* gb = new GEOMBase();
489 Handle(GEOM_AISShape) aisShape;
491 aisShape = gb->ConvertIOinGEOMAISShape( FirstIOS, true );
492 if( aisShape.IsNull() )
494 float transp = aisShape->Transparency();
496 // Compute new transparency value
497 transp = transp + delta;
500 else if ( transp > 1 )
503 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
506 Handle(AIS_InteractiveContext) ic = vm->getAISContext();
507 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
508 aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), true );
509 if ( !aisShape.IsNull() ) {
510 ic->SetTransparency( aisShape, transp, false );
511 ic->Redisplay( aisShape, Standard_False, Standard_True );
514 ic->UpdateCurrentViewer();
515 GeometryGUI::Modified();
519 void GEOMToolsGUI::OnNbIsos( ActionType actionType )
521 SalomeApp_Application* app =
522 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
523 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
524 SUIT_ViewWindow* window = app->desktop()->activeWindow();
526 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
527 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
529 if(isOCC){ // if is OCCViewer
531 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
532 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
535 if ( ic->MoreCurrent() ) {
536 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
537 CurObject->restoreIsoNumbers();
538 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
540 int UIso = CurDrawer->UIsoAspect()->Number();
541 int VIso = CurDrawer->VIsoAspect()->Number();
546 if ( actionType == SHOWDLG ) {
547 GEOMToolsGUI_NbIsosDlg * NbIsosDlg =
548 new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
550 NbIsosDlg->setU( UIso );
551 NbIsosDlg->setV( VIso );
553 if ( NbIsosDlg->exec() ) {
554 SUIT_OverrideCursor();
556 newNbUIso = NbIsosDlg->getU();
557 newNbVIso = NbIsosDlg->getV();
561 else if ( actionType == INCR || actionType == DECR ) {
563 if (actionType == DECR)
566 newNbUIso = UIso + delta;
567 newNbVIso = VIso + delta;
569 if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 )
573 for(; ic->MoreCurrent(); ic->NextCurrent()) {
574 int aMgrId = window->getViewManager()->getGlobalId();
575 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
577 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
579 QVariant v = aStudy->getObjectProperty( aMgrId, CurObject->getIO()->getEntry(), EDGE_WIDTH_PROP , QVariant() );
581 int width = v.isValid() ? v.toInt() : 1;
583 CurDrawer->SetUIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, width , newNbUIso) );
584 CurDrawer->SetVIsoAspect( new Prs3d_IsoAspect(Quantity_NOC_GRAY75, Aspect_TOL_SOLID, width , newNbVIso) );
586 CurObject->storeIsoNumbers();
588 ic->SetLocalAttributes(CurObject, CurDrawer);
589 ic->Redisplay(CurObject);
591 QString anIsos("%1%2%3");anIsos = anIsos.arg(newNbUIso);anIsos = anIsos.arg(DIGIT_SEPARATOR);anIsos = anIsos.arg(newNbVIso);
592 aStudy->setObjectProperty(aMgrId ,CurObject->getIO()->getEntry(), ISOS_WIDTH_PROP, anIsos);
595 GeometryGUI::Modified();
597 else if(isVTK){ // if is VTKViewer
599 // Warning. It's works incorrect. must be recheked.
601 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >
602 ( SUIT_Session::session()->activeApplication() );
605 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
608 SALOME_ListIO selected;
609 aSelMgr->selectedObjects( selected );
610 if ( selected.IsEmpty() )
613 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
617 SALOME_View* view = GEOM_Displayer::GetActiveView();
619 vtkActorCollection* aCollection = vtkActorCollection::New();
621 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
622 Handle(SALOME_InteractiveObject) anIObject = It.Value();
623 SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() );
624 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( aPrs );
626 vtkActorCollection* anActors = vtkPrs->GetObjects();
627 anActors->InitTraversal();
628 vtkActor* anAct = anActors->GetNextActor();
629 aCollection->AddItem(anAct);
634 aCollection->InitTraversal();
641 vtkActor* anAct = aCollection->GetNextActor();
642 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
643 anActor->RestoreIsoNumbers();
644 anActor->GetNbIsos(UIso,VIso);
652 if ( actionType == SHOWDLG ) {
653 GEOMToolsGUI_NbIsosDlg* NbIsosDlg =
654 new GEOMToolsGUI_NbIsosDlg( SUIT_Session::session()->activeApplication()->desktop() );
656 NbIsosDlg->setU( UIso );
657 NbIsosDlg->setV( VIso );
659 if ( NbIsosDlg->exec() ) {
660 SUIT_OverrideCursor();
662 newNbUIso = NbIsosDlg->getU();
663 newNbVIso = NbIsosDlg->getV();
665 return; //Cancel case
667 else if ( actionType == INCR || actionType == DECR ) {
669 if (actionType == DECR)
672 newNbUIso = UIso + delta;
673 newNbVIso = VIso + delta;
675 if ( newNbUIso < 0 || newNbVIso < 0 || newNbUIso > 99 || newNbVIso > 99 )
679 while( anAct!=NULL ) {
680 if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)){
681 // There are no casting to needed actor.
682 int aIsos[2]={newNbUIso,newNbVIso};
683 anActor->SetNbIsos(aIsos);
684 anActor->StoreIsoNumbers();
686 QString anIsos("%1%2%3");anIsos = anIsos.arg(newNbUIso);anIsos = anIsos.arg(DIGIT_SEPARATOR);anIsos = anIsos.arg(newNbVIso);
687 int aMgrId = window->getViewManager()->getGlobalId();
688 aStudy->setObjectProperty(aMgrId ,anActor->getIO()->getEntry(), ISOS_PROP, anIsos);
690 anAct = aCollection->GetNextActor();
693 GeometryGUI::Modified();
697 void GEOMToolsGUI::OnDeflection()
699 SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
700 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
703 bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type());
704 bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type());
705 int mgrId = window->getViewManager()->getGlobalId();
707 if (isOCC) { // if is OCCViewer
708 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>(window->getViewManager()->getViewModel());
709 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
712 if (ic->MoreCurrent()) {
713 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
715 Standard_Real aDC, aPrevDC;
716 Standard_Boolean isOwnDC = CurObject->OwnDeviationCoefficient(aDC, aPrevDC);
718 aDC = ic->DeviationCoefficient();
720 GEOMToolsGUI_DeflectionDlg * DeflectionDlg = new GEOMToolsGUI_DeflectionDlg
721 (SUIT_Session::session()->activeApplication()->desktop());
722 DeflectionDlg->setTheDC(aDC);
726 if (DeflectionDlg->exec()) {
727 SUIT_OverrideCursor();
728 aNewDC = DeflectionDlg->getTheDC();
729 ok = (1e-07 <= aNewDC && aNewDC <= 1.0); // spinbox can return zero
731 for (; ic->MoreCurrent(); ic->NextCurrent()) {
732 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
733 ic->SetDeviationCoefficient(CurObject, aNewDC, Standard_True);
734 ic->Redisplay(CurObject);
735 appStudy->setObjectProperty(mgrId,CurObject->getIO()->getEntry(), DEFLECTION_COEFF_PROP, aNewDC);
744 GeometryGUI::Modified();
746 else if (isVTK) { // if is VTKViewer
747 SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
748 (SUIT_Session::session()->activeApplication());
752 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
756 SALOME_ListIO selected;
757 aSelMgr->selectedObjects(selected);
758 if (selected.IsEmpty())
761 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>(window);
765 SALOME_View* view = GEOM_Displayer::GetActiveView();
767 vtkActorCollection* aCollection = vtkActorCollection::New();
769 for (SALOME_ListIteratorOfListIO It (selected); It.More(); It.Next()) {
770 Handle(SALOME_InteractiveObject) anIObject = It.Value();
771 SALOME_Prs* aPrs = view->CreatePrs(anIObject->getEntry());
772 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>(aPrs);
774 vtkActorCollection* anActors = vtkPrs->GetObjects();
775 anActors->InitTraversal();
776 vtkActor* anAct = anActors->GetNextActor();
777 aCollection->AddItem(anAct);
782 aCollection->InitTraversal();
788 vtkActor* anAct = aCollection->GetNextActor();
789 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct))
790 aDC = anActor->GetDeflection();
794 GEOMToolsGUI_DeflectionDlg* DeflectionDlg = new GEOMToolsGUI_DeflectionDlg
795 (SUIT_Session::session()->activeApplication()->desktop());
796 DeflectionDlg->setTheDC(aDC);
797 if (DeflectionDlg->exec()) {
798 SUIT_OverrideCursor();
799 aDC = DeflectionDlg->getTheDC();
800 while (anAct != NULL) {
801 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
802 // There are no casting to needed actor.
803 anActor->SetDeflection(aDC);
804 appStudy->setObjectProperty(mgrId, anActor->getIO()->getEntry(), DEFLECTION_COEFF_PROP, aDC);
806 anAct = aCollection->GetNextActor();
809 GeometryGUI::Modified();
813 void GEOMToolsGUI::OnSelectOnly(int mode)
815 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
817 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
818 GEOM_Displayer aDisp (appStudy);
819 aDisp.GlobalSelection(mode);
820 getGeometryGUI()->setLocalSelectionMode(mode);
824 void GEOMToolsGUI::OnShowHideChildren( bool show )
826 SALOME_ListIO selected;
827 SalomeApp_Application* app =
828 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
830 SalomeApp_Module* mod = app ? dynamic_cast<SalomeApp_Module*>(app->activeModule()) : 0;
832 GEOM_Displayer* disp = mod ? dynamic_cast<GEOM_Displayer*>(mod->displayer()) : 0;
835 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
836 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
837 if ( aSelMgr && appStudy ) {
838 aSelMgr->selectedObjects( selected );
839 if ( !selected.IsEmpty() ) {
840 _PTR(Study) aStudy = appStudy->studyDS();
841 _PTR(StudyBuilder) B = aStudy->NewBuilder();
843 bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
845 SUIT_MessageBox::warning( app->desktop(),
846 QObject::tr( "WRN_WARNING" ),
847 QObject::tr( "WRN_STUDY_LOCKED" ) );
851 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
852 Handle(SALOME_InteractiveObject) IObject = It.Value();
854 _PTR(SObject) obj ( aStudy->FindObjectID( IObject->getEntry() ) );
855 _PTR(GenericAttribute) anAttr;
857 _PTR(AttributeExpandable) aExp = B->FindOrCreateAttribute( obj, "AttributeExpandable" );
858 aExp->SetExpandable( show );
860 disp->EraseWithChildren(IObject,true);
865 app->updateObjectBrowser( false );
866 app->updateActions();
870 void GEOMToolsGUI::OnPointMarker()
872 GEOMToolsGUI_MarkerDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
876 void GEOMToolsGUI::OnMaterialProperties()
878 GEOMToolsGUI_MaterialPropertiesDlg dlg( SUIT_Session::session()->activeApplication()->desktop() );
882 void GEOMToolsGUI::OnUnpublishObject() {
883 SALOME_ListIO selected;
884 SalomeApp_Application* app =
885 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
887 SalomeApp_Module* mod = app ? dynamic_cast<SalomeApp_Module*>(app->activeModule()) : 0;
889 GEOM_Displayer* disp = mod ? dynamic_cast<GEOM_Displayer*>(mod->displayer()) : 0;
892 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
893 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
894 if ( aSelMgr && appStudy ) {
895 aSelMgr->selectedObjects( selected );
896 if ( !selected.IsEmpty() ) {
897 _PTR(Study) aStudy = appStudy->studyDS();
898 _PTR(StudyBuilder) B = aStudy->NewBuilder();
900 bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
902 SUIT_MessageBox::warning( app->desktop(),
903 QObject::tr( "WRN_WARNING" ),
904 QObject::tr( "WRN_STUDY_LOCKED" ) );
908 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
909 Handle(SALOME_InteractiveObject) IObject = It.Value();
911 _PTR(SObject) obj ( aStudy->FindObjectID( IObject->getEntry() ) );
912 _PTR(GenericAttribute) anAttr;
914 _PTR(AttributeDrawable) aDrw = B->FindOrCreateAttribute( obj, "AttributeDrawable" );
915 aDrw->SetDrawable( false );
916 disp->EraseWithChildren(IObject);
919 aSelMgr->clearSelected();
922 app->updateObjectBrowser( false );
923 app->updateActions();
928 void GEOMToolsGUI::OnPublishObject() {
929 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
933 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
937 _PTR(Study) aStudy = appStudy->studyDS();
942 //Check lock of the study
943 bool aLocked = ( _PTR(AttributeStudyProperties)( aStudy->GetProperties() ) )->IsLocked();
945 SUIT_MessageBox::warning( app->desktop(),
946 QObject::tr( "WRN_WARNING" ),
947 QObject::tr( "WRN_STUDY_LOCKED" ) );
951 GEOMToolsGUI_PublishDlg * publishDlg =
952 new GEOMToolsGUI_PublishDlg( SUIT_Session::session()->activeApplication()->desktop() );
957 void GEOMToolsGUI::OnEdgeWidth()
959 SUIT_ViewWindow* window = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
960 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
963 bool isOCC = (window && window->getViewManager()->getType() == OCCViewer_Viewer::Type());
964 bool isVTK = (window && window->getViewManager()->getType() == SVTK_Viewer::Type());
965 int mgrId = window->getViewManager()->getGlobalId();
967 if (isOCC) { // if is OCCViewer
968 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>(window->getViewManager()->getViewModel());
969 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
971 if (ic->MoreCurrent()) {
972 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
974 int aWidth = (int)CurObject->Width();
976 GEOMToolsGUI_LineWidthDlg * Dlg = new GEOMToolsGUI_LineWidthDlg
977 (SUIT_Session::session()->activeApplication()->desktop(),"EDGE_WIDTH_TLT");
978 Dlg->setTheLW(aWidth);
981 aNewWidth = Dlg->getTheLW();
982 bool ok = (aNewWidth != aWidth && aNewWidth != 0 );
984 for(; ic->MoreCurrent(); ic->NextCurrent()) {
985 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
986 CurObject->SetWidth(aNewWidth);
987 ic->Redisplay(CurObject);
988 appStudy->setObjectProperty(mgrId,CurObject->getIO()->getEntry(), EDGE_WIDTH_PROP, aNewWidth);
996 GeometryGUI::Modified();
998 else if (isVTK) { // if is VTKViewer
999 SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>
1000 (SUIT_Session::session()->activeApplication());
1004 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
1008 SALOME_ListIO selected;
1009 aSelMgr->selectedObjects(selected);
1010 if (selected.IsEmpty())
1013 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>(window);
1017 SALOME_View* view = GEOM_Displayer::GetActiveView();
1019 vtkActorCollection* aCollection = vtkActorCollection::New();
1021 for (SALOME_ListIteratorOfListIO It (selected); It.More(); It.Next()) {
1022 Handle(SALOME_InteractiveObject) anIObject = It.Value();
1023 SALOME_Prs* aPrs = view->CreatePrs(anIObject->getEntry());
1024 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>(aPrs);
1026 vtkActorCollection* anActors = vtkPrs->GetObjects();
1027 anActors->InitTraversal();
1028 vtkActor* anAct = anActors->GetNextActor();
1029 aCollection->AddItem(anAct);
1034 aCollection->InitTraversal();
1040 vtkActor* anAct = aCollection->GetNextActor();
1041 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct))
1042 aWidth = anActor->GetWidth();
1046 GEOMToolsGUI_LineWidthDlg * Dlg = new GEOMToolsGUI_LineWidthDlg
1047 (SUIT_Session::session()->activeApplication()->desktop(),"EDGE_WIDTH_TLT");
1049 Dlg->setTheLW(aWidth);
1051 SUIT_OverrideCursor();
1052 aWidth = Dlg->getTheLW();
1053 while (anAct != NULL) {
1054 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
1055 // There are no casting to needed actor.
1056 anActor->SetWidth(aWidth);
1057 appStudy->setObjectProperty(mgrId, anActor->getIO()->getEntry(), EDGE_WIDTH_PROP, aWidth);
1059 anAct = aCollection->GetNextActor();
1062 GeometryGUI::Modified();
1067 void GEOMToolsGUI::OnIsosWidth() {
1068 SalomeApp_Application* app =
1069 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
1070 SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
1071 SUIT_ViewWindow* window = app->desktop()->activeWindow();
1073 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
1074 bool isVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
1076 if(isOCC){ // if is OCCViewer
1078 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
1079 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
1082 if ( ic->MoreCurrent() ) {
1083 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
1084 CurObject->restoreIsoNumbers();
1085 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
1087 Handle(Graphic3d_AspectLine3d) asp = CurDrawer->UIsoAspect()->Aspect();
1090 Aspect_TypeOfLine T;
1094 int aWidth = (int)W;
1096 GEOMToolsGUI_LineWidthDlg * Dlg =
1097 new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(),"ISOS_WIDTH_TLT" );
1099 Dlg->setTheLW( aWidth );
1101 if ( Dlg->exec() ) {
1102 SUIT_OverrideCursor();
1103 aWidth = Dlg->getTheLW();
1104 } else //Cancel case
1107 for(; ic->MoreCurrent(); ic->NextCurrent()) {
1108 int aMgrId = window->getViewManager()->getGlobalId();
1109 CurObject = Handle(GEOM_AISShape)::DownCast(ic->Current());
1111 Handle(AIS_Drawer) CurDrawer = CurObject->Attributes();
1113 CurObject->Attributes()->UIsoAspect()->SetWidth(aWidth);
1114 CurObject->Attributes()->VIsoAspect()->SetWidth(aWidth);
1116 ic->Redisplay(CurObject);
1118 aStudy->setObjectProperty(aMgrId ,CurObject->getIO()->getEntry(), ISOS_WIDTH_PROP, aWidth);
1120 GeometryGUI::Modified();
1123 else if(isVTK){ // if is VTKViewer
1125 // Warning. It's works incorrect. must be recheked.
1127 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >
1128 ( SUIT_Session::session()->activeApplication() );
1131 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
1134 SALOME_ListIO selected;
1135 aSelMgr->selectedObjects( selected );
1136 if ( selected.IsEmpty() )
1139 SVTK_ViewWindow* vtkVW = dynamic_cast<SVTK_ViewWindow*>( window );
1143 SALOME_View* view = GEOM_Displayer::GetActiveView();
1145 vtkActorCollection* aCollection = vtkActorCollection::New();
1147 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
1148 Handle(SALOME_InteractiveObject) anIObject = It.Value();
1149 SALOME_Prs* aPrs = view->CreatePrs( anIObject->getEntry() );
1150 SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( aPrs );
1152 vtkActorCollection* anActors = vtkPrs->GetObjects();
1153 anActors->InitTraversal();
1154 vtkActor* anAct = anActors->GetNextActor();
1155 aCollection->AddItem(anAct);
1160 aCollection->InitTraversal();
1166 vtkActor* anAct = aCollection->GetNextActor();
1167 if (GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
1168 aWidth = anActor->GetIsosWidth();
1173 GEOMToolsGUI_LineWidthDlg* Dlg =
1174 new GEOMToolsGUI_LineWidthDlg( SUIT_Session::session()->activeApplication()->desktop(), "ISOS_WIDTH_TLT" );
1176 Dlg->setTheLW( aWidth );
1178 SUIT_OverrideCursor();
1179 aWidth = Dlg->getTheLW();
1181 return; //Cancel case
1183 while( anAct!= NULL ) {
1184 if(GEOM_Actor* anActor = GEOM_Actor::SafeDownCast(anAct)) {
1185 // There are no casting to needed actor.
1186 anActor->SetIsosWidth(aWidth);
1187 int aMgrId = window->getViewManager()->getGlobalId();
1188 aStudy->setObjectProperty(aMgrId ,anActor->getIO()->getEntry(), ISOS_WIDTH_PROP, aWidth);
1190 anAct = aCollection->GetNextActor();
1194 GeometryGUI::Modified();
1198 void GEOMToolsGUI::OnBringToFront() {
1199 SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
1203 SalomeApp_Module* mod = dynamic_cast<SalomeApp_Module*>(app->activeModule());
1207 GEOM_Displayer* disp = dynamic_cast<GEOM_Displayer*>(mod->displayer());
1212 LightApp_SelectionMgr* aSelMgr = app->selectionMgr();
1216 SALOME_ListIO selected;
1217 aSelMgr->selectedObjects( selected );
1218 if ( selected.IsEmpty() )
1221 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
1225 SUIT_ViewWindow* window = app->desktop()->activeWindow();
1227 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
1231 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
1233 QAction* a = getGeometryGUI()->getAction( GEOMOp::OpBringToFront );
1234 bool checked = a->isChecked();
1237 GEOMBase* gb = new GEOMBase();
1238 Handle(GEOM_AISShape) aisShape;
1240 Handle(AIS_InteractiveContext) ic = vm->getAISContext();
1241 SALOME_ListIO anIOlst;
1242 for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
1243 aisShape = gb->ConvertIOinGEOMAISShape( It.Value(), true );
1244 if ( !aisShape.IsNull() ) {
1245 aisShape->setTopLevel(checked);
1246 int aMgrId = window->getViewManager()->getGlobalId();
1247 appStudy->setObjectProperty( aMgrId, aisShape->getIO()->getEntry(), TOP_LEVEL_PROP, checked );
1248 anIOlst.Append(aisShape->getIO());
1251 disp->Redisplay(anIOlst);
1252 GeometryGUI::Modified();
1256 void GEOMToolsGUI::OnClsBringToFront() {
1257 SalomeApp_Application* app =
1258 dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
1262 SalomeApp_Module* mod = dynamic_cast<SalomeApp_Module*>(app->activeModule());
1266 GEOM_Displayer* disp = dynamic_cast<GEOM_Displayer*>(mod->displayer());
1272 SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>(app->activeStudy());
1276 SUIT_ViewWindow* window = app->desktop()->activeWindow();
1278 bool isOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
1280 if(isOCC){ // if is OCCViewer
1282 OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
1283 Handle (AIS_InteractiveContext) ic = vm->getAISContext();
1285 SALOME_ListIO anIOlst;
1286 AIS_ListOfInteractive aList;
1287 ic->DisplayedObjects( aList );
1288 for ( AIS_ListIteratorOfListOfInteractive it( aList ); it.More(); it.Next() ) {
1290 Handle(GEOM_AISShape) CurObject = Handle(GEOM_AISShape)::DownCast(it.Value());
1292 if(CurObject.IsNull())
1295 CurObject->setTopLevel(Standard_False);
1297 int aMgrId = window->getViewManager()->getGlobalId();
1298 appStudy->setObjectProperty( aMgrId, QString(CurObject->getIO()->getEntry()), TOP_LEVEL_PROP, Standard_False );
1299 anIOlst.Append(CurObject->getIO());
1301 disp->Redisplay(anIOlst);
1302 GeometryGUI::Modified();