QXRD  0.11.16
Public Member Functions | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
QxrdMaskDialog Class Reference

#include <qxrdmaskdialog.h>

Inheritance diagram for QxrdMaskDialog:
Inheritance graph
[legend]
Collaboration diagram for QxrdMaskDialog:
Collaboration graph
[legend]

Public Member Functions

 QxrdMaskDialog (QxrdDataProcessorWPtr procw, QWidget *parent=0)
 
 ~QxrdMaskDialog ()
 

Protected Member Functions

void changeEvent (QEvent *e)
 

Private Slots

void doHideMaskAll ()
 
void doShowMaskAll ()
 
void doHideMaskRange ()
 
void doShowMaskRange ()
 
void doInvertMask ()
 
void doGrowMask ()
 
void doShrinkMask ()
 
void doAndMask ()
 
void doOrMask ()
 
void doXorMask ()
 
void doAndNotMask ()
 
void doOrNotMask ()
 
void doXorNotMask ()
 
void doExchangeMask ()
 
void doRollMask ()
 
void doRollUpMask ()
 
void doRollDownMask ()
 
void doClearMask ()
 
void doClearMaskTop ()
 
void doNewMask ()
 
void doPushMask ()
 
void doUndoMask ()
 
void doZingersMask ()
 

Private Member Functions

int maskStackSelectPopup ()
 

Private Attributes

QxrdDataProcessorWPtr m_Processor
 
QxrdMaskStackWPtr m_Masks
 
QxrdMaskStackModelPtr m_MaskStackModel
 

Detailed Description

Definition at line 11 of file qxrdmaskdialog.h.

Constructor & Destructor Documentation

QxrdMaskDialog::QxrdMaskDialog ( QxrdDataProcessorWPtr  procw,
QWidget *  parent = 0 
)
explicit

Definition at line 10 of file qxrdmaskdialog.cpp.

References DEBUG_CONSTRUCTORS, doAndMask(), doAndNotMask(), doClearMask(), doClearMaskTop(), doExchangeMask(), doGrowMask(), doHideMaskAll(), doHideMaskRange(), doInvertMask(), doNewMask(), doOrMask(), doOrNotMask(), doPushMask(), doRollDownMask(), doRollMask(), doRollUpMask(), doShowMaskAll(), doShowMaskRange(), doShrinkMask(), doUndoMask(), doXorMask(), doXorNotMask(), doZingersMask(), m_Masks, m_MaskStackModel, m_Processor, and qcepDebug().

10  :
11  QDockWidget(parent),
12  m_Processor(procw),
13  m_Masks(),
15 {
17  printf("QxrdMaskDialog::QxrdMaskDialog(%p)\n", this);
18  }
19 
20  setupUi(this);
21 
22  connect(m_HideMaskAll, &QAbstractButton::clicked, this, &QxrdMaskDialog::doHideMaskAll);
23  connect(m_ShowMaskAll, &QAbstractButton::clicked, this, &QxrdMaskDialog::doShowMaskAll);
24  connect(m_HideMaskRange, &QAbstractButton::clicked, this, &QxrdMaskDialog::doHideMaskRange);
25  connect(m_ShowMaskRange, &QAbstractButton::clicked, this, &QxrdMaskDialog::doShowMaskRange);
26  connect(m_InvertMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doInvertMask);
27  connect(m_GrowMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doGrowMask);
28  connect(m_ShrinkMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doShrinkMask);
29  connect(m_AndMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doAndMask);
30  connect(m_OrMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doOrMask);
31  connect(m_XorMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doXorMask);
32  connect(m_AndNotMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doAndNotMask);
33  connect(m_OrNotMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doOrNotMask);
34  connect(m_XorNotMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doXorNotMask);
35  connect(m_ExchangeMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doExchangeMask);
36  connect(m_RollUpMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doRollUpMask);
37  connect(m_RollDownMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doRollDownMask);
38  connect(m_RollMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doRollMask);
39  connect(m_NewMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doNewMask);
40  connect(m_PushMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doPushMask);
41  connect(m_ClearMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doClearMask);
42  connect(m_ClearMaskTop, &QAbstractButton::clicked, this, &QxrdMaskDialog::doClearMaskTop);
43  connect(m_UndoMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doUndoMask);
44  connect(m_ZingerMask, &QAbstractButton::clicked, this, &QxrdMaskDialog::doZingersMask);
45 
47 
48  if (proc) {
49  proc -> prop_MaskMinimumValue() -> linkTo(m_MaskMinimum);
50  proc -> prop_MaskMaximumValue() -> linkTo(m_MaskMaximum);
51  proc -> prop_MaskCircleRadius() -> linkTo(m_MaskCircleRadius);
52  proc -> prop_MaskSetPixels() -> linkTo(m_MaskSetPixels);
53 
54  m_Masks = proc->maskStack();
57 
58  m_MaskStackView -> setModel(m_MaskStackModel.data());
59  m_MaskStackView -> setMaskStack(m_Masks);
60  m_MaskStackView -> setProcessor(m_Processor);
61  m_MaskStackView -> setMaskDialog(this);
62  }
63 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor
QxrdMaskStackWPtr m_Masks
QxrdMaskStackModelPtr m_MaskStackModel
QSharedPointer< QxrdMaskStackModel > QxrdMaskStackModelPtr

Here is the call graph for this function:

QxrdMaskDialog::~QxrdMaskDialog ( )

Definition at line 65 of file qxrdmaskdialog.cpp.

References DEBUG_CONSTRUCTORS, and qcepDebug().

66 {
68  printf("QxrdMaskDialog::~QxrdMaskDialog(%p)\n", this);
69  }
70 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26

Here is the call graph for this function:

Member Function Documentation

void QxrdMaskDialog::changeEvent ( QEvent *  e)
protected

Definition at line 72 of file qxrdmaskdialog.cpp.

73 {
74  QDockWidget::changeEvent(e);
75  switch (e->type()) {
76  case QEvent::LanguageChange:
77  retranslateUi(this);
78  break;
79  default:
80  break;
81  }
82 }
void QxrdMaskDialog::doAndMask ( )
privateslot

Definition at line 234 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

235 {
236  int n = maskStackSelectPopup();
237 
238  if (n >= 0) {
240 
241  if (proc) {
242  proc->andMaskStack(n);
243  proc->statusMessage("Mask Stack AND");
244  }
245  }
246 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doAndNotMask ( )
privateslot

Definition at line 276 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

277 {
278  int n = maskStackSelectPopup();
279 
280  if (n >= 0) {
282 
283  if (proc) {
284  proc->andNotMaskStack(n);
285  proc->statusMessage("Mask Stack AND NOT");
286  }
287  }
288 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doClearMask ( )
privateslot

Definition at line 365 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

366 {
368 
369  if (proc) {
370  proc->clearMaskStack();
371  proc->statusMessage("Mask Stack Cleared");
372  }
373 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

void QxrdMaskDialog::doClearMaskTop ( )
privateslot

Definition at line 375 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

376 {
378 
379  if (proc) {
380  proc->clearMaskStackTop();
381  proc->statusMessage("Top of Mask Stack Cleared");
382  }
383 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

void QxrdMaskDialog::doExchangeMask ( )
privateslot

Definition at line 318 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

319 {
320  int n = maskStackSelectPopup();
321 
322  if (n >= 0) {
324 
325  if (proc) {
326  proc->exchangeMaskStack(n);
327  proc->statusMessage("Mask Stack Exchanged");
328  }
329  }
330 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doGrowMask ( )
privateslot

Definition at line 206 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

207 {
208  int n = maskStackSelectPopup();
209 
210  if (n >= 0) {
212 
213  if (proc) {
214  proc->growMaskStack(n);
215  proc->statusMessage("Mask Stack Invert");
216  }
217  }
218 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doHideMaskAll ( )
privateslot

Definition at line 114 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

115 {
116  int n = maskStackSelectPopup();
117 
118  if (n >= 0) {
120 
121  if (proc) {
122  proc->hideMaskAllStack(n);
123  proc->statusMessage("Mask Stack Hide All");
124  }
125  }
126 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doHideMaskRange ( )
privateslot

Definition at line 142 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

143 {
144  int n = maskStackSelectPopup();
145 
146  if (n >= 0) {
148 
149  if (proc) {
150  proc->hideMaskRangeStack(n);
151  proc->statusMessage("Mask Stack Hide In Range");
152  }
153  }
154 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doInvertMask ( )
privateslot

Definition at line 192 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

193 {
194  int n = maskStackSelectPopup();
195 
196  if (n >= 0) {
198 
199  if (proc) {
200  proc->invertMaskStack(n);
201  proc->statusMessage("Mask Stack Invert");
202  }
203  }
204 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doNewMask ( )
privateslot

Definition at line 395 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

396 {
398 
399  if (proc) {
400  proc->newMaskStack();
401  proc->statusMessage("New Mask");
402  }
403 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

void QxrdMaskDialog::doOrMask ( )
privateslot

Definition at line 248 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

249 {
250  int n = maskStackSelectPopup();
251 
252  if (n >= 0) {
254 
255  if (proc) {
256  proc->orMaskStack(n);
257  proc->statusMessage("Mask Stack OR");
258  }
259  }
260 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doOrNotMask ( )
privateslot

Definition at line 290 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

291 {
292  int n = maskStackSelectPopup();
293 
294  if (n >= 0) {
296 
297  if (proc) {
298  proc->orNotMaskStack(n);
299  proc->statusMessage("Mask Stack OR NOT");
300  }
301  }
302 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doPushMask ( )
privateslot

Definition at line 385 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

386 {
388 
389  if (proc) {
390  proc->pushMaskStack();
391  proc->statusMessage("Mask Pushed");
392  }
393 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

void QxrdMaskDialog::doRollDownMask ( )
privateslot

Definition at line 355 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

356 {
358 
359  if (proc) {
360  proc->rollMaskStack(-1);
361  proc->statusMessage("Mask Stack Rolled Down");
362  }
363 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

void QxrdMaskDialog::doRollMask ( )
privateslot

Definition at line 332 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

333 {
334  int n = maskStackSelectPopup();
335 
336  if (n >= 0) {
338 
339  if (proc) {
340  proc->rollMaskStack(n);
341  }
342  }
343 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doRollUpMask ( )
privateslot

Definition at line 345 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

346 {
348 
349  if (proc) {
350  proc->rollMaskStack(1);
351  proc->statusMessage("Mask Stack Rolled Up");
352  }
353 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

void QxrdMaskDialog::doShowMaskAll ( )
privateslot

Definition at line 128 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

129 {
130  int n = maskStackSelectPopup();
131 
132  if (n >= 0) {
134 
135  if (proc) {
136  proc->showMaskAllStack(n);
137  proc->statusMessage("Mask Stack Show All");
138  }
139  }
140 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doShowMaskRange ( )
privateslot

Definition at line 156 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

157 {
158  int n = maskStackSelectPopup();
159 
160  if (n >= 0) {
162 
163  if (proc) {
164  proc->showMaskRangeStack(n);
165  proc->statusMessage("Mask Stack Show In Range");
166  }
167  }
168 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doShrinkMask ( )
privateslot

Definition at line 220 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

221 {
222  int n = maskStackSelectPopup();
223 
224  if (n >= 0) {
226 
227  if (proc) {
228  proc->shrinkMaskStack(n);
229  proc->statusMessage("Mask Stack Invert");
230  }
231  }
232 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doUndoMask ( )
privateslot

Definition at line 405 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

406 {
408 
409  if (proc) {
410  proc->statusMessage("Undo Not Implemented");
411  }
412 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

void QxrdMaskDialog::doXorMask ( )
privateslot

Definition at line 262 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

263 {
264  int n = maskStackSelectPopup();
265 
266  if (n >= 0) {
268 
269  if (proc) {
270  proc->xorMaskStack(n);
271  proc->statusMessage("Mask Stack XOR");
272  }
273  }
274 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doXorNotMask ( )
privateslot

Definition at line 304 of file qxrdmaskdialog.cpp.

References m_Processor, and maskStackSelectPopup().

Referenced by QxrdMaskDialog().

305 {
306  int n = maskStackSelectPopup();
307 
308  if (n >= 0) {
310 
311  if (proc) {
312  proc->xorNotMaskStack(n);
313  proc->statusMessage("Mask Stack XOR NOT");
314  }
315  }
316 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
int maskStackSelectPopup()
QxrdDataProcessorWPtr m_Processor

Here is the call graph for this function:

Here is the caller graph for this function:

void QxrdMaskDialog::doZingersMask ( )
privateslot

Definition at line 170 of file qxrdmaskdialog.cpp.

References m_Processor.

Referenced by QxrdMaskDialog().

171 {
172 // int n = maskStackSelectPopup();
173 
174 // if (n >= 0) {
175 // QxrdDataProcessorPtr proc(m_Processor);
176 
177 // if (proc) {
178 // proc->zingersStack(n);
179 // proc->statusMessage("Find Zingers");
180 // }
181 // }
182 
184 
185  if (proc) {
186  QxrdZingerDialog dlg(proc);
187 
188  dlg.exec();
189  }
190 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor

Here is the caller graph for this function:

int QxrdMaskDialog::maskStackSelectPopup ( )
private

Definition at line 83 of file qxrdmaskdialog.cpp.

References m_Processor, and QxrdMaskStack::stackLevelName().

Referenced by doAndMask(), doAndNotMask(), doExchangeMask(), doGrowMask(), doHideMaskAll(), doHideMaskRange(), doInvertMask(), doOrMask(), doOrNotMask(), doRollMask(), doShowMaskAll(), doShowMaskRange(), doShrinkMask(), doXorMask(), and doXorNotMask().

84 {
85  QMenu actions;
86 
88 
89  if (proc) {
90  QxrdMaskStackPtr m = proc->maskStack();
91 
92  if (m) {
93  int nmasks = m->size();
94 
95  for (int i=0; i<nmasks; i++) {
96  QcepMaskDataPtr p = m->at(i);
97  if (p) {
98  QString lvl = m->stackLevelName(i);
99  actions.addAction(tr("%1: %2").arg(lvl).arg(p->get_Title()))->setData(i);
100  }
101  }
102  }
103 
104  QAction *selected = actions.exec(QCursor::pos());
105 
106  if (selected) {
107  return selected->data().toInt();
108  }
109  }
110 
111  return -1;
112 }
QSharedPointer< QxrdDataProcessor > QxrdDataProcessorPtr
QxrdDataProcessorWPtr m_Processor
static QString stackLevelName(int n)
QSharedPointer< QcepMaskData > QcepMaskDataPtr

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

QxrdMaskStackWPtr QxrdMaskDialog::m_Masks
private

Definition at line 52 of file qxrdmaskdialog.h.

Referenced by QxrdMaskDialog().

QxrdMaskStackModelPtr QxrdMaskDialog::m_MaskStackModel
private

Definition at line 53 of file qxrdmaskdialog.h.

Referenced by QxrdMaskDialog().

QxrdDataProcessorWPtr QxrdMaskDialog::m_Processor
private

The documentation for this class was generated from the following files: