Version: 6.3.1

src/VISUGUI/VisuGUI.h

Go to the documentation of this file.
00001 // Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
00002 //
00003 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00005 //
00006 // This library is free software; you can redistribute it and/or
00007 // modify it under the terms of the GNU Lesser General Public
00008 // License as published by the Free Software Foundation; either
00009 // version 2.1 of the License.
00010 //
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 //
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00019 //
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 
00023 //  VISU VISUGUI : GUI of VISU component
00024 //  File   : VisuGUI.h
00025 //  Author : Laurent CORNABE & Hubert ROLLAND
00026 //  Module : VISU
00027 //
00028 #ifndef VisuGUI_HeaderFile
00029 #define VisuGUI_HeaderFile
00030 
00031 #include <SalomeApp_Module.h>
00032 
00033 #include <SVTK_ViewWindow.h>
00034 #include <VISU_Prs3d_i.hh>
00035 
00036 #include "VisuGUI_Panel.h"
00037 
00038 #include <map>
00039 #include <set>
00040 
00041 class SUIT_ViewManager;
00042 class VisuGUI_Slider;
00043 class VisuGUI_Sweep;
00044 
00045 namespace VISU
00046 {
00047   class Prs3d_i;
00048   typedef std::pair<Prs3d_i*,int> TPrs3dToInd; // prs pointer and default index of scalar bar placement
00049   typedef std::set<TPrs3dToInd> TSetPrs3d;
00050   typedef std::map<SVTK_ViewWindow*,TSetPrs3d> TViewToPrs3d;
00051 }
00052 
00053 class VisuGUI: public SalomeApp_Module
00054 {
00055   Q_OBJECT;
00056 
00057 public:
00058   enum PanelId { SelectionPanelId = 0,
00059                  FeatureEdgesPanelId,
00060                  ClippingPlanesPanelId };
00061 
00062 public:
00063   VisuGUI();
00064   virtual ~VisuGUI();
00065 
00066   virtual LightApp_Displayer*    displayer();
00067   virtual void initialize( CAM_Application* );
00068   virtual void windows( QMap<int, int>& ) const;
00069   virtual void viewManagers( QStringList& ) const;
00070 
00071   virtual QString engineIOR() const;
00072 
00073   virtual void  studyActivated();
00074 
00075   virtual void  contextMenuPopup( const QString& theClient, QMenu* theMenu, QString& theTitle );
00076 
00077   virtual void createPreferences();
00078   virtual void preferencesChanged( const QString&, const QString& );
00079 
00080   virtual
00081   SUIT_ViewManager*
00082   getViewManager(const QString& theType, 
00083                  const bool theIsCreate);
00084 
00085   VISU::TViewToPrs3d&
00086   getScalarBarsMap();
00087 
00088   virtual bool renameAllowed( const QString& ) const;
00089   virtual bool renameObject( const QString&, const QString& );
00090   
00091 
00092 signals:
00093   void moduleDeactivated();
00094   void moduleActivated();
00095   void presentationCreated(VISU::Prs3d_i* thePrs);
00096   void beforeObjectDelete(QString theEntry);
00097 
00098 public slots:
00099   virtual bool deactivateModule( SUIT_Study* );
00100   virtual bool activateModule( SUIT_Study* );
00101   virtual void OnEraseAll();
00102 
00103 protected slots:
00104   void OnImportFromFile();
00105   void OnImportTableFromFile();
00106   void OnExportTableToFile();
00107   void OnImportMedField();
00108 
00109   void OnLoadComponentData();
00110 
00111   void OnCreateMesh();
00112   void OnCreateScalarMap();
00113   void OnCreateDeformedShape();
00114   void OnCreateVectors();
00115   void OnCreateIsoSurfaces();
00116   void OnCreateCutPlanes();
00117   void OnCreateCutLines();
00118   void OnCreateCutSegment();
00119   void OnCreateStreamLines();
00120   void OnCreatePlot3D();
00121   void OnCreateManyMesh();
00122   void OnCreatePlot2dView();
00123   void OnCreateDeformedShapeAndScalarMap();
00124 
00125   void OnEditScalarMap();
00126   void OnEditDeformedShape();
00127   void OnEditCutPlanes();
00128   void OnEditCutLines();
00129   void OnEditCutSegment();
00130   void OnEditIsoSurfaces();
00131   void OnEditVectors();
00132   void OnEditStreamLines();
00133   void OnEditPlot3D();
00134   void OnEditDeformedShapeAndScalarMap();
00135 
00136   virtual void OnDisplayPrs();
00137   virtual void OnDisplayOnlyPrs();
00138   virtual void OnErasePrs();
00139   //  virtual void OnEraseAll();
00140 
00141   void OnToggleSelectionPanel();
00142   void OnSwitchSelectionMode();
00143   void OnSwitchSelectionMode( int );
00144 
00145   void OnMakeSurfaceframe();
00146   void OnMakeInsideframe();
00147   void OnMakeWireframe();
00148   void OnMakeSurface();
00149   void OnMakePoints();
00150   void OnMakeShrink();
00151 
00152   void OnMakeFeatureEdges();
00153 
00154   void OnSetShadingOn();
00155   void OnSetShadingOff();
00156 
00157   void OnChangeColor();
00158   void OnChangeWireframeColor();
00159   void OnChangeOpacity();
00160   void OnChangeLines();
00161   void OnChangePointMarker();
00162   void OnChangeShrinkFactor();
00163 
00164   void OnShowTable();
00165   void OnShowTablePlot();
00166   void OnShowScalarBar();
00167   void OnHideScalarBar();
00168   void OnCreateTable();
00169   void OnDeleteObjects();
00170   void OnPlotData();
00171   void OnCurveProperties();
00172   void OnClearContainer();
00173   void OnEditContainer();
00174 
00175   void OnMergeScalarBars();
00176   void OnFreeScalarBars();
00177 
00178   virtual void OnSaveViewParams();
00179   virtual void OnRestoreViewParams();
00180 
00181   void OnClippingPlanes();
00182   void OnSweep();
00183   void OnParallelTimeAnimation();
00184   void OnSucccessiveTimeAnimation();
00185   void OnShowAnimation();
00186 
00187   void OnPointEvolution();
00188   void OnShowEvolution();
00189 
00190   void OnCopyPresentation();
00191 
00192   void OnTranslatePrs();
00193   void OnArrangeActors();
00194   void OnPlot3dFromCutPlane();
00195 
00196   void OnManageCache();
00197 
00198   void OnFilterScalars();
00199   
00200   void OnValuesLabeling();
00201   void OnValuesLabelingParams();
00202 
00203   void OnArcQuadMode();
00204   void OnLineQuadMode();
00205 
00206   // MULTIPR
00207   void OnMultiprViewFullRes();
00208   void OnMultiprViewMediumRes();
00209   void OnMultiprViewLowRes();
00210   void OnMultiprViewHide();
00211   void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
00212 
00213   void OnFileInfo();
00214   void OnExportMED();
00215 
00216 protected:
00217   virtual LightApp_Selection* createSelection() const;
00218 
00219   virtual void processPresentationCreated( VISU::Prs3d_i* thePrs );
00220 
00221   void OnTimeAnimation(VISU::Animation::AnimationMode theMode);
00222 
00223 private:
00224   void createActions();
00225   void createMenus();
00226   void createToolBars();
00227   void createPopupMenus();
00228   void createPanels();
00229   void SetScalarBarVisibility( bool );
00230   void activateAppropriateViewer( Handle(SALOME_InteractiveObject) theIO );
00231   int  addVtkFontPref( const QString& label, const int pId, const QString& param, const bool useSize );
00232 
00233 private:
00234   QMap<int,VisuGUI_Panel*> myPanels;
00235   VisuGUI_Slider*          mySlider;
00236   VisuGUI_Sweep*           mySweep; 
00237 
00238   LightApp_Displayer*      myDisplayer;
00239   VISU::TViewToPrs3d       myScalarBarsMap;
00240 };
00241 
00242 #endif
Copyright © 2007-2011 CEA/DEN, EDF R&D, OPEN CASCADE
Copyright © 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS