X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FCurveCreator%2FCurveCreator_TreeView.h;h=2e4da3c66656d0a0d28d6d5b4aaa292fc5dc3af7;hb=c1d63ef1f803d255b61ee99fb618bf471add07f4;hp=09929bf356ad7507fd002cc671ea8aa7fdf63c3f;hpb=7d880c6a8262b6d670ed70ee2b9ec25c199a46d4;p=modules%2Fgeom.git diff --git a/src/CurveCreator/CurveCreator_TreeView.h b/src/CurveCreator/CurveCreator_TreeView.h old mode 100755 new mode 100644 index 09929bf35..2e4da3c66 --- a/src/CurveCreator/CurveCreator_TreeView.h +++ b/src/CurveCreator/CurveCreator_TreeView.h @@ -1,4 +1,4 @@ -// Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2013-2023 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 @@ -23,12 +23,12 @@ #include #include -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 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 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& theList ); - void setSelectedPoints( const QList< QPair >& 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: