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 GEOMETRYGUI_H
00028 #define GEOMETRYGUI_H
00029
00030 #include "GEOM_GEOMGUI.hxx"
00031
00032 #include <SalomeApp_Module.h>
00033
00034 #include <GEOM_Client.hxx>
00035 #include <SALOME_InteractiveObject.hxx>
00036 #include <SALOMEDSClient.hxx>
00037
00038 #include "GEOMGUI.h"
00039
00040
00041 #include <QMap>
00042
00043
00044 #include <gp_Ax3.hxx>
00045 #include <Graphic3d_HArray1OfBytes.hxx>
00046
00047
00048 #include "SALOMEconfig.h"
00049 #include CORBA_CLIENT_HEADER(SALOMEDS)
00050
00051
00052 #define DEFLECTION_MIN 1e-06
00053
00054
00055 #define NAME_SEPARATOR '_' // character used to separate parameter names
00056 #define DIGIT_SEPARATOR ':' // character used to separate numeric parameter values (color = r:g:b)
00057
00058 #define VISIBILITY_PROP "Visibility" //Object visibility property
00059 #define OPACITY_PROP "Opacity" //Object opacity property
00060 #define TRANSPARENCY_PROP "Transparency" //Object transparency property
00061 #define DISPLAY_MODE_PROP "DisplayMode" //Object display mode property
00062 #define ISOS_PROP "Isos" //Number of the Isos property of the object
00063 #define COLOR_PROP "Color" //Color of the object
00064 #define VECTOR_MODE_PROP "VectorMode" //Vector mode property
00065 #define DEFLECTION_COEFF_PROP "DeflectionCoeff" //Deflection coeff property
00066 #define MARKER_TYPE_PROP "MarkerType" // Marker type property
00067
00068
00069 class QDialog;
00070 class QMenu;
00071 class GEOMGUI_OCCSelector;
00072 class LightApp_VTKSelector;
00073 class LightApp_Selection;
00074 class SUIT_ViewManager;
00075 class SalomeApp_Study;
00076
00077
00078
00079
00080
00081 class GEOMGUI_EXPORT GeometryGUI : public SalomeApp_Module
00082 {
00083 Q_OBJECT;
00084
00085 public:
00086
00087 GeometryGUI();
00088
00089
00090 ~GeometryGUI();
00091
00092 virtual LightApp_Displayer* displayer();
00093 virtual void initialize( CAM_Application* );
00094 virtual QString engineIOR() const;
00095
00096 static Handle(Graphic3d_HArray1OfBytes) getTexture( SalomeApp_Study*, int, int&, int& );
00097
00098 static bool InitGeomGen();
00099
00100 static GEOM::GEOM_Gen_var GetGeomGen();
00101
00102 static CORBA::Object_var ClientSObjectToObject (_PTR(SObject) theSObject);
00103 static SALOMEDS::Study_var ClientStudyToStudy (_PTR(Study) theStudy);
00104
00105 static void Modified( bool = true );
00106
00107 GEOM_Client& GetShapeReader() { static SHAPE_READER(myShapeReader);return myShapeReader; }
00108
00109
00110 QDialog* GetActiveDialogBox(){ return myActiveDialogBox; }
00111
00112 void SetActiveDialogBox( QDialog* aDlg );
00113
00114
00115 void EmitSignalDeactivateDialog();
00116 void EmitSignalCloseAllDialogs();
00117 void EmitSignalDefaultStepValueChanged( double newVal );
00118
00119
00120 void OnGUIEvent( int id );
00121
00122
00123 void SetWorkingPlane( gp_Ax3 wp ) { myWorkingPlane = wp; }
00124 gp_Ax3 GetWorkingPlane() { return myWorkingPlane; }
00125 void ActiveWorkingPlane();
00126
00127 virtual bool renameObject( const QString&, const QString& );
00128
00129 virtual void windows( QMap<int, int>& ) const;
00130 virtual void viewManagers( QStringList& ) const;
00131
00132 virtual void contextMenuPopup( const QString&, QMenu*, QString& );
00133 virtual void createPreferences();
00134 virtual void preferencesChanged( const QString&, const QString& );
00135 int getLocalSelectionMode() const;
00136 void setLocalSelectionMode(const int mode);
00137
00138 virtual void storeVisualParameters (int savePoint);
00139 virtual void restoreVisualParameters(int savePoint);
00140
00141 public slots:
00142 virtual bool deactivateModule( SUIT_Study* );
00143 virtual bool activateModule( SUIT_Study* );
00144 virtual void OnKeyPress ( SUIT_ViewWindow*, QKeyEvent* );
00145 virtual void OnMousePress( SUIT_ViewWindow*, QMouseEvent* );
00146 virtual void OnMouseMove ( SUIT_ViewWindow*, QMouseEvent* );
00147
00148 protected slots:
00149 virtual void onViewManagerAdded( SUIT_ViewManager* );
00150 virtual void onViewManagerRemoved( SUIT_ViewManager* );
00151
00152 private slots:
00153 void OnGUIEvent();
00154 void onWindowActivated( SUIT_ViewWindow* );
00155 void onViewAboutToShow();
00156
00157 signals :
00158 void SignalDeactivateActiveDialog();
00159 void SignalCloseAllDialogs();
00160 void SignalDefaultStepValueChanged( double newVal );
00161
00162 protected:
00163 virtual LightApp_Selection* createSelection() const;
00164
00165 private:
00166 GEOMGUI* getLibrary( const QString& libraryName );
00167 void createGeomAction( const int id, const QString& po_id,
00168 const QString& icon_id = QString(""),
00169 const int key = 0, const bool toggle = false,
00170 const QString& shortcutAction = QString() );
00171 void createPopupItem( const int, const QString& clients, const QString& types,
00172 const bool isSingle = false, const int isVisible = -1,
00173 const bool isExpandAll = false, const bool isOCC = false,
00174 const int parentId = -1 );
00175
00176 void createOriginAndBaseVectors();
00177
00178 public:
00179 static GEOM::GEOM_Gen_var myComponentGeom;
00180
00181 private:
00182
00183 typedef QMap<long, Handle(Graphic3d_HArray1OfBytes)> TextureMap;
00184 typedef QMap<long, TextureMap> StudyTextureMap;
00185 typedef QMap<QString, GEOMGUI*> GUIMap;
00186
00187 GUIMap myGUIMap;
00188 QDialog* myActiveDialogBox;
00189 gp_Ax3 myWorkingPlane;
00190 QMap<int,QString> myRules;
00191 static StudyTextureMap myTextureMap;
00192
00193 QList<GEOMGUI_OCCSelector*> myOCCSelectors;
00194 QList<LightApp_VTKSelector*> myVTKSelectors;
00195
00196 LightApp_Displayer* myDisplayer;
00197 int myLocalSelectionMode;
00198
00199 friend class DisplayGUI;
00200 };
00201
00202 #endif