Salome HOME
Merge changes for HYDRO project : hydro/imps_2017_salome_83 branch.
authorrnv <rnv@opencascade.com>
Tue, 13 Mar 2018 14:37:03 +0000 (17:37 +0300)
committerrnv <rnv@opencascade.com>
Tue, 13 Mar 2018 14:37:03 +0000 (17:37 +0300)
15 files changed:
src/CurveCreator/CurveCreator_Curve.cxx
src/CurveCreator/CurveCreator_Curve.hxx
src/CurveCreator/CurveCreator_Diff.cxx
src/CurveCreator/CurveCreator_Displayer.cxx
src/CurveCreator/CurveCreator_Displayer.hxx
src/CurveCreator/CurveCreator_ICurve.hxx
src/CurveCreator/CurveCreator_Section.cxx
src/CurveCreator/CurveCreator_Section.hxx
src/CurveCreator/CurveCreator_TableView.cxx
src/CurveCreator/CurveCreator_TableView.h
src/CurveCreator/CurveCreator_TreeView.cxx
src/CurveCreator/CurveCreator_Utils.cxx
src/CurveCreator/CurveCreator_Widget.cxx
src/CurveCreator/CurveCreator_Widget.h
src/EntityGUI/EntityGUI_PolylineDlg.cxx

index e307e81606b14a7c727d9e08613b6e9e2a38f27f..35843c83a7b8ec70dcbf16942592ba4eee3fe545 100644 (file)
@@ -56,7 +56,11 @@ CurveCreator_Curve::CurveCreator_Curve( const CurveCreator::Dimension theDimensi
   myNbRedos   (0),
   myUndoDepth (-1),
   myOpLevel(0),
-  mySkipSorting(false)
+  mySkipSorting(false),
+  myPointAspectColor (Quantity_NOC_ROYALBLUE4), 
+  myCurveColor (Quantity_NOC_RED),
+  myEraseAll(true),
+  myLineWidth(1)
 {
 }
 
@@ -249,13 +253,16 @@ void CurveCreator_Curve::getCoordinates( int theISection, int theIPoint, double&
   }
 }
 
-void CurveCreator_Curve::redisplayCurve()
+void CurveCreator_Curve::redisplayCurve(bool preEraseAllObjects)
 {
   //DEBTRACE("redisplayCurve");
-  if( myDisplayer ) {
-    myDisplayer->eraseAll( false );
+  if( myDisplayer ) 
+  {
+    if (preEraseAllObjects)
+      myDisplayer->eraseAll( false );
+    else
+      myDisplayer->erase( myAISShape, false);
     myAISShape = NULL;
-
     myDisplayer->display( getAISObject( true ), true );
   }
 }
@@ -357,8 +364,12 @@ bool CurveCreator_Curve::redo()
 bool CurveCreator_Curve::clearInternal()
 {
   // erase curve from the viewer
-  if( myDisplayer ) {
-    myDisplayer->eraseAll( true );
+  if( myDisplayer )
+  {
+    if (myEraseAll)
+      myDisplayer->eraseAll( true );
+    else
+      myDisplayer->erase(myAISShape, false);
     myAISShape = NULL;
   }
   // Delete all allocated data.
@@ -394,6 +405,23 @@ bool CurveCreator_Curve::clear()
   return res;
 }
 
+//=======================================================================
+// function: clear
+// purpose:
+//=======================================================================
+void CurveCreator_Curve::SetEraseAllState(bool toEraseAll)
+{
+  myEraseAll = toEraseAll;
+}
+//=======================================================================
+// function: clear
+// purpose:
+//=======================================================================
+bool CurveCreator_Curve::GetEraseAllState() const
+{
+  return myEraseAll;
+}
+
 //! For internal use only! Undo/Redo are not used here.
 bool CurveCreator_Curve::joinInternal( const std::list<int>& theSections )
 {
@@ -422,7 +450,7 @@ bool CurveCreator_Curve::joinInternal( const std::list<int>& theSections )
       break;
   }
 
-  redisplayCurve();
+  redisplayCurve(false);
   return res;
 }
 
@@ -465,7 +493,7 @@ int CurveCreator_Curve::addSectionInternal
   aSection->myIsClosed = theIsClosed;
   aSection->myPoints   = thePoints;
   mySections.push_back(aSection);
-  redisplayCurve();
+  redisplayCurve(false);
   return mySections.size()-1;
 }
 
@@ -525,7 +553,7 @@ bool CurveCreator_Curve::removeSectionInternal( const int theISection )
     delete *anIterRm;
     mySections.erase(anIterRm);
   }
-  redisplayCurve();
+  redisplayCurve(false);
   return true;
 }
   
@@ -616,14 +644,14 @@ bool CurveCreator_Curve::setClosedInternal( const int theISection,
       aSection = (CurveCreator_Section*)getSection( i );
       if( aSection ) {
         aSection->myIsClosed = theIsClosed;
-        redisplayCurve();
+        redisplayCurve(false);
       }
     }
   } else {
     aSection = (CurveCreator_Section*)getSection( theISection );
     if ( aSection ) {
       aSection->myIsClosed = theIsClosed;
-      redisplayCurve();
+      redisplayCurve(false);
     }
   }
   return true;
@@ -706,12 +734,12 @@ bool CurveCreator_Curve::setSectionTypeInternal( const int theISection,
       if ( aSection )
         aSection->myType = theType;
     }
-    redisplayCurve();
+    redisplayCurve(false);
   } else {
     aSection = (CurveCreator_Section*)getSection( theISection );
     if ( aSection && aSection->myType != theType ){
       aSection->myType = theType;
-      redisplayCurve();
+      redisplayCurve(false);
     }
   }
   return true;
@@ -772,7 +800,7 @@ bool CurveCreator_Curve::addPointsInternal( const CurveCreator::SectionsMap &the
     }
   }
   if(res)
-    redisplayCurve();
+    redisplayCurve(false);
   return res;
 }
 
@@ -830,7 +858,7 @@ bool CurveCreator_Curve::setPointInternal( const CurveCreator::SectionsMap &theS
     }
   }
   if(res)
-    redisplayCurve();
+    redisplayCurve(false);
   
   return res;
 }
@@ -914,7 +942,7 @@ bool CurveCreator_Curve::removePointsInternal( const SectionToPointList &thePoin
     aRes = removeSectionPoints(aSectionId, anIt->second);
   }
   if( aRes)
-    redisplayCurve();
+    redisplayCurve(false);
 
   return aRes;
 }
@@ -971,32 +999,39 @@ CurveCreator::Coordinates CurveCreator_Curve::getPoint( const int theISection,
 // function: getPoints
 // purpose:
 //=======================================================================
-CurveCreator::Coordinates CurveCreator_Curve::getPoints( const int theISection ) const
+CurveCreator::Coordinates CurveCreator_Curve::getCoords( int theISection ) const
 {
-  //DEBTRACE("getPoints");
   CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
   return aSection ? aSection->myPoints : CurveCreator::Coordinates();
 }
 
+Handle(TColgp_HArray1OfPnt) CurveCreator_Curve::GetDifferentPoints( int theISection ) const
+{
+  //DEBTRACE("getPoints");
+  CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
+  return aSection ? aSection->GetDifferentPoints( (int)myDimension ) : Handle(TColgp_HArray1OfPnt)();
+}
+
 void CurveCreator_Curve::constructAISObject()
 {
   //DEBTRACE("constructAISObject");
   TopoDS_Shape aShape;
   CurveCreator_Utils::constructShape( this, aShape );
-
-  myAISShape = new AIS_Shape( aShape );
+  myAISShape = new AIS_Shape( aShape );  
+  myAISShape->SetColor( myCurveColor );
+  myAISShape->SetWidth( myLineWidth );
   Handle(Prs3d_PointAspect) anAspect = myAISShape->Attributes()->PointAspect();
   anAspect->SetScale( 3.0 );
   anAspect->SetTypeOfMarker(Aspect_TOM_O_POINT);
-  anAspect->SetColor(Quantity_NOC_ROYALBLUE4);
+  anAspect->SetColor(myPointAspectColor);
   myAISShape->Attributes()->SetPointAspect( anAspect );
-
 }
 
 Handle(AIS_InteractiveObject) CurveCreator_Curve::getAISObject( const bool theNeedToBuild ) const
 {
   //DEBTRACE("getAISObject");
-  if ( !myAISShape && theNeedToBuild ) {
+  if ( !myAISShape && theNeedToBuild ) 
+  {
     CurveCreator_Curve* aCurve = (CurveCreator_Curve*)this;
     aCurve->constructAISObject();
   }
index 74667f4f0753483013f4f6306d258ba1423dcedf..08239f4e7564c78761dbbb9ea198526644818a46 100644 (file)
@@ -36,6 +36,7 @@ struct CurveCreator_Section;
 class CurveCreator_Displayer;
 class AIS_Shape;
 class AIS_InteractiveObject;
+class Quantity_Color;
 
 /**
  *  The CurveCreator_Curve object is represented as one or more sets of
@@ -108,7 +109,7 @@ protected:
 public: // TODO: remove public
   void getCoordinates( int theISection, int theIPoint, double& theX, double& theY, double& theZ ) const;
 protected:  // TODO: remove public
-  void redisplayCurve();
+  void redisplayCurve(bool preEraseAllObjects = true);
 
 public:
   /************   Implementation of INTERFACE methods   ************/
@@ -139,6 +140,14 @@ public:
   //! Clear the polyline (remove all sections)
   virtual bool clear();
 
+  //! set erase-all state
+  //! if true => erase all objects from viever, else remove only the current curve
+  void SetEraseAllState(bool toEraseAll);
+
+  //! get erase-all state
+  //! if true => erase all objects from viever, else remove only the current curve
+  bool GetEraseAllState() const;
+
   //! For internal use only! Undo/Redo are not used here.
   virtual bool joinInternal( const std::list<int>& theSections );
 
@@ -261,7 +270,9 @@ public:
   /**
    * Get points of a section (the total points in Curve if theISection is equal to -1)..
    */
-  virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const;
+  virtual Handle(TColgp_HArray1OfPnt) GetDifferentPoints( int theISection = -1 ) const;
+
+  CurveCreator::Coordinates getCoords( int theISection = -1 ) const;
 
 
   /**
@@ -292,7 +303,7 @@ public:
   /**
    *  Get the curve AIS object
    */
-  virtual Handle(AIS_InteractiveObject) getAISObject( const bool theNeedToBuild = false ) const;
+  virtual Handle(AIS_InteractiveObject) getAISObject( const bool theNeedToBuild = false) const;
 
 protected:
   /**
@@ -322,6 +333,9 @@ public:
   CurveCreator::Sections          mySections;   //!< curve data
   CurveCreator::Dimension         myDimension;  //!< curve dimension
   CurveCreator_Displayer*         myDisplayer;  //!< curve displayer
+  Quantity_Color myPointAspectColor;
+  Quantity_Color myCurveColor;
+  double myLineWidth;
 
 private:
 
@@ -332,6 +346,7 @@ private:
   int                             myUndoDepth;
   int                             myOpLevel;
   AIS_Shape*                      myAISShape;   //!< AIS shape
+  bool                            myEraseAll;
 };
 
 #endif
index e27bd0aad39b61ad46b76436c02c7112f6133cb2..362e451e4c2fbf752e565536f812ed9b72bc6678 100644 (file)
@@ -336,7 +336,7 @@ bool CurveCreator_Diff::init(const CurveCreator_Curve *theCurve,
               aSectionId = anIt->first;
               aPointId = anIt->second;
               const CurveCreator::Coordinates &aPoints =
-                      theCurve->getPoints(aSectionId);
+                      theCurve->getCoords(aSectionId);
               CurveCreator::Coordinates::const_iterator anIterBegin =
                   aPoints.begin() + (aDim*aPointId);
               CurveCreator::Coordinates::const_iterator anIterEnd = 
@@ -526,7 +526,7 @@ bool CurveCreator_Diff::addSectionToUndo
                        CurveCreator_Operation &theOperation) const
 {
   const std::string aName = theCurve->getSectionName(theIndex);
-  const CurveCreator::Coordinates &aPnts = theCurve->getPoints(theIndex);
+  const CurveCreator::Coordinates &aPnts = theCurve->getCoords(theIndex);
   const CurveCreator::SectionType aType = theCurve->getSectionType(theIndex);
   const bool isClosed = theCurve->isClosed(theIndex);
 
index 61285c96297437177147d53022a4c678289b6580..4ac2e0450c8cd90950c71da118acfb8c75eefd30 100644 (file)
@@ -54,14 +54,22 @@ void CurveCreator_Displayer::eraseAll( bool isUpdate )
 {
   if(myObjects.empty())
     return;
-  for( int i = 0 ; i < myObjects.size() ; i++ ){
+  for( int i = 0 ; i < myObjects.size() ; i++ )
     myContext->Erase(myObjects[i], Standard_False);
-  }
   myObjects.clear();
   if( isUpdate )
     myContext->UpdateCurrentViewer();
 }
 
+void CurveCreator_Displayer::erase( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate )
+{
+  if(theObject.IsNull())
+    return;
+  myContext->Erase(theObject, Standard_False);
+  if( isUpdate )
+    myContext->UpdateCurrentViewer();
+}
+
 Quantity_Color CurveCreator_Displayer::getActiveColor( bool isHL )
 {
   if( isHL ){
@@ -70,6 +78,13 @@ Quantity_Color CurveCreator_Displayer::getActiveColor( bool isHL )
   return Quantity_Color( 0., 1., 0., Quantity_TOC_RGB );
 }
 
+void CurveCreator_Displayer::Update()
+{
+  for( int i = 0 ; i < myObjects.size() ; i++ )
+    myContext->Update(myObjects[i], Standard_True);
+  myContext->UpdateCurrentViewer();
+}
+
 /*void CurveCreator_Displayer::highlight( const AISObjectsList& theObjects, bool isHL )
 {
   return;
index d78b2a2f26d7fe5779638795b75da3613dea39e4..9528c8616240cd2d70f322dd92c1f024b9d891ae 100644 (file)
@@ -38,6 +38,8 @@ public:
 
   void display( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate );
   void eraseAll( bool isUpdate );
+  void erase( const Handle(AIS_InteractiveObject)& theObject, bool isUpdate );
+  void Update();
   //void highlight( const AISObjectsList& theObjects, bool isHL );
 
 protected:
index 150e37d2e363328ec9fbb2e5e30a67d80125ee03..d1a2e48bccc6d6bb0160076dd1385256c67335ce 100644 (file)
@@ -59,8 +59,7 @@ struct CURVECREATOR_EXPORT CurveCreator_ISection
   virtual ~CurveCreator_ISection() {}
 
   //! Calculates the different points of the section.
-  virtual void GetDifferentPoints(
-    const int theDimension, Handle(TColgp_HArray1OfPnt)& thePoints) const = 0;
+  virtual Handle(TColgp_HArray1OfPnt) GetDifferentPoints( int theDimension ) const = 0;
 };
 
 /**
@@ -192,7 +191,7 @@ public:
   /**
    * Get points of a section (the total points in Curve if theISection is equal to -1)..
    */
-  virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const = 0;
+  virtual Handle(TColgp_HArray1OfPnt) GetDifferentPoints( int theISection = -1 ) const = 0;
 
   /**
    *  Get number of points in specified section or (the total number of points
index e2298c092acbcb95fb860e13ec9018fb9451482c..51f83fab663475c8890880c93949b6e63d6a2694 100644 (file)
@@ -30,16 +30,24 @@ const double POINT_CONFUSION = 1e-4;
 // function: GetDifferentPoints
 // purpose:
 //=======================================================================
-void CurveCreator_Section::GetDifferentPoints(
-  const int theDimension, Handle(TColgp_HArray1OfPnt)& thePoints) const
+Handle(TColgp_HArray1OfPnt) CurveCreator_Section::GetDifferentPoints( int theDimension ) const
 {
+  Handle(TColgp_HArray1OfPnt) points;
+
   std::vector<gp_Pnt> aTmpPoints;
+
   CurveCreator::Coordinates::const_iterator aPIt = myPoints.begin();
   CurveCreator::Coordinates::const_iterator aPItLast = myPoints.end();
-  const gp_Pnt aFirstPoint(
-    *aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2));
-  gp_Pnt aPoint = aFirstPoint;
-  aTmpPoints.push_back(aPoint);
+
+  gp_Pnt aFirstPoint;
+  gp_Pnt aPoint;
+
+  if( myPoints.size() > 0 )
+  {
+    aFirstPoint = gp_Pnt(*aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2));
+    aPoint = aFirstPoint;
+    aTmpPoints.push_back(aPoint);
+  }
 
   for (; aPIt != aPItLast; aPIt += theDimension)
   {
@@ -62,9 +70,11 @@ void CurveCreator_Section::GetDifferentPoints(
     }
   }
 
-  thePoints = new TColgp_HArray1OfPnt(1, aPointCount);
+  points = new TColgp_HArray1OfPnt(1, aPointCount);
   for (int aPI = 0; aPI < aPointCount; ++aPI)
   {
-    thePoints->SetValue(aPI + 1, aTmpPoints[aPI]);
+    points->SetValue(aPI + 1, aTmpPoints[aPI]);
   }
+
+  return points;
 }
index 9ad98048a55af66eff13c46625335763580099ad..07b1bc9731309da0fbe70a75f42c008b1ea81d98 100644 (file)
@@ -36,13 +36,13 @@ struct CURVECREATOR_EXPORT CurveCreator_Section :
   CurveCreator_Section() : myName("Section"),myType(CurveCreator::Polyline), myIsClosed(false)
   { }
 
-  std::string               myName; //!< section name
+  std::string               myName;     //!< section name
   CurveCreator::Coordinates myPoints;   //!< points coordinates
   CurveCreator::SectionType myType;     //!< type of the section
   bool                      myIsClosed; //!< closed or not
 
   //! A virtual method.
-  void GetDifferentPoints(const int theDimension, Handle(TColgp_HArray1OfPnt)& thePoints) const;
+  Handle(TColgp_HArray1OfPnt) GetDifferentPoints( int theDimension ) const;
 };
 
 #endif
index bda45103e5bb853f1bf6e54bea75ec9f47434ffb..a6d819dcd78830415b57251a2e85853b2e76a527 100644 (file)
@@ -19,6 +19,7 @@
 
 #include "CurveCreator_TableView.h"
 #include "CurveCreator_UtilsICurve.hxx"
+#include "CurveCreator_Widget.h"
 
 #include <gp_Pnt.hxx>
 
@@ -94,10 +95,14 @@ void CurveCreator_TableItemDelegate::setModelData( QWidget* theEditor,
     QItemDelegate::setModelData( theEditor, theModel, theIndex );
 }
 
+
+
+
 CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve,
-                                                QWidget* theParent,
+                                                CurveCreator_Widget* theParent,
                                                 const QStringList& theCoordTitles )
-: QTableWidget( theParent ), myCurve( theCurve )
+  : QTableWidget( theParent ), myWidget( theParent ),
+    myCurve( theCurve ), myCurrentSortId( -1 ), myCurrentSortOrder( Qt::AscendingOrder )
 {
   setItemDelegate( new CurveCreator_TableItemDelegate( this ) );
   setVisible( false );
@@ -199,5 +204,22 @@ int CurveCreator_TableView::getPointId( const int theRowId ) const
 
 void CurveCreator_TableView::OnHeaderClick( int theLogicalId )
 {
-  sortByColumn( theLogicalId, Qt::AscendingOrder );
+  if( theLogicalId == myCurrentSortId )
+    if( myCurrentSortOrder == Qt::AscendingOrder )
+      myCurrentSortOrder = Qt::DescendingOrder;
+    else
+      myCurrentSortOrder = Qt::AscendingOrder;
+
+  sortByColumn( theLogicalId, myCurrentSortOrder );
+
+  CurveCreator_ICurve::SectionToPointList selected;
+  for( int r=0, n=rowCount(); r<n; r++ )
+  {
+    int section = item( r, 0 )->data( Qt::UserRole ).toInt();
+    int point = item( r, 1 )->data( Qt::UserRole ).toInt();
+    selected.push_back( CurveCreator_ICurve::SectionToPoint( section, point ) );
+  }
+  myWidget->setSelectedPoints( selected );
+
+  myCurrentSortId = theLogicalId;
 }
index bfc0e9b69b23db5c78d6bcd53c9e6eaae21f9f42..16db2385695b71761e826b4564eb5fb2daf0b1ac 100644 (file)
@@ -25,6 +25,8 @@
 #include <QItemDelegate>
 #include <QTableWidget>
 
+class CurveCreator_Widget;
+
 class CurveCreator_TableItemDelegate : public QItemDelegate
 {
 public:
@@ -39,12 +41,12 @@ public:
                                  const QModelIndex& theIndex ) const;
 };
 
-class CurveCreator_TableView : public QTableWidget
+class CURVECREATOR_EXPORT CurveCreator_TableView : public QTableWidget
 {
   Q_OBJECT
 
 public:
-  CurveCreator_TableView( CurveCreator_ICurve* theCurve, QWidget* theParent = 0,
+  CurveCreator_TableView( CurveCreator_ICurve* theCurve, CurveCreator_Widget* theParent,
                           const QStringList& theCoordTitles = QStringList() );
   ~CurveCreator_TableView() {};
 
@@ -63,12 +65,15 @@ public:
    */
   int getPointId( const int theRowId ) const;
 
-private slots:
+public slots:
   void OnHeaderClick( int );
 
 private:
+  CurveCreator_Widget* myWidget;
   CurveCreator_ICurve* myCurve;
 
+  int           myCurrentSortId;
+  Qt::SortOrder myCurrentSortOrder;
 };
 
 #endif // CURVECREATOR_TABLEVIEW_H
index 6a8ecec53101ef42b2c9143490fc1edd56aaf15e..89f2606c3586f3eb1832f526c465a87b8dd68a37 100644 (file)
@@ -212,9 +212,13 @@ int CurveCreator_TreeViewModel::getPoint( const QModelIndex& theIndx ) const
 
 void CurveCreator_TreeViewModel::setCurve( CurveCreator_ICurve* theCurve )
 {
-  myCurve = theCurve;
 #if QT_VERSION < QT_VERSION_CHECK(5, 0, 0)
+  myCurve = theCurve;
   reset();
+#else
+  beginResetModel();
+  myCurve = theCurve;
+  endResetModel();
 #endif
 }
 
index 77de8c2d83c924cac5400ae1828e7b18387ab552..22fd00e6b6b0c65113c31cc899940a1caeecd726 100644 (file)
@@ -309,9 +309,7 @@ void CurveCreator_Utils::constructShape(
     }
 
     // Get the different points.
-    const CurveCreator_ISection* aSection = theCurve->getSection(aSectionI);
-    Handle(TColgp_HArray1OfPnt) aPoints;
-    aSection->GetDifferentPoints(theCurve->getDimension(), aPoints);
+    Handle(TColgp_HArray1OfPnt) aPoints = theCurve->GetDifferentPoints( aSectionI );
     const int aPointCount = aPoints->Length();
     const bool isClosed = theCurve->isClosed(aSectionI);
 
@@ -617,24 +615,24 @@ void CurveCreator_Utils::setSelectedPoints( Handle(AIS_InteractiveContext) theCo
   theContext->SetAutomaticHilight( Standard_False );
 
   Handle(SelectMgr_Selection) aSelection = anAISShape->Selection( AIS_Shape::SelectionMode( TopAbs_VERTEX ) );
-  for( aSelection->Init(); aSelection->More(); aSelection->Next() )
-  {    
-    const Handle(SelectMgr_SensitiveEntity) aHSenEntity = aSelection->Sensitive();
-    if( aHSenEntity.IsNull() )
-      continue;
-    Handle(SelectBasics_SensitiveEntity) aSenEntity = aHSenEntity->BaseSensitive();
-
-    Handle(Select3D_SensitivePoint) aSenPnt = Handle(Select3D_SensitivePoint)::DownCast( aSenEntity );
 
-    gp_Pnt anOwnerPnt = aSenPnt->Point();
-    Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast( aSenPnt->OwnerId() );
+  CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
+                                                          aLast = thePoints.end();
+  bool isFound = false;
+  for( int i=0; i<aSize; i++ )
+  {
+    for( aSelection->Init(); aSelection->More(); aSelection->Next() )
+    {
+      const Handle(SelectMgr_SensitiveEntity) aHSenEntity = aSelection->Sensitive();
+      if( aHSenEntity.IsNull() )
+        continue;
+      Handle(SelectBasics_SensitiveEntity) aSenEntity = aHSenEntity->BaseSensitive();
 
+      Handle(Select3D_SensitivePoint) aSenPnt = Handle(Select3D_SensitivePoint)::DownCast( aSenEntity );
+  
+      gp_Pnt anOwnerPnt = aSenPnt->Point();
+      Handle(SelectMgr_EntityOwner) anOwner = Handle(SelectMgr_EntityOwner)::DownCast( aSenPnt->OwnerId() );
 
-    CurveCreator_ICurve::SectionToPointList::const_iterator anIt = thePoints.begin(),
-                                                                   aLast = thePoints.end();
-    bool isFound = false;
-    for( int i=0; i<aSize; i++ )
-    {
       bool isIntersect = fabs( aPntsToSelect[i].X() - anOwnerPnt.X() ) < LOCAL_SELECTION_TOLERANCE &&
                          fabs( aPntsToSelect[i].Y() - anOwnerPnt.Y() ) < LOCAL_SELECTION_TOLERANCE;
       if( isIntersect )
index ae0c67d91ba8641a3eec5353e2e24c029bc19eac..8a7feb465f0b3c1df3bec85855ce94e5866a8435 100644 (file)
@@ -80,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 );
@@ -1460,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 );
+  //}
 }
 
 /**
index da38404a6127ef3be372d8b2a4ee21137524db91..e91e50249f27a1ec4dbd19a1d19e9e559f9d2fdc 100644 (file)
@@ -71,8 +71,7 @@ public:
                                 CurveCreator_ICurve *theCurve,
                                 const int theActionFlags = NoFlags,
                                 const QStringList& theCoordTitles = QStringList(),
-                                Qt::WindowFlags fl=0,
-                                int theLocalPointRowLimit = 20);
+                                Qt::WindowFlags fl=0);
 
   // OCC viewer manipulation
   void setOCCViewer( OCCViewer_Viewer* theViewer );
@@ -95,14 +94,18 @@ public:
 
   void SetViewer2DMode(const bool To2D);
 
+  void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& =
+                               CurveCreator_ICurve::SectionToPointList() );
+
+  void updateLocalPointView();
+  void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false );
+
 signals:
   void selectionChanged();
   void subOperationStarted( QWidget*, bool );
   void subOperationFinished( QWidget* );
 
 public slots:
-
-protected slots:
   void     onAdditionMode(bool checked);
   void     onModificationMode(bool checked);
   void     onDetectionMode(bool checked);
@@ -162,13 +165,15 @@ protected:
                  BRING_TOGETHER_ID
   };
 
+public:
+  QAction* getAction(ActionId theId);
+  QAction* getAction(ActionMode theMode);
+
 private:
   OCCViewer_Viewer* getOCCViewer();
 
   QAction* createAction( ActionId theId, const QString& theName, const QPixmap& theImage,
                          const QString& theToolTip, const QKeySequence& theShortcut );
-  QAction* getAction(ActionId theId);
-  QAction* getAction(ActionMode theMode);
 
   void updateActionsStates();
   void updateUndoRedo();
@@ -179,14 +184,10 @@ private:
   void insertPointToSelectedSegment( const int theXPosition,
                                      const int theYPosition );
   void moveSelectedPoints( const int theXPosition, const int theYPosition );
-  void updateLocalPointView();
-  void setLocalPointContext( const bool theOpen, const bool isUpdateTable = false );
 
   void setDragStarted( const bool theState, const QPoint& thePoint = QPoint() );
 
   void getSelectedPoints( CurveCreator_ICurve::SectionToPointList& thePoints );
-  void setSelectedPoints( const CurveCreator_ICurve::SectionToPointList& =
-                               CurveCreator_ICurve::SectionToPointList() );
 
   void stopActionMode();
 
index 1c6c9bda5cb44a81ab9bd11563f308cc9e361f26..e79e0aa6d29e361bae442ab9afab9fd74cc3854e 100644 (file)
@@ -252,7 +252,7 @@ void EntityGUI_PolylineDlg::GetCurveParams(GEOM::ListOfListOfDouble &theCoords,
 
   for (i = 0; i < aNbSec; ++i) {
     // Set coordinates
-    CurveCreator::Coordinates aCoords   = myCurve->getPoints(i);
+    CurveCreator::Coordinates aCoords   = myCurve->getCoords(i);
     const int                 aNbPoints = aCoords.size();
 
     theCoords[i].length(aNbPoints);