Go to the documentation of this file.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_H
00028 #define SMESHGUI_H
00029
00030
00031 #include "SMESH_SMESHGUI.hxx"
00032
00033
00034 #include <SalomeApp_Module.h>
00035 #include <VTKViewer_MarkerDef.h>
00036 #include <SALOME_InteractiveObject.hxx>
00037
00038
00039 #include <SALOMEconfig.h>
00040 #include CORBA_SERVER_HEADER(SMESH_Gen)
00041
00042
00043 #include <vtkSmartPointer.h>
00044 #include <vtkType.h>
00045
00046 class vtkActor;
00047 class vtkCallbackCommand;
00048 class vtkObject;
00049
00050 class QDialog;
00051
00052 class SUIT_Desktop;
00053 class SUIT_Study;
00054 class SUIT_ViewWindow;
00055 class SUIT_ResourceMgr;
00056 class SUIT_ViewManager;
00057
00058 class LightApp_Operation;
00059 class SalomeApp_Study;
00060 class LightApp_Selection;
00061 class LightApp_SelectionMgr;
00062
00063 class SMESH_Actor;
00064 class SMESHGUI_FilterLibraryDlg;
00065
00066 typedef std::map<int, VTK::MarkerMap> SMESHGUI_StudyId2MarkerMap;
00067
00068 namespace SMESH
00069 {
00070 class OrientedPlane;
00071 struct ClippingPlaneInfo
00072 {
00073 OrientedPlane* Plane;
00074 std::list<vtkActor*> ActorList;
00075 };
00076 }
00077
00078 typedef std::list<SMESH::ClippingPlaneInfo> SMESHGUI_ClippingPlaneInfoList;
00079 typedef std::map<SUIT_ViewManager*, SMESHGUI_ClippingPlaneInfoList> SMESHGUI_ClippingPlaneInfoMap;
00080
00081
00082
00083
00084
00085 class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module
00086 {
00087 Q_OBJECT;
00088
00089 public :
00090 SMESHGUI();
00091 ~SMESHGUI();
00092
00093 static SMESH::SMESH_Gen_var GetSMESHGen();
00094 static SMESHGUI* GetSMESHGUI();
00095 static LightApp_SelectionMgr* selectionMgr();
00096 static SUIT_ResourceMgr* resourceMgr();
00097 static SUIT_Desktop* desktop();
00098 static SalomeApp_Study* activeStudy();
00099
00100 bool isActiveStudyLocked();
00101
00102 static bool automaticUpdate(unsigned int requestedSize = 0, bool* limitExceeded = 0);
00103
00104 static void Modified( bool = true );
00105
00106 virtual LightApp_Displayer* displayer();
00107 virtual QString engineIOR() const;
00108 virtual void initialize( CAM_Application* );
00109 virtual void windows( QMap<int, int>& ) const;
00110 virtual void viewManagers( QStringList& ) const;
00111
00112 QDialog* GetActiveDialogBox();
00113 void SetActiveDialogBox( QDialog* );
00114
00115 void ResetState();
00116 void SetState( int );
00117 bool DefineDlgPosition( QWidget*, int&, int& );
00118 void switchToOperation( int );
00119
00120 virtual bool OnGUIEvent( int );
00121 virtual bool OnMousePress( QMouseEvent*, SUIT_ViewWindow* );
00122 virtual bool OnMouseMove( QMouseEvent*, SUIT_ViewWindow* );
00123 virtual bool OnKeyPress( QKeyEvent*, SUIT_ViewWindow* );
00124
00125 virtual LightApp_Selection* createSelection() const;
00126
00127 virtual void BuildPresentation ( const Handle(SALOME_InteractiveObject)&,
00128 SUIT_ViewWindow* = 0 );
00129
00130
00131 void EmitSignalDeactivateDialog();
00132 void EmitSignalStudyFrameChanged();
00133 void EmitSignalCloseAllDialogs();
00134 void EmitSignalVisibilityChanged();
00135
00136 virtual void contextMenuPopup( const QString&, QMenu*, QString& );
00137 virtual void createPreferences();
00138 virtual void preferencesChanged( const QString&, const QString& );
00139
00140 virtual void update( const int );
00141
00142 static SALOMEDS::Color getUniqueColor( const QList<SALOMEDS::Color>& );
00143
00144 virtual void storeVisualParameters (int savePoint);
00145 virtual void restoreVisualParameters(int savePoint);
00146
00147 virtual void addActorAsObserver( SMESH_Actor* theActor );
00148
00149 virtual bool renameAllowed( const QString& ) const;
00150 virtual bool renameObject( const QString&, const QString& );
00151
00152
00153 SMESHGUI_ClippingPlaneInfoMap& getClippingPlaneInfoMap() { return myClippingPlaneInfoMap; }
00154
00155 public slots:
00156 virtual bool deactivateModule( SUIT_Study* );
00157 virtual bool activateModule( SUIT_Study* );
00158 virtual void studyClosed( SUIT_Study* );
00159 void onViewClosed( SUIT_ViewWindow* );
00160
00161
00162 private slots:
00163 void OnGUIEvent();
00164 void onViewManagerActivated( SUIT_ViewManager* );
00165 void onViewManagerRemoved( SUIT_ViewManager* );
00166 void onOperationCommited( SUIT_Operation* );
00167 void onOperationAborted( SUIT_Operation* );
00168 void onHypothesisEdit( int result );
00169
00170 signals:
00171 void SignalDeactivateActiveDialog();
00172 void SignalStudyFrameChanged();
00173 void SignalCloseAllDialogs();
00174 void SignalVisibilityChanged();
00175
00176 protected:
00177 void createSMESHAction( const int,
00178 const QString&,
00179 const QString& = QString(),
00180 const int = 0,
00181 const bool = false,
00182 const QString& = QString() );
00183 void createPopupItem( const int,
00184 const QString&,
00185 const QString&,
00186 const QString& = QString(),
00187 const int = -1 );
00188
00189 virtual LightApp_Operation* createOperation( const int ) const;
00190
00191 virtual bool isSelectionCompatible();
00192
00193 virtual bool reusableOperation( const int id );
00194
00195 static void ProcessEvents( vtkObject* theObject,
00196 unsigned long theEvent,
00197 void* theClientData,
00198 void* theCallData );
00199
00200 private:
00201 void OnEditDelete();
00202 int addVtkFontPref( const QString& label,
00203 const int pId,
00204 const QString& param );
00205
00206 void connectView( const SUIT_ViewWindow* );
00207
00208
00209 private :
00210 static SMESH::SMESH_Gen_var myComponentSMESH;
00211 QDialog* myActiveDialogBox;
00212 int myState;
00213 QMap<int, QString> myRules;
00214 LightApp_Displayer* myDisplayer;
00215
00216 SMESHGUI_FilterLibraryDlg* myFilterLibraryDlg;
00217
00218 SMESHGUI_StudyId2MarkerMap myMarkerMap;
00219 SMESHGUI_ClippingPlaneInfoMap myClippingPlaneInfoMap;
00220
00221 vtkSmartPointer<vtkCallbackCommand> myEventCallbackCommand;
00222 vtkFloatingPointType myPriority;
00223 };
00224
00225 #endif // SMESHGUI_H