Salome HOME
Copyright update 2022
[modules/geom.git] / src / CurveCreator / CurveCreator_Widget.cxx
index fc31c7dd6eff8b8950a2bf9607ad04fbebdb9b2c..28035cf0712c9ebc6b7ec13adf63813cf9a675b9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2022  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+#include <Basics_OCCTVersion.hxx>
+
 #include "CurveCreator_Widget.h"
 #include "CurveCreator_TreeView.h"
-#include "CurveCreator_ICurve.hxx"
-#include "CurveCreator.hxx"
 #include "CurveCreator_NewSectionDlg.h"
 #include "CurveCreator_Utils.hxx"
 #include "CurveCreator_UtilsICurve.hxx"
 #include "CurveCreator_TableView.h"
 
+#include "CurveCreator_Curve.hxx"
+#include "CurveCreator_Section.hxx"
+#include <QColorDialog>
+
 #include <SUIT_Session.h>
 #include <SUIT_Desktop.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_ViewManager.h>
 
+#include <TopExp_Explorer.hxx>
+#include "CurveCreator_ShapeFilter.hxx"
+
 #include <OCCViewer_ViewManager.h>
 #include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_Utilities.h>
@@ -82,11 +89,10 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
                                          CurveCreator_ICurve *theCurve,
                                          const int theActionFlags,
                                          const QStringList& theCoordTitles,
-                                         Qt::WindowFlags fl,
-                                         int theLocalPointRowLimit )
-: QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0),
+                                         Qt::WindowFlags /*fl*/ )
+: QWidget(parent), myCurve(theCurve), myNewSectionEditor(NULL),
+  myOCCViewer( 0 ), mySection(0),
   myDragStarted( false ), myDragInteractionStyle( SUIT_ViewModel::STANDARD ),
-  myOCCViewer( 0 ), myLocalPointRowLimit( theLocalPointRowLimit ),
   myOld2DMode(OCCViewer_ViewWindow::No2dMode)
 {
   bool isToEnableClosed = !( theActionFlags & DisableClosedSection );
@@ -98,7 +104,10 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
 
   QGroupBox* aSectionGroup = new QGroupBox(tr("SECTION_GROUP_TITLE"),this);
 
-  mySectionView = new CurveCreator_TreeView(myCurve, aSectionGroup);
+
+  bool toDrawSectColor = !(theActionFlags & DisableSetColor);
+
+  mySectionView = new CurveCreator_TreeView(myCurve, aSectionGroup, toDrawSectColor);
   mySectionView->setSelectionMode( QTreeView::ExtendedSelection );
   connect( mySectionView, SIGNAL(selectionChanged()), this, SLOT( onSelectionChanged() ) );
   connect( mySectionView, SIGNAL(sectionEntered(int)), this, SLOT(onEditSection(int)) );
@@ -125,20 +134,21 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
   QPixmap aBringTogetherPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_BRING_TOGETHER")));
   QPixmap aStepUpPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_UP")));
   QPixmap aStepDownPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_ARROW_DOWN")));
+  QPixmap aSetColorPixmap(aResMgr->loadPixmap("GEOM", tr("ICON_CC_SETCOLOR")));
 
-  QAction* anAct = createAction( UNDO_ID, tr("UNDO"), anUndoPixmap, tr("UNDO_TLT"), 
+  QAction* anAct = createAction( UNDO_ID, tr("UNDO"), anUndoPixmap, tr("UNDO_TLT"),
                                  QKeySequence(Qt::ControlModifier|Qt::Key_Z) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onUndo()) );
   aTB->addAction(anAct);
 
-  anAct = createAction( REDO_ID, tr("REDO"), aRedoPixmap, tr("REDO_TLT"), 
+  anAct = createAction( REDO_ID, tr("REDO"), aRedoPixmap, tr("REDO_TLT"),
                         QKeySequence(Qt::ControlModifier|Qt::Key_Y) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onRedo()) );
   aTB->addAction(anAct);
 
   aTB->addSeparator();
-  
-  anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"), 
+
+  anAct = createAction( NEW_SECTION_ID, tr("NEW_SECTION"), aNewSectionPixmap, tr("NEW_SECTION_TLT"),
                         QKeySequence(Qt::ControlModifier|Qt::Key_N) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onNewSection()) );
   if ( !(theActionFlags & DisableNewSection) ) {
@@ -146,54 +156,61 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
     aTB->addSeparator();
   }
 
-  anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"), 
+  anAct = createAction( ADDITION_MODE_ID, tr("ADDITION_MODE"), aNewPointPixmap, tr("ADDITION_MODE_TLT"),
                         QKeySequence() );
   anAct->setCheckable(true);
   connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onAdditionMode(bool)) );
   connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
   aTB->addAction(anAct);
-  
-  anAct = createAction( MODIFICATION_MODE_ID, tr("MODIFICATION_MODE"), anEditPointsPixmap, tr("MODIFICATION_MODE_TLT"), 
+
+  anAct = createAction( MODIFICATION_MODE_ID, tr("MODIFICATION_MODE"), anEditPointsPixmap, tr("MODIFICATION_MODE_TLT"),
                         QKeySequence() );
   anAct->setCheckable(true);
   connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onModificationMode(bool)) );
   connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
   aTB->addAction(anAct);
 
-  anAct = createAction( DETECTION_MODE_ID, tr("DETECTION_MODE"), aDetectPointsPixmap, tr("DETECTION_MODE_TLT"), 
+  anAct = createAction( DETECTION_MODE_ID, tr("DETECTION_MODE"), aDetectPointsPixmap, tr("DETECTION_MODE_TLT"),
                         QKeySequence() );
   anAct->setCheckable(true);
   connect(anAct, SIGNAL(triggered(bool)), this, SLOT(onDetectionMode(bool)) );
   connect(anAct, SIGNAL(toggled(bool)), this, SLOT(onModeChanged(bool)) );
-  if ( !(theActionFlags & DisableDetectionMode) ) {
-    aTB->addAction(anAct);
-  }
-  
-  anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"), 
+//  if ( !(theActionFlags & DisableDetectionMode) ) {
+//    aTB->addAction(anAct);
+//  }
+
+  anAct = createAction( CLOSE_SECTIONS_ID, tr("CLOSE_SECTIONS"), QPixmap(), tr("CLOSE_SECTIONS_TLT"),
                         QKeySequence(Qt::ControlModifier|Qt::Key_W) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onCloseSections()) );
 
-  anAct = createAction( UNCLOSE_SECTIONS_ID, tr("UNCLOSE_SECTIONS"), QPixmap(), 
+  anAct = createAction( UNCLOSE_SECTIONS_ID, tr("UNCLOSE_SECTIONS"), QPixmap(),
                         tr("UNCLOSE_SECTIONS_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_S) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onUncloseSections()) );
 
-  anAct = createAction( SET_SECTIONS_POLYLINE_ID, tr("SET_SECTIONS_POLYLINE"), 
-                        aPolylinePixmap, tr("SET_SECTIONS_POLYLINE_TLT"), 
+  anAct = createAction( SET_SECTIONS_POLYLINE_ID, tr("SET_SECTIONS_POLYLINE"),
+                        aPolylinePixmap, tr("SET_SECTIONS_POLYLINE_TLT"),
                         QKeySequence(Qt::ControlModifier|Qt::Key_E) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onSetPolyline()) );
 
-  anAct = createAction( SET_SECTIONS_SPLINE_ID, tr("SET_SECTIONS_SPLINE"), aSplinePixmap, 
+  anAct = createAction( SET_SECTIONS_SPLINE_ID, tr("SET_SECTIONS_SPLINE"), aSplinePixmap,
                         tr("SET_SECTIONS_SPLINE_TLT"), QKeySequence(Qt::ControlModifier|Qt::Key_R) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onSetSpline()) );
 
   aTB->addSeparator();
 
-  anAct = createAction( REMOVE_ID, tr("REMOVE"), aRemovePixmap, tr("REMOVE_TLT"), 
+  anAct = createAction( REMOVE_ID, tr("REMOVE"), aRemovePixmap, tr("REMOVE_TLT"),
                         QKeySequence(Qt::ControlModifier|Qt::Key_Delete ) );
   connect(anAct, SIGNAL(triggered()), this, SLOT(onRemove()) );
   aTB->addAction(anAct);
-  
-  anAct = createAction( JOIN_ID, tr("JOIN"), aJoinPixmap, tr("JOIN_TLT"), 
+
+  anAct = createAction( SETCOLOR_ID, tr("SETCOLOR"), aSetColorPixmap, tr("SETCOLOR_TLT"),
+                        QKeySequence(Qt::ControlModifier|Qt::Key_C ) );
+  connect(anAct, SIGNAL(triggered()), this, SLOT(onSetColor()) );
+
+  if ( !(theActionFlags & DisableSetColor) )
+    aTB->addAction(anAct);
+
+  anAct = createAction( JOIN_ID, tr("JOIN"), aJoinPixmap, tr("JOIN_TLT"),
                         QKeySequence(Qt::ControlModifier|Qt::Key_Plus ) );
   connect( anAct, SIGNAL(triggered()), this, SLOT(onJoin()) );
   aTB->addAction(anAct);
@@ -203,11 +220,11 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
   connect( anAct, SIGNAL(triggered()), this, SLOT(onBringTogether()) );
   aTB->addAction(anAct);
 
-  anAct = createAction( CLEAR_ALL_ID, tr("CLEAR_ALL"), QPixmap(), tr("CLEAR_ALL_TLT"), 
+  anAct = createAction( CLEAR_ALL_ID, tr("CLEAR_ALL"), QPixmap(), tr("CLEAR_ALL_TLT"),
                         QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Delete ) );
   connect( anAct, SIGNAL(triggered()), this, SLOT( onClearAll()) );
 
-  anAct = createAction( JOIN_ALL_ID, tr("JOIN_ALL"), QPixmap(), tr("JOIN_ALL_TLT"), 
+  anAct = createAction( JOIN_ALL_ID, tr("JOIN_ALL"), QPixmap(), tr("JOIN_ALL_TLT"),
                         QKeySequence(Qt::ControlModifier | Qt::ShiftModifier | Qt::Key_Plus ) );
   connect( anAct, SIGNAL(triggered()), this, SLOT(onJoinAll()) );
 
@@ -306,7 +323,7 @@ OCCViewer_ViewPort3d* CurveCreator_Widget::getViewPort()
   OCCViewer_Viewer* aViewer = getOCCViewer();
   if ( aViewer )
     aViewPort = ((OCCViewer_ViewWindow*)aViewer->getViewManager()->getActiveView())->getViewPort();
-    
+
   return aViewPort;
 }
 
@@ -350,6 +367,11 @@ void CurveCreator_Widget::onSelectionChanged()
   updateActionsStates();
   updateUndoRedo();
   emit selectionChanged();
+  QList<int> selectedSections = mySectionView->getSelectedSections();
+  CurveCreator_Curve* Curve =  ((CurveCreator_Curve*)myCurve);
+  Curve->myCurSectInd.clear();
+  foreach (int sectInd, selectedSections)
+    Curve->myCurSectInd.push_back(sectInd);
 }
 
 void CurveCreator_Widget::updateActionsStates()
@@ -360,6 +382,8 @@ void CurveCreator_Widget::updateActionsStates()
     if ( removeEnabled() )
       anEnabledAct << REMOVE_ID;
     QList<int> aSelSections = mySectionView->getSelectedSections();
+    if (aSelSections.size() == 1)
+      anEnabledAct << SETCOLOR_ID;
     CurveCreator_TreeView::SelectionType aSelType = mySectionView->getSelectionType();
     switch( aSelType ){
     case CurveCreator_TreeView::ST_NOSEL:{
@@ -432,8 +456,10 @@ void CurveCreator_Widget::updateActionsStates()
       break;
     }*/
 
+    default:
+      break;
     }
-    
+
     /*int aSelObjsCnt = aSelPoints.size() + aSelSections.size();
     if( aSelObjsCnt > 0 ){
       anEnabledAct << REMOVE_ID;
@@ -481,7 +507,7 @@ void CurveCreator_Widget::onModificationMode(bool checked)
   myLocalPointView->setVisible( checked );
 }
 
-void CurveCreator_Widget::onDetectionMode(bool checked)
+void CurveCreator_Widget::onDetectionMode(bool /*checked*/)
 {
 }
 
@@ -512,6 +538,8 @@ void CurveCreator_Widget::onModeChanged(bool checked)
         else if (myActionMap[MODIFICATION_MODE_ID]->isChecked())
           myActionMap[MODIFICATION_MODE_ID]->trigger();
         break;
+      default:
+        break;
     }
   }
   updateActionsStates();
@@ -598,7 +626,7 @@ void CurveCreator_Widget::onEditSection( int theSection )
 {
   if( !myCurve )
     return;
-  
+
   stopActionMode();
   mySection = theSection;
   QString aSectName = QString::fromStdString( myCurve->getSectionName(theSection));
@@ -618,18 +646,18 @@ void CurveCreator_Widget::onModifySection()
   bool isClosed = myNewSectionEditor->isClosed();
   CurveCreator::SectionType aSectType = myNewSectionEditor->getSectionType();
   if( myCurve->getSectionName(mySection) != aName.toStdString() )
-    myCurve->setSectionName( mySection , aName.toStdString() );
+    myCurve->setSectionName( mySection, aName.toStdString() );
 
-  bool isGeomModified = false;
+  //bool isGeomModified = false;
 
   if( myCurve->getSectionType(mySection) != aSectType ) {
     myCurve->setSectionType( mySection, aSectType );
-    isGeomModified = true;
+    //isGeomModified = true;
   }
 
   if( myCurve->isClosed(mySection) != isClosed ) {
     myCurve->setClosed( mySection, isClosed );
-    isGeomModified = true;
+    //isGeomModified = true;
   }
   mySectionView->sectionChanged(mySection);
   updateUndoRedo();
@@ -686,6 +714,31 @@ void CurveCreator_Widget::onRemove()
   }
 }
 
+void CurveCreator_Widget::onSetColor()
+{
+  if( !myCurve )
+    return;
+
+  QList<int> aSections = mySectionView->getSelectedSections();
+  if (aSections.size() != 1)
+    return;
+
+  int aSectNum = aSections[0];
+  Quantity_Color aColor = ((CurveCreator_Curve*)myCurve)->getColorSection( aSectNum );;
+
+  QColor aQColor = CurveCreator_Utils::colorConv(aColor);
+  QColor aNewQColor = QColorDialog::getColor( aQColor, this );
+  if( !aNewQColor.isValid() )
+    return;
+
+  Quantity_Color aNewColor = CurveCreator_Utils::colorConv(aNewQColor);
+
+  ((CurveCreator_Curve*)myCurve)->setColorSection( aSectNum, aNewColor);
+
+  updateUndoRedo();
+}
+
+
 void CurveCreator_Widget::onClearAll()
 {
   if( !myCurve )
@@ -707,7 +760,7 @@ void CurveCreator_Widget::onJoinAll()
   for( int i = 0, aNb = myCurve->getNbSections(); i < aNb ; i++ ){
     aSectionsToJoin.push_back( i );
   }
-  bool aRes = myCurve->join( aSectionsToJoin );
+  /*bool aRes = */myCurve->join( aSectionsToJoin );
 
   mySectionView->reset();
   updateActionsStates();
@@ -956,7 +1009,7 @@ void CurveCreator_Widget::SetViewer2DMode(const bool To2D)
 
 //=================================================================================
 // function : GeometryGUI::addCoordsByClick()
-// purpose  : Manage mouse press events in Additon mode
+// purpose  : Manage mouse press events in Addition mode
 //=================================================================================
 void CurveCreator_Widget::addCoordsByClick( QMouseEvent* pe )
 {
@@ -968,7 +1021,7 @@ void CurveCreator_Widget::addCoordsByClick( QMouseEvent* pe )
     if ( ic.IsNull() )
       return;
 
-    gp_Pnt aPnt;    
+    gp_Pnt aPnt;
     OCCViewer_ViewPort3d* vp = getViewPort();
 
     aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
@@ -1006,11 +1059,11 @@ void CurveCreator_Widget::onBringTogether()
 
   CurveCreator_ICurve::SectionToPointList::const_iterator anIt = myLocalPoints.begin(),
                                                           aLast = myLocalPoints.end();
-  int sections[nbPoints];
-  int iPoints[nbPoints];
-  int nbPtsSection[nbPoints];
-  double x[nbPoints];
-  double y[nbPoints];
+  std::vector<int> sections(nbPoints);
+  std::vector<int> iPoints(nbPoints);
+  std::vector<int> nbPtsSection(nbPoints);
+  std::vector<double> x(nbPoints);
+  std::vector<double> y(nbPoints);
   int i = 0;
   for ( ; anIt != aLast; anIt++, i++ )
     {
@@ -1018,7 +1071,7 @@ void CurveCreator_Widget::onBringTogether()
       sections[i] = aSPoint.first;
       iPoints[i] = aSPoint.second;
       nbPtsSection[i] = myCurve->getNbPoints(sections[i]);
-      if ((iPoints[i] != 0) and (iPoints[i] != nbPtsSection[i]-1))
+      if ((iPoints[i] != 0) && (iPoints[i] != nbPtsSection[i]-1))
         {
           MESSAGE("a point is not on a section extremity, nothing done");
           return;
@@ -1092,10 +1145,10 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
     {
       Handle(AIS_InteractiveContext) aCtx = getAISContext();
       if ( !aCtx.IsNull() )
-        aCtx->ClearSelected();
+        aCtx->ClearSelected( Standard_True );
     }
     return;
-  } 
+  }
   if (theEvent->button() != Qt::LeftButton) return;
   if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
 
@@ -1114,20 +1167,46 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
       return;
 
     if (!aHasShift)
-      aCtx->ClearCurrents( false );
+      aCtx->ClearCurrents( false );  // todo: deprecated OCCT API
 
     Handle(V3d_View) aView3d = aView->getViewPort()->getView();
     if ( !aView3d.IsNull() )
     {
+      CurveCreator_Curve* Curve =  ((CurveCreator_Curve*)myCurve);
+      //if (!Curve->myCurSectInd.empty())
+      //{
+        aCtx->RemoveFilters();
+        Handle(CurveCreator_ShapeFilter) filter = new CurveCreator_ShapeFilter();
+        for (int i=0; i<Curve->myCurSectInd.size(); i++)
+        {
+          int sectInd = Curve->myCurSectInd[i];
+          const TopoDS_Shape& W = Curve->mySect2Shape(sectInd+1);
+          TopExp_Explorer exp(W, TopAbs_VERTEX);
+          for (;exp.More();exp.Next())
+            filter->AddShape(exp.Current());
+        }
+        aCtx->AddFilter(filter);
+#if OCC_VERSION_LARGE <= 0x07030000
+        if (aCtx->HasOpenedContext())
+        {
+          Handle(AIS_LocalContext) aLctx = aCtx->LocalContext();
+          aLctx->Filter()->Clear();
+          aLctx->AddFilter(filter);
+        }
+#else
+        // TODO: check if something required
+#endif
+      //}
+
       // Initialize the single selection if start and end points are equal,
       // otherwise a rectangular selection.
       if ( myStartPoint == myEndPoint )
       {
-        aCtx->MoveTo( myEndPoint.x(), myEndPoint.y(), aView3d );
+        aCtx->MoveTo( myEndPoint.x(), myEndPoint.y(), aView3d, Standard_True );
         if ( aHasShift )
-          aCtx->ShiftSelect();
+          aCtx->ShiftSelect( Standard_True );
         else
-          aCtx->Select();
+          aCtx->Select( Standard_True );
       }
       else
       {
@@ -1142,7 +1221,6 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
   }
 
   if ( myDragStarted ) {
-    bool isDragged = myDragged;
     CurveCreator_ICurve::SectionToPointList aDraggedPoints;
     QMap<CurveCreator_ICurve::SectionToPoint, CurveCreator::Coordinates > anInitialDragPointsCoords;
     if ( myDragged ) {
@@ -1169,7 +1247,7 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
             if ( aCoords.size() < 2 ) {
               continue;
             }
-            
+
             CurveCreator_ICurve::SectionToPoint aSectionToPoint = std::make_pair( aSectionId, aPointId );
 
             if ( !anInitialDragPointsCoords.contains( aSectionToPoint ) ) {
@@ -1177,7 +1255,7 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
             }
           }
         }
-        
+
         // Apply points sorting
         CurveCreator_ICurve::SectionToPointList aPoints;
         startCurveModification( aPoints, false );
@@ -1197,7 +1275,7 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
         }
 
         myCurve->setSeveralPoints( aCoordList, false );
-    
+
         finishCurveModification( aDraggedPoints );
       } else {
         // if the drag of some points has happened, restore the drag selection
@@ -1247,7 +1325,7 @@ void CurveCreator_Widget::onMouseMove( SUIT_ViewWindow*, QMouseEvent* theEvent )
  * Set zero viewer by the last view closed in
  * \param theManager a viewer manager
  */
-void CurveCreator_Widget::onLastViewClosed( SUIT_ViewManager* theManager )
+void CurveCreator_Widget::onLastViewClosed( SUIT_ViewManager* /*theManager*/ )
 {
   myOCCViewer = 0;
 }
@@ -1267,7 +1345,7 @@ void CurveCreator_Widget::onMouseMove( QMouseEvent* theEvent )
   onMouseMove( 0, theEvent );
 }
 
-void CurveCreator_Widget::onCellChanged( int theRow, int theColumn )
+void CurveCreator_Widget::onCellChanged( int theRow, int /*theColumn*/ )
 {
   int aCurrSect = myLocalPointView->getSectionId( theRow );
   int aPntIndex = myLocalPointView->getPointId( theRow );
@@ -1389,7 +1467,7 @@ void CurveCreator_Widget::insertPointToSelectedSegment( const int theX,
   }
 
   int anInsertPos = -1;
-  int aLastPoint = myCurve->getNbPoints( aSectionId )-1; 
+  int aLastPoint = myCurve->getNbPoints( aSectionId )-1;
   if ( ( aPoint1Id == aLastPoint && aPoint2Id == 0 ) ||
        ( aPoint2Id == aLastPoint && aPoint1Id == 0 ) )
     anInsertPos = -1; // if the section happens between first and last points
@@ -1440,9 +1518,9 @@ void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
 
     aChangedPos[0] = aChangedPos[0] - aXDelta;
     aChangedPos[1] = aChangedPos[1] - anYDelta;
-    
+
     aCoordList.push_back(
-      std::make_pair(std::make_pair( aSectionId, aPointId ), 
+      std::make_pair(std::make_pair( aSectionId, aPointId ),
                      aChangedPos ));
   }
   myCurve->setSeveralPoints( aCoordList, false );
@@ -1460,22 +1538,22 @@ void CurveCreator_Widget::updateLocalPointView()
     return;
 
   CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
-  int aNbPoints = myLocalPoints.size();
+  //int aNbPoints = myLocalPoints.size();
 
-  bool isRowLimit = aNbPoints > myLocalPointRowLimit;
-  myLocalPointView->setVisible( getActionMode() == ModificationMode && !isRowLimit );
+  //bool isRowLimit = aNbPoints > myLocalPointRowLimit;
+  myLocalPointView->setVisible( getActionMode() == ModificationMode/* && !isRowLimit */);
 
-  if ( !isRowLimit ) {
-    bool isBlocked = myLocalPointView->blockSignals(true);
+  //if ( !isRowLimit ) {
+  bool isBlocked = myLocalPointView->blockSignals(true);
 
-    myLocalPointView->setLocalPointsToTable( myLocalPoints );
+  myLocalPointView->setLocalPointsToTable( myLocalPoints );
 
-    myLocalPointView->blockSignals( isBlocked );
-  }
+  myLocalPointView->blockSignals( isBlocked );
+  //}
 }
 
 /**
- * 
+ *
  */
 void CurveCreator_Widget::setLocalPointContext( const bool theOpen, const bool isUpdateTable )
 {
@@ -1523,7 +1601,7 @@ void CurveCreator_Widget::setSelectedPoints( const CurveCreator_ICurve::SectionT
   if ( myDragStarted )
     return;
   Handle(AIS_InteractiveContext) aContext = getAISContext();
-  if ( aContext.IsNull() || !aContext->HasOpenedContext() )
+  if ( aContext.IsNull() )
     return;
 
   CurveCreator_Utils::setSelectedPoints( aContext, myCurve, thePoints );
@@ -1593,7 +1671,7 @@ void CurveCreator_Widget::convert( const CurveCreator_ICurve::SectionToPointList
 }
 
 /**
- * Returns whethe the container has the value
+ * Returns whether the container has the value
  * \param theList a container of values
  * \param theValue a value
  */