145 m_d->systemsAllowedCameraList << system;
148 assert(!
m_d->system2rootNodes.contains(system));
149 m_d->system2rootNodes.insert(system,sysroot);
150 m_d->root->addChild(sysroot);
152 m_d->system2switchable << QPair<IVP1System*,bool>(system,switchable);
154 assert(!
m_d->system2startdisabled.contains(system));
155 m_d->system2startdisabled.insert(system,startDisabled);
156 assert(
m_d->system2startdisabled.contains(system));
158 if (allowController) {
159 m_d->systemsAllowedControllers << system;
163 if (allowExtraDisplayWidget)
164 m_d->systemsAllowedExtraDisplayWidgets << system;
171 QWidget * snapshotgroupbox =
new QWidget();
172 m_d->uisnapshot.setupUi(snapshotgroupbox);
176 m_d->sys2tabpage,
m_d->tabwidget,
177 m_d->system2switchable,
178 m_d->checkbox2system,
179 colorselectbutton_dummy,
180 snapshotgroupbox,
true ));
182 SoOffscreenRenderer::getMaximumResolution().getValue(
x,
y);
188 connect(
m_d->uisnapshot.checkBox_as_shown,SIGNAL(toggled(
bool)),
this,SLOT(
updateSnapshotDim()));
189 connect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
190 connect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
191 connect(
m_d->uisnapshot.radioButton_width,SIGNAL(toggled(
bool)),
this,SLOT(
updateSnapshotDim()));
192 connect(
m_d->uisnapshot.radioButton_height,SIGNAL(toggled(
bool)),
this,SLOT(
updateSnapshotDim()));
202 m_d->system2switchable.clear();
204 QMapIterator<QCheckBox*,IVP1System*> it(
m_d->checkbox2system);
205 while (it.hasNext()) {
208 assert(
m_d->system2startdisabled.contains(it.value()));
209 if (
m_d->system2startdisabled[it.value()]) {
210 it.key()->setChecked(
false);
211 m_d->updateSystemState(it.key());
222 QList<QPair<QString,QWidget*> > sysname2extradisplay;
224 QWidget * edwidget = sys->buildExtraDisplayWidget();
226 sysname2extradisplay << QPair<QString,QWidget*>(sys->name(),edwidget);
229 if (sysname2extradisplay.count()==0) {
231 setMinimumSize(
m_d->min3dx,
m_d->min3dy);
232 }
else if (sysname2extradisplay.count()==1) {
233 m_d->setupSplitter(sysname2extradisplay.front().second);
234 }
else if (sysname2extradisplay.count()>1) {
236 for (
int i = 0; i < sysname2extradisplay.count(); ++i) {
237 tabWidget->addTab(sysname2extradisplay.at(i).second,sysname2extradisplay.at(i).first);
239 tabWidget->setCurrentIndex(0);
240 m_d->setupSplitter(tabWidget);
245 m_d->viewer->setSceneGraph(
m_d->root);
246 m_d->viewer->setGLRenderAction(
new SoLineHighlightRenderAction());
251 m_d->viewer->setTransparencyType( SoGLRenderAction::BLEND );
255 sys->registerViewer(
m_d->viewer);
267 m_d->uisnapshot.checkBox_as_shown->setChecked(
false);
445 VP1Msg::messageDebug(
"IVP13DStandardChannelWidget::getSnapshot() - transparent bkg: "+QString::number(transp)+
" , width: "+QString::number(
width)+
" , batch: "+QString::number(batch));
463 if (
m_d->uisnapshot.checkBox_as_shown->isChecked()) {
470 int original_width = 0;
473 original_width =
m_d->uisnapshot.spinBox_width->value();
474 m_d->uisnapshot.spinBox_width->setValue(
width );
480 VP1Msg::messageVerbose(
"'transp' option set - using VP1QtInventorUtils::renderToPixmap() with transp set to 'true'");
482 m_d->uisnapshot.spinBox_width->value(),
483 m_d->uisnapshot.spinBox_height->value(),
488 if (
width)
m_d->uisnapshot.spinBox_width->setValue( original_width );
491 VP1Msg::messageVerbose(
"save the screenshot with the default tool (with settings from GUI) - using VP1QtInventorUtils::renderToPixmap()");
493 m_d->uisnapshot.spinBox_width->value(),
494 m_d->uisnapshot.spinBox_height->value(),
495 m_d->uisnapshot.checkBox_transp->isChecked());
506 disconnect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
507 disconnect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
509 if (
m_d->uisnapshot.radioButton_720p->isChecked()) {
510 m_d->uisnapshot.spinBox_width->setValue(1280);
511 m_d->uisnapshot.spinBox_height->setValue(720);
513 else if (
m_d->uisnapshot.radioButton_1080p->isChecked()) {
514 m_d->uisnapshot.spinBox_width->setValue(1920);
515 m_d->uisnapshot.spinBox_height->setValue(1080);
517 else if (
m_d->uisnapshot.radioButton_4K->isChecked()) {
518 m_d->uisnapshot.spinBox_width->setValue(4096);
519 m_d->uisnapshot.spinBox_height->setValue(2160);
521 else if (
m_d->uisnapshot.radioButton_8K->isChecked()) {
522 m_d->uisnapshot.spinBox_width->setValue(8192);
523 m_d->uisnapshot.spinBox_height->setValue(4320);
529 connect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
530 connect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
549 if (!
m_d->uisnapshot.checkBox_as_shown)
552 if (sender()==
m_d->uisnapshot.spinBox_width)
553 m_d->uisnapshot.radioButton_width->setChecked(
true);
554 else if (sender()==
m_d->uisnapshot.spinBox_height)
555 m_d->uisnapshot.radioButton_height->setChecked(
true);
562 int onscreen_width =
m_d->viewer->getNormalWidget()->geometry().width();
563 int onscreen_height =
m_d->viewer->getNormalWidget()->geometry().height();
565 if (
m_d->uisnapshot.checkBox_as_shown->isChecked() ) {
566 disconnect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
567 disconnect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
568 m_d->uisnapshot.spinBox_width->setValue(onscreen_width);
569 m_d->uisnapshot.spinBox_height->setValue(onscreen_height);
570 connect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
571 connect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
573 if (
m_d->uisnapshot.checkBox_lockRatio->isChecked()) {
575 if (
m_d->uisnapshot.radioButton_width->isChecked()) {
576 disconnect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
577 m_d->uisnapshot.spinBox_height->setValue(
static_cast<int>(
m_d->uisnapshot.spinBox_width->value()*
static_cast<double>(onscreen_height)/onscreen_width+0.5));
578 connect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
580 disconnect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
581 m_d->uisnapshot.spinBox_width->setValue(
static_cast<int>(
m_d->uisnapshot.spinBox_height->value()*
static_cast<double>(onscreen_width)/onscreen_height+0.5));
582 connect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
600 if (
m_d->uisnapshot.spinBox_width->value()>=
m_d->uisnapshot.spinBox_width->maximum()) {
601 disconnect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
602 disconnect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
603 m_d->uisnapshot.spinBox_width->setValue(
m_d->uisnapshot.spinBox_width->maximum());
604 m_d->uisnapshot.spinBox_height->setValue(
static_cast<int>(
m_d->uisnapshot.spinBox_width->value()*
static_cast<double>(onscreen_height)/onscreen_width+0.5));
605 connect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
606 connect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
608 if (
m_d->uisnapshot.spinBox_height->value()>=
m_d->uisnapshot.spinBox_height->maximum()) {
609 disconnect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
610 disconnect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
611 m_d->uisnapshot.spinBox_height->setValue(
m_d->uisnapshot.spinBox_height->maximum());
612 m_d->uisnapshot.spinBox_width->setValue(
static_cast<int>(
m_d->uisnapshot.spinBox_height->value()*
static_cast<double>(onscreen_width)/onscreen_width+0.5));
613 connect(
m_d->uisnapshot.spinBox_width,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
614 connect(
m_d->uisnapshot.spinBox_height,SIGNAL(valueChanged(
int)),
this,SLOT(
updateSnapshotDim()));
714 QByteArray byteArray;
715 QBuffer buffer(&byteArray);
716 buffer.open(QIODevice::WriteOnly);
717 QDataStream out(&buffer);
731 QMap<QString, bool> sysname2turnedon;
732 QMap<QCheckBox*,IVP1System*>::const_iterator it =
m_d->checkbox2system.constBegin();
733 while (it !=
m_d->checkbox2system.constEnd()) {
734 sysname2turnedon.insert(it.key()->text(),it.key()->isChecked());
740 out << sysname2turnedon;
742 out << (
m_d->extradisplaywidget_splitter ?
m_d->extradisplaywidget_splitter->saveState() : QByteArray() );
744 out <<
m_d->viewer->saveState();
748 out <<
m_d->uisnapshot.checkBox_transp->isChecked();
749 bool widthfixed =
m_d->uisnapshot.radioButton_width->isChecked();
750 bool as_shown =
m_d->uisnapshot.checkBox_as_shown->isChecked();
754 out << (qint32)(widthfixed ?
m_d->uisnapshot.spinBox_width->value() :
m_d->uisnapshot.spinBox_height->value());
757 out <<
m_d->tabwidget->tabText(
m_d->tabwidget->currentIndex());
777 buffer.open(QIODevice::ReadOnly);
778 QDataStream
state(&buffer);
783 message(
"Configuration file version: " + QString::number(version) );
785 if (version<0||version>7) {
786 message(
"Warning: State data in .vp1 file is in wrong format - ignoring!");
790 QByteArray basestate;
802 state >> bgdcol_dummy;
806 QMap<QString, bool> sysname2turnedon;
807 state >> sysname2turnedon;
808 QMap<QCheckBox*,IVP1System*>::const_iterator it =
m_d->checkbox2system.constBegin();
809 while (it !=
m_d->checkbox2system.constEnd()) {
810 if (sysname2turnedon.contains(it.key()->text())) {
811 if (sysname2turnedon[it.key()->text()]!=it.key()->isChecked())
812 it.key()->setChecked(sysname2turnedon[it.key()->text()]);
814 message(
"Warning: Config data does not contain information about switched state of subsystem '"+it.key()->text()+
"'");
826 QByteArray splitstate;
828 if (
m_d->extradisplaywidget_splitter)
829 m_d->extradisplaywidget_splitter->restoreState(splitstate);
832 QByteArray ba_viewer;
834 m_d->viewer->restoreFromState(ba_viewer);
835 m_d->need_initial_viewall =
false;
838 bool aa_dummy, transp, widthfixed, as_shown;
842 m_d->uisnapshot.checkBox_transp->setChecked(transp);
843 m_d->uisnapshot.checkBox_as_shown->setChecked(as_shown);
845 m_d->uisnapshot.radioButton_width->setChecked(
true);
846 m_d->uisnapshot.radioButton_height->setChecked(
false);
848 m_d->uisnapshot.radioButton_width->setChecked(
false);
849 m_d->uisnapshot.radioButton_height->setChecked(
true);
855 m_d->uisnapshot.spinBox_width->setValue(fixval);
857 m_d->uisnapshot.spinBox_height->setValue(fixval);
862 if (
m_d->tabwidget) {
863 for (
int i = 0; i <
m_d->tabwidget->count(); ++i) {
864 if (
m_d->tabwidget->tabText(i) == tabname) {
865 m_d->tabwidget->setCurrentIndex(i);
914 QMap<QString, bool> sysname2turnedon;
916 QByteArray splitstate;
918 QByteArray ba_viewer;
920 bool transp, widthfixed, as_shown;
922 qint32
width, height;
938 state >> sysname2turnedon;
944 state >> locked_ratio;
947 state >> isUsingPresets;
963 QMap<QCheckBox*,IVP1System*>::const_iterator it =
checkbox2system.constBegin();
965 if (sysname2turnedon.contains(it.key()->text())) {
966 if (sysname2turnedon[it.key()->text()]!=it.key()->isChecked())
967 it.key()->setChecked(sysname2turnedon[it.key()->text()]);
969 channel->message(
"Warning: Config data does not contain information about switched state of subsystem '"+it.key()->text()+
"'");
980 viewer->restoreFromState(ba_viewer);
985 uisnapshot.checkBox_transp->setChecked(transp);
986 uisnapshot.checkBox_as_shown->setChecked(as_shown);
988 uisnapshot.radioButton_width->setChecked(
true);
989 uisnapshot.radioButton_height->setChecked(
false);
991 uisnapshot.radioButton_width->setChecked(
false);
992 uisnapshot.radioButton_height->setChecked(
true);
1001 uisnapshot.groupBox_imagePresets->setChecked(
true);
1003 uisnapshot.radioButton_720p->setChecked(
true);
1005 uisnapshot.radioButton_1080p->setChecked(
true);
1014 for (
int i = 0; i <
tabwidget->count(); ++i) {
static QWidget * compositionController(const QList< IVP1System * > &systemsWithControllersAllowed, QMap< IVP1System *, QWidget * > &sys2tabpage, VP1TabWidget *&tabwidget, const QList< QPair< IVP1System *, bool > > &system2switchable, QMap< QCheckBox *, IVP1System * > &checkbox2system, VP1ColorSelectButton *&colorselectbutton, QWidget *extrawidget=0, bool nobgdcolorsel=false)