1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #include "HYDROGUI_LandCoverMapOp.h"
21 #include "HYDROGUI_Module.h"
22 #include "HYDROGUI_OCCDisplayer.h"
23 #include "HYDROGUI_Operations.h"
24 #include "HYDROGUI_LandCoverMapDlg.h"
25 #include "HYDROGUI_Tool2.h"
26 #include "HYDROGUI_UpdateFlags.h"
27 #include "HYDROGUI_DataObject.h"
28 #include "HYDROGUI_ShapeLandCoverMap.h"
29 #include "HYDROGUI_OCCSelector.h"
31 #include <HYDROData_Iterator.h>
32 #include <HYDROData_StricklerTable.h>
33 #include <HYDROData_PolylineXY.h>
34 #include <HYDROData_Object.h>
36 #include <OCCViewer_ViewManager.h>
37 #include <OCCViewer_ViewModel.h>
38 #include <OCCViewer_ViewWindow.h>
39 #include <OCCViewer_ViewPort3d.h>
41 #include <LightApp_Application.h>
42 #include <LightApp_SelectionMgr.h>
43 #include <SUIT_ViewWindow.h>
46 #include <TopoDS_Face.hxx>
47 #include <TopTools_ListOfShape.hxx>
48 #include <TopTools_ListIteratorOfListOfShape.hxx>
49 #include <AIS_Shape.hxx>
51 #include <QApplication>
52 #include <QMouseEvent>
54 HYDROGUI_LandCoverMapOp::HYDROGUI_LandCoverMapOp( HYDROGUI_Module* theModule, const int theOperationId )
55 : HYDROGUI_Operation( theModule ),
56 myOperationId( theOperationId ),
59 switch( myOperationId )
61 case CreateLandCoverMapId:
62 setName( tr( "CREATE_LAND_COVER_MAP" ) );
65 setName( tr( "ADD_LAND_COVER" ) );
67 case RemoveLandCoverId:
68 setName( tr( "REMOVE_LAND_COVER" ) );
70 case SplitLandCoverId:
71 setName( tr( "SPLIT_LAND_COVER" ) );
73 case MergeLandCoverId:
74 setName( tr( "MERGE_LAND_COVER" ) );
76 case ChangeLandCoverTypeId:
77 setName( tr( "CHANGE_LAND_COVER_TYPE" ) );
82 HYDROGUI_LandCoverMapOp::~HYDROGUI_LandCoverMapOp()
87 void HYDROGUI_LandCoverMapOp::startOperation()
89 HYDROGUI_Operation::startOperation();
91 HYDROGUI_LandCoverMapDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverMapDlg*>( inputPanel() );
95 aPanel->blockSignals( true );
99 // Set name of the created/edited land cover map object
100 QString anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_LAND_COVER_MAP_NAME" ) );
101 if ( myOperationId != CreateLandCoverMapId )
103 if ( isApplyAndClose() )
104 myEditedObject = Handle(HYDROData_LandCoverMap)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
106 // Construct a list of names of all land cover map objects defined within the data model
107 QStringList aLandCoverMapNames;
108 HYDROData_Iterator anIterator( doc(), KIND_LAND_COVER_MAP );
109 for( ; anIterator.More(); anIterator.Next() )
111 Handle(HYDROData_LandCoverMap) aLandCoverObj =
112 Handle(HYDROData_LandCoverMap)::DownCast( anIterator.Current() );
113 if ( !aLandCoverObj.IsNull() )
114 aLandCoverMapNames.append( aLandCoverObj->GetName() );
117 //aLandCoverMapNames.sort();
118 aPanel->setObjectNames( aLandCoverMapNames );
120 if ( myEditedObject.IsNull() )
122 if ( !aLandCoverMapNames.empty() )
124 anObjectName = aLandCoverMapNames.first();
125 if ( !anObjectName.isEmpty())
127 Handle(HYDROData_LandCoverMap) anObject =
128 Handle(HYDROData_LandCoverMap)::DownCast( HYDROGUI_Tool::FindObjectByName( module(), anObjectName ) );
129 if( !anObject.IsNull() )
130 myEditedObject = anObject;
135 anObjectName = myEditedObject->GetName();
137 aPanel->setObjectName( anObjectName );
140 if ( myOperationId != CreateLandCoverMapId )
143 aPanel->blockSignals( false );
145 module()->update( UF_OCCViewer | UF_FitAll );
148 void HYDROGUI_LandCoverMapOp::abortOperation()
152 HYDROGUI_Operation::abortOperation();
154 module()->update( UF_OCCViewer | UF_FitAll );
157 void HYDROGUI_LandCoverMapOp::commitOperation()
161 HYDROGUI_Operation::commitOperation();
163 module()->update( UF_OCCViewer | UF_FitAll );
166 HYDROGUI_InputPanel* HYDROGUI_LandCoverMapOp::createInputPanel() const
168 HYDROGUI_LandCoverMapDlg* aPanel = new HYDROGUI_LandCoverMapDlg( module(), getName(), myOperationId );
169 connect( aPanel, SIGNAL( landCoverMapChanged( const QString& ) ),
170 this, SLOT( onLandCoverMapChanged( const QString& ) ) );
174 bool HYDROGUI_LandCoverMapOp::processApply( int& theUpdateFlags,
175 QString& theErrorMsg,
176 QStringList& theBrowseObjectsEntries )
178 HYDROGUI_LandCoverMapDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverMapDlg*>( inputPanel() );
182 // Check name of the created/edited object
183 QString anObjectName = aPanel->getObjectName().simplified();
184 if ( anObjectName.isEmpty() )
186 theErrorMsg = tr( "INCORRECT_OBJECT_NAME" );
190 if ( myOperationId == CreateLandCoverMapId || ( !myEditedObject.IsNull() && myEditedObject->GetName() != anObjectName ) )
192 // check that there are no other objects with the same name in the document
193 Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( module(), anObjectName );
194 if( !anObject.IsNull() )
196 theErrorMsg = tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( anObjectName );
201 Handle(HYDROData_PolylineXY) aPolyline;
202 Handle(HYDROData_Object) aFace;
204 TopTools_ListOfShape aFacesSelectedInViewer;
206 // Get polyline/face selected in combo-box
207 if ( myOperationId == CreateLandCoverMapId || myOperationId == AddLandCoverId || myOperationId == SplitLandCoverId )
209 Handle(HYDROData_Entity) aPolylineFace = aPanel->getPolylineFace();
210 aPolyline = Handle(HYDROData_PolylineXY)::DownCast( aPolylineFace );
211 aFace = Handle(HYDROData_Object)::DownCast( aPolylineFace );
212 if ( aPolyline.IsNull() && aFace.IsNull() )
214 theErrorMsg = tr( "POLYLINE_FACE_NOT_DEFINED" );
218 // Get face(s) selected in the 3d viewer
219 else if ( myOperationId == RemoveLandCoverId ||
220 myOperationId == MergeLandCoverId ||
221 myOperationId == ChangeLandCoverTypeId )
224 // Fill in aFacesSelectedInViewer list
225 getSelectedShapes( aFacesSelectedInViewer );
228 // Get selected Strickler type
229 QString aSelectedStricklerType;
230 if ( myOperationId == CreateLandCoverMapId ||
231 myOperationId == AddLandCoverId ||
232 myOperationId == MergeLandCoverId ||
233 myOperationId == ChangeLandCoverTypeId )
235 aSelectedStricklerType = aPanel->getSelectedStricklerTypeName();
236 if ( aSelectedStricklerType.isEmpty() )
238 theErrorMsg = tr( "STRICKLER_TYPE_NOT_DEFINED" );
243 // Create / find the new / edited land cover map object
244 Handle(HYDROData_LandCoverMap) aLandCoverMapObj = myOperationId != CreateLandCoverMapId ? myEditedObject :
245 Handle(HYDROData_LandCoverMap)::DownCast( doc()->CreateObject( KIND_LAND_COVER_MAP ) );
246 if ( aLandCoverMapObj.IsNull() )
248 theErrorMsg = tr( "LAND_COVER_MAP_UNDEFINED" );
252 // Set land cover map name
253 aLandCoverMapObj->SetName( anObjectName );
255 // Add land cover to new / edited land cover map
256 if ( myOperationId == CreateLandCoverMapId || myOperationId == AddLandCoverId )
258 bool aLandCoverAdded = false;
259 if ( !aPolyline.IsNull() )
260 aLandCoverAdded = aLandCoverMapObj->Add( aPolyline, aSelectedStricklerType );
261 else if ( !aFace.IsNull() )
262 aLandCoverAdded = aLandCoverMapObj->Add( aFace, aSelectedStricklerType );
263 if ( !aLandCoverAdded )
265 theErrorMsg = tr( "LAND_COVER_NOT_ADDED" );
270 // Remove land cover from edited land cover map
271 if ( myOperationId == RemoveLandCoverId )
273 bool aLandCoverRemoved = false;
274 if ( !aFacesSelectedInViewer.IsEmpty() )
276 aLandCoverRemoved = aLandCoverMapObj->Remove( aFacesSelectedInViewer );
277 if ( !aLandCoverRemoved )
279 theErrorMsg = tr( "LAND_COVER_NOT_REMOVED" );
285 // Split land cover(s) inside edited land cover map
286 if ( myOperationId == SplitLandCoverId )
288 bool aLandCoverSplit = false;
289 if ( !aPolyline.IsNull() )
290 aLandCoverSplit = aLandCoverMapObj->Split( aPolyline );
291 else if ( !aFace.IsNull() )
293 // Get the complete boundary of the object face as the splitting polyline
294 QList<TopoDS_Shape> aBoundShapes;
295 QStringList aBoundNames;
296 aFace->GetBoundaries( aBoundShapes, aBoundNames );
298 for( int i=0, n=aBoundShapes.size(); i<n; i++ )
300 TopoDS_Shape aShape = aBoundShapes[i];
301 if( aShape.IsNull() )
304 bool aSplitResult = aLandCoverMapObj->Split( aShape );
305 aLandCoverSplit = ( i==0 ? aSplitResult : aLandCoverSplit && aSplitResult );
308 if ( !aLandCoverSplit )
310 theErrorMsg = tr( "LAND_COVER_NOT_SPLIT" );
315 // Merge land covers inside edited land cover map
316 if ( myOperationId == MergeLandCoverId )
318 bool aLandCoverMerged = false;
319 if ( !aFacesSelectedInViewer.IsEmpty() )
321 aLandCoverMerged = aLandCoverMapObj->Merge( aFacesSelectedInViewer, aSelectedStricklerType );
322 if ( !aLandCoverMerged )
324 theErrorMsg = tr( "LAND_COVER_NOT_MERGED" );
330 // Change Strickler type for land cover(s) inside edited land cover map
331 if ( myOperationId == ChangeLandCoverTypeId )
333 bool aLandCoverChangeType = false;
334 if ( !aFacesSelectedInViewer.IsEmpty() )
336 aLandCoverChangeType = aLandCoverMapObj->ChangeType( aFacesSelectedInViewer, aSelectedStricklerType );
337 if ( !aLandCoverChangeType )
339 theErrorMsg = tr( "LAND_COVER_TYPE_NOT_CHANGED" );
345 // Update land cover map object and close preview
346 aLandCoverMapObj->Update();
350 // Publish the newly created land cover map in the Object Browser
351 module()->setObjectVisible( HYDROGUI_Tool::GetActiveOCCViewId( module() ), aLandCoverMapObj, true );
352 if ( myOperationId == CreateLandCoverMapId )
354 QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aLandCoverMapObj );
355 theBrowseObjectsEntries.append( anEntry );
358 // Update presentation of land cover object in the 3d viewer
359 module()->setIsToUpdate( aLandCoverMapObj );
360 module()->getOCCDisplayer()->SetToUpdateColorScale();
362 theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
364 if ( myOperationId == CreateLandCoverMapId )
365 module()->enableLCMActions();
370 void HYDROGUI_LandCoverMapOp::onLandCoverMapChanged( const QString& theName )
372 // If the edited land cover map was changed in the combo-box, update myEditedObject
373 if ( myOperationId != CreateLandCoverMapId )
375 myEditedObject = Handle(HYDROData_LandCoverMap)::DownCast( HYDROGUI_Tool::FindObjectByName( module(), theName ) );
376 if ( !myEditedObject.IsNull() )
378 // Show preview of the newly selected land cover map
385 void HYDROGUI_LandCoverMapOp::onCreatePreview()
387 HYDROGUI_LandCoverMapDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverMapDlg*>( inputPanel() );
391 QApplication::setOverrideCursor( Qt::WaitCursor );
393 LightApp_Application* anApp = module()->getApp();
394 if ( !getPreviewManager() )
395 setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>(
396 anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
397 OCCViewer_ViewManager* aViewManager = getPreviewManager();
398 if ( aViewManager && !myPreviewPrs )
400 if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
402 Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
403 if ( !aCtx.IsNull() )
405 disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
406 aViewer, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
407 disconnect(aViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
408 aViewer, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
410 connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
411 this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
412 connect(aViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
413 this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
415 LightApp_SelectionMgr* aSelectionMgr = module()->getApp()->selectionMgr();
418 QList<SUIT_Selector*> aSelectorList;
419 aSelectionMgr->selectors( aViewManager->getType(), aSelectorList );
420 QList<SUIT_Selector*>::iterator anIter, anIterEnd = aSelectorList.end();
421 for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
423 HYDROGUI_OCCSelector* aHydroSelector = dynamic_cast<HYDROGUI_OCCSelector*>( *anIter );
424 if ( aHydroSelector )
426 disconnect( aHydroSelector->viewer(), SIGNAL( deselection() ), aHydroSelector, SLOT( onDeselection() ) );
427 connect( this, SIGNAL( deselection() ), aHydroSelector, SLOT( onDeselection() ) );
432 connect( this, SIGNAL( selectionChanged() ), this, SLOT( onViewerSelectionChanged() ) );
433 myPreviewPrs = new HYDROGUI_ShapeLandCoverMap( module()->getOCCDisplayer(), aCtx, myEditedObject, getPreviewZLayer()/*, theIsScalarMapMode*/ );
438 if ( aViewManager && myPreviewPrs && !myEditedObject.IsNull() )
440 if ( myOperationId == RemoveLandCoverId ||
441 myOperationId == MergeLandCoverId ||
442 myOperationId == ChangeLandCoverTypeId )
443 myPreviewPrs->setSelectionMode( AIS_Shape::SelectionMode( TopAbs_FACE ) );
444 myPreviewPrs->update( false, false );
446 if ( myOperationId == ChangeLandCoverTypeId )
447 selectLandCoverInPreview();
450 module()->update( UF_OCCViewer | UF_FitAll );
452 QApplication::restoreOverrideCursor();
455 void HYDROGUI_LandCoverMapOp::onViewerSelectionChanged()
457 HYDROGUI_LandCoverMapDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverMapDlg*>( inputPanel() );
461 int aNbSelected = getNbSelected();
463 if ( myOperationId == RemoveLandCoverId || myOperationId == ChangeLandCoverTypeId )
464 // Enable Apply, Apply and Close buttons only if at least one face (land cover) is selected in the 3d viewer
465 aPanel->setApplyEnabled( aNbSelected > 0 );
466 else if ( myOperationId == MergeLandCoverId )
467 // Enable Apply, Apply and Close buttons only if at least two faces (land covers) are selected in the 3d viewer
468 aPanel->setApplyEnabled( aNbSelected > 1 );
470 if ( myOperationId == MergeLandCoverId || myOperationId == ChangeLandCoverTypeId )
472 if ( aNbSelected == 1 && !myEditedObject.IsNull() )
474 TopTools_ListOfShape aFacesSelectedInViewer;
475 getSelectedShapes( aFacesSelectedInViewer );
476 if ( aFacesSelectedInViewer.Extent() == 1 )
478 QString aType = myEditedObject->StricklerType( TopoDS::Face( aFacesSelectedInViewer.First() ) );
479 if ( !aType.isEmpty() )
480 aPanel->setSelectedStricklerTypeName( aType );
485 if ( myOperationId == RemoveLandCoverId || myOperationId == MergeLandCoverId || myOperationId == ChangeLandCoverTypeId )
486 aPanel->updateSelectedLandCoversLabel( aNbSelected );
489 void HYDROGUI_LandCoverMapOp::onMousePress(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent)
491 myStartPnt.setX(theEvent->x()); myStartPnt.setY(theEvent->y());
494 void HYDROGUI_LandCoverMapOp::onMouseRelease(SUIT_ViewWindow* theWindow, QMouseEvent* theEvent)
496 if (theEvent->button() != Qt::LeftButton) return;
497 if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
499 OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
503 OCCViewer_ViewManager* aViewManager = getPreviewManager();
507 OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer();
511 Handle(AIS_InteractiveContext) aCtx = getInteractiveContext();
515 myEndPnt.setX(theEvent->x()); myEndPnt.setY(theEvent->y());
517 if (myStartPnt == myEndPnt)
519 if ( !aViewer->isPreselectionEnabled() ) {
520 Handle(V3d_View) aView3d = aView->getViewPort()->getView();
521 if ( !aView3d.IsNull() ) {
522 aCtx->MoveTo(myEndPnt.x(), myEndPnt.y(), aView3d);
526 Handle(StdSelect_ViewerSelector3d) aMainSelector = aCtx->MainSelector();
527 if ( aMainSelector.IsNull() )
529 const Standard_Integer aDetectedNb = aMainSelector->NbPicked();
530 if ( aDetectedNb == 0 )
532 aCtx->ClearSelected( false );
536 for (Standard_Integer aDetIter = 1; aDetIter <= aDetectedNb; ++aDetIter)
538 Handle(SelectMgr_EntityOwner) anOwner = aMainSelector->Picked (aDetIter);
539 aCtx->AddOrRemoveSelected( anOwner, Standard_False );
544 aCtx->ShiftSelect(myStartPnt.x(), myStartPnt.y(),
545 myEndPnt.x(), myEndPnt.y(),
546 aView->getViewPort()->getView(), Standard_False );
549 aCtx->UpdateCurrentViewer();
550 emit selectionChanged();
553 void HYDROGUI_LandCoverMapOp::closePreview()
561 HYDROGUI_LandCoverMapDlg* aPanel = ::qobject_cast<HYDROGUI_LandCoverMapDlg*>( inputPanel() );
565 if ( myOperationId == RemoveLandCoverId || myOperationId == MergeLandCoverId || myOperationId == ChangeLandCoverTypeId )
566 aPanel->setApplyEnabled( false );
568 OCCViewer_ViewManager* aViewManager = getPreviewManager();
571 if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
573 disconnect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
574 this, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
575 disconnect(aViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
576 this, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
577 connect(aViewManager, SIGNAL(mousePress(SUIT_ViewWindow*, QMouseEvent*)),
578 aViewer, SLOT(onMousePress(SUIT_ViewWindow*, QMouseEvent*)));
579 connect(aViewManager, SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
580 aViewer, SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
582 LightApp_SelectionMgr* aSelectionMgr = module()->getApp()->selectionMgr();
585 QList<SUIT_Selector*> aSelectorList;
586 aSelectionMgr->selectors( aViewManager->getType(), aSelectorList );
587 QList<SUIT_Selector*>::iterator anIter, anIterEnd = aSelectorList.end();
588 for( anIter = aSelectorList.begin(); anIter != anIterEnd; anIter++ )
590 HYDROGUI_OCCSelector* aHydroSelector = dynamic_cast<HYDROGUI_OCCSelector*>( *anIter );
591 if ( aHydroSelector )
593 disconnect( this, SIGNAL( deselection() ), aHydroSelector, SLOT( onDeselection() ) );
594 connect( aHydroSelector->viewer(), SIGNAL( deselection() ), aHydroSelector, SLOT( onDeselection() ) );
602 Handle(AIS_InteractiveContext) HYDROGUI_LandCoverMapOp::getInteractiveContext()
604 OCCViewer_ViewManager* aViewManager = getPreviewManager();
605 Handle(AIS_InteractiveContext) aCtx = NULL;
606 if ( aViewManager ) {
607 if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
608 aCtx = aViewer->getAISContext();
614 void HYDROGUI_LandCoverMapOp::getSelectedShapes( TopTools_ListOfShape& theSelectedShapes )
616 Handle(AIS_InteractiveContext) aCtx = getInteractiveContext();
617 if ( !aCtx.IsNull() )
619 for ( aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected() )
621 TopoDS_Shape aSelectedShape = aCtx->SelectedShape();
622 if ( aSelectedShape.IsNull() )
625 theSelectedShapes.Append( aSelectedShape );
630 int HYDROGUI_LandCoverMapOp::getNbSelected()
634 Handle(AIS_InteractiveContext) aCtx = getInteractiveContext();
635 if ( !aCtx.IsNull() )
637 for ( aCtx->InitSelected(); aCtx->MoreSelected(); aCtx->NextSelected() )
639 TopoDS_Shape aSelectedShape = aCtx->SelectedShape();
640 if ( aSelectedShape.IsNull() )
649 void HYDROGUI_LandCoverMapOp::selectLandCoverInPreview()
651 if ( myPreviewPrs && !myEditedObject.IsNull() && myEditedObject->GetLCCount() == 1 )
653 OCCViewer_ViewManager* aViewManager = getPreviewManager();
657 Handle(AIS_InteractiveContext) aCtx = getInteractiveContext();
661 OCCViewer_ViewWindow* aViewWindow = (OCCViewer_ViewWindow*)aViewManager->getActiveView();
665 OCCViewer_ViewPort3d* aViewPort = aViewWindow->getViewPort();
669 Handle(V3d_View) aView = aViewPort->getView();
670 if ( aView.IsNull() )
673 aCtx->ShiftSelect( 0, 0, aViewPort->width(), aViewPort->height(), aView, Standard_False );
674 aCtx->UpdateCurrentViewer();
675 emit selectionChanged();