From: ouv Date: Fri, 27 Sep 2013 09:20:08 +0000 (+0000) Subject: HYDRO feature 34: Polylines creation: improvements. X-Git-Tag: BR_hydro_v_0_3~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=c75c1e3d1131942529ec2e7abc8ff36ce2496bc3;p=modules%2Fgeom.git HYDRO feature 34: Polylines creation: improvements. --- diff --git a/src/CurveCreator/CurveCreator_NewPointDlg.cxx b/src/CurveCreator/CurveCreator_NewPointDlg.cxx index 5af871285..04c02c637 100755 --- a/src/CurveCreator/CurveCreator_NewPointDlg.cxx +++ b/src/CurveCreator/CurveCreator_NewPointDlg.cxx @@ -11,7 +11,8 @@ #include 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; } //======================================================================= diff --git a/src/CurveCreator/CurveCreator_NewPointDlg.h b/src/CurveCreator/CurveCreator_NewPointDlg.h index d936e51bb..91f56770b 100755 --- a/src/CurveCreator/CurveCreator_NewPointDlg.h +++ b/src/CurveCreator/CurveCreator_NewPointDlg.h @@ -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 diff --git a/src/CurveCreator/CurveCreator_Widget.cxx b/src/CurveCreator/CurveCreator_Widget.cxx index f75c02835..ed1fb08bb 100644 --- a/src/CurveCreator/CurveCreator_Widget.cxx +++ b/src/CurveCreator/CurveCreator_Widget.cxx @@ -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] diff --git a/src/CurveCreator/CurveCreator_Widget.h b/src/CurveCreator/CurveCreator_Widget.h index fe2cd856c..dfe61e3c2 100644 --- a/src/CurveCreator/CurveCreator_Widget.h +++ b/src/CurveCreator/CurveCreator_Widget.h @@ -28,6 +28,9 @@ public: QList getSelectedSections(); QList< QPair< int, int > > getSelectedPoints(); + bool isInstantSketchingEnabled() const; + void setInstantSketchingEnabled( const bool theState ); + signals: void selectionChanged(); void subOperationStarted( QWidget* );