1 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 // + This file is part of enGrid. +
5 // + Copyright 2008-2014 enGits GmbH +
7 // + enGrid is free software: you can redistribute it and/or modify +
8 // + it under the terms of the GNU General Public License as published by +
9 // + the Free Software Foundation, either version 3 of the License, or +
10 // + (at your option) any later version. +
12 // + enGrid is distributed in the hope that it will be useful, +
13 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
14 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
15 // + GNU General Public License for more details. +
17 // + You should have received a copy of the GNU General Public License +
18 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
20 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
22 #ifndef EDGELENGTHSOURCE_H
23 #define EDGELENGTHSOURCE_H
25 class EdgeLengthSource
;
26 template <class UI
> class GuiEdgeLengthSourceDlg
;
27 template <class UI
> class GuiEdgeLengthSource
;
29 #include "egvtkobject.h"
32 class EdgeLengthSource
: public EgVtkObject
35 protected: // attributes
42 virtual bool read(QString
) { return false; }
43 virtual QString
write() { return QString(); }
44 virtual void config() {}
45 virtual double edgeLength(vec3_t x
) = 0;
47 void setName(QString name
) { m_Name
= name
; }
48 QString
name() { return m_Name
; }
52 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
55 class GuiEdgeLengthSourceDlg
: public QDialog
58 friend class GuiEdgeLengthSource
<UI
>;
60 protected: // attributes
62 UI m_UI
; ///< The user interface definition from QtDesigner
67 GuiEdgeLengthSourceDlg();
71 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
74 GuiEdgeLengthSourceDlg
<UI
>::GuiEdgeLengthSourceDlg()
80 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
83 class GuiEdgeLengthSource
: public EdgeLengthSource
86 protected: // attributes
88 GuiEdgeLengthSourceDlg
<UI
> *m_Dlg
;
93 UI
& ui() { return m_Dlg
->m_UI
; }
98 GuiEdgeLengthSource();
99 virtual void config();
100 virtual void setDlgFields() = 0;
101 virtual void readDlgFields() = 0;
105 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
109 GuiEdgeLengthSource
<UI
>::GuiEdgeLengthSource()
115 void GuiEdgeLengthSource
<UI
>::config()
117 m_Dlg
= new GuiEdgeLengthSourceDlg
<UI
>;
126 #endif // EDGELENGTHSOURCE_H