Salome HOME
Updated copyright comment
[modules/geom.git] / src / CurveCreator / CurveCreator_TreeView.h
old mode 100755 (executable)
new mode 100644 (file)
index 09929bf..c1fe189
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2024  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <QTreeView>
 #include <QAbstractItemModel>
 
-class CurveCreator_Curve;
+class CurveCreator_ICurve;
 
 class CurveCreator_TreeViewModel : public QAbstractItemModel
 {
 public:
-  CurveCreator_TreeViewModel( CurveCreator_Curve* theCurve, QObject* parent );
+  CurveCreator_TreeViewModel( CurveCreator_ICurve* theCurve, QObject* parent, bool toDrawColorIcon );
   virtual int  columnCount(const QModelIndex & parent = QModelIndex()) const;
   virtual int  rowCount(const QModelIndex & parent = QModelIndex()) const;
   virtual QVariant     data(const QModelIndex & index, int role = Qt::DisplayRole) const;
@@ -44,12 +44,13 @@ public:
   int     getSection( const QModelIndex& theIndx ) const;
   int     getPoint( const QModelIndex& theIndx ) const;
 
-  void    setCurve( CurveCreator_Curve* theCurve );
+  void    setCurve( CurveCreator_ICurve* theCurve );
 
 private:
   enum IconType{ ICON_POLYLINE, ICON_SPLINE, ICON_CLOSED_SPLINE, ICON_CLOSED_POLYLINE, ICON_POINT };
 private:
-  CurveCreator_Curve*          myCurve;
+  CurveCreator_ICurve*          myCurve;
+  bool                         myDrawColorIcon;
   QMap<IconType, QPixmap>      myCachedIcons;
 };
 
@@ -59,15 +60,13 @@ class CurveCreator_TreeView : public QTreeView
 public:
   enum SelectionType{ ST_NOSEL, ST_POINTS, ST_POINTS_ONE_SECTION, ST_SECTIONS, ST_MIXED };
 public:
-  explicit CurveCreator_TreeView( CurveCreator_Curve* theCurve, QWidget *parent = 0);
+  explicit CurveCreator_TreeView( CurveCreator_ICurve* theCurve, QWidget *parent = 0, bool toDrawColorIcon = true);
   SelectionType getSelectionType() const;
   QList<int> getSelectedSections() const;
-  QList< QPair< int, int > > getSelectedPoints() const;
 
   void    pointsAdded( int theSection, int thePoint, int thePointsCnt=1 );
   void    pointDataChanged( int theSection, int thePoint );
   void    pointsRemoved(int theSection, int thePoint, int thePointsCnt=1 );
-  void    pointsSwapped( int theSection, int thePointNum, int theOffset );
 
   void    sectionAdded( int theSection );
   void    sectionChanged(int theSection , int aSectCnt = 1);
@@ -75,15 +74,15 @@ public:
   void    sectionsSwapped( int theSection, int theOffset );
 
   void    setSelectedSections( const QList<int>& theList );
-  void    setSelectedPoints( const QList< QPair<int, int> >& thePointsList );
 
-  void    setCurve( CurveCreator_Curve* theCurve );
+  void    setCurve( CurveCreator_ICurve* theCurve );
+
+  void    reset();
 
 signals:
   void    selectionChanged();
   void    sectionEntered(int);
-  void    pointEntered(int,int);
-public slots:
+
 protected slots:
   void onActivated( QModelIndex theIndx );
 protected: