Version: 9.16.0
Plot2d_AnalyticalCurveDlg.h
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
6// This library is free software; you can redistribute it and/or
7// modify it under the terms of the GNU Lesser General Public
8// License as published by the Free Software Foundation; either
9// version 2.1 of the License, or (at your option) any later version.
10//
11// This library is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14// Lesser General Public License for more details.
15//
16// You should have received a copy of the GNU Lesser General Public
17// License along with this library; if not, write to the Free Software
18// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22// File : Plot2d_AnalyticalCurveDlg.h
23// Author : Roman NIKOLAEV, Open CASCADE S.A.S. (roman.nikolaev@opencascade.com)
24
25
26#ifndef PLOT2D_ANALYTICAL_CURVE_DLG_H
27#define PLOT2D_ANALYTICAL_CURVE_DLG_H
28
29#include "Plot2d.h"
31
32#include <QDialog>
33#include <QMap>
34
35class QListWidget;
36class QListWidgetItem;
37class QGroupBox;
38class QLineEdit;
39class QCheckBox;
40class QComboBox;
41class QPushButton;
42
43class QtxIntSpinBox;
44class QtxColorButton;
45class QwtPlot;
46
50
52{
53 Q_OBJECT
54
55 class Updater;
56 class UpdateLocker;
57
58 enum { ItemExisting, ItemAdded, ItemRemoved };
59
60public:
63
64 void accept();
65 void reject();
66
67private:
68
69 void init();
70 void initPropsFromCurve(Plot2d_AnalyticalCurve*);
71 QListWidgetItem* selected() const;
72 Plot2d_AnalyticalCurve* selectedCurve() const;
73 QListWidgetItem* getItem(Plot2d_AnalyticalCurve*) const;
74 bool processCurves();
75 QwtPlot* getPlot();
76 int propStatus( Plot2d_AnalyticalCurve* = 0, const int def = ItemExisting );
77 QString propTitle( Plot2d_AnalyticalCurve* = 0, const QString& def = "" );
78 bool propVisible( Plot2d_AnalyticalCurve* = 0, bool def = true );
79 QString propFormula( Plot2d_AnalyticalCurve* = 0, const QString& def = "" );
80 int propIntervals( Plot2d_AnalyticalCurve* = 0, int def = 100 );
83 int propLineWidth( Plot2d_AnalyticalCurve* = 0, int def = 0 );
84 QColor propColor( Plot2d_AnalyticalCurve* = 0, const QColor& def = QColor() );
85 bool propAutoAssign( Plot2d_AnalyticalCurve* = 0, bool def = true );
86
87private slots:
88 void addCurve();
89 void removeCurve();
90 void updateCurve();
91 void updateState();
92 void selectionChanged();
93 void help();
94 void apply();
95
96private:
97 typedef QMap <QString, QVariant> CurveProps;
98 typedef QMap <Plot2d_AnalyticalCurve*, CurveProps> PropMap;
99
103
109 QCheckBox* myAutoAssign;
115 QPushButton* myAddButton;
116 QPushButton* myRemoveButton;
117};
118
120{
121 Q_OBJECT
122public:
123 Updater( QWidget* parent );
124 ~Updater();
125signals:
126 void update();
127};
128
129#endif //PLOT2D_ANALYTICAL_CURVE_DLG_H
#define PLOT2D_EXPORT
Definition: Plot2d.h:36
Definition: Plot2d_AnalyticalCurveDlg.cxx:83
Definition: Plot2d_AnalyticalCurveDlg.h:120
Updater(QWidget *parent)
Definition: Plot2d_AnalyticalCurveDlg.cxx:108
~Updater()
Definition: Plot2d_AnalyticalCurveDlg.cxx:111
Definition: Plot2d_AnalyticalCurveDlg.h:52
QGroupBox * myCurveProps
Definition: Plot2d_AnalyticalCurveDlg.h:108
QLineEdit * myFormula
Definition: Plot2d_AnalyticalCurveDlg.h:106
QPushButton * myRemoveButton
Definition: Plot2d_AnalyticalCurveDlg.h:116
QPushButton * myAddButton
Definition: Plot2d_AnalyticalCurveDlg.h:115
Plot2d_CurveContainer * myContainer
Definition: Plot2d_AnalyticalCurveDlg.h:100
QComboBox * myMarkerType
Definition: Plot2d_AnalyticalCurveDlg.h:111
QtxIntSpinBox * myLineWidth
Definition: Plot2d_AnalyticalCurveDlg.h:113
Updater * myUpdater
Definition: Plot2d_AnalyticalCurveDlg.h:102
QGroupBox * myCurveParams
Definition: Plot2d_AnalyticalCurveDlg.h:105
QWidget * myPropsGrp
Definition: Plot2d_AnalyticalCurveDlg.h:110
@ ItemAdded
Definition: Plot2d_AnalyticalCurveDlg.h:58
QtxIntSpinBox * myNbIntervals
Definition: Plot2d_AnalyticalCurveDlg.h:107
QComboBox * myLineType
Definition: Plot2d_AnalyticalCurveDlg.h:112
QMap< QString, QVariant > CurveProps
Definition: Plot2d_AnalyticalCurveDlg.h:97
QCheckBox * myAutoAssign
Definition: Plot2d_AnalyticalCurveDlg.h:109
PropMap myProperties
Definition: Plot2d_AnalyticalCurveDlg.h:101
QListWidget * myCurvesList
Definition: Plot2d_AnalyticalCurveDlg.h:104
QMap< Plot2d_AnalyticalCurve *, CurveProps > PropMap
Definition: Plot2d_AnalyticalCurveDlg.h:98
QtxColorButton * myColor
Definition: Plot2d_AnalyticalCurveDlg.h:114
Definition: Plot2d_AnalyticalCurve.h:37
Definition: Plot2d_AnalyticalCurve.h:147
Definition: Plot2d_ViewFrame.h:67
For more information see QT documentation.
The QtxColorButton class implements a widget for color preference items editing.
Definition: QtxColorButton.h:36
Enhanced version of the Qt's spin box.
Definition: QtxIntSpinBox.h:34
MarkerType
Definition: Plot2d.h:74
@ None
Definition: Plot2d.h:74
LineType
Definition: Plot2d.h:86
@ NoPen
Definition: Plot2d.h:87