Implementation of GUI for mesh refinement with help of patterns

This commit is contained in:
san 2005-01-17 16:16:56 +00:00
parent f0ddb8c3ac
commit 5b961b878c
3 changed files with 1573 additions and 1319 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,169 +1,187 @@
// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// //
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public // modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either // License as published by the Free Software Foundation; either
// version 2.1 of the License. // version 2.1 of the License.
// //
// This library is distributed in the hope that it will be useful, // This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of // but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details. // Lesser General Public License for more details.
// //
// You should have received a copy of the GNU Lesser General Public // You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software // License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
// //
// See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
// //
// //
// //
// File : SMESHGUI_MeshPatternDlg.h // File : SMESHGUI_MeshPatternDlg.h
// Author : Sergey LITONIN // Author : Sergey LITONIN
// Module : SMESH // Module : SMESH
#ifndef SMESHGUI_MeshPatternDlg_H #ifndef SMESHGUI_MeshPatternDlg_H
#define SMESHGUI_MeshPatternDlg_H #define SMESHGUI_MeshPatternDlg_H
#include <qdialog.h> #include <qdialog.h>
// IDL Headers // IDL Headers
#include <SALOMEconfig.h> #include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(GEOM_Gen) #include CORBA_SERVER_HEADER(GEOM_Gen)
#include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Mesh)
#include CORBA_SERVER_HEADER(SMESH_Pattern) #include CORBA_SERVER_HEADER(SMESH_Pattern)
class QCloseEvent; class QCloseEvent;
class QFrame; class QFrame;
class QLineEdit; class QLineEdit;
class SMESHGUI_SpinBox; class SMESHGUI_SpinBox;
class QPushButton; class QPushButton;
class SALOME_Selection; class SALOME_Selection;
class QRadioButton; class QRadioButton;
class QCheckBox; class QCheckBox;
class QButtonGroup; class QButtonGroup;
class QLabel; class QLabel;
class SMESHGUI_CreatePatternDlg; class QSpinBox;
class SMESHGUI_PatternWidget; class QGroupBox;
class vtkUnstructuredGrid; class SMESHGUI_CreatePatternDlg;
class SALOME_Actor; class SMESHGUI_PatternWidget;
class vtkUnstructuredGrid;
/* class SALOME_Actor;
Class : SMESHGUI_MeshPatternDlg
Description : Dialog to specify filters for VTK viewer /*
*/ Class : SMESHGUI_MeshPatternDlg
Description : Dialog to specify filters for VTK viewer
class SMESHGUI_MeshPatternDlg : public QDialog */
{
Q_OBJECT class SMESHGUI_MeshPatternDlg : public QDialog
{
// Pattern type Q_OBJECT
enum { Type_2d, Type_3d };
// Pattern type
// selection input enum { Type_2d, Type_3d };
enum { Mesh, Object, Vertex1, Vertex2 };
// selection input
public: enum { Mesh, Object, Vertex1, Vertex2, Ids };
SMESHGUI_MeshPatternDlg( QWidget*,
SALOME_Selection*, public:
const char* = 0 ); SMESHGUI_MeshPatternDlg( QWidget*,
virtual ~SMESHGUI_MeshPatternDlg(); SALOME_Selection*,
const char* = 0 );
void Init( SALOME_Selection* ); virtual ~SMESHGUI_MeshPatternDlg();
private slots: void Init( SALOME_Selection* );
void onOk(); private slots:
bool onApply();
void onClose(); void onOk();
bool onApply();
void onDeactivate(); void onClose();
void onSelectionDone(); void onDeactivate();
void onSelInputChanged();
void onSelectionDone();
void onTypeChanged( int ); void onSelInputChanged();
void onOpen();
void onNew(); void onTypeChanged( int );
void onReverse( bool ); void onModeToggled( bool );
void onPreview( bool ); void onOpen();
void onOkCreationDlg(); void onNew();
void onCloseCreationDlg(); void onReverse( bool );
void onPreview( bool );
private: void onOkCreationDlg();
void onCloseCreationDlg();
QFrame* createButtonFrame( QWidget* ); void onTextChanged( const QString& );
QFrame* createMainFrame ( QWidget* ); void onNodeChanged( int value );
void displayPreview();
vtkUnstructuredGrid* getGrid(); private:
void erasePreview();
void updateWgState(); QFrame* createButtonFrame( QWidget* );
bool loadFromFile( const QString& ); QFrame* createMainFrame ( QWidget* );
void activateSelection(); void displayPreview();
QStringList prepareFilters() const; vtkUnstructuredGrid* getGrid();
QString autoExtension( const QString& theFileName ) const; void erasePreview();
void closeEvent( QCloseEvent* e ) ; void updateWgState();
void enterEvent ( QEvent * ) ; bool loadFromFile( const QString& );
bool isValid( const bool theMess = true ); void activateSelection();
void resetSelInput(); QStringList prepareFilters() const;
QString autoExtension( const QString& theFileName ) const;
private: void closeEvent( QCloseEvent* e ) ;
void enterEvent ( QEvent * ) ;
QPushButton* myOkBtn; bool isValid( const bool theMess = true );
QPushButton* myApplyBtn; void resetSelInput();
QPushButton* myCloseBtn; bool isRefine() const;
QButtonGroup* myTypeGrp; bool getIds( QValueList<int>& ) const;
QRadioButton* mySwitch2d; int getNode( bool = false ) const;
QRadioButton* mySwitch3d;
private:
QMap< int, QPushButton* > mySelBtn;
QMap< int, QLineEdit* > mySelEdit; QPushButton* myOkBtn;
QMap< int, QLabel* > mySelLbl; QPushButton* myApplyBtn;
QPushButton* myCloseBtn;
QLineEdit* myName;
QPushButton* myOpenBtn; QButtonGroup* myTypeGrp;
QPushButton* myNewBtn; QRadioButton* mySwitch2d;
QRadioButton* mySwitch3d;
QCheckBox* myReverseChk;
SMESHGUI_PatternWidget* myPicture2d; QCheckBox* myRefine;
QFrame* myPicture3d;
QLabel* myPreview3d; QFrame* myRefineGrp;
QSpinBox* myNode1;
QCheckBox* myPreviewChk; QSpinBox* myNode2;
QLabel* myNode2Lbl;
SALOME_Selection* mySelection;
int mySelInput; QGroupBox* myGeomGrp;
int myNbPoints; QMap< int, QPushButton* > mySelBtn;
int myType; QMap< int, QLineEdit* > mySelEdit;
bool myIsCreateDlgOpen; QMap< int, QLabel* > mySelLbl;
SMESH::SMESH_Mesh_var myMesh; QLineEdit* myName;
GEOM::GEOM_Object_var myMeshShape; QPushButton* myOpenBtn;
QMap< int, GEOM::GEOM_Object_var > myGeomObj; QPushButton* myNewBtn;
SMESHGUI_CreatePatternDlg* myCreationDlg; QCheckBox* myReverseChk;
SMESH::SMESH_Pattern_var myPattern; SMESHGUI_PatternWidget* myPicture2d;
SALOME_Actor* myPreviewActor; QFrame* myPicture3d;
}; QLabel* myPreview3d;
#endif QCheckBox* myPreviewChk;
SALOME_Selection* mySelection;
int mySelInput;
int myNbPoints;
int myType;
bool myIsCreateDlgOpen;
bool myBusy;
SMESH::SMESH_Mesh_var myMesh;
GEOM::GEOM_Object_var myMeshShape;
QMap< int, GEOM::GEOM_Object_var > myGeomObj;
SMESHGUI_CreatePatternDlg* myCreationDlg;
SMESH::SMESH_Pattern_var myPattern;
SALOME_Actor* myPreviewActor;
};
#endif

View File

@ -1660,6 +1660,20 @@ msgstr "It is impossible to load pattern\nThere are no elements in it"
msgid "SMESHGUI_MeshPatternDlg::ERR_READ_BAD_KEY_POINT" msgid "SMESHGUI_MeshPatternDlg::ERR_READ_BAD_KEY_POINT"
msgstr "It is impossible to load pattern\nKey-point not on a boundary" msgstr "It is impossible to load pattern\nKey-point not on a boundary"
msgid "SMESHGUI_MeshPatternDlg::REFINE"
msgstr "Refine selected mesh elements"
msgid "SMESHGUI_MeshPatternDlg::NODE_1"
msgstr "Node 1"
msgid "SMESHGUI_MeshPatternDlg::NODE_2"
msgstr "Node 2"
msgid "SMESHGUI_MeshPatternDlg::MESH_FACES"
msgstr "Mesh faces"
msgid "SMESHGUI_MeshPatternDlg::MESH_VOLUMES"
msgstr "Mesh volumes"
#---------------------------------------------------- #----------------------------------------------------