2 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
4 // + This file is part of enGrid. +
6 // + Copyright 2008,2009 Oliver Gloth +
8 // + enGrid is free software: you can redistribute it and/or modify +
9 // + it under the terms of the GNU General Public License as published by +
10 // + the Free Software Foundation, either version 3 of the License, or +
11 // + (at your option) any later version. +
13 // + enGrid is distributed in the hope that it will be useful, +
14 // + but WITHOUT ANY WARRANTY; without even the implied warranty of +
15 // + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +
16 // + GNU General Public License for more details. +
18 // + You should have received a copy of the GNU General Public License +
19 // + along with enGrid. If not, see <http://www.gnu.org/licenses/>. +
21 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
24 #ifndef EDGELENGTHSOURCE_H
25 #define EDGELENGTHSOURCE_H
27 class EdgeLengthSource
;
28 template <class UI
> class GuiEdgeLengthSourceDlg
;
29 template <class UI
> class GuiEdgeLengthSource
;
31 #include "egvtkobject.h"
34 class EdgeLengthSource
: public EgVtkObject
37 protected: // attributes
44 virtual bool read(QString txt
) = 0;
45 virtual QString
write() = 0;
46 virtual void config() = 0;
47 virtual double edgeLength(vec3_t x
) = 0;
49 virtual void setName(QString name
) = 0;
50 QString
name() { return m_Name
; }
54 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
57 class GuiEdgeLengthSourceDlg
: public QDialog
60 friend class GuiEdgeLengthSource
<UI
>;
62 protected: // attributes
64 UI m_UI
; ///< The user interface definition from QtDesigner
69 GuiEdgeLengthSourceDlg();
73 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
76 GuiEdgeLengthSourceDlg
<UI
>::GuiEdgeLengthSourceDlg()
82 // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
85 class GuiEdgeLengthSource
: public EdgeLengthSource
88 protected: // attributes
90 GuiEdgeLengthSourceDlg
<UI
> *m_Dlg
;
95 UI
& ui() { return m_Dlg
->m_UI
; };
100 GuiEdgeLengthSource();
101 virtual void config();
102 virtual void setName(QString name
);
103 virtual void setDlgFields() = 0;
104 virtual void readDlgFields() = 0;
108 // . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
112 GuiEdgeLengthSource
<UI
>::GuiEdgeLengthSource()
118 void GuiEdgeLengthSource
<UI
>::config()
120 m_Dlg
= new GuiEdgeLengthSourceDlg
<UI
>;
129 void GuiEdgeLengthSource
<UI
>::setName(QString name
)
135 #endif // EDGELENGTHSOURCE_H