Developer documentation | Axl-2.5.1

axlInspectorObjectSceneWidgetFieldVectorStream.cpp
Go to the documentation of this file.
1 /* axlInspectorObjectSceneWidgetFieldVectorStream.cpp ---
2  *
3  * Author: Julien Wintz
4  * Copyright (C) 2008 - Julien Wintz, Inria.
5  * Created: Tue Dec 21 14:14:53 2010 (+0100)
6  * Version: $Id$
7  * Last-Updated: Fri Sep 9 15:35:25 2011 (+0200)
8  * By: Julien Wintz
9  * Update #: 107
10  */
11 
12 /* Commentary:
13  *
14  */
15 
16 /* Change log:
17  *
18  */
19 
21 
22 #include <dtkCoreSupport/dtkGlobal.h>
23 
24 #include <QtGui>
25 
26 class axlInspectorObjectSceneWidgetFieldVectorStreamPrivate
27 {
28 public:
29  QDoubleSpinBox *stream_radius_spin;
30  QDoubleSpinBox *stream_propagati_spin;
31  QComboBox *stream_direction_comb;
32 };
33 
34 axlInspectorObjectSceneWidgetFieldVectorStream::axlInspectorObjectSceneWidgetFieldVectorStream(QWidget *parent) : QWidget(parent), d(new axlInspectorObjectSceneWidgetFieldVectorStreamPrivate)
35 {
36  QWidget *stream_form = new QWidget(this);
37  stream_form->setObjectName("axlInspectorObjectSceneWidgetFieldVectorStreamForm");
38 
39  d->stream_propagati_spin = new QDoubleSpinBox(this);
40  d->stream_propagati_spin->setValue(100);
41  d->stream_propagati_spin->setMinimum(0);
42  d->stream_propagati_spin->setMaximum(100000);
43  d->stream_propagati_spin->setSingleStep(1);
44 
45  d->stream_radius_spin = new QDoubleSpinBox(this);
46  d->stream_radius_spin->setValue(0.001);
47  d->stream_radius_spin->setMinimum(0);
48  d->stream_radius_spin->setMaximum(100000);
49  d->stream_radius_spin->setSingleStep(0.001);
50  d->stream_radius_spin->setDecimals(3);
51 
52  d->stream_direction_comb = new QComboBox(this);
53  d->stream_direction_comb->addItem("Forward");
54  d->stream_direction_comb->addItem("Backward");
55  d->stream_direction_comb->addItem("Both");
56  d->stream_direction_comb->setCurrentIndex(2);
57 
58  QFormLayout *stream_form_layout = new QFormLayout(stream_form);
59  stream_form_layout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow);
60  stream_form_layout->addRow("Radius", d->stream_radius_spin);
61  stream_form_layout->addRow("Propagation", d->stream_propagati_spin);
62  stream_form_layout->addRow("Direction", d->stream_direction_comb);
63 
64  QVBoxLayout *layout = new QVBoxLayout(this);
65  layout->setContentsMargins(0, 0, 0, 0);
66  layout->addWidget(new QLabel("Stream", this));
67  layout->addWidget(stream_form);
68 
69 
70  connect(d->stream_radius_spin, SIGNAL(valueChanged(double)), this, SIGNAL(streamRadiusValueChanged(double)));
71  connect(d->stream_propagati_spin, SIGNAL(valueChanged(double)), this, SIGNAL(streamPropagationValueChanged(double)));
72  connect(d->stream_direction_comb, SIGNAL(currentIndexChanged(int)), this, SIGNAL(streamDirectionValueChanged(int)));
73 }
74 
76 {
77  delete d;
78 
79  d = NULL;
80 }