Salome HOME
IPAL54434: TC9.2.0: GEOM: Textured point marker is not set
[modules/geom.git] / src / CurveCreator / CurveCreator_Widget.cxx
index fc31c7dd6eff8b8950a2bf9607ad04fbebdb9b2c..8a7feb465f0b3c1df3bec85855ce94e5866a8435 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2016  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
@@ -19,8 +19,6 @@
 
 #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"
@@ -82,11 +80,10 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
                                          CurveCreator_ICurve *theCurve,
                                          const int theActionFlags,
                                          const QStringList& theCoordTitles,
-                                         Qt::WindowFlags fl,
-                                         int theLocalPointRowLimit )
+                                         Qt::WindowFlags fl )
 : QWidget(parent), myNewSectionEditor(NULL), myCurve(theCurve), mySection(0),
   myDragStarted( false ), myDragInteractionStyle( SUIT_ViewModel::STANDARD ),
-  myOCCViewer( 0 ), myLocalPointRowLimit( theLocalPointRowLimit ),
+  myOCCViewer( 0 ),
   myOld2DMode(OCCViewer_ViewWindow::No2dMode)
 {
   bool isToEnableClosed = !( theActionFlags & DisableClosedSection );
@@ -165,9 +162,9 @@ CurveCreator_Widget::CurveCreator_Widget(QWidget* parent,
   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);
-  }
+//  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) );
@@ -956,7 +953,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 )
 {
@@ -1006,11 +1003,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 +1015,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,7 +1089,7 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
     {
       Handle(AIS_InteractiveContext) aCtx = getAISContext();
       if ( !aCtx.IsNull() )
-        aCtx->ClearSelected();
+        aCtx->ClearSelected( Standard_True );
     }
     return;
   } 
@@ -1123,11 +1120,11 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEven
       // 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
       {
@@ -1462,16 +1459,16 @@ void CurveCreator_Widget::updateLocalPointView()
   CurveCreator_Utils::getSelectedPoints( aContext, myCurve, myLocalPoints );
   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 );
+  //}
 }
 
 /**
@@ -1593,7 +1590,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
  */