From: apo Date: Mon, 19 Sep 2005 12:06:06 +0000 (+0000) Subject: Porting to BR-D5-38-2003 branch X-Git-Tag: BR-D5-38-2003_D2005-12-10~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b2744d014def6e381e9c88f2ad91fd4260af3ebf;p=modules%2Fsmesh.git Porting to BR-D5-38-2003 branch --- diff --git a/src/SMESHFiltersSelection/Makefile.in b/src/SMESHFiltersSelection/Makefile.in index e9c388166..c438321b7 100644 --- a/src/SMESHFiltersSelection/Makefile.in +++ b/src/SMESHFiltersSelection/Makefile.in @@ -64,7 +64,7 @@ EXPORT_HEADERS= SMESH_Type.h \ # additionnal information to compil and link file CPPFLAGS += $(OCC_INCLUDES) $(QT_INCLUDES) $(PYTHON_INCLUDES) $(VTK_INCLUDES) \ -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ - -I${GEOM_ROOT_DIR}/include/salome -I${BOOSTDIR} + -I${GEOM_ROOT_DIR}/include/salome ${BOOST_CPPFLAGS} CXXFLAGS += $(OCC_CXXFLAGS) -I${KERNEL_ROOT_DIR}/include/salome -I${GUI_ROOT_DIR}/include/salome \ -I${GEOM_ROOT_DIR}/include/salome -I${BOOSTDIR} LDFLAGS += $(OCC_KERNEL_LIBS) -L${GUI_ROOT_DIR}/lib/salome -L${GEOM_ROOT_DIR}/lib/salome -lSalomeApp -lsuit diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index 49d6ff795..81ca6c8de 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -2216,17 +2216,17 @@ bool SMESHGUI_FilterDlg::createFilter (const int theType) //======================================================================= void SMESHGUI_FilterDlg::insertFilterInViewer() { - if (SVTK_InteractorStyle* aStyle = SMESH::GetInteractorStyle()) { + if (SVTK_Selector* aSelector = SMESH::GetSelector()) { SMESH::ElementType anEntType = (SMESH::ElementType)myTable->GetType(); if (myFilter[ myTable->GetType() ]->_is_nil() || myFilter[ myTable->GetType() ]->GetPredicate()->_is_nil() || !mySetInViewer->isChecked()) { - SMESH::RemoveFilter(getFilterId(anEntType), aStyle); + SMESH::RemoveFilter(getFilterId(anEntType), aSelector); } else { Handle(SMESHGUI_PredicateFilter) aFilter = new SMESHGUI_PredicateFilter(); aFilter->SetPredicate(myFilter[ myTable->GetType() ]->GetPredicate()); - SMESH::SetFilter(aFilter, aStyle); + SMESH::SetFilter(aFilter, aSelector); } } } diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index 2887e3c59..4afe023f5 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -504,8 +504,8 @@ void SMESHGUI_MultiEditDlg::onSelectionDone() myActor = SMESH::FindActorByEntry(aList.First()->getEntry()); if (!myActor) myActor = SMESH::FindActorByObject(myMesh); - SVTK_InteractorStyle* aStyle = SMESH::GetInteractorStyle(); - Handle(VTKViewer_Filter) aFilter = aStyle->GetFilter(myFilterType); + SVTK_Selector* aSelector = SMESH::GetSelector(); + Handle(VTKViewer_Filter) aFilter = aSelector->GetFilter(myFilterType); if (!aFilter.IsNull()) aFilter->SetActor(myActor); } @@ -605,9 +605,9 @@ void SMESHGUI_MultiEditDlg::onFilterAccepted() //======================================================================= bool SMESHGUI_MultiEditDlg::isIdValid (const int theId) const { - SVTK_InteractorStyle* aStyle = SMESH::GetInteractorStyle(); + SVTK_Selector* aSelector = SMESH::GetSelector(); Handle(SMESHGUI_Filter) aFilter = - Handle(SMESHGUI_Filter)::DownCast(aStyle->GetFilter(myFilterType)); + Handle(SMESHGUI_Filter)::DownCast(aSelector->GetFilter(myFilterType)); return (!aFilter.IsNull() && aFilter->IsObjValid(theId)); } diff --git a/src/SMESHGUI/SMESHGUI_Selection.cxx b/src/SMESHGUI/SMESHGUI_Selection.cxx index 014e88a5a..5ff9b0ff0 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.cxx +++ b/src/SMESHGUI/SMESHGUI_Selection.cxx @@ -308,8 +308,8 @@ QVariant SMESHGUI_Selection::isVisible( int ind ) const QString entry = static_cast( myDataOwners[ ind ].get() )->entry(); SMESH_Actor* actor = SMESH::FindActorByEntry( entry.latin1() ); if ( actor && actor->hasIO() ) { - SVTK_RenderWindowInteractor* renderInter = SMESH::GetCurrentVtkView()->getRWInteractor(); - return QVariant( renderInter->isVisible( actor->getIO() ), 0 ); + if(SVTK_ViewWindow* aViewWindow = SMESH::GetCurrentVtkView()) + return QVariant( aViewWindow->isVisible( actor->getIO() ), 0 ); } } return QVariant( false, 0 ); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index c9141ec82..801909657 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -36,9 +36,7 @@ #include "SVTK_Selector.h" #include "SVTK_ViewModel.h" #include "SVTK_ViewWindow.h" -#include "SVTK_RenderWindow.h" #include "SVTK_InteractorStyle.h" -#include "SVTK_RenderWindowInteractor.h" #include "utilities.h" @@ -448,85 +446,83 @@ namespace SMESH{ double SP1 = mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ), SP2 = mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ); - for ( int i=0, n=views.count(); igetRWInteractor(); - if (anInteractor) { - // mesh element selection - anInteractor->SetSelectionProp(aSelColor.red()/255., aSelColor.green()/255., - aSelColor.blue()/255., SW ); - - // tolerances - anInteractor->SetSelectionTolerance(SP1, SP2); - - // pre-selection - SVTK_InteractorStyle* aStyle = - dynamic_cast( anInteractor->GetInteractorStyle() ); - if (aStyle) { - aStyle->setPreselectionProp(aPreColor.red()/255., aPreColor.green()/255., - aPreColor.blue()/255., PW); - } - } + for ( int i=0, n=views.count(); iSetSelectionProp(aSelColor.red()/255., + aSelColor.green()/255., + aSelColor.blue()/255., + SW ); + // tolerances + aVtkView->SetSelectionTolerance(SP1, SP2); + + // pre-selection + aVtkView->SetPreselectionProp(aPreColor.red()/255., + aPreColor.green()/255., + aPreColor.blue()/255., + PW); // update actors vtkRenderer* aRenderer = aVtkView->getRenderer(); vtkActorCollection *aCollection = aRenderer->GetActors(); aCollection->InitTraversal(); while(vtkActor *anAct = aCollection->GetNextActor()){ if(SMESH_Actor *anActor = dynamic_cast(anAct)){ - anActor->SetHighlightColor(aHiColor.red()/255., aHiColor.green()/255., + anActor->SetHighlightColor(aHiColor.red()/255., + aHiColor.green()/255., aHiColor.blue()/255.); - anActor->SetPreHighlightColor(aPreColor.red()/255., aPreColor.green()/255., + anActor->SetPreHighlightColor(aPreColor.red()/255., + aPreColor.green()/255., aPreColor.blue()/255.); } } + } } } //---------------------------------------------------------------------------- - SVTK_InteractorStyle* GetInteractorStyle(SUIT_ViewWindow *theWindow){ - if(SVTK_ViewWindow* aWnd = GetVtkViewWindow(theWindow)){ - if(SVTK_RenderWindowInteractor* anInteractor = aWnd->getRWInteractor()){ - return dynamic_cast( anInteractor->GetInteractorStyle() ); - } - } + SVTK_Selector* + GetSelector(SUIT_ViewWindow *theWindow) + { + if(SVTK_ViewWindow* aWnd = GetVtkViewWindow(theWindow)) + return aWnd->GetSelector(); + return NULL; } void SetFilter(const Handle(VTKViewer_Filter)& theFilter, - SVTK_InteractorStyle* theStyle) + SVTK_Selector* theSelector) { - if (theStyle) - theStyle->SetFilter(theFilter); + if (theSelector) + theSelector->SetFilter(theFilter); } - Handle(VTKViewer_Filter) GetFilter(int theId, SVTK_InteractorStyle* theStyle) + Handle(VTKViewer_Filter) GetFilter(int theId, SVTK_Selector* theSelector) { - return theStyle->GetFilter(theId); + return theSelector->GetFilter(theId); } - bool IsFilterPresent(int theId, SVTK_InteractorStyle* theStyle) + bool IsFilterPresent(int theId, SVTK_Selector* theSelector) { - return theStyle->IsFilterPresent(theId); + return theSelector->IsFilterPresent(theId); } - void RemoveFilter(int theId, SVTK_InteractorStyle* theStyle) + void RemoveFilter(int theId, SVTK_Selector* theSelector) { - theStyle->RemoveFilter(theId); + theSelector->RemoveFilter(theId); } - void RemoveFilters(SVTK_InteractorStyle* theStyle) + void RemoveFilters(SVTK_Selector* theSelector) { - for ( int id = SMESHGUI_NodeFilter; theStyle && id < SMESHGUI_LastFilter; id++ ) - theStyle->RemoveFilter( id ); + for ( int id = SMESHGUI_NodeFilter; theSelector && id < SMESHGUI_LastFilter; id++ ) + theSelector->RemoveFilter( id ); } bool IsValid(SALOME_Actor* theActor, int theCellId, - SVTK_InteractorStyle* theStyle) + SVTK_Selector* theSelector) { - return theStyle->IsValid(theActor,theCellId); + return theSelector->IsValid(theActor,theCellId); } diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.h b/src/SMESHGUI/SMESHGUI_VTKUtils.h index f94695cd5..c597fade7 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.h +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.h @@ -34,7 +34,6 @@ class SUIT_Study; class SUIT_ViewWindow; class SUIT_ViewManager; -class SVTK_InteractorStyle; class SVTK_ViewWindow; class SVTK_Selector; @@ -119,25 +118,25 @@ namespace SMESH{ //---------------------------------------------------------------------------- - SVTK_InteractorStyle* - GetInteractorStyle (SUIT_ViewWindow* = GetActiveWindow()); + SVTK_Selector* + GetSelector(SUIT_ViewWindow* = GetActiveWindow()); void SetFilter (const Handle(VTKViewer_Filter)& theFilter, - SVTK_InteractorStyle* theStyle = GetInteractorStyle()); + SVTK_Selector* theSelector = GetSelector()); Handle(VTKViewer_Filter) - GetFilter (int theId, SVTK_InteractorStyle* theStyle = GetInteractorStyle()); + GetFilter (int theId, SVTK_Selector* theSelector = GetSelector()); bool IsFilterPresent (int theId, - SVTK_InteractorStyle* theStyle = GetInteractorStyle()); + SVTK_Selector* theSelector = GetSelector()); void RemoveFilter (int theId, - SVTK_InteractorStyle* theStyle = GetInteractorStyle()); + SVTK_Selector* theSelector = GetSelector()); - void RemoveFilters (SVTK_InteractorStyle* theStyle = GetInteractorStyle()); + void RemoveFilters (SVTK_Selector* theSelector = GetSelector()); bool IsValid (SALOME_Actor* theActor, int theCellId, - SVTK_InteractorStyle* theStyle = GetInteractorStyle()); + SVTK_Selector* theSelector = GetSelector()); //---------------------------------------------------------------------------- int GetNameOfSelectedNodes(SVTK_Selector* theSelector,