if ( aDraggedPoints.size() > 0 )
{
START_MEASURE_TIME;
- setSelectedPonts( aDraggedPoints );
+ setSelectedPoints( aDraggedPoints );
END_MEASURE_TIME( "drop" );
}
}
void CurveCreator_Widget::removePoint()
{
CurveCreator_ICurve::SectionToPointList aPoints;
- getSelectedPonts( aPoints );
+ getSelectedPoints( aPoints );
if ( aPoints.size() == 0 )
return;
finishCurveModification( aSelPoints );
- setSelectedPonts();
+ setSelectedPoints();
}
void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
if ( aContext.IsNull() )
return;
- std::list<float> aSelectedList = CurveCreator_Utils::getSelectedPoints( aContext );
- /*int aNbPoints = aSelectedList.size()/3;
+ CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
+ int aNbPoints = myLocalPoints.size();
bool isRowLimit = aNbPoints > myLocalPointRowLimit;
myLocalPointView->setVisible( !isRowLimit );
- if ( isRowLimit )
- return;
- */
- std::list<float>::const_iterator anIt = aSelectedList.begin(), aLast = aSelectedList.end();
- bool isBlocked = myLocalPointView->blockSignals(true);
- myLocalPointView->setRowCount( 0 );
- for ( ; anIt != aLast; anIt++ )
- {
- float aX = *anIt;
- anIt++;
- float anY = *anIt;
- anIt++;
- float aZ = *anIt;
- myLocalPointView->addLocalPointToTable( aX, anY );
+ if ( !isRowLimit ) {
+ bool isBlocked = myLocalPointView->blockSignals(true);
+ myLocalPointView->setRowCount( 0 );
+ CurveCreator_ICurve::SectionToPointList::const_iterator anIt = myLocalPoints.begin(),
+ aLast = myLocalPoints.end();
+ for ( ; anIt != aLast; anIt++ )
+ myLocalPointView->addLocalPointToTable( *anIt );
+
+ myLocalPointView->blockSignals( isBlocked );
}
- myLocalPointView->blockSignals(isBlocked);
}
/**
void CurveCreator_Widget::setDragStarted( const bool theState, const QPoint& thePoint )
{
if ( theState ) {
- getSelectedPonts( myDragPoints );
+ getSelectedPoints( myDragPoints );
myDragStarted = myDragPoints.size();
myDragStartPosition = thePoint;
if ( myDragStarted ) {
myDragged = false;
}
-void CurveCreator_Widget::getSelectedPonts( CurveCreator_ICurve::SectionToPointList& thePoints )
+void CurveCreator_Widget::getSelectedPoints( CurveCreator_ICurve::SectionToPointList& thePoints )
{
thePoints.clear();
- for ( int i = 0, aNb = myLocalPointView->rowCount(); i < aNb; i++ )
- thePoints.push_back( std::make_pair( myLocalPointView->getSectionId( i ),
- myLocalPointView->getPointId( i ) ) );
+ thePoints = myLocalPoints;
}
}
-void CurveCreator_Widget::setSelectedPonts( const CurveCreator_ICurve::SectionToPointList& thePoints )
+void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& thePoints )
{
if ( myDragStarted )
return;
{
if ( theFillPoints ) {
thePoints.clear();
- getSelectedPonts( thePoints );
+ getSelectedPoints( thePoints );
}
setLocalPointContext( false );
}
{
if ( getActionMode() == ModificationMode )
setLocalPointContext( true );
- setSelectedPonts( thePoints );
+ setSelectedPoints( thePoints );
updateUndoRedo();
}