25 #include <dtkCoreSupport/dtkAbstractProcessFactory.h>
26 #include <dtkCoreSupport/dtkAbstractProcess.h>
30 class axlInspectorCameraPrivate
35 QRadioButton *radioButtonLastCamera;
37 QRadioButton *radioButtonCameraX;
38 QRadioButton *radioButtonCameraY;
39 QRadioButton *radioButtonCameraZ;
41 QRadioButton *radioButtonCameraInverseX;
42 QRadioButton *radioButtonCameraInverseY;
43 QRadioButton *radioButtonCameraInverseZ;
45 QRadioButton *radioButtonCameraPerpective;
46 QRadioButton *radioButtonCameraParallel;
48 QCheckBox *checkBoxGridX;
49 QCheckBox *checkBoxGridY;
50 QCheckBox *checkBoxGridZ;
52 QCheckBox *checkBoxShowAxes;
54 QSlider *sliderResolution;
62 QVBoxLayout *layout =
new QVBoxLayout(
this);
64 QGridLayout *layoutCamera =
new QGridLayout();
65 QButtonGroup *buttonGroupCamera =
new QButtonGroup(
this);
66 QButtonGroup *buttonGroupCameraProjection =
new QButtonGroup(
this);
69 d->radioButtonLastCamera =
new QRadioButton(
"Free",
this);
70 d->radioButtonLastCamera->setToolTip(
"switch to free camera");
71 d->radioButtonLastCamera->setChecked(
true);
72 d->radioButtonLastCamera->setFocusPolicy(Qt::NoFocus);
73 layoutCamera->addWidget(d->radioButtonLastCamera, 0, 0);
77 d->radioButtonCameraX =
new QRadioButton(
" X",
this);
78 d->radioButtonCameraX->setFocusPolicy(Qt::NoFocus);
80 d->radioButtonCameraY =
new QRadioButton(
" Y",
this);
81 d->radioButtonCameraY->setFocusPolicy(Qt::NoFocus);
83 d->radioButtonCameraZ =
new QRadioButton(
" Z",
this);
84 d->radioButtonCameraZ->setFocusPolicy(Qt::NoFocus);
86 layoutCamera->addWidget(d->radioButtonCameraX, 1, 0);
87 layoutCamera->addWidget(d->radioButtonCameraY, 1, 1);
88 layoutCamera->addWidget(d->radioButtonCameraZ, 1, 2);
91 d->radioButtonCameraInverseX =
new QRadioButton(
"-X",
this);
92 d->radioButtonCameraInverseX->setFocusPolicy(Qt::NoFocus);
94 d->radioButtonCameraInverseY =
new QRadioButton(
"-Y",
this);
95 d->radioButtonCameraInverseY->setFocusPolicy(Qt::NoFocus);
97 d->radioButtonCameraInverseZ =
new QRadioButton(
"-Z",
this);
98 d->radioButtonCameraInverseZ->setFocusPolicy(Qt::NoFocus);
100 layoutCamera->addWidget(d->radioButtonCameraInverseX, 2, 0);
101 layoutCamera->addWidget(d->radioButtonCameraInverseY, 2, 1);
102 layoutCamera->addWidget(d->radioButtonCameraInverseZ, 2, 2);
104 buttonGroupCamera->addButton(d->radioButtonLastCamera);
105 buttonGroupCamera->addButton(d->radioButtonCameraX);
106 buttonGroupCamera->addButton(d->radioButtonCameraY);
107 buttonGroupCamera->addButton(d->radioButtonCameraZ);
108 buttonGroupCamera->addButton(d->radioButtonCameraInverseX);
109 buttonGroupCamera->addButton(d->radioButtonCameraInverseY);
110 buttonGroupCamera->addButton(d->radioButtonCameraInverseZ);
112 QHBoxLayout *layoutCameraProjection =
new QHBoxLayout();
114 d->radioButtonCameraPerpective =
new QRadioButton(
" Perspective",
this);
115 d->radioButtonCameraPerpective->setFocusPolicy(Qt::NoFocus);
116 d->radioButtonCameraPerpective->setChecked(
true);
118 d->radioButtonCameraParallel =
new QRadioButton(
" Parallel",
this);
119 d->radioButtonCameraParallel->setFocusPolicy(Qt::NoFocus);
120 layoutCameraProjection->addWidget(d->radioButtonCameraPerpective);
121 layoutCameraProjection->addWidget(d->radioButtonCameraParallel);
123 buttonGroupCameraProjection->addButton(d->radioButtonCameraPerpective);
124 buttonGroupCameraProjection->addButton(d->radioButtonCameraParallel);
125 QGridLayout *layoutGrid =
new QGridLayout();
127 d->checkBoxGridX =
new QCheckBox(
" X",
this);
128 d->checkBoxGridX->setFocusPolicy(Qt::NoFocus);
130 d->checkBoxGridY =
new QCheckBox(
" Y",
this);
131 d->checkBoxGridY->setFocusPolicy(Qt::NoFocus);
133 d->checkBoxGridZ =
new QCheckBox(
" Z",
this);
134 d->checkBoxGridZ->setFocusPolicy(Qt::NoFocus);
136 d->sliderResolution =
new QSlider(Qt::Horizontal,
this);
137 d->sliderResolution->setMinimum(1);
138 d->sliderResolution->setMaximum(100);
139 d->sliderResolution->setToolTip(
"Set the grid resolution between 1 and 100");
142 layoutGrid->addWidget(d->checkBoxGridX, 0, 0);
143 layoutGrid->addWidget(d->checkBoxGridY, 0, 1);
144 layoutGrid->addWidget(d->checkBoxGridZ, 0, 2);
145 layoutGrid->addWidget(d->sliderResolution, 1, 0, 1, 3);
147 d->checkBoxShowAxes =
new QCheckBox(
" Show axes",
this);
148 d->checkBoxShowAxes->setChecked(
true);
153 layout->addWidget(
new QLabel(
"Projection :",
this));
154 layout->addLayout(layoutCameraProjection);
156 layout->addWidget(
new QLabel(
"View",
this));
157 layout->addLayout(layoutCamera);
159 layout->addWidget(
new QLabel(
"Grid :",
this));
160 layout->addLayout(layoutGrid);
162 layout->addWidget(
new QLabel(
"Axes :",
this));
163 layout->addWidget(d->checkBoxShowAxes);
169 connect(d->radioButtonCameraInverseX, SIGNAL(clicked()),
this, SLOT(
onCameraViewChanged()));
170 connect(d->radioButtonCameraInverseY, SIGNAL(clicked()),
this, SLOT(
onCameraViewChanged()));
171 connect(d->radioButtonCameraInverseZ, SIGNAL(clicked()),
this, SLOT(
onCameraViewChanged()));
174 connect(d->checkBoxGridX, SIGNAL(clicked()),
this, SLOT(
onGridChanged()));
175 connect(d->checkBoxGridY, SIGNAL(clicked()),
this, SLOT(
onGridChanged()));
176 connect(d->checkBoxGridZ, SIGNAL(clicked()),
this, SLOT(
onGridChanged()));
189 connect(d->sliderResolution, SIGNAL(valueChanged(
int)), d->view, SLOT(onGridResolutionChanged(
int)));
191 connect(d->checkBoxShowAxes, SIGNAL(clicked(
bool)), d->view, SLOT(onShowAxis(
bool)));
197 d->checkBoxShowAxes->setChecked(d->view->getAxesVisibility());
199 if (d->view->getParallelProjection())
200 d->radioButtonCameraParallel->setChecked(
true);
202 d->radioButtonCameraPerpective->setChecked(
true);
207 if(d->radioButtonCameraParallel->isChecked())
208 d->view->setParallelCamera(
true);
210 if(d->radioButtonCameraPerpective->isChecked())
211 d->view->setParallelCamera(
false);
217 if(d->radioButtonLastCamera->isChecked())
218 d->view->setCameraViewDefaut();
220 if(d->radioButtonCameraX->isChecked())
221 d->view->setCameraViewPositiveX();
223 if(d->radioButtonCameraY->isChecked())
224 d->view->setCameraViewPositiveY();
226 if(d->radioButtonCameraZ->isChecked())
227 d->view->setCameraViewPositiveZ();
229 if(d->radioButtonCameraInverseX->isChecked())
230 d->view->setCameraViewNegativeX();
232 if(d->radioButtonCameraInverseY->isChecked())
233 d->view->setCameraViewNegativeY();
235 if(d->radioButtonCameraInverseZ->isChecked())
236 d->view->setCameraViewNegativeZ();
241 d->view->setGrid(d->checkBoxGridX->isChecked(), d->checkBoxGridY->isChecked(), d->checkBoxGridZ->isChecked());
axlInspectorCamera(QWidget *parent=0)
void onCameraProjectionChanged(void)
void setView(axlAbstractView *view)
~axlInspectorCamera(void)
void onCameraViewChanged(void)