CEDRIC  Revision_backup-2009-02
EventMapDialog.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 2008 Boris Iven, Max Hermann
4  *
5  * This file is part of the "CEDRIC Event Display" application.
6  *
7  *****************************************************************************/
8 
9 #ifndef EVENTMAPDIALOG_H
10 #define EVENTMAPDIALOG_H
11 
12 #include <QtGui>
13 
14 class EventMapDialog: public QDialog
15 {
16  Q_OBJECT
17 
18 public:
19  EventMapDialog( QWidget* parent=0 )
20  : QDialog( parent )
21  {
22  m_samplesSpinBox = new QSpinBox;
23  m_samplesSpinBox->setRange( 10, 2000 );
24  m_samplesSpinBox->setValue( 200 );
25 
26  QLabel* samplesLabel = new QLabel(tr("Number of samples"));
27  samplesLabel->setBuddy( m_samplesSpinBox );
28 
29 
30  m_weightCombo = new QComboBox;
31  m_weightCombo->addItem( tr("Normalized weights") );
32  m_weightCombo->addItem( tr("Unit weights") );
33  m_weightCombo->setCurrentIndex(0);
34 
35  QLabel* weightLabel = new QLabel(tr("Feature weight method"));
36  weightLabel->setBuddy( m_weightCombo );
37 
38 
39  m_distCombo = new QComboBox;
40  m_distCombo->addItem( tr("Mahalanobis") );
41  m_distCombo->addItem( tr("Manhattan") );
42  m_distCombo->setCurrentIndex(0);
43 
44  QLabel* distLabel = new QLabel(tr("Ground distance"));
45  distLabel->setBuddy( m_distCombo );
46 
47 
48  QPushButton* okButton = new QPushButton(tr("Accept"));
49  QPushButton* cancelButton = new QPushButton(tr("Abort"));
50  okButton->setDefault( true );
51 
52 
53  QHBoxLayout *samplesLayout = new QHBoxLayout;
54  samplesLayout->addWidget( samplesLabel );
55  samplesLayout->addWidget( m_samplesSpinBox );
56 
57  QVBoxLayout *weightLayout = new QVBoxLayout;
58  weightLayout->addWidget( weightLabel );
59  weightLayout->addWidget( m_weightCombo );
60 
61  QVBoxLayout *distLayout = new QVBoxLayout;
62  distLayout->addWidget( distLabel );
63  distLayout->addWidget( m_distCombo );
64 
65  QHBoxLayout* butLayout = new QHBoxLayout;
66  butLayout->addStretch( 1 );
67  butLayout->addWidget( cancelButton );
68  butLayout->addWidget( okButton );
69 
70  QVBoxLayout* layout = new QVBoxLayout;
71  layout->addLayout( samplesLayout );
72  layout->addLayout( weightLayout );
73  layout->addLayout( distLayout );
74  layout->addStretch( 2 );
75  layout->addLayout( butLayout );
76 
77  setLayout( layout );
78  setWindowTitle( tr("Event Map Options") );
79  setFixedHeight( sizeHint().height() );
80 
81  connect( okButton, SIGNAL(clicked()), this, SLOT(accept()) );
82  connect( cancelButton, SIGNAL(clicked()), this, SLOT(reject()) );
83  }
84 
85  int getSampleSize() const { return m_samplesSpinBox->value(); }
86  int getWeightType() const { return m_weightCombo->currentIndex(); }
87  int getGroundDistance() const { return m_distCombo->currentIndex(); }
88 
89  void setSampleSize( int size ) { m_samplesSpinBox->setValue( size ); }
90  void setWeightType( int type ) { m_weightCombo->setCurrentIndex( type ); }
91  void setGroundDistance( int type ) { m_weightCombo->setCurrentIndex( type ); }
92 
93 private:
94  QSpinBox* m_samplesSpinBox;
95  QComboBox* m_weightCombo;
96  QComboBox* m_distCombo;
97 };
98 
99 #endif // EVENTMAPDIALOG_H
int getGroundDistance() const
Definition: EventMapDialog.h:87
Definition: EventMapDialog.h:14
int getWeightType() const
Definition: EventMapDialog.h:86
EventMapDialog(QWidget *parent=0)
Definition: EventMapDialog.h:19
void setGroundDistance(int type)
Definition: EventMapDialog.h:91
void setWeightType(int type)
Definition: EventMapDialog.h:90
void setSampleSize(int size)
Definition: EventMapDialog.h:89
int getSampleSize() const
Definition: EventMapDialog.h:85