UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zqdlg_sgoptions.hpp
1 /* zqdlg_sgoptions.hpp */
2 /* $Id: zqdlg_sgoptions.hpp,v 1.5 2007/03/11 11:45:31 rus1 Exp $ */
3 
4 /*
5  * $Log: zqdlg_sgoptions.hpp,v $
6  * Revision 1.5 2007/03/11 11:45:31 rus1
7  * Capability to change labels for time and coordinate
8  *
9  * Revision 1.4 2006/05/25 11:02:25 guser1
10  * + updateCoords().
11  *
12  * Revision 1.3 2006/05/24 09:46:31 guser4
13  * Change order of initializations in constructor.
14  *
15  * Revision 1.2 2006/05/23 11:42:17 guser4
16  * + showModal()
17  *
18  * Revision 1.1 2006/03/06 13:59:57 rus1
19  * + Scale & Grid & Manual zoom dialog
20  *
21  */
22 
23 #ifndef __zqdlg_sgoptions_hpp
24 #define __zqdlg_sgoptions_hpp
25 
26 #include <set>
27 #include <qzq_area.hpp>
28 #include <zqb_natgroup.hpp>
29 #include <zqb_natgrpmember.hpp>
30 
31 
32 
34 class ScaleAndGrid;
35 
36 
44 {
45  friend class ScaleAndGrid;
46 
47 public:
48 
51  ZqDlgSGOptions (QWidget* parent,
52  ZqbNatGroup* pNatCoord, ZqbNatGroup* pNatTime);
53 
55  virtual ~ZqDlgSGOptions ();
56 
58  void setCoordLabel (const QString& qsCoordLabel);
59 
61  void setTimeLabel (const QString& qsTimeLabel);
62 
63 
66  int showModal ();
67 
69  void show ();
70 
72  void hide ();
73 
74 
76  void setCoords (double c[2]);
77 
79  void setTimes (double t[2]);
80 
81 
83  void updateCoords ();
84 
86  void updateBounds ();
87 
89  void updateSteps ();
90 
91 
97  void attachArea (QzqArea* pArea);
98 
100  void detachArea (QzqArea* pArea);
101 
102 
104  void apply ();
105 
106  /*
107  * Internal classes which are needed just for handling change of
108  * natural group coordinates.
109  */
110 
113  {
114  /* Pointer to the parent class. */
115  ZqDlgSGOptions *m_pSGO;
116 
117  public:
118 
123  : ZqbNatGrpMember(pNatGroup), m_pSGO(pSGO) {}
124 
126  virtual void onSetCoords () {
127  double t[2];
128  group().getCoords(t);
129  m_pSGO->setTimes(t);
130  }
131 
132  } m_Time;
133 
136  {
137  /* Pointer to the parent class. */
138  ZqDlgSGOptions *m_pSGO;
139 
140  public:
141 
147  : ZqbNatGrpMember(pNatGroup), m_pSGO(pSGO) {}
148 
150  virtual void onSetCoords () {
151  double c[2];
152  group().getCoords(c);
153  m_pSGO->setCoords(c);
154  }
155 
156  } m_Coord;
157 
158 protected:
159 
161  ScaleAndGrid *m_pDlg;
162 
165  std::set<QzqArea*> m_AttachedArea;
166 
167 };
168 
169 
170 #endif /* zqdlg_sgoptions.hpp */
virtual void getCoords(double c[2]) const
Definition: zqdlg_sgoptions.hpp:135
void setCoordLabel(const QString &qsCoordLabel)
Definition: zqdlg_sgoptions.hpp:43
Definition: zqb_natgroup.hpp:35
TimeWatcher(ZqDlgSGOptions *pSGO, ZqbNatGroup *pNatGroup)
Definition: zqdlg_sgoptions.hpp:122
void updateBounds()
virtual void onSetCoords()
Definition: zqdlg_sgoptions.hpp:150
void updateSteps()
virtual void onSetCoords()
Definition: zqdlg_sgoptions.hpp:126
virtual ZqbNatGroup & group() const
Definition: qzq_area.hpp:39
void attachArea(QzqArea *pArea)
void setCoords(double c[2])
void setTimeLabel(const QString &qsTimeLabel)
virtual ~ZqDlgSGOptions()
void setTimes(double t[2])
CoordWatcher(ZqDlgSGOptions *pSGO, ZqbNatGroup *pNatGroup)
Definition: zqdlg_sgoptions.hpp:146
std::set< QzqArea * > m_AttachedArea
Definition: zqdlg_sgoptions.hpp:165
Definition: zqb_natgrpmember.hpp:26
void updateCoords()
ZqDlgSGOptions(QWidget *parent, ZqbNatGroup *pNatCoord, ZqbNatGroup *pNatTime)
void detachArea(QzqArea *pArea)
ScaleAndGrid * m_pDlg
Definition: zqdlg_sgoptions.hpp:161
Definition: zqdlg_sgoptions.hpp:112