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 #ifndef SMESHGUI_CREATEPATTERNDLG_H
00027 #define SMESHGUI_CREATEPATTERNDLG_H
00028
00029
00030 #include "SMESH_SMESHGUI.hxx"
00031
00032
00033 #include <QDialog>
00034
00035
00036 #include <SALOMEconfig.h>
00037 #include CORBA_SERVER_HEADER(SMESH_Mesh)
00038 #include CORBA_SERVER_HEADER(SMESH_Pattern)
00039
00040 class SMESHGUI_PatternWidget;
00041 class SALOMEDSClient_SObject;
00042
00043 class QLineEdit;
00044 class QRadioButton;
00045 class QCheckBox;
00046 class QButtonGroup;
00047 class SVTK_Selector;
00048 class LightApp_SelectionMgr;
00049 class SMESHGUI;
00050
00056 class SMESHGUI_EXPORT SMESHGUI_CreatePatternDlg : public QDialog
00057 {
00058 Q_OBJECT
00059
00060 public:
00061 enum { Type_2d, Type_3d };
00062
00063 public:
00064 SMESHGUI_CreatePatternDlg( SMESHGUI*, const int );
00065 virtual ~SMESHGUI_CreatePatternDlg();
00066
00067 void Init( const int );
00068 QString GetPatternName() const;
00069 SMESH::SMESH_Pattern_ptr GetPattern();
00070 void SetMesh( SMESH::SMESH_Mesh_ptr );
00071
00072 signals:
00073 void NewPattern();
00074 void Close();
00075
00076 private:
00077 void closeEvent( QCloseEvent* );
00078 void enterEvent( QEvent* );
00079 void keyPressEvent( QKeyEvent* );
00080
00081 private slots:
00082 void onOk();
00083 void onSave();
00084 void onClose();
00085 void onHelp();
00086
00087 void onDeactivate();
00088
00089 void onSelectionDone();
00090 void onTypeChanged( int );
00091 void onProject( bool );
00092 void onSelBtnClicked();
00093
00094 private:
00095 QWidget* createButtonFrame( QWidget* );
00096 QWidget* createMainFrame( QWidget* );
00097 void displayPreview();
00098 void erasePreview();
00099 void activateSelection();
00100 QString autoExtension( const QString& ) const;
00101 bool isValid();
00102 bool loadFromObject( const bool = true );
00103 QString getDefaultName() const;
00104 GEOM::GEOM_Object_ptr getGeom( SALOMEDSClient_SObject* ) const;
00105
00106 private:
00107 QButtonGroup* myTypeGrp;
00108 QRadioButton* mySwitch2d;
00109 QRadioButton* mySwitch3d;
00110
00111 QLineEdit* myMeshEdit;
00112 QLineEdit* myName;
00113
00114 SMESHGUI_PatternWidget* myPicture2d;
00115
00116 QCheckBox* myProjectChk;
00117
00118 SMESHGUI* mySMESHGUI;
00119 SVTK_Selector* mySelector;
00120 LightApp_SelectionMgr* mySelectionMgr;
00121 int myType;
00122
00123 SMESH::SMESH_Mesh_var myMesh;
00124 SMESH::SMESH_subMesh_var mySubMesh;
00125 GEOM::GEOM_Object_var myGeomObj;
00126
00127 SMESH::SMESH_Pattern_var myPattern;
00128 bool myIsLoaded;
00129
00130 QString myHelpFileName;
00131 };
00132
00133 #endif // SMESHGUI_CREATEPATTERNDLG_H