00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef SMESHGUI_VTKUTILS_H
00028 #define SMESHGUI_VTKUTILS_H
00029
00030
00031 #include "SMESH_SMESHGUI.hxx"
00032
00033 #include "SMESHGUI_Utils.h"
00034 #include <SMESH_Object.h>
00035
00036
00037 #include <SALOMEDSClient_definitions.hxx>
00038
00039
00040 #include <SALOME_InteractiveObject.hxx>
00041 #include <VTKViewer_Filter.h>
00042
00043 class TColStd_IndexedMapOfInteger;
00044
00045 class SALOMEDSClient_Study;
00046
00047 class SUIT_ViewWindow;
00048 class SUIT_ViewManager;
00049
00050 class SVTK_ViewWindow;
00051 class SVTK_Selector;
00052
00053 class LightApp_SelectionMgr;
00054 class SalomeApp_Module;
00055
00056 class SMESHGUI;
00057 class SMESH_Actor;
00058 class SALOME_Actor;
00059
00060 class vtkActor;
00061
00062 namespace SMESH
00063 {
00064
00065 typedef std::pair<int,std::string> TKeyOfVisualObj;
00066
00067 SMESHGUI_EXPORT
00068 TVisualObjPtr GetVisualObj( int, const char*, bool nulData =false );
00069 SMESHGUI_EXPORT
00070 void OnVisuException();
00071
00072
00073 SMESHGUI_EXPORT
00074 SVTK_ViewWindow* GetViewWindow( const SalomeApp_Module* = 0,
00075 bool = false );
00076 SMESHGUI_EXPORT
00077 SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* );
00078 SMESHGUI_EXPORT
00079 SVTK_ViewWindow* GetVtkViewWindow( SUIT_ViewWindow* );
00080
00081 SMESHGUI_EXPORT
00082 SVTK_ViewWindow* GetCurrentVtkView();
00083
00084
00085 SMESHGUI_EXPORT
00086 void RepaintCurrentView();
00087 SMESHGUI_EXPORT
00088 void RepaintViewWindow( SVTK_ViewWindow* );
00089 SMESHGUI_EXPORT
00090 void RenderViewWindow( SVTK_ViewWindow* );
00091 SMESHGUI_EXPORT
00092 void FitAll();
00093
00094
00095 SMESHGUI_EXPORT
00096 SMESH_Actor* FindActorByEntry( SUIT_ViewWindow*, const char* );
00097 SMESHGUI_EXPORT
00098 SMESH_Actor* FindActorByEntry( const char* );
00099
00100 SMESHGUI_EXPORT
00101 SMESH_Actor* FindActorByObject( CORBA::Object_ptr );
00102
00103
00104 SMESHGUI_EXPORT
00105 SMESH_Actor* CreateActor( _PTR(Study), const char*, int = false );
00106 SMESHGUI_EXPORT
00107 void DisplayActor( SUIT_ViewWindow*, SMESH_Actor* );
00108 SMESHGUI_EXPORT
00109 void RemoveActor( SUIT_ViewWindow*, SMESH_Actor* );
00110 SMESHGUI_EXPORT
00111 void RemoveVisuData( int );
00112
00113
00114 enum EDisplaing { eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll };
00115
00116 SMESHGUI_EXPORT
00117 bool UpdateView( SUIT_ViewWindow*, EDisplaing, const char* = "" );
00118 SMESHGUI_EXPORT
00119 bool UpdateView( EDisplaing, const char* = "" );
00120
00121 SMESHGUI_EXPORT
00122 void UpdateView();
00123
00124 SMESHGUI_EXPORT
00125 bool UpdateNulData( const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay);
00126
00127 SMESHGUI_EXPORT
00128 bool Update( const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay);
00129
00130
00131 SMESHGUI_EXPORT
00132 void SetPointRepresentation( bool );
00133
00134 SMESHGUI_EXPORT
00135 void SetPickable( SMESH_Actor* = 0 );
00136
00137 SMESHGUI_EXPORT
00138 void UpdateSelectionProp( SMESHGUI* );
00139
00140
00141 SMESHGUI_EXPORT
00142 SVTK_Selector* GetSelector( SUIT_ViewWindow* = GetActiveWindow() );
00143
00144 SMESHGUI_EXPORT
00145 void SetFilter( const Handle(VTKViewer_Filter)&, SVTK_Selector* = GetSelector() );
00146 SMESHGUI_EXPORT
00147 Handle(VTKViewer_Filter) GetFilter( int, SVTK_Selector* = GetSelector() );
00148 SMESHGUI_EXPORT
00149 bool IsFilterPresent( int, SVTK_Selector* = GetSelector() );
00150 SMESHGUI_EXPORT
00151 void RemoveFilter( int, SVTK_Selector* = GetSelector() );
00152
00153 SMESHGUI_EXPORT
00154 void RemoveFilters( SVTK_Selector* = GetSelector());
00155
00156 SMESHGUI_EXPORT
00157 bool IsValid( SALOME_Actor*, int, SVTK_Selector* = GetSelector() );
00158
00159
00160 SMESHGUI_EXPORT
00161 int GetNameOfSelectedNodes( SVTK_Selector*,
00162 const Handle(SALOME_InteractiveObject)&,
00163 QString& );
00164 SMESHGUI_EXPORT
00165 int GetNameOfSelectedElements( SVTK_Selector*,
00166 const Handle(SALOME_InteractiveObject)&,
00167 QString& );
00168 SMESHGUI_EXPORT
00169 int GetEdgeNodes( SVTK_Selector*, const TVisualObjPtr&, int&, int& );
00170
00171
00172 SMESHGUI_EXPORT
00173 int GetNameOfSelectedNodes( LightApp_SelectionMgr*,
00174 const Handle(SALOME_InteractiveObject)&,
00175 QString& );
00176 SMESHGUI_EXPORT
00177 int GetNameOfSelectedNodes( LightApp_SelectionMgr*, QString& );
00178 SMESHGUI_EXPORT
00179 int GetNameOfSelectedElements( LightApp_SelectionMgr*,
00180 const Handle(SALOME_InteractiveObject)&,
00181 QString& );
00182 SMESHGUI_EXPORT
00183 int GetNameOfSelectedElements( LightApp_SelectionMgr*, QString& );
00184 SMESHGUI_EXPORT
00185 int GetSelected( LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger&,
00186 const bool = true );
00187
00188 SMESHGUI_EXPORT
00189 int GetEdgeNodes( LightApp_SelectionMgr*, int&, int& );
00190
00191 SMESHGUI_EXPORT
00192 void SetControlsPrecision( const long );
00193
00194 #ifndef DISABLE_PLOT2DVIEWER
00195 SMESHGUI_EXPORT
00196 void ClearPlot2Viewers( SUIT_ViewWindow* theWindow );
00197 #endif
00198
00199
00200 SMESHGUI_EXPORT
00201 bool ComputeClippingPlaneParameters( std::list<vtkActor*> theActorList,
00202 vtkFloatingPointType theNormal[3],
00203 vtkFloatingPointType theDist,
00204 vtkFloatingPointType theBounds[6],
00205 vtkFloatingPointType theOrigin[3] );
00206 SMESHGUI_EXPORT
00207 void RemoveVisualObjectWithActors( const char* theEntry, bool fromAllViews = false );
00208 };
00209
00210 #endif // SMESHGUI_VTKUTILS_H