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_MESHOP_H
00028 #define SMESHGUI_MESHOP_H
00029
00030
00031 #include "SMESH_SMESHGUI.hxx"
00032
00033 #include "SMESHGUI_SelectionOp.h"
00034
00035 class HypothesesSet;
00036 class SMESHGUI_MeshDlg;
00037 class SMESHGUI_ShapeByMeshOp;
00038 class HypothesisData;
00039
00045 class SMESHGUI_EXPORT SMESHGUI_MeshOp : public SMESHGUI_SelectionOp
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 enum HypType{ Algo = 0, MainHyp, AddHyp, NbHypTypes };
00051
00052 typedef std::pair<SMESH::SMESH_Hypothesis_var, QString> THypItem;
00053 typedef QList< THypItem > THypList;
00054
00055 typedef int THypType;
00056 typedef QMap< THypType, THypList > TType2HypList;
00057
00058 typedef int THypDim;
00059 typedef QMap< THypDim, TType2HypList > TDim2Type2HypList;
00060
00061 public:
00062 SMESHGUI_MeshOp( const bool, const bool = true );
00063 virtual ~SMESHGUI_MeshOp();
00064
00065 virtual LightApp_Dialog* dlg() const;
00066
00067 protected:
00068 virtual void startOperation();
00069 virtual void commitOperation();
00070 virtual void selectionDone();
00071 virtual SUIT_SelectionFilter* createFilter( const int ) const;
00072 virtual bool isValid( SUIT_Operation* ) const;
00073
00074 protected slots:
00075 virtual bool onApply();
00076 void onCreateHyp( const int, const int );
00077 void onEditHyp( const int, const int );
00078 void onHypoSet( const QString& );
00079 void onGeomSelectionByMesh( bool );
00080 void onPublishShapeByMeshDlg( SUIT_Operation* );
00081 void onCloseShapeByMeshDlg( SUIT_Operation* );
00082 void onAlgoSelected( const int, const int = -1 );
00083 void processSet();
00084 void onHypoCreated( int );
00085 void onHypoEdited( int );
00086
00087 private:
00088 typedef QList<HypothesisData*> THypDataList;
00089
00090 bool isValid( QString& ) const;
00091 void availableHyps( const int,
00092 const int,
00093 QStringList&,
00094 THypDataList&,
00095 HypothesisData* = 0 ) const;
00096 static void existingHyps( const int,
00097 const int,
00098 _PTR(SObject),
00099 QStringList&,
00100 THypList&,
00101 HypothesisData* = 0 );
00102 HypothesisData* hypData( const int,
00103 const int,
00104 const int );
00105
00106 void createHypothesis( const int, const int,
00107 const QString& );
00108
00109 bool createMesh( QString&, QStringList& );
00110 bool createSubMesh( QString&, QStringList& );
00111 bool editMeshOrSubMesh( QString& );
00112
00113 int currentHyp( const int, const int ) const;
00114 bool isAccessibleDim( const int ) const;
00115 void setCurrentHyp( const int, const int, const int );
00116 void setDefaultName() const;
00117 SMESH::SMESH_Hypothesis_var getAlgo( const int );
00118 void readMesh();
00119 QString name( _PTR(SObject) ) const;
00120 int find( const SMESH::SMESH_Hypothesis_var&,
00121 const THypList& ) const;
00122 SMESH::SMESH_Hypothesis_var getInitParamsHypothesis( const QString&,
00123 const QString& ) const;
00124 bool isSubshapeOk() const;
00125 char* isSubmeshIgnored() const;
00126 _PTR(SObject) getSubmeshByGeom() const;
00127 void selectObject( _PTR(SObject) ) const;
00128
00129 private:
00130 SMESHGUI_MeshDlg* myDlg;
00131 SMESHGUI_ShapeByMeshOp* myShapeByMeshOp;
00132 bool myToCreate;
00133 bool myIsMesh;
00134 bool myIsOnGeometry;
00135
00136 TDim2Type2HypList myExistingHyps;
00137 TDim2Type2HypList myObjHyps;
00138
00139
00140
00141 THypDataList myAvailableHypData[4][NbHypTypes];
00142
00143 bool myIgnoreAlgoSelection;
00144 HypothesesSet* myHypoSet;
00145 int myDim, myType;
00146
00147 QString myObjectToSelect;
00148 };
00149
00150 #endif // SMESHGUI_MESHOP_H