HYDRO feature 34: Polylines creation: improvements.

This commit is contained in:
ouv 2013-09-27 09:20:08 +00:00
parent e7d1a0371b
commit c75c1e3d11
4 changed files with 33 additions and 1 deletions

View File

@ -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;
}
//=======================================================================

View File

@ -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

View 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]

View 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* );