]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
HYDRO feature 34: Polylines creation: improvements.
authorouv <ouv@opencascade.com>
Fri, 27 Sep 2013 09:20:08 +0000 (09:20 +0000)
committerouv <ouv@opencascade.com>
Fri, 27 Sep 2013 09:20:08 +0000 (09:20 +0000)
src/CurveCreator/CurveCreator_NewPointDlg.cxx
src/CurveCreator/CurveCreator_NewPointDlg.h
src/CurveCreator/CurveCreator_Widget.cxx
src/CurveCreator/CurveCreator_Widget.h

index 5af871285180224081d7c529d24aff9638eea6be..04c02c637120466f24e00cd4f398e11572a52a02 100755 (executable)
@@ -11,7 +11,8 @@
 #include <QLocale>
 
 CurveCreator_NewPointDlg::CurveCreator_NewPointDlg(CurveCreator::Dimension theDim, QWidget *parent) :
-  QWidget(parent), myX(NULL), myY(NULL), myZ(NULL), myIsEdit(false), myDim(theDim)
+  QWidget(parent), myX(NULL), myY(NULL), myZ(NULL), myIsEdit(false), myDim(theDim),
+  myIsInstantSketchingEnabled(false)
 {
   QString aTitle = QString(tr("ADD_NEW_POINT"));
   setWindowTitle(aTitle);
@@ -143,6 +144,18 @@ void CurveCreator_NewPointDlg::setCoordinates( const CurveCreator::Coordinates&
     double aZ = theCoords[2];
     myZ->setValue(aZ);
   }
+  if( isInstantSketchingEnabled() )
+    emit addPoint();
+}
+
+bool CurveCreator_NewPointDlg::isInstantSketchingEnabled() const
+{
+  return myIsInstantSketchingEnabled;
+}
+
+void CurveCreator_NewPointDlg::setInstantSketchingEnabled( const bool theState )
+{
+  myIsInstantSketchingEnabled = theState;
 }
 
 //=======================================================================
index d936e51bb71477af5b24ab0048ab8c47ce96e6c8..91f56770b319a24b14a00598128a5add20ff0924 100755 (executable)
@@ -23,6 +23,8 @@ public:
   void setEditMode( bool isEdit );
   void setCoordinates( const CurveCreator::Coordinates& theCoords );
   void setDimension(CurveCreator::Dimension theDim);
+  bool isInstantSketchingEnabled() const;
+  void setInstantSketchingEnabled( const bool theState );
 signals:
   void addPoint();
   void modifyPoint();
@@ -43,6 +45,7 @@ private:
   QPushButton*            myCancelBtn;
   bool                    myIsEdit;
   QString                 mySectionName;
+  bool                    myIsInstantSketchingEnabled;
 };
 
 #endif // CURVECREATOR_NEWPOINTDLG_H
index f75c02835e0e5c61d8e67a2acea94a802bcb01a2..ed1fb08bb1ded3c02f8f51d5555acb6c4fac526b 100644 (file)
@@ -743,6 +743,19 @@ QList< QPair< int, int > > CurveCreator_Widget::getSelectedPoints()
   return mySectionView->getSelectedPoints();
 }
 
+bool CurveCreator_Widget::isInstantSketchingEnabled() const
+{
+  if( myNewPointEditor )
+    return myNewPointEditor->isInstantSketchingEnabled();
+  return false;
+}
+
+void CurveCreator_Widget::setInstantSketchingEnabled( const bool theState )
+{
+  if( myNewPointEditor )
+    myNewPointEditor->setInstantSketchingEnabled( theState );
+}
+
 //=================================================================================
 // function : GeometryGUI::OnMousePress()
 // purpose  : Manage mouse press events [static]
index fe2cd856c1f14c087782ce6951be589953283124..dfe61e3c2dc38f19df35c0f2d5600428f5e025e7 100644 (file)
@@ -28,6 +28,9 @@ public:
     QList<int> getSelectedSections();
     QList< QPair< int, int > > getSelectedPoints();
 
+    bool isInstantSketchingEnabled() const;
+    void setInstantSketchingEnabled( const bool theState );
+
 signals:
     void selectionChanged();
     void subOperationStarted( QWidget* );