Salome HOME
Update of CheckDone
[modules/smesh.git] / src / StdMeshersGUI / StdMeshersGUI_QuadrangleParamWdg.h
index b58445b6d4a238d4db3c69d085fe9c173509f01e..44afe5faee7002d04a0f17da2493556173abd1ab 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // 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.
+// version 2.1 of the License, or (at your option) any later version.
 //
 // This library is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 
 // SMESH includes
 #include "SMESH_StdMeshersGUI.hxx"
+#include "StdMeshersGUI_StdHypothesisCreator.h"
+
+#include <SALOME_InteractiveObject.hxx>
 
 // Qt includes
 #include <QWidget>
+#include <QItemDelegate>
+
 
 class QButtonGroup;
+class QLineEdit;
+class QListWidget;
+class QPushButton;
+class QTabWidget;
+class QTreeWidget;
+class StdMeshersGUI_QuadrangleParamWdg;
+class StdMeshersGUI_SubShapeSelectorWdg;
+
+//================================================================================
+/*!
+ * \brief Quadrangle Parameters Creator
+ */
+class STDMESHERSGUI_EXPORT StdMeshersGUI_QuadrangleParamCreator : public StdMeshersGUI_StdHypothesisCreator
+{
+  Q_OBJECT
+
+    class ItemDelegate;
+
+ public:
+  StdMeshersGUI_QuadrangleParamCreator( const QString& aHypType );
+
+  //virtual bool     checkParams( QString& ) const;
+  virtual QString  helpPage() const;
+
+ protected:
+  virtual QFrame*  buildFrame();
+  virtual void     retrieveParams() const;
+  virtual QString  storeParams() const;
+
+ private slots:
+
+  void onTypeChanged(int type);
+  void onAddShape();
+  void onRemoveShape();
+  void onAddPoint();
+  void onRemovePoint();
+  void onSelectionChanged();
+  void onTabChanged(int);
+
+ private:
 
+  QLineEdit*                         myName;
+  StdMeshersGUI_QuadrangleParamWdg*  myTypeWdg;
+  StdMeshersGUI_SubShapeSelectorWdg* myVertexSelWdg;
+  StdMeshersGUI_SubShapeSelectorWdg* myCornersSelWdg;
+  QListWidget*                       myShapesList;
+  QPushButton*                       myAddShapeBut;
+  QTreeWidget*                       myCoordsTreeWdg;
+  QTabWidget*                        myTabs;
+  Handle(SALOME_InteractiveObject)   mySelectedShapeIO;
+};
+
+//================================================================================
+/*!
+ * \brief Transition type widget
+ */
 class STDMESHERSGUI_EXPORT StdMeshersGUI_QuadrangleParamWdg : public QWidget
 {
   Q_OBJECT
 
-public:
+    public:
   StdMeshersGUI_QuadrangleParamWdg (QWidget* parent = 0);
   ~StdMeshersGUI_QuadrangleParamWdg();
 
   void SetType (int theType);
   int  GetType ();
 
-private:
-  // Quadranle preference, Triangle preference, Reduced
-  QButtonGroup* myType;
+  GEOM::ListOfGO*     GetShapes();
+  SMESH::nodes_array* GetPoints();
+  void                Set( GEOM::ListOfGO_var shapes, SMESH::nodes_array_var points );
+
+ signals:
+
+  void typeChanged(int);
+
+ private:
+  QButtonGroup* myType; // Quadrangle preference, Triangle preference, Reduced
+};
+
+//================================================================================
+/*!
+ * \brief Item delegate for a tree widget
+ */
+class StdMeshersGUI_QuadrangleParamCreator::ItemDelegate : public QItemDelegate
+{
+  Q_OBJECT
+public:
+  ItemDelegate( QObject* );
+  QWidget* createEditor( QWidget*, const QStyleOptionViewItem&, const QModelIndex& ) const;
 };
 
 #endif // STDMESHERSGUI_QUADRANGLEPARAMWDG_H