X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHGUI%2FSMESHGUI_VTKUtils.cxx;h=3cfbaf35400798eefe23920d146a48c113da9cf0;hb=39b202e1bb5679758a8da044b1c5e994f44335cf;hp=d8144f320dd16aacb844c71be3fa2fd5afd21519;hpb=85b1cfc1f07d0b93d88803c6c0ccadf8f3349719;p=modules%2Fsmesh.git diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index d8144f320..3cfbaf354 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -1,37 +1,46 @@ -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// SMESH SMESHGUI : GUI for SMESH component // -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. +// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. // -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// File : SMESHGUI_VTKUtils.cxx +// Author : Open CASCADE S.A.S. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com - +// SMESH includes #include "SMESHGUI_VTKUtils.h" + +#include "SMESHGUI.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_Filter.h" -#include "SMESHGUI.h" -#include "SMESH_Actor.h" -#include "SMESH_ActorUtils.h" -#include "SMESH_ObjectDef.h" +#include +#include +#include #include +// SALOME GUI includes #include #include -#include #include +#include +#include #include #include @@ -44,34 +53,26 @@ #include #include +// SALOME KERNEL includes #include +// IDL includes #include -#include CORBA_CLIENT_HEADER(SMESH_Gen) #include CORBA_CLIENT_HEADER(SMESH_Mesh) #include CORBA_CLIENT_HEADER(SMESH_Group) -#include CORBA_CLIENT_HEADER(SMESH_Hypothesis) - -#include -#include -// VTK +// VTK includes #include #include #include -// OCCT +// OCCT includes #include #include -// STL -#include -using namespace std; - - -namespace SMESH { - - typedef map TVisualObjCont; +namespace SMESH +{ + typedef std::map TVisualObjCont; static TVisualObjCont VISUAL_OBJ_CONT; //============================================================================= @@ -104,7 +105,7 @@ namespace SMESH { SUIT_ViewManager* aViewManager = app ? app->getViewManager(SVTK_Viewer::Type(), true) : 0; if ( aViewManager ) { - QPtrVector views = aViewManager->getViews(); + QVector views = aViewManager->getViews(); for ( int iV = 0; iV < views.count(); ++iV ) { if ( SMESH_Actor* actor = FindActorByEntry( views[iV], theEntry)) { if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) @@ -138,7 +139,7 @@ namespace SMESH { for ( int iM = 0; iM < viewMgrs.count(); ++iM ) { SUIT_ViewManager* aViewManager = viewMgrs.at( iM ); if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type()) { - QPtrVector views = aViewManager->getViews(); + QVector views = aViewManager->getViews(); for ( int iV = 0; iV < views.count(); ++iV ) { if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) { vtkRenderer *aRenderer = vtkWnd->getRenderer(); @@ -180,7 +181,7 @@ namespace SMESH { SUIT_ViewManager* aViewManager = viewMgrs.at( iM ); if ( aViewManager && aViewManager->getType() == SVTK_Viewer::Type() && aViewManager->study()->id() == studyID ) { - QPtrVector views = aViewManager->getViews(); + QVector views = aViewManager->getViews(); for ( int iV = 0; iV < views.count(); ++iV ) { if(SVTK_ViewWindow* vtkWnd = GetVtkViewWindow(views[iV])) { vtkRenderer *aRenderer = vtkWnd->getRenderer(); @@ -225,9 +226,8 @@ namespace SMESH { // after or at showing this message, so we do an additional check of available memory // char* buf = new char[100*1024]; // delete [] buf; - SUIT_MessageBox::warn1 (SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), - QObject::tr("SMESH_VISU_PROBLEM"), - QObject::tr("SMESH_BUT_OK")); + SUIT_MessageBox::warning(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_VISU_PROBLEM")); } catch (...) { // no more memory at all: last resort cout<< "SMESHGUI_VTKUtils::OnVisuException(), exception even at showing a message!!!" < views = theMgr->getViews(); - if( views.containsRef( theWindow ) ) + QVector views = theMgr->getViews(); + if( views.contains( theWindow ) ) return GetVtkViewWindow( theWindow ); else return NULL; @@ -650,7 +648,7 @@ namespace SMESH { vtkActorCollection *aCollection = aRenderer->GetActors(); aCollection->InitTraversal(); while(vtkActor *anAct = aCollection->GetNextActor()) - if(SMESH_Actor *anActor = dynamic_cast(anAct)) + if(dynamic_cast(anAct)) return false; } return true; @@ -754,7 +752,7 @@ namespace SMESH { } }else{ SALOME_ListIteratorOfListIO anIter( selected ); - for(; anIter.More(); anIter.Next()){ + for( ; anIter.More(); anIter.Next()){ Handle(SALOME_InteractiveObject) anIO = anIter.Value(); if ( !Update(anIO,true) ) break; // avoid multiple warinings if visu failed @@ -796,7 +794,7 @@ namespace SMESH { return; } - QPtrVector views = vm->getViews(); + QVector views = vm->getViews(); SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( theModule ); if( !mgr ) @@ -885,7 +883,7 @@ namespace SMESH { void RemoveFilters(SVTK_Selector* theSelector) { - for ( int id = SMESHGUI_NodeFilter; theSelector && id < SMESHGUI_LastFilter; id++ ) + for ( int id = SMESH::NodeFilter; theSelector && id < SMESH::LastFilter; id++ ) theSelector->RemoveFilter( id ); } @@ -963,7 +961,7 @@ namespace SMESH { anIdContainer.insert(aMapIndex(i)); TIdContainer::const_iterator anIter = anIdContainer.begin(); - for(; anIter != anIdContainer.end(); anIter++) + for( ; anIter != anIdContainer.end(); anIter++) theName += QString(" %1").arg(*anIter); return aMapIndex.Extent(); @@ -1043,12 +1041,12 @@ namespace SMESH { if(FindActorByEntry(theIO->getEntry())){ TColStd_IndexedMapOfInteger aMapIndex; theMgr->GetIndexes(theIO,aMapIndex); - typedef set TIdContainer; + typedef std::set TIdContainer; TIdContainer anIdContainer; for( int i = 1; i <= aMapIndex.Extent(); i++) anIdContainer.insert(aMapIndex(i)); TIdContainer::const_iterator anIter = anIdContainer.begin(); - for(; anIter != anIdContainer.end(); anIter++){ + for( ; anIter != anIdContainer.end(); anIter++){ theName += QString(" %1").arg(*anIter); } return aMapIndex.Extent(); @@ -1142,4 +1140,4 @@ namespace SMESH { } } -} +} // end of namespace SMESH