Salome HOME
Win32 compilation.
[modules/geom.git] / src / EntityGUI / EntityGUI_SketcherDlg.h
index 93a6835fff9f0685849e10411da451c9bc8ed411..0d4f0d32482e1053d0346a94edc3bba418635d64 100644 (file)
@@ -49,6 +49,7 @@ class EntityGUI_Point;
 class EntityGUI_Dir1;
 class EntityGUI_Dir2;
 class EntityGUI_Skeleton;
+class DlgRef_4Spin;
 class GeometryGUI;
 
 #ifndef COORD_MIN
@@ -68,13 +69,13 @@ class EntityGUI_SketcherDlg : public QDialog, GEOMBase_Helper
 
 public:
   EntityGUI_SketcherDlg( GeometryGUI*, QWidget* = 0, bool = false, Qt::WindowFlags = 0,
-                         const double = 2. );
+                         const double = -1 );
   ~EntityGUI_SketcherDlg();
 
   bool eventFilter (QObject* object, QEvent* event);
   
-  bool                               acceptMouseEvent() const { return ( getPnt1ConstructorId() == 1 );  } //accept mouse event only on absolute selection mode
-  void                               OnPointSelected( Qt::KeyboardModifiers, const gp_Pnt& ); // called by EntityGUI::OnMousePress()
+  bool                               acceptMouseEvent() const;  // called by EntityGUI::OnMousePress()
+  void                               OnPointSelected( Qt::KeyboardModifiers, const gp_Pnt&, bool isStart = true );             
 
 protected:
   void                               initSpinBox( SalomeApp_DoubleSpinBox*, 
@@ -85,7 +86,8 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-
+  virtual void                       addSubshapesToStudy();
+  
   void                               closeEvent( QCloseEvent* );
   void                               keyPressEvent( QKeyEvent* );
 
@@ -105,12 +107,21 @@ private:
                                                      const double = -1,
                                                      const int  = -1,
                                                      const int  = -1);
+  
+  void                               displayPntPreview( const double = 0.0,
+                                                        const double = 0.0,
+                                                        bool /*append*/ = true,
+                                                        bool /*update*/ = true
+                                                      );
 
   bool                               createShapes( GEOM::GEOM_Object_ptr,
                                                    TopoDS_Shape&,
                                                    TopoDS_Shape& );
   int                                getPnt1ConstructorId() const;
   int                                getPnt2ConstructorId() const;
+  void                               OnFirstPoint();
+  void                               OnNextPoint(); 
+
 
 private:
   int                                myConstructorId;
@@ -121,6 +132,7 @@ private:
 
   bool                               myIsAllAdded;
   bool                               myIsApply;
+  bool                               autoApply;
 
   QLineEdit*                         myEditCurrentArgument;   /* Current LineEdit */
 
@@ -131,12 +143,14 @@ private:
   QStringList                        myUndoParameters;
 
   Standard_Real                      myX, myY, myDX, myDY;
+  Standard_Real                      myX1, myY1, myX2, myY2;
   Standard_Real                      myXc, myYc, myDXc, myDYc;
   Standard_Real                      myLength, myAngle, myRadius;
   Standard_Real                      myLastX1, myLastY1;
   Standard_Real                      myLastX2, myLastY2;
 
   QString                            myXStr, myYStr, myDXStr, myDYStr;
+  QString                            myX1Str, myY1Str, myX2Str, myY2Str;
   QString                            myXcStr, myYcStr, myDXcStr, myDYcStr;
   QString                            myLengthStr, myAngleStr, myRadiusStr;
   QString                            myLastX1Str, myLastY1Str;
@@ -156,12 +170,16 @@ private:
   EntityGUI_2Spin*                   Group2Spin;
   EntityGUI_3Spin1Check*             Group3Spin;
   EntityGUI_4Spin1Check*             Group4Spin;
+  DlgRef_4Spin*                      GroupRect;
 
   QLabel*                            myErrLabel;
 
   QGroupBox*                         GroupBox1;
   QComboBox*                         ComboBox1;
   QPushButton*                       planeButton;
+  QPushButton*                       selButton;
+  
+  QLineEdit*                         WPlaneLineEdit;
 
   GeometryGUI*                       myGeometryGUI;
 
@@ -170,6 +188,9 @@ private:
   double                             myLineWidth;
 
   QList<gp_Ax3>                      myLCSList;
+  GEOM::GEOM_Object_var              myGlobalCS;
+  GEOM::GEOM_Object_var              myWPlane;
+  QList< GEOM::GEOM_Object_var >     myWPlaneList;
 
   int                                myCheckFlag;
   
@@ -199,6 +220,7 @@ private slots:
   void                               DeactivateActiveDialog();
   void                               ActivateThisDialog();
   void                               TypeClicked( int );
+  void                               RectClicked();
   void                               DestClicked( int );
   void                               PointClicked( int );
   void                               Point2Clicked( int );
@@ -207,8 +229,10 @@ private slots:
   void                               CheckBoxClicked( int );
   void                               ValueChangedInSpinBox( double );
   void                               SetDoubleSpinBoxStep( double );
+  void                               AddLocalCS( GEOM::GEOM_Object_var );
   void                               FindLocalCS();
   gp_Ax3                             GetActiveLocalCS();
+  gp_Ax3                             WPlaneToLCS( GEOM::GEOM_Object_var );
   void                               ActivateLocalCS();
 };