Salome HOME
Modifs cas-tests + evols ihm
[modules/hexablock.git] / src / HEXABLOCKGUI / MyBasicGUI_PointDlg.hxx
index eaed34a319603c4030595b3fac72f91d39f8d7ed..2f85baf869e1edd62e315ab146ffa3b5fc4ed061 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2009-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2009-2013  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #ifndef MYBASICGUI_POINTDLG_H
 #define MYBASICGUI_POINTDLG_H
 
-
-
+#include "HEXABLOCKGUI_Export.hxx"
 
 #include "MyGEOMBase_Skeleton.hxx"
-#include "GEOM_GenericObjPtr.h"
 #include <QMap>
 
-class DlgRef_2Sel1Spin;
-class DlgRef_3Spin;
-class DlgRef_2Sel;
-class DlgRef_1Sel3Spin;
-class DlgRef_1Sel2Spin;
+class MyDlgRef_2Sel1Spin;
+class MyDlgRef_3Spin;
+class MyDlgRef_2Sel;
+class MyDlgRef_1Sel3Spin;
+class MyDlgRef_1Sel2Spin;
 
 class QLineEdit;
 class QGroupBox;
@@ -47,9 +45,6 @@ class gp_Pnt;
 #include <SUIT_Session.h>
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewManager.h>
-// #include <VTKViewer_ViewModel.h>
-
-
 
 #include "SVTK_Selection.h"
 #include <SVTK_ViewModel.h>
@@ -67,112 +62,86 @@ namespace HEXABLOCK
 // class    : MyBasicGUI_PointDlg
 // purpose  :
 //=================================================================================
-typedef class MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
-{ 
+typedef class HEXABLOCK_EXPORT MyBasicGUI_PointDlg : public MyGEOMBase_Skeleton
+{
   Q_OBJECT
 
 public:
-  MyBasicGUI_PointDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0 );
+  MyBasicGUI_PointDlg( QWidget* = 0, Qt::WindowFlags = 0 );
   ~MyBasicGUI_PointDlg();
 
   bool                               acceptMouseEvent() const { return ( getConstructorId() == 0 );  }
-  void                               OnPointSelected( const gp_Pnt& ); // called by BasicGUI::OnMousePress()
-
-protected:
-  // redefined from GEOMBase_Helper
-
-  virtual GEOM::GEOM_IOperations_ptr createOperation();
-  virtual bool                       isValid( QString& );
-  virtual bool                       execute( ObjectList& );
-  virtual void                       addSubshapesToStudy();
+  void                               OnPointSelected( const gp_Pnt& );
 
 private:
-  void                               Init();
-  void                               enterEvent( QEvent* );
   double                             getParameter() const;
   double                             getUParameter() const;
   double                             getVParameter() const;
   void                               updateParamCoord(bool theIsUpdate);
-
-private:
-  GEOM::GeomObjPtr                   myEdge;
-  GEOM::GeomObjPtr                   myFace;
-  GEOM::GeomObjPtr                   myRefPoint; 
-  GEOM::GeomObjPtr                   myLine1; 
-  GEOM::GeomObjPtr                   myLine2;
-
   bool                               myBusy;
 
-  DlgRef_3Spin*                      GroupXYZ;
-  DlgRef_1Sel3Spin*                  GroupRefPoint;
-  DlgRef_2Sel1Spin*                  GroupOnCurve;
-  DlgRef_2Sel*                       GroupLineIntersection;
-  DlgRef_1Sel2Spin*                  GroupOnSurface;
-  
+  MyDlgRef_3Spin*                      GroupXYZ;
+  MyDlgRef_1Sel3Spin*                  GroupRefPoint;
+  MyDlgRef_2Sel1Spin*                  GroupOnCurve;
+  MyDlgRef_2Sel*                       GroupLineIntersection;
+  MyDlgRef_1Sel2Spin*                  GroupOnSurface;
+
   QGroupBox*                         myCoordGrp;
   QLineEdit*                         myX;
   QLineEdit*                         myY;
   QLineEdit*                         myZ;
 
-  
+
 
   QGroupBox*                         myParamGroup;
   QButtonGroup*                      myParamCoord;
 
   QMenu*                             myBtnPopup;
-  QMap<QAction*, int>                myActions;
+  QMenu*                             myBtnPopup2;
+  QAction*                           action_line1_edge;
+  QAction*                           action_line1_wire;
+  QAction*                           action_line2_edge;
+  QAction*                           action_line2_wire;
 
-  TopAbs_ShapeEnum                   myNeedType;
-  
 private slots:
-  void                               ClickOnOk();
-  bool                               ClickOnApply();
-  void                               ActivateThisDialog();
-  void                               DeactivateActiveDialog();
-  void                               SelectionIntoArgument();
-  void                               SetEditCurrentArgument();
   void                               ConstructorsClicked( int );
-  void                               ValueChangedInSpinBox( double );
   void                               SetDoubleSpinBoxStep( double );
   void                               ClickParamCoord( int );
-  void                               CheckBoxClicked( int );
   void                               onBtnPopup( QAction* );
   void                               updateSize();
-
+ // void                               onRefPointChanged(const QString& pointName);
+ // void                               onStartPointSelected(const QString& pointName);
+  void                               onParamValueChanged(double newValue);
+  void                               onXCoordChanged(double newValue);
+  void                               onYCoordChanged(double newValue);
+  void                               onZCoordChanged(double newValue);
+  void                               onUpdateResults(const QString& data);
 
 // HEXABLOCK
 public:
-  void setDocumentModel( HEXABLOCK::GUI::DocumentModel* m );
-  void setPatternDataSelectionModel( HEXABLOCK::GUI::PatternDataSelectionModel* s );
-
-  bool onAccept( const bool publish = true, const bool useTransaction = true );
-
+  void clear();
+  TopoDS_Vertex computeGeomVertex(bool preview=false);
+  TopoDS_Vertex computeGeomPointXYZ();
+  TopoDS_Vertex computeGeomPointRef();
+  TopoDS_Vertex computeGeomPointEdge();
+  TopoDS_Vertex computeGeomPointInt();
+  TopoDS_Vertex computeGeomPointSurf();
 
 protected:
-  virtual bool eventFilter( QObject *obj, QEvent *event );
-  virtual void hideEvent ( QHideEvent * event );
   virtual void showEvent ( QShowEvent * event );
-  void _initInputWidget();
-  void _initViewManager();
-  void _highlightWidget(QObject* obj, Qt::GlobalColor clr);
-  bool _isLineOrListWidget(QObject*);
 
-protected slots:
-  void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel );
-  void onWindowActivated( SUIT_ViewManager* vm );
+  virtual bool apply(QModelIndex& result);
+  virtual void _initInputWidget( Mode editmode );
+  void updateInputs(const int constructorId);
 
+  TopoDS_Vertex currentVertex;
+  QMap<int, double> paramInputValue;
+  QMap<int, QVector3D*> coordsInputValue;
 
-private:
-  HEXABLOCK::GUI::DocumentModel*              _documentModel;
-  HEXABLOCK::GUI::PatternDataSelectionModel*  _patternDataSelectionModel;
-  LightApp_SelectionMgr*                      _mgr;
-  SUIT_ViewManager*                           _vtkVm;
-  SUIT_ViewManager*                           _occVm;
-//   QLineEdit*                                  _vertex_le;
-
-  QObject*                                    _currentObj;
-  bool                                        _selectionMutex;
-
+protected slots:
+  void onWindowActivated( SUIT_ViewManager* vm );
+  void updateHelpFileName();
+  virtual void onSelectionChanged(  const QItemSelection& sel, const QItemSelection& unsel );
 
 } VertexAssocDialog;