26 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
27 #include <dtkCoreSupport/dtkAbstractProcess.h>
28 #include <dtkGuiSupport/dtkColorButton.h>
32 class axlInspectorToolCreatorPointPrivate
35 QSlider *sliderOpacity;
36 dtkColorButton *colorButton;
39 QDoubleSpinBox *spinBoxCoordonate_x;
40 QDoubleSpinBox *spinBoxCoordonate_y;
41 QDoubleSpinBox *spinBoxCoordonate_z;
46 QVBoxLayout *layout =
new QVBoxLayout(
this);
49 d->sliderOpacity =
new QSlider(Qt::Horizontal,
this);
51 QHBoxLayout *layoutOpacity =
new QHBoxLayout;
52 layoutOpacity->addWidget(
new QLabel(
"Opacity",
this));
53 layoutOpacity->addWidget(d->sliderOpacity);
54 d->sliderOpacity->setMaximum(100);
57 d->colorButton =
new dtkColorButton(
this);
59 QHBoxLayout *layoutColorButton =
new QHBoxLayout;
60 layoutColorButton->addWidget(
new QLabel(
"Color",
this));
61 layoutColorButton->addWidget(d->colorButton);
62 d->colorButton->setColor(QColor(
"#a0a0a4"));
65 QVBoxLayout *layoutCoordonate =
new QVBoxLayout();
66 QHBoxLayout *layoutCoordonate_x =
new QHBoxLayout();
67 QHBoxLayout *layoutCoordonate_y =
new QHBoxLayout();
68 QHBoxLayout *layoutCoordonate_z =
new QHBoxLayout();
69 QLabel *labelCoordonate_x =
new QLabel(
"x",
this);
70 QLabel *labelCoordonate_y =
new QLabel(
"y",
this);
71 QLabel *labelCoordonate_z =
new QLabel(
"z",
this);
72 d->spinBoxCoordonate_x =
new QDoubleSpinBox(
this);
73 d->spinBoxCoordonate_y =
new QDoubleSpinBox(
this);
74 d->spinBoxCoordonate_z =
new QDoubleSpinBox(
this);
76 d->spinBoxCoordonate_x->setRange(-1000, 1000);
77 d->spinBoxCoordonate_y->setRange(-1000, 1000);
78 d->spinBoxCoordonate_z->setRange(-1000, 1000);
80 d->spinBoxCoordonate_x->setValue(0.0);
81 d->spinBoxCoordonate_y->setValue(0.0);
82 d->spinBoxCoordonate_z->setValue(0.0);
83 d->spinBoxCoordonate_x->setSingleStep(0.1);
84 d->spinBoxCoordonate_y->setSingleStep(0.1);
85 d->spinBoxCoordonate_z->setSingleStep(0.1);
87 layoutCoordonate_x->addWidget(labelCoordonate_x);
88 layoutCoordonate_x->addWidget(d->spinBoxCoordonate_x);
89 layoutCoordonate_y->addWidget(labelCoordonate_y);
90 layoutCoordonate_y->addWidget(d->spinBoxCoordonate_y);
91 layoutCoordonate_z->addWidget(labelCoordonate_z);
92 layoutCoordonate_z->addWidget(d->spinBoxCoordonate_z);
93 layoutCoordonate->addLayout(layoutCoordonate_x);
94 layoutCoordonate->addLayout(layoutCoordonate_y);
95 layoutCoordonate->addLayout(layoutCoordonate_z);
97 QPushButton *button =
new QPushButton(
"Create",
this);
98 connect(button, SIGNAL(clicked()),
this, SLOT(
run()));
100 layout->addWidget(
new QLabel(
"axlInspectorToolCreatorPoint",
this));
101 layout->addLayout(layoutCoordonate);
102 layout->addLayout(layoutOpacity);
103 layout->addLayout(layoutColorButton);
104 layout->addWidget(button);
116 d->controller = controller;
121 axlPoint *newPoint =
new axlPoint(d->spinBoxCoordonate_x->value(), d->spinBoxCoordonate_y->value(), d->spinBoxCoordonate_z->value());
122 newPoint->
setColor(d->colorButton->color());
123 double opacity = 1.0 - 0.01 * d->sliderOpacity->value();
Class axlPoint defines 3D points.
void setOpacity(const double &opacity)
void setColor(double r, double g, double b)