X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FVISUGUI%2FVisuGUI.h;h=10a62f2f037c73da6dddd98b64e0c1b42a283d6b;hb=ecd894f04a6fda04697c23f4607af5dc0ab473f5;hp=aa78fe3455279282c285bdc74dea3cadad28acda;hpb=55d716c5e69656916a6070607a89fb446144fea8;p=modules%2Fvisu.git diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index aa78fe34..10a62f2f 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -1,277 +1,152 @@ // VISU VISUGUI : GUI of VISU component // // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// 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. -// -// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // // // // File : VisuGUI.h -// Author : Laurent CORNABE & Hubert ROLLAND +// Author : Laurent CORNABE & Hubert ROLLAND // Module : VISU // $Header$ #ifndef VisuGUI_HeaderFile #define VisuGUI_HeaderFile -#ifndef _Standard_HeaderFile -#include -#endif - -#include -#include CORBA_SERVER_HEADER(VISU_Gen) -#include CORBA_SERVER_HEADER(SALOMEDS) -#include CORBA_SERVER_HEADER(SALOMEDS_Attributes) +#include "SalomeApp_Module.h" -#include "QAD_Desktop.h" -class VTKViewer_ViewFrame; +#include "SALOME_InteractiveObject.hxx" #include "VISUConfig.hh" -class VISU_Actor; -class VISU_MeshAct; -class VISU_ScalarMapAct; -class VisuGUI_SelectionDlg; - -#include -class vtkRenderer; - -#include -#include -#include "SALOME_ListIteratorOfListIO.hxx" -#include "SALOMEGUI.h" - -namespace VISU{ - class VISU_Gen_i; +#include "SALOMEconfig.h" +#include CORBA_SERVER_HEADER(SALOMEDS) +#include CORBA_SERVER_HEADER(VISU_Gen) +#include CORBA_SERVER_HEADER(MED_Gen) - class Result_i; +class SUIT_Desktop; +namespace VISU { class Prs3d_i; - class ScalarMap_i; - class DeformedShape_i; - class IsoSurfaces_i; - class CutPlanes_i; - class CutLines_i; - class Vectors_i; - class StreamLines_i; - - class Table_i; - class Curve_i; - class Container_i; } -// ====================================================================== -// CLASS VIUSGUI -// ====================================================================== -// - -class VisuGUI : public SALOMEGUI{ +class VisuGUI: public SalomeApp_Module +{ Q_OBJECT; - public: - VisuGUI( const QString& name = "", QObject* parent = 0 ); - virtual ~VisuGUI(); - - static VISU::VISU_Gen_i* GetVisuGen(); - - static QAD_Desktop* GetDesktop(); - static QAD_Study* GetActiveStudy(); - static vtkRenderer* GetRenderer(); - static VTKViewer_ViewFrame* GetVtkViewFrame(); - static SALOMEDS::Study_var GetStudyDocument(); - static SALOMEDS::StudyBuilder_var NewBuilder(); - static VISU::Storable::TRestoringMap getMapOfValue(SALOMEDS::SObject_var theSObject); - - static VISU::Result_i* CreatePresent(SALOMEDS::SObject_var theField, VISU::Result_var& theResult); +public: - enum CameraOrient {e3D, eFront, eLeft, eTop}; - static CameraOrient SetFitAll( VTKViewer_ViewFrame* vf); + VisuGUI(); + virtual ~VisuGUI(); - typedef VISU::Result_ptr (VISU::VISU_Gen_i::* TImportFun)(const char*); - void ImportFromFile(TImportFun theImportFun); + virtual void initialize( CAM_Application* ); + virtual void windows( QMap& ) const; + virtual void viewManagers( QStringList& ) const; - bool CreateScalarMap(SALOMEDS::SObject_var theField); - static VISU::ScalarMap_i* CreateScalarMapPrs(SALOMEDS::SObject_var theField, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, int theTimeId); - bool CreateDeformedShape(SALOMEDS::SObject_var theField); - static VISU::DeformedShape_i* CreateDeformedShapePrs(SALOMEDS::SObject_var theField, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, int theTimeId); - bool CreateVectors(SALOMEDS::SObject_var theField); - static VISU::Vectors_i* CreateVectorsPrs(SALOMEDS::SObject_var theField, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, int theTimeId); - bool CreateIsoSurfaces(SALOMEDS::SObject_var theField); - static VISU::IsoSurfaces_i* CreateIsoSurfacesPrs(SALOMEDS::SObject_var theField, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, int theTimeId); - bool CreateCutPlanes(SALOMEDS::SObject_var theField); - static VISU::CutPlanes_i* CreateCutPlanesPrs(SALOMEDS::SObject_var theField, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, int theTimeId); - bool CreateCutLines(SALOMEDS::SObject_var theField); - static VISU::CutLines_i* CreateCutLinesPrs(SALOMEDS::SObject_var theField, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, int theTimeId); - bool CreateStreamLines(SALOMEDS::SObject_var theField); - static VISU::StreamLines_i* CreateStreamLinesPrs(SALOMEDS::SObject_var theField, - const char* theMeshName, VISU::Entity theEntity, - const char* theFieldName, int theTimeId); - bool TestObjectBrowser(SALOMEDS::SObject_var& objVisu); - - static void ShowTrihedron(bool Show); - static void ChangeViewer(int theType); - - static void NewColor(VISU_Actor *Actor); - static void NewWireframeColor(VISU_MeshAct *Actor); - static void NewOpacity(VISU_Actor *Actor); - static void NewLinewidth(VISU_Actor *Actor); - - static void ChangeScalarBar(); - static void SetSweepingPreferences(); - - static void PlotTable( VISU::Table_i* table, int theDisplaying ); - static void PlotCurve( VISU::Curve_i* curve, int theDisplaying ); - static void PlotContainer( VISU::Container_i* container, int theDisplaying ); - - static QString getVisuInputDir(); - static QString getVisuOutputDir(); - - static QString getValue(SALOMEDS::SObject_var theSObject, QString theKey); - static int checkHomoSelection(); - - static VISU_Actor* UpdateViewer(VISU::Prs3d_i* thePrs, bool theDispOnly=false); - static bool IsDisplayed(VISU::Prs3d_i* thePrs); - static void ErasePrs(VISU::Prs3d_i* thePrs); - - static VISU::Prs3d_i* GetSelectedPrs3d(Handle(SALOME_InteractiveObject)* theIO = NULL); - static void RecreateActor(VISU::Prs3d_i* thePrs); - static void CreateActor(VISU::Prs3d_i* thePrs); - static VISU_Actor* GetActor(VISU::Prs3d_i* thePrs, VTKViewer_ViewFrame* theViewFrame = NULL); - - void VisuGUI::ChangeRepresentation(VISU::PresentationType theType); - void DeletePresentation(VISU::Prs3d_i* thePrs); - - void SetState(int aState ); - void ResetState(); - void EmitSignalDeactivateDialog(); - void EmitSignalCloseAllDialogs(); - QDialog* GetActiveDialogBox(); - void SetActiveDialogBox(QDialog* aDlg); + virtual QString engineIOR() const; - void CreatePlot(SALOMEDS::SObject_var theTableSO); + virtual void studyActivated(); -// ---------------------------------------- -// All method of standard EXPORT -// ---------------------------------------- - virtual bool OnGUIEvent(int theCommandID, QAD_Desktop* parent); - virtual bool SetSettings(QAD_Desktop* parent); - virtual void DefinePopup(QString & theContext, - QString & theParent, - QString & theObject ) ; - virtual bool CustomPopup(QAD_Desktop* parent, - QPopupMenu* popup, - const QString & theContext, - const QString & theParent, - const QString & theObject); - virtual void BuildPresentation( const Handle(SALOME_InteractiveObject)&, - QAD_ViewFrame* = 0 ); - virtual bool OnMousePress(QMouseEvent* pe , - QAD_Desktop* parent, - QAD_StudyFrame* studyFrame); - virtual bool OnMouseMove(QMouseEvent* pe , - QAD_Desktop* parent, - QAD_StudyFrame* studyFrame); - virtual bool OnKeyPress(QKeyEvent* pe, - QAD_Desktop* parent, - QAD_StudyFrame* studyFrame); - virtual void SupportedViewType (int* buffer, int bufferSize); + virtual void contextMenuPopup( const QString& theClient, QPopupMenu* theMenu, QString& theTitle ); public slots: - void ImportTablesFromFile(); - void ExportTableToFile(); - - void ImportFile(); - void CopyAndImportFile(); - - void ExportToFile(); - - void CreateMesh(); - void CreateScalarMap(); - void CreateDeformedShape(); - void CreateVectors(); - void CreateIsoSurfaces(); - void CreateCutPlanes(); - void CreateCutLines(); - void CreateStreamLines(); - void CreateManyMesh(); - void CreatePlot2dView(); - - void DisplayPrs(); - void DisplayOnlyPrs(); - void ErasePrs(); - void EditPrs(); - void DisplayManyPrs(); - void DisplayOnlyManyPrs(); - void EraseManyPrs(); - void EditContainer(); - - void MakeSurfaceframe(); - void MakeInsideframe(); - void MakeWireframe(); - void MakeSurface(); - void MakePoints(); - void MakeShrink(); - - void ChageColor(); - void ChangeWireframeColor(); - void ChangeOpacity(); - void ChangeLines(); - - void ShowTable(); - void CreateTable(); - void DeleteObject(); - void PlotData(); - void CurveProperties(); - void ClearContainer(); - - void SaveViewParams(); - void RestoreViewParams(); - - void DeletePrs(); - void Rename(); - void RenameTable(); - void RenameContainer(); - void Sweep(); - void TimeAnimation(); - - void ImportMedField(); - //void ImportMedMesh(); - - void DeleteViewParams(); - void CopyPresentation(); - - void SelectionInfo(); - -private : - QDialog* myActiveDialogBox; - int myState ; - VisuGUI_SelectionDlg* mySelectionDlg; + virtual bool deactivateModule( SUIT_Study* ); + virtual bool activateModule( SUIT_Study* ); + +protected slots: + void OnImportFromFile(); + void OnExploreMEDFile(); + void OnImportTableFromFile(); + void OnExportTableToFile(); + void OnImportMedField(); + + void OnCreateMesh(); + void OnCreateScalarMap(); + void OnCreateDeformedShape(); + void OnCreateVectors(); + void OnCreateIsoSurfaces(); + void OnCreateCutPlanes(); + void OnCreateCutLines(); + void OnCreateStreamLines(); + void OnCreatePlot3D(); + void OnCreateManyMesh(); + void OnCreatePlot2dView(); + + void OnEditPrs(); + //void OnDeletePrs(); + + void OnDisplayPrs(); + void OnDisplayOnlyPrs(); + void OnErasePrs(); + void OnEraseAll(); + + void OnMakeSurfaceframe(); + void OnMakeInsideframe(); + void OnMakeWireframe(); + void OnMakeSurface(); + void OnMakePoints(); + void OnMakeShrink(); + + void OnChangeColor(); + void OnChangeWireframeColor(); + void OnChangeOpacity(); + void OnChangeLines(); + + void OnShowTable(); + void OnCreateTable(); + //void OnDeleteObject(); + void OnDeleteObjects(); + void OnPlotData(); + void OnCurveProperties(); + void OnClearContainer(); + void OnEditContainer(); + + void OnMergeScalarBars(); + void OnFreeScalarBars(); + + void OnSaveViewParams(); + void OnRestoreViewParams(); + //void OnDeleteViewParams(); + + void OnRename(); + void OnClippingPlanes(); + void OnSweep(); + void OnTimeAnimation(); + void OnShowAnimation(); + + void OnCopyPresentation(); + + void OnSelectionInfo(); + + void OnTranslatePrs(); + void OnArrangeActors(); + + void OnScaling(); + void OnCubeAxes(); + +protected: + virtual SalomeApp_Selection* createSelection() const; + +private: + void createActions(); + void createMenus(); + void createToolBars(); + void createPopupMenus(); }; #endif