Salome HOME
lots 3,8 - corrections
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_ProfileDlg.h
1 // Copyright (C) 2014-2015  EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
6 //
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10 // Lesser General Public License for more details.
11 //
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
15 //
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
17 //
18
19 #ifndef HYDROGUI_PROFILEDLG_H
20 #define HYDROGUI_PROFILEDLG_H
21
22 #include "HYDROGUI_ViewerDlg.h"
23
24 #include <AIS_InteractiveContext.hxx>
25 #include <vector>
26
27 class CurveCreator_Widget;
28 class CurveCreator_ICurve;
29 class OCCViewer_ViewManager;
30 class SUIT_ViewWindow;
31 class QGroupBox;
32 class QLineEdit;
33 class QLabel;
34 class QListWidget;
35 class HYDROGUI_CurveCreatorProfile;
36 class HYDROData_SequenceOfObjects; 
37 class QListWidgetItem;
38
39 class HYDROGUI_ProfileDlg : public HYDROGUI_ViewerDlg
40 {
41   Q_OBJECT
42
43 public:
44   HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QString& theTitle, bool theSingleProfileMode );
45   virtual ~HYDROGUI_ProfileDlg();
46
47   void setProfileName( const QString& theName );
48   void addProfileName( const QString& theName, const QColor& theColor );
49   void eraseProfile( int index );
50   QStringList getProfileNames() const;
51         
52   void  setProfile( CurveCreator_ICurve* theProfile );
53   void  setProfilesPointer(std::vector<HYDROGUI_CurveCreatorProfile*>* theProfilesPointer);
54   void  switchToFirstProfile();
55   //void  SetSingleProfileMode(bool SingleMode);
56   //bool  GetSingleProfileMode() const;
57   void  SwitchToProfile(int theIndex);
58   void  BlockProfileNameSignals(bool state);
59   int   GetProfileSelectionIndex();
60
61   void  reset();
62
63   QList<int> getSelectedSections();
64
65   void  deleteSelected();
66   bool  deleteEnabled();
67
68 protected slots:
69   void processStartedSubOperation( QWidget*, bool );
70   void processFinishedSubOperation( QWidget* );
71   void ProfileNameChanged(QString);
72   void onProfileIndexChanged();
73   void onAddBtnPressed(bool);
74   void onRemoveBtnPressed(bool);
75   void onSetColorBtnPressed(bool);
76   void onProfileNameChanged(QListWidgetItem* item);
77
78 signals:
79   void                  createPreview( QString );
80   void                  selectionChanged();
81   void                  widgetCreated(QWidget*);
82   void                  subOperationStarted(QWidget*);
83   void                  subOperationFinished(QWidget*);
84   void                  AddProfiles();
85   void                  RemoveProfile(int);
86
87 protected:
88   virtual Handle(AIS_Trihedron) trihedron();
89
90 private:
91   QLineEdit*             myName;
92   QListWidget*           myProfileNames;
93   QPushButton*           myAddProfBtn;
94   QPushButton*           myRemProfBtn; 
95   QPushButton*           mySetColorProfBtn;
96 public:
97   CurveCreator_Widget*   myEditorWidget;
98   QGroupBox*             myAddElementBox;
99   std::vector<HYDROGUI_CurveCreatorProfile*>* myProfilesPointer;
100 private:
101   bool                   myIsEdit;
102   QString                myCurrentName;
103 };
104
105 #endif