15 #include "ui_vp1customstereoeditor.h"
26 #include <Inventor/nodes/SoGroup.h>
27 #include <Inventor/nodes/SoCamera.h>
28 #include <Inventor/SbBox.h>
31 #include <QCloseEvent>
39 Ui::VP1CustomStereoEditorForm
ui;
104 : QWidget(0,Qt::WindowStaysOnTopHint), m_d(
new Imp)
113 m_d->
ui.setupUi(
this);
114 m_d->
ui.groupBox_camera->setChecked(
true);
115 m_d->
ui.groupBox_viewer->setChecked(
false);
121 setWindowIcon(QIcon(QString(
":/vp1/icons/icons/3d_32x32.png")));
169 m_d->
ui.groupBox_viewer->hide();
199 m_d->
ui.radioButton_standard->setChecked(
true);
200 m_d->
ui.radioButton_noStereo->setChecked(
true);
201 m_d->
ui.radioButton_standard_viewer->setChecked(
true);
203 m_d->
ui.groupBox_2->setEnabled(
false);
206 QWidget::showEvent(
ev);
229 m_d->
ui.doubleSpinBox_offset->setValue( (
m_d->
viewer->getCamera()->focalDistance.getValue() / 30.0) );
230 m_d->
ui.doubleSpinBox_offset_viewer->setValue( (
m_d->
viewer->getCamera()->focalDistance.getValue() / 30.0) );
237 double value_meters = 0.;
239 if (
m_d->
ui.doubleSpinBox_imageWidth_meter==sender()) {
241 m_d->
ui.doubleSpinBox_imageWidth_inch->setValue(
value * 39.370);
242 value_meters =
value;
244 else if (
m_d->
ui.doubleSpinBox_imageWidth_inch==sender()) {
246 m_d->
ui.doubleSpinBox_imageWidth_meter->setValue(
value / 39.370);
247 value_meters =
value / 39.370;
250 value_meters =
m_d->
ui.doubleSpinBox_imageWidth_meter->value();
255 double nativeParallax =
m_d->
ui.doubleSpinBox_offset->value() / value_meters;
256 double minimumObjDistance =
m_d->
ui.doubleSpinBox_offset->value() / 30.;
270 SoCamera *camera =
m_d->
viewer->getCamera();
271 if (
m_d->
ui.radioButton_standard->isChecked() ) {
272 camera->setStereoMode(SoCamera::MONOSCOPIC);
275 else if (
m_d->
ui.radioButton_left->isChecked() ) {
276 camera->setStereoMode(SoCamera::LEFT_VIEW);
279 else if (
m_d->
ui.radioButton_right->isChecked() ) {
280 camera->setStereoMode(SoCamera::RIGHT_VIEW);
291 if (
m_d->
ui.radioButton_left_viewer->isChecked())
298 if (
m_d->
ui.radioButton_right_viewer->isChecked())
305 if (
m_d->
ui.radioButton_standard_viewer->isChecked())
309 if (
m_d->
ui.radioButton_noStereo->isChecked())
312 m_d->
ui.groupBox_2->setEnabled(
false);
314 if (
m_d->
ui.radioButton_anaglyph->isChecked())
317 m_d->
ui.groupBox_2->setEnabled(
true);
319 if (
m_d->
ui.radioButton_quadbuffer->isChecked())
322 m_d->
ui.groupBox_2->setEnabled(
true);
324 if (
m_d->
ui.radioButton_int_rows->isChecked())
327 m_d->
ui.groupBox_2->setEnabled(
true);
329 if (
m_d->
ui.radioButton_int_cols->isChecked())
332 m_d->
ui.groupBox_2->setEnabled(
true);
348 if (
m_d->
ui.pushButton_refresh==sender())
351 double offset(
m_d->
ui.doubleSpinBox_offset->value());
352 double parallax(
m_d->
ui.doubleSpinBox_parallax->value());
357 SoCamera *camera =
m_d->
viewer->getCamera();
359 if (old_offset !=
offset) {
360 camera->setStereoAdjustment(
offset);
364 if (old_parallax != parallax) {
365 camera->setBalanceAdjustment(parallax);
374 else if (
m_d->
ui.pushButton_refreshViewer==sender())
377 double offset(
m_d->
ui.doubleSpinBox_offset_viewer->value());
381 if (old_offset !=
offset) {
389 else if (
m_d->
ui.pushButton_defCamera==sender())
413 double defParall = 1.0;
415 m_d->
ui.doubleSpinBox_offset->setValue(defOff);
416 m_d->
ui.doubleSpinBox_parallax->setValue(defParall);
422 else if (
m_d->
ui.pushButton_defViewer==sender())
435 m_d->
ui.doubleSpinBox_offset_viewer->setValue(defOff);