33#include <Inventor/nodes/SoSphere.h>
34#include <Inventor/nodes/SoGroup.h>
35#include <Inventor/nodes/SoPerspectiveCamera.h>
36#include <Inventor/nodes/SoSeparator.h>
37#include <Inventor/Qt/widgets/SoQtPopupMenu.h>
38#include <Inventor/events/SoKeyboardEvent.h>
39#include <Inventor/events/SoMouseButtonEvent.h>
40#include <Inventor/nodes/SoEnvironment.h>
41#include <Inventor/actions/SoSearchAction.h>
42#include <Inventor/nodekits/SoBaseKit.h>
43#include <Inventor/SoSceneManager.h>
49#include <QColorDialog>
51#include <QInputDialog>
178 case VERTEX:
return "VERTEX";
179 case INDET:
return "INDET";
181 case CALO:
return "CALO";
182 case MUON:
return "MUON";
183 default:
return "Unknown(ERROR)";
197 QPushButton *
addNewButton(QString text,QString tooltip,
REGION region ,
VIEW view,QWidget * tempparent, QString iconname=
"");
303 void rotateCamera(SoCamera * cam,
const SbVec3f & aroundaxis,
const float delta);
369 const bool perspective(
theclass->currentCamIsPerspective());
372 QString n = QString(perspective?
"Perspective":
"Orthographic")+
"View"+QString::number(i++);
411 QByteArray byteArray;
412 QBuffer buffer(&byteArray);
413 buffer.open(QIODevice::WriteOnly);
414 QDataStream out(&buffer);
436 buffer.open(QIODevice::ReadOnly);
437 QDataStream state(&buffer);
443 "Attempt to depersistify stored view ignored due to bad version!");
473 SbVec3f pos = camera->position.getValue();
475 SoSearchAction action;
476 SbBool oldsearch = SoBaseKit::isSearchingChildren();
477 SoBaseKit::setSearchingChildren(TRUE);
479 action.setSearchingAll(
true);
480 action.setType(SoCamera::getClassTypeId());
481 action.setInterest(SoSearchAction::ALL);
482 action.apply(scenegraph);
484 SoBaseKit::setSearchingChildren(oldsearch);
486 SoPathList &cameras = action.getPaths();
488 for (
int i = 0, e = cameras.getLength(); i != e; ++i) {
489 auto*
tail = cameras[i]->getTail();
490 std::cerr <<
"Camera #" << i <<
" = " << (
void *)
tail <<
"(" <<
typeid(*tail).name() <<
")\n";
493 std::cerr <<
"Calculated clip-planes. Near: " << nearfar[0] <<
". Far: " << nearfar[1] <<
"\n"
494 <<
"Current camera clip-planes. Near: " << camera->nearDistance.getValue() <<
", Far: " << camera->farDistance.getValue() <<
"\n"
495 <<
"Camera ptr: " << (
void *) camera <<
"\n"
496 <<
"Camera name: " << camera->getName() <<
"\n"
497 <<
"Camera type: " <<
typeid(*camera).name() <<
"\n"
498 <<
"Camera position:(" << pos[0] <<
", " << pos[1] <<
", " << pos[2] <<
")\n"
499 <<
"Number of cameras in the scene: " << cameras.getLength() <<
"\n"
500 <<
"Focal distance: " << camera->focalDistance.getValue() << std::endl;
517 if (camera->nearDistance.getValue() != nearfar[0])
518 camera->nearDistance = nearfar[0];
519 if (camera->farDistance.getValue() != nearfar[1])
520 camera->farDistance = nearfar[1];
530 SoQtFullViewer::BuildFlag flag,
531 SoQtViewer::Type
type)
532: SoQtExaminerViewer(parent,(name?name:
"VP1ExaminerViewer"),embed,flag,
type,false),
537 QWidget * widget = buildWidget(getParentWidget());
539 rightWheelLabel->setVisible(
false);
540 setBaseWidget(widget);
541 setLeftWheelString(
"Rotz");
544 setRightWheelString(
"Zoom test");
545 leftWheel->setMinimumHeight(20);
546 rightWheel->setMinimumHeight(20);
559 QObject::connect(&(
m_d->animationSequencer),SIGNAL(clipVolumePercentOfATLAS(
double)),
m_d->customtoureditor,SLOT(setClipVolumePercentOfATLAS(
double)));
561 m_d->customtoureditor->disableObjectWhenTourNotAvailable(
m_d->customtour_execute);
562 if (
m_d->customtoureditorState!=QByteArray()) {
563 m_d->customtoureditor->setState(
m_d->customtoureditorState);
564 m_d->customtoureditorState = QByteArray();
574 VP1Msg::messageDebug(
"VP1ExaminerViewer::setStereoOffsetSlot() - offset: " + QString::number(offset));
575 SoQtExaminerViewer::setStereoOffset(offset);
578 return SoQtExaminerViewer::getStereoOffset();
582 return SoQtExaminerViewer::setStereoType(
type);
585 return SoQtExaminerViewer::getStereoType();
588 SoQtExaminerViewer::setAnaglyphStereoColorMasks(left, right);
591 SoQtExaminerViewer::getAnaglyphStereoColorMasks(left, right);
600 case VIEW_AS_IS:
return 0;
601 case VIEW_HIDDEN_LINE:
return 1;
602 case VIEW_NO_TEXTURE:
return 2;
603 case VIEW_LOW_COMPLEXITY:
return 3;
604 case VIEW_LINE:
return 4;
605 case VIEW_POINT:
return 5;
606 case VIEW_BBOX:
return 6;
607 case VIEW_LOW_RES_LINE:
return 7;
608 case VIEW_LOW_RES_POINT:
return 8;
609 case VIEW_SAME_AS_STILL:
return 9;
610 case VIEW_WIREFRAME_OVERLAY :
return 10;
620 case 0:
return SoQtViewer::VIEW_AS_IS;
621 case 1:
return SoQtViewer::VIEW_HIDDEN_LINE;
622 case 2:
return SoQtViewer::VIEW_NO_TEXTURE;
623 case 3:
return SoQtViewer::VIEW_LOW_COMPLEXITY;
624 case 4:
return SoQtViewer::VIEW_LINE;
625 case 5:
return SoQtViewer::VIEW_POINT;
626 case 6:
return SoQtViewer::VIEW_BBOX;
627 case 7:
return SoQtViewer::VIEW_LOW_RES_LINE;
628 case 8:
return SoQtViewer::VIEW_LOW_RES_POINT;
629 case 9:
return SoQtViewer::VIEW_SAME_AS_STILL;
630 case 10:
return SoQtViewer::VIEW_WIREFRAME_OVERLAY;
633 return SoQtViewer::VIEW_AS_IS;
643 QByteArray byteArray;
644 QBuffer buffer(&byteArray);
645 buffer.open(QIODevice::WriteOnly);
646 QDataStream out(&buffer);
659 if (getBufferingType()==BUFFER_SINGLE)
661 else if (getBufferingType()==BUFFER_INTERACTIVE)
668 out << isperspective;
673 const bool isdeco(isDecoration()), isheadlight(isHeadlight()),isviewing(isViewing());
677 out <<
m_d->decorationMenuRemoved;
679 +
str(isdeco)+
", "+
str(isheadlight)+
", "+
str(isviewing)+
", "+
str(
m_d->decorationMenuRemoved)+
")");
682 out <<
m_d->isantialias;
694 out << idrawstyle_still;
695 out << idrawstyle_interactive;
707 m_d->ensureMenuInit();
708 out <<
m_d->popup_tourReturnToStartAction->isChecked();
709 out <<
m_d->popup_tourStartEachEvent->isChecked();
712 if (
m_d->popup_tourSpeedVerySlow->isChecked()) ispeed = -2;
713 else if (
m_d->popup_tourSpeedSlow->isChecked()) ispeed = -1;
714 else if (
m_d->popup_tourSpeedFast->isChecked()) ispeed = 1;
715 else if (
m_d->popup_tourSpeedVeryFast->isChecked()) ispeed = 2;
718 out <<
m_d->popup_tourPartsVertex->isChecked();
719 out <<
m_d->popup_tourPartsInDet->isChecked();
720 out <<
m_d->popup_tourPartsCalo->isChecked();
721 out <<
m_d->popup_tourPartsMuon->isChecked();
724 if (
m_d->popup_tourLoopTwice->isChecked()) iloop = 2;
725 else if (
m_d->popup_tourLoopThrice->isChecked()) iloop = 3;
726 else if (
m_d->popup_tourLoopForever->isChecked()) iloop = 999;
732 out <<
m_d->resetCamera_isPerspective;
733 out <<
m_d->resetCamera_state;
739 QList<QByteArray> persistifiedViews;
741 persistifiedViews << sv.persistifiedState();
743 out << persistifiedViews;
749 out <<
m_d->ambientLightPercentage;
755 out << (
m_d->customtoureditor ?
m_d->customtoureditor->state() : QByteArray());
770 QBuffer buffer(&ba_state);
771 buffer.open(QIODevice::ReadOnly);
772 QDataStream state(&buffer);
776 if (version<0||version>6) {
777 VP1Msg::messageDebug(
"VP1ExaminerViewer Warning: Input state data is in wrong format - ignoring!");
785 if (bgdcol.isValid())
799 state >> isperspective;
804 if (getCamera()&&ba_cam!=QByteArray())
809 bool isdeco, isheadlight, isviewing, decoremoved;
810 state >> isdeco;
if (isdeco!=isDecoration()) setDecoration(isdeco);
811 state >> isheadlight;
if (isheadlight!=isHeadlight()) setHeadlight(isheadlight);
812 state >> isviewing;
if (isviewing!=isViewing())
setViewing(isviewing);
815 +
str(isdeco)+
", "+
str(isheadlight)+
", "+
str(isviewing)+
", "+
str(decoremoved)+
")");
819 SbBool smoothing;
int numPasses;
822 m_d->isantialias=smoothing;
825 state >>
m_d->isantialias;
837 int idrawstyle_still, idrawstyle_interactive;
838 state >> idrawstyle_still;
839 state >> idrawstyle_interactive;
852 m_d->ensureMenuInit();
854 state >> b;
m_d->popup_tourReturnToStartAction->setChecked(b);
855 state >> b;
m_d->popup_tourStartEachEvent->setChecked(b);
859 if (ispeed==-2)
m_d->popup_tourSpeedVerySlow->setChecked(
true);
860 else if (ispeed==-1)
m_d->popup_tourSpeedSlow->setChecked(
true);
861 else if (ispeed==1)
m_d->popup_tourSpeedFast->setChecked(
true);
862 else if (ispeed==2)
m_d->popup_tourSpeedVeryFast->setChecked(
true);
864 state >> b;
m_d->popup_tourPartsVertex->setChecked(b);
865 state >> b;
m_d->popup_tourPartsInDet->setChecked(b);
866 state >> b;
m_d->popup_tourPartsCalo->setChecked(b);
867 state >> b;
m_d->popup_tourPartsMuon->setChecked(b);
871 if (iloop==2)
m_d->popup_tourLoopTwice->setChecked(
true);
872 else if (iloop==3)
m_d->popup_tourLoopThrice->setChecked(
true);
873 else if (iloop==999)
m_d->popup_tourLoopForever->setChecked(
true);
878 state >>
m_d->resetCamera_isPerspective;
879 state >>
m_d->resetCamera_state;
880 if (
m_d->popup_resetCameraAction) {
881 bool v(
m_d->resetCamera_state!=QByteArray());
882 if (
m_d->popup_resetCameraAction->isVisible()!=v)
883 m_d->popup_resetCameraAction->setVisible(v);
887 m_d->storedViews.clear();
888 QList<QByteArray> persistifiedViews;
889 state >> persistifiedViews;
890 for(
const QByteArray& ba_pv : persistifiedViews) {
893 m_d->storedViews << sv;
895 m_d->storedViewsChanged();
899 state >>
m_d->ambientLightPercentage;
904 if (ba!=QByteArray()) {
905 if (!
m_d->customtoureditor)
906 m_d->customtoureditorState = std::move(ba);
908 m_d->customtoureditor->setState(ba);
912 m_d->updateEnvironmentNode();
913 m_d->updateAmbientLightText();
923#if SOQT_MAJOR_VERSION <= 1 && SOQT_MINOR_VERSION <= 4 && SOQT_MICRO_VERSION <= 1
928 SoQtExaminerViewer::setSceneGraph(0);
936 SoQtExaminerViewer::createViewerButtons(parent,buttonlist);
939 if (buttonlist->getLength()==7) {
941 m_d->button_interact =
static_cast<QPushButton*
>(buttonlist->get(0));
942 m_d->button_examine =
static_cast<QPushButton*
>(buttonlist->get(1));
943 m_d->button_home =
static_cast<QPushButton*
>(buttonlist->get(2));
944 m_d->button_sethome =
static_cast<QPushButton*
>(buttonlist->get(3));
945 m_d->button_viewall =
static_cast<QPushButton*
>(buttonlist->get(4));
946 m_d->button_seek =
static_cast<QPushButton*
>(buttonlist->get(5));
947 m_d->button_togglecamera =
static_cast<QPushButton*
>(buttonlist->get(6));
949 m_d->button_interact->setToolTip(
"Pick mode (ESC/M toggles). Use this in order to select objects.");
950 m_d->button_examine->setToolTip(
"Navigation mode (ESC/M toggles). Use to ROTATE (left click), ZOOM (wheel or SHIFT+CTRL+left click) or PAN (middle click or SHIFT+left click or CTRL+left click).");
951 m_d->button_home->setToolTip(
"Change view to home view");
952 m_d->button_sethome->setToolTip(
"Store current view as new home");
953 m_d->button_viewall->setToolTip(
"View all objects currently displayed (V)");
954 m_d->button_seek->setToolTip(
"Seek to point (S). Sets cameras rotation centre to the clicked point and zooms towards it.");
955 m_d->button_togglecamera->setToolTip(
"Toggle (C) camera between perspective (P) and orthographic (O) mode.");
957 m_d->button_home->setVisible(
false);
958 m_d->button_sethome->setVisible(
false);
960 VP1Msg::message(
"VP1ExaminerViewer::createViewerButtons ERROR: Did not get list of exactly 7 buttons from base.");
969 QPushButton * button =
new QPushButton(tempparent);
970 if (iconname.isEmpty()) {
971 button->setText(text);
973 button->setIcon( QIcon(iconname) );
975 button->setToolTip(tooltip);
977 button->setFocusPolicy(Qt::NoFocus);
980 QObject::connect(button,SIGNAL(clicked()),
signalcatcher,SLOT(catchSignal()));
1016 for (
int iloop = 0; iloop < nloops; ++iloop) {
1019 if (first||latestRegion!=region)
1024 latestRegion=region;
1026 firstRegion = region;
1033 if (first||latestRegion!=region)
1038 latestRegion=region;
1040 firstRegion = region;
1047 if (first||latestRegion!=region)
1052 latestRegion=region;
1054 firstRegion = region;
1061 if (first||latestRegion!=region)
1066 latestRegion=region;
1068 firstRegion = region;
1092 QWidget * tempparent =
new QWidget();
1096 tempparent->setVisible(
false);
1118 QPushButton *button =
new QPushButton(tempparent);
1119 button->setText(
"XT");
1120 button->setToolTip(
"Execute a tour of the detector (configure in context menu)");
1121 button->setFocusPolicy(Qt::NoFocus);
1123 QObject::connect(button,SIGNAL(clicked()),
signalcatcher, SLOT(catchSignal()));
1124 theclass->addAppPushButton(button);
1128 QWidget * w_spacer =
new QWidget(tempparent);
1129 QSizePolicy sp_spacer(w_spacer->sizePolicy());
1130 unsigned vertStretch = 99999;
1131 sp_spacer.setVerticalStretch(vertStretch);
1132 w_spacer->setSizePolicy(sp_spacer);
1133 theclass->addAppPushButton(w_spacer);
1135 tempparent->deleteLater();
1143 if (sender()==&(
m_d->animationSequencer)) {
1144 if (
m_d->tourLoopsForever)
1145 m_d->animationSequencer.startAnimating(
m_d->tourLoopsForeverSkipFirstFrame);
1148 QPushButton* button =
dynamic_cast<QPushButton*
>(sender());
1150 if (
m_d->detectorbuttons.find(button)!=
m_d->detectorbuttons.end())
1151 m_d->detectorZoomButtonClicked(
m_d->detectorbuttons.find(button)->second);
1152 else if (button==
m_d->takeTourButton)
1153 m_d->takeTourButtonClicked();
1156 QMenu*
menu =
dynamic_cast<QMenu*
>(sender());
1161 VP1Msg::messageDebug(
"VP1ExaminerViewer_SignalCatcher::catchSignal ERROR: Received unknown signal");
1168 if (
m_d->detectorViewButtons)
1169 m_d->takeTourButtonClicked();
1176 return m_d->popup_tourStartEachEvent ?
m_d->popup_tourStartEachEvent->isChecked() :
false;
1195 r = perspective ? 13 : 7;
1199 r = perspective ? 35 : 27;
1209 r = perspective ? 95 : 73;
1220 QWidget * w =
theclass->getGLWidget();
1222 w->setFocus(Qt::OtherFocusReason);
1236 QDir().mkpath(outdir);
1249 if (!
m_d->customtoureditor||!
m_d->customtoureditor->tourAvailable())
1255 bool jump(
m_d->action_movieenabled->isChecked());
1260 m_d->animationSequencer.sequence().clearAllFrames();
1261 m_d->customtoureditor->addTourToAnimationSequencer(
m_d->animationSequencer,jump);
1262 m_d->applyMovieSettingsToAnimationSequencer();
1264 m_d->animationSequencer.startAnimating();
1288 VP1Msg::messageVerbose(
"detectorZoomButtonClicked region = "+
toString(p.first)+
", from "+QString((std::to_string(p.second) +
" Z axis").c_str()));
1290 SoNode * rootnode =
theclass->getSceneGraph();
1292 VP1Msg::messageDebug(
"VP1ExaminerViewer::Imp::detectorZoomButtonClicked WARNING: No scenegraph set. Ignoring.");
1295 if ( ! ( rootnode->getTypeId().isDerivedFrom(SoGroup::getClassTypeId())) ) {
1296 VP1Msg::messageDebug(
"VP1ExaminerViewer::Imp::detectorZoomButtonClicked WARNING: Root node does not derive from SoGroup. Ignoring.");
1299 if (
theclass->currentCamIsPerspective()) {
1304 SoCamera * camera =
theclass->getCamera();
1306 VP1Msg::messageDebug(
"VP1ExaminerViewer::Imp::detectorZoomButtonClicked WARNING: Could not get camera. Ignoring.");
1312 SoGroup * root =
static_cast<SoGroup*
>(rootnode);
1316 theclass->currentCamIsPerspective());
1325 theclass->setLeftWheelString(
"Rotz");
1332 theclass->setLeftWheelString(
"Rotz");
1339 theclass->setLeftWheelString(
"Rotx");
1342 SbVec3f lookat(xDir,0,zDir), upvec(0,1,0);
1344 bool notifyenabled = root->enableNotify(
false);
1346 root->insertChild(regionsphere,0);
1350 camera->unrefNoDelete();
1356 root->removeChild(regionsphere);
1357 if (notifyenabled) {
1358 root->enableNotify(
true);
1362 rootnode->unrefNoDelete();
1382 if (
m_d->decorationMenuRemoved || !prefmenu)
1384 m_d->decorationMenuRemoved =
true;
1385 int id = prefmenu->getMenuItem(
"decoration");
1387 prefmenu->removeMenuItem(
id);
1397 if (evt->getTypeId().isDerivedFrom(SoKeyboardEvent::getClassTypeId())) {
1408 if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::V)) {
1412 if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::Q))
1414 if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::C)) {
1418 if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::P)) {
1423 if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::O)) {
1428 if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::M)) {
1432 if (SO_KEY_PRESS_EVENT(evt,SoKeyboardEvent::A)) {
1441 }
else if (evt->getTypeId().isDerivedFrom(SoMouseButtonEvent::getClassTypeId())) {
1444 const SoMouseButtonEvent * ev_mouse =
static_cast<const SoMouseButtonEvent*
>(evt);
1445 if ((ev_mouse->getButton() == SoMouseButtonEvent::BUTTON2)) {
1446 if (ev_mouse->getState() == SoButtonEvent::DOWN) {
1454 return SoQtExaminerViewer::processSoEvent(evt);
1468 SoQtExaminerViewer::viewAll();
1477 SoQtExaminerViewer::toggleCameraType();
1485 if (rightWheelLabel)
1486 rightWheelLabel->setUpdatesEnabled(
false);
1487 SoQtExaminerViewer::setCameraType(
type);
1488 setRightWheelString(
"Zoom");
1489 if (rightWheelLabel) {
1490 rightWheelLabel->setVisible(
true);
1491 rightWheelLabel->setUpdatesEnabled(
true);
1507 SoQtExaminerViewer::setSeekMode(enable);
1515 SoQtExaminerViewer::setViewing(enable);
1523 SoQtExaminerViewer::bottomWheelFinish();
1531 SoQtExaminerViewer::bottomWheelMotion(val);
1539 SoQtExaminerViewer::bottomWheelStart();
1546 SoQtExaminerViewer::leftWheelFinish();
1559 newval =
m_d->rotXWheelMotion(val, getLeftWheelValue());
1561 newval =
m_d->rotZWheelMotion(val, getLeftWheelValue());
1563 SoQtFullViewer::leftWheelMotion(newval);
1570 SoQtExaminerViewer::leftWheelStart();
1577 SoQtExaminerViewer::rightWheelFinish();
1584 SoQtExaminerViewer::rightWheelMotion(val);
1591 SoQtExaminerViewer::rightWheelStart();
1597 SoCamera * cam =
theclass->getCamera();
1602 rotateCamera(cam, SbVec3f(0, 0, -1), value - oldvalue);
1603 cam->unrefNoDelete();
1610 SoCamera * cam =
theclass->getCamera();
1615 rotateCamera(cam, SbVec3f(-1, 0, 0), value - oldvalue);
1616 cam->unrefNoDelete();
1622 const SbVec3f & aroundaxis,
1625 const SbVec3f DEFAULTDIRECTION(0, 0, -1);
1626 const SbRotation currentorientation = cam->orientation.getValue();
1629 currentorientation.multVec(DEFAULTDIRECTION, currentdir);
1631 const SbVec3f focalpoint = cam->position.getValue() +
1632 cam->focalDistance.getValue() * currentdir;
1635 cam->orientation = SbRotation(aroundaxis, delta) * currentorientation;
1638 cam->orientation.getValue().multVec(DEFAULTDIRECTION, newdir);
1639 cam->position = focalpoint - cam->focalDistance.getValue() * newdir;
1645 SoQtExaminerViewer::setBufferingType(bt);
1653 SoQtExaminerViewer::setAntialiasing(smoothing, numPasses);
1669 bool printWarning =
false;
1671 #ifndef BUILDVP1LIGHT
1672 env_aa = std::getenv(
"VP1_ADVANCED_ANTIALIASING");
1675 if(antialiasingIsOn){
1681 if (env_aa != NULL) {
1682 std::string env_aa_string( env_aa );
1683 if(env_aa_string ==
"1") {
1686 if ( ! std::getenv(
"VP1_ADVANCED_ANTIALIASING_PRINTMSG")) {
1687 VP1Msg::messageWarningRed(
"You switched ON advanced anti-aliasing. That's very good, but please notice that this method DOES NOT WORK on LXPLUS machines, currently, because of their old graphics drivers! If you are on LXPLUS, this will likely freeze VP1... If that's the case, please restart VP1 without the '-advanced-aa' flag.");
1689 ::setenv(
"VP1_ADVANCED_ANTIALIASING_PRINTMSG",
"1", 1);
1695 VP1Msg::message(
"Sep 2017: AA is now done using a new technique so please let hn-atlas-vp1-help@cern.ch know of any problems.");
1698 if (getGLRenderAction()->isSmoothing() != smoothing)
1699 getGLRenderAction()->setSmoothing(smoothing);
1702 #if SOQT_MAJOR_VERSION > 1 || (SOQT_MAJOR_VERSION == 1 && SOQT_MINOR_VERSION >= 5)
1703 if (getSampleBuffers() != buffers)
1704 setSampleBuffers(buffers);
1707 VP1Msg::message(
"Multisampling is not supported by SoQT < 1.5, this anti-aliasing mode is disabled");
1712 getGLRenderAction()->setSmoothing(smoothing);
1713 setSampleBuffers(0);
1717 printWarning =
true;
1721 printWarning =
true;
1725 VP1Msg::messageWarningRed(
"Anti-aliasing is using low-quality mode only, because of problems with the graphic drivers installed on LXPLUS machines. If you are not running VP1 on LXPLUS machine (for example, if you are running it on a custom SLC6 machine), you can start VP1 again using the command-line flag '-advanced-aa'.");
1728 m_d->isantialias=smoothing;
1734 SoQtExaminerViewer::setTransparencyType(t);
1740 SoQtExaminerViewer::setDrawStyle(t,s);
1746 return m_d->isantialias;
1757 std::cout <<
"antiAliasing set." << std::endl;
1764 if (
m_d->resetCamera_state==QByteArray())
1770 if (getCamera()&&
m_d->resetCamera_state!=QByteArray())
1778 return getCameraType() == SoPerspectiveCamera::getClassTypeId();
1784 SoCamera * cam(getCamera());
1790 int width,
int height,
bool transp )
1792 SoCamera * cam = getCamera();
1795 bool notifyenabled = cam->enableNotify(
false);
1799 if (currentPersp!=camStateIsPerspective)
1803 if (currentPersp!=camStateIsPerspective)
1807 if (notifyenabled) {
1808 cam->enableNotify(
true);
1817 if (
m_d->resetCamera_state!=QByteArray())
1823 if (
m_d->popup_resetCameraAction&&!
m_d->popup_resetCameraAction->isVisible())
1824 m_d->popup_resetCameraAction->setVisible(
true);
1838 action_movieheight->setText(
"Change output &height [current: "+QString::number(height)+
"]");
1839 action_moviefps->setText(
"Change output &FPS [current: "+QString::number(fps)+
"]");
1855 QWidget * w =
theclass->getWidget();
1866 QMenu * tourmenu =
popup_menu->addMenu(
"&Tour");
1872 QMenu * tourspeedmenu = tourmenu->addMenu(
"&Speed");
1873 QMenu * tourpartsmenu = tourmenu->addMenu(
"&Parts");
1874 QMenu * tourloopmenu = tourmenu->addMenu(
"&Looping");
1888 QActionGroup * tour_speed_group =
new QActionGroup(tourspeedmenu);
1917 QActionGroup * tour_loop_group =
new QActionGroup(tourloopmenu);
1926 QMenu * advancedmenu =
popup_menu->addMenu(
"&More");
1938 QMenu * viewsmenu = advancedmenu->addMenu(
"Stored &views");
1952 QMenu * customtourmenu = advancedmenu->addMenu(
"Custom &tour");
1958 QMenu * moviesmenu = advancedmenu->addMenu(
"&Movie settings");
1959 action_movieenabled = moviesmenu->addAction(
"&Enable movie output when executing tours (one image file per frame)");
1970 action_movieoutdir->setData(username.isEmpty() ?
"/tmp/vp1frames" :
"/tmp/"+username+
"/vp1frames");
1983 QMenu * drawstylemenu = advancedmenu->addMenu(
"&Draw styles");
1985 QMenu * drawstyle_still_menu = drawstylemenu->addMenu(
"&Still draw style");
1986 QMenu * drawstyle_interactive_menu = drawstylemenu->addMenu(
"&Interactive draw style");
1987 QMenu * drawstyle_transptype_menu = drawstylemenu->addMenu(
"&Transparency Type");
1990 QActionGroup * ds_still_group =
new QActionGroup(drawstyle_still_menu);
1991 QActionGroup * ds_interactive_group =
new QActionGroup(drawstyle_interactive_menu);
1995 if (ds!=SoQtViewer::VIEW_SAME_AS_STILL) {
1997 QAction * act = drawstyle_still_menu->addAction(pretty);
2000 ds_still_group->addAction(act);
2001 act->setCheckable(
true);
2003 if (ds!=SoQtViewer::VIEW_AS_IS) {
2005 QAction * act = drawstyle_interactive_menu->addAction(pretty);
2008 ds_interactive_group->addAction(act);
2009 act->setCheckable(
true);
2014 QActionGroup * transptype_group =
new QActionGroup(drawstyle_transptype_menu);
2019 transptype_group->addAction(act);
2020 act->setCheckable(
true);
2025 QMenu * stereoviewmenu_main = advancedmenu->addMenu(
"&Stereographic view");
2030 SoCamera *camera =
theclass->getCamera();
2031 float default_focal_camera = camera->focalDistance.getValue();
2033 popup_focal_value_action->setText(
"Change camera FOCAL LENGTH [current: "+QString::number(default_focal_camera)+
"]");
2163 act->setIcon(sv.icon());
2165 act->setEnabled(
false);
2167 act->setData(sv.name());
2180 act->setIcon(sv.icon());
2182 act->setEnabled(
false);
2184 act->setData(sv.name());
2195 act->setIcon(sv.icon());
2196 act->setData(sv.name());
2206 act->setIcon(sv.icon());
2207 act->setData(sv.name());
2228 if (act->data().toInt() == idrawstyle_still) {
2229 act->setChecked(
true);
2236 if (act->data().toInt() == idrawstyle_interactive) {
2237 act->setChecked(
true);
2244 if (act->data().toInt() == itransptype) {
2245 act->setChecked(
true);
2263 QWidget * w = getWidget();
2267 if(filename.isEmpty()) {
2270 filename = QFileDialog::getSaveFileName(w,
"Select output file",
2272 "Inventor files (*.iv)",0,QFileDialog::DontResolveSymlinks);
2273 if(filename.isEmpty())
2275 if (!filename.endsWith(
".iv"))
2277 m_d->lastDumpFile=filename;
2280 SoGroup * standardisedRoot(0);
2281 if ( rootnode->getTypeId().isDerivedFrom(SoGroup::getClassTypeId()))
2298 QWidget * w = getWidget();
2302 if(filename.isEmpty()) {
2305 filename = QFileDialog::getSaveFileName(w,
"Select output file",
2307 "VRML2.0/X3D files (*.wrl)",0,QFileDialog::DontResolveSymlinks);
2308 if(filename.isEmpty())
2310 if (!filename.endsWith(
".wrl"))
2312 m_d->lastDumpFile=filename;
2315 SoGroup * standardisedRoot(0);
2316 if ( rootnode->getTypeId().isDerivedFrom(SoGroup::getClassTypeId()))
2322 VP1Msg::messageDebug(
"VP1ExaminerViewer: Error: Problems dumping scene to VRML file "+filename);
2329 QWidget * w = getWidget();
2332 if(filename.isEmpty()) {
2335 filename = QFileDialog::getSaveFileName(w,
"Select output file",
2337 "Scalable Vector Graphics files (*.svg)",0,QFileDialog::DontResolveSymlinks);
2338 if(filename.isEmpty())
2340 if (!filename.endsWith(
".svg"))
2342 m_d->lastSVGFile=filename;
2352 SoNode *rootA =
static_cast<SoNode*
>(SoQtRenderArea::getSceneGraph());
2353 if (!rootA )
return;
2354 SoNode *cam =
static_cast<SoNode*
>(this->getCamera());
2355 if ( ! cam )
return;
2359 assert(
search.getPath());
2360 SoNode* hiddenRoot =
2361 static_cast<SoFullPath *
>(
search.getPath())->getNodeFromTail(1);
2363 const SbViewportRegion& vpRegion = getViewportRegion();
2365 action->setFileName(filename.toStdString().c_str());
2367 action->enableFileWriting();
2368 action->apply(hiddenRoot);
2369 action->disableFileWriting();
2377 QWidget * w = getWidget();
2380 if(filename.isEmpty()) {
2383 filename = QFileDialog::getSaveFileName(w,
"Select output file",
2385 "Encapsulated Postscript files (*.eps)",0,QFileDialog::DontResolveSymlinks);
2386 if(filename.isEmpty())
2388 if (!filename.endsWith(
".eps"))
2390 m_d->lastEPSFile=filename;
2398 if (FILE *output = fopen (filename.toStdString().c_str(),
"w"))
2403 buffsize += 1024*1024;
2411 GL_RGBA, 0, NULL,0, 0, 0,
2412 buffsize, output, NULL);
2425 a = std::max(0,std::min(100,
a));
2426 if (
m_d->ambientLightPercentage==
a)
2428 m_d->ambientLightPercentage =
a;
2429 m_d->updateAmbientLightText();
2430 m_d->updateEnvironmentNode();
2436 return m_d->ambientLightPercentage;
2443 if (!
m_d->ensureMenuInit())
2445 m_d->updatePopupMenuStates();
2448 QAction * selAct =
m_d->popup_menu->exec(QCursor::pos());
2455 if ( selAct ==
m_d->popup_bgdColAction ) {
2460 QColor col = QColorDialog::getColor(oldcol, getWidget());
2465 if ( selAct ==
m_d->popup_ambientLightAction ) {
2469 int newamb = QInputDialog::getInt(getWidget(),
"Change ambient light",
2470 "New ambient light percentage:",
2476 if ( selAct ==
m_d->popup_headLightAction ) {
2478 setHeadlight(
m_d->popup_headLightAction->isChecked());
2481 if ( selAct ==
m_d->popup_hidedecorationsaction ) {
2483 setDecoration(!
m_d->popup_hidedecorationsaction->isChecked());
2486 if ( selAct ==
m_d->popup_antiAliasAction ) {
2493 if ( selAct ==
m_d->popup_dumpSceneAction ) {
2498 if ( selAct ==
m_d->popup_dumpSceneVRMLAction ) {
2504 if ( selAct ==
m_d->popup_toSVGAction ) {
2510 if ( selAct ==
m_d->popup_toEPSAction ) {
2516 if ( selAct ==
m_d->popup_resetCameraAction ) {
2521 if (
m_d->popup_drawstyle_still_actions.contains(selAct)) {
2526 if (ds!=getDrawStyle(STILL))
2530 if (
m_d->popup_drawstyle_interactive_actions.contains(selAct)) {
2535 if (ds!=getDrawStyle(INTERACTIVE))
2539 if (
m_d->popup_transptype_actions.contains(selAct)) {
2548 if (
m_d->storeViewActions.contains(selAct)) {
2549 QString name = selAct->data().toString();
2559 bool replaced(
false);
2561 if (oldsv.
name()==name) {
2562 m_d->storedViews.replace(i,sv);
2569 m_d->storedViews << sv;
2570 m_d->storedViewsChanged();
2574 if (
m_d->zoomToViewActions.contains(selAct)) {
2575 QString name = selAct->data().toString();
2577 SoCamera * camera = getCamera();
2580 if (sv.name()==name) {
2589 " to stored view, but can't get root and camera pointers");
2596 if (
m_d->restoreViewActions.contains(selAct)) {
2597 QString name = selAct->data().toString();
2599 SoCamera * camera = getCamera();
2602 if (sv.name()==name) {
2603 if (!
m_d->fitsCurrentCamType(sv))
2607 QByteArray ba = sv.camState();
2614 " to stored view, but can't get root and camera pointers");
2620 if (
m_d->deleteViewActions.contains(selAct)) {
2621 QString name = selAct->data().toString();
2624 if (sv.name()==name) {
2625 m_d->storedViews.removeAt(i);
2630 m_d->storedViewsChanged();
2634 if (selAct==
m_d->customtour_launcheditor) {
2636 if (!
m_d->customtoureditor) {
2638 QObject::connect(&(
m_d->animationSequencer),SIGNAL(clipVolumePercentOfATLAS(
double)),
m_d->customtoureditor,SLOT(setClipVolumePercentOfATLAS(
double)));
2640 m_d->customtoureditor->disableObjectWhenTourNotAvailable(
m_d->customtour_execute);
2641 if (
m_d->customtoureditorState!=QByteArray()) {
2642 m_d->customtoureditor->setState(
m_d->customtoureditorState);
2643 m_d->customtoureditorState = QByteArray();
2646 m_d->customtoureditor->show();
2651 if (selAct==
m_d->customtour_execute) {
2657 if (selAct==
m_d->action_movieenabled) {
2659 m_d->updateMovieMenuVisuals();
2662 if (selAct==
m_d->action_moviewidth) {
2663 int old =
m_d->action_moviewidth->data().toInt();
2666 int newwidth = QInputDialog::getInt(getWidget(),
"Change movie width",
2667 "New movie width:", old,1,4000,1,&ok);
2668 if (ok&&old!=newwidth) {
2670 m_d->action_moviewidth->setData(newwidth);
2671 m_d->updateMovieMenuVisuals();
2675 if (selAct==
m_d->action_movieheight) {
2676 int old =
m_d->action_movieheight->data().toInt();
2679 int newheight = QInputDialog::getInt(getWidget(),
"Change movie height",
2680 "New movie height:", old,1,4000,1,&ok);
2681 if (ok&&old!=newheight) {
2683 m_d->action_movieheight->setData(newheight);
2684 m_d->updateMovieMenuVisuals();
2688 if (selAct==
m_d->action_moviefps) {
2689 int old =
m_d->action_moviefps->data().toInt();
2692 int newfps = QInputDialog::getInt(getWidget(),
"Change movie FPS",
2693 "New movie frames per second:", old,1,4000,1,&ok);
2694 if (ok&&old!=newfps) {
2696 m_d->action_moviefps->setData(newfps);
2697 m_d->updateMovieMenuVisuals();
2701 if (selAct==
m_d->action_movieoutdir) {
2702 QString old =
m_d->action_movieoutdir->data().toString();
2703 QString newoutdir = QFileDialog::getExistingDirectory ( getWidget(),
"Select movie frame output directory",old);
2704 if (!newoutdir.isEmpty()&&old!=newoutdir) {
2706 m_d->action_movieoutdir->setData(newoutdir);
2707 m_d->updateMovieMenuVisuals();
2711 if (selAct==
m_d->action_moviefadetocurrentview) {
2716 if (selAct==
m_d->popup_tourReturnToStartAction
2717 ||selAct==
m_d->popup_tourStartEachEvent
2718 ||selAct==
m_d->popup_tourSpeedVerySlow
2719 ||selAct==
m_d->popup_tourSpeedSlow
2720 ||selAct==
m_d->popup_tourSpeedMedium
2721 ||selAct==
m_d->popup_tourSpeedFast
2722 ||selAct==
m_d->popup_tourSpeedVeryFast
2723 ||selAct==
m_d->popup_tourPartsVertex
2724 ||selAct==
m_d->popup_tourPartsInDet
2725 ||selAct==
m_d->popup_tourPartsCalo
2726 ||selAct==
m_d->popup_tourPartsMuon
2727 ||selAct==
m_d->popup_tourLoopOnce
2728 ||selAct==
m_d->popup_tourLoopTwice
2729 ||selAct==
m_d->popup_tourLoopThrice
2730 ||selAct==
m_d->popup_tourLoopForever) {
2734 if (selAct==
m_d->popup_tourExecute) {
2744 if (selAct==
m_d->stereo_launcheditor) {
2746 if (!
m_d->customstereoeditor) {
2754 m_d->customstereoeditor->show();
2796 if (selAct==
m_d->popup_focal_value_action) {
2800 SoPerspectiveCamera * camera =
dynamic_cast<SoPerspectiveCamera*
>(getCamera());
2801 if (! (camera==NULL) ) {
2802 float current_value = camera->focalDistance.getValue();
2803 int newfocal = QInputDialog::getDouble(getWidget(),
2804 "Change focal length",
2805 "New focal length: ",
2811 if (ok && current_value != newfocal) {
2813 m_d->popup_focal_value_action->setData(newfocal);
2815 camera->focalDistance.setValue(newfocal);
2817 m_d->popup_focal_value_action->setText(
"Change FOCAL LENGTH value [current: "+QString::number(newfocal)+
"]");
2949 if (!
m_d->customstereoeditor) {
2957 m_d->customstereoeditor->show();
2967 QList<SoQtViewer::StereoType> l;
2970 l << SoQtViewer::STEREO_NONE;
2971 l<< SoQtViewer::STEREO_ANAGLYPH;
2976 l << SoQtViewer::STEREO_QUADBUFFER;
2978 l << SoQtViewer::STEREO_INTERLEAVED_ROWS;
2980 l << SoQtViewer::STEREO_INTERLEAVED_COLUMNS;
2989 case SoQtViewer::STEREO_NONE:
return "NO Stereo";
2990 case SoQtViewer::STEREO_ANAGLYPH:
return "Anaglyph Stereo (Red-Cyan 3D mode)";
2991 case SoQtViewer::STEREO_QUADBUFFER:
return "QUADBUFFER";
2992 case SoQtViewer::STEREO_INTERLEAVED_ROWS:
return "INTERLEAVED_ROWS";
2993 case SoQtViewer::STEREO_INTERLEAVED_COLUMNS:
return "INTERLEAVED_COLUMNS";
2995 VP1Msg::messageDebug(
"VP1ExaminerViewer::Imp::viewerStereoType2PrettyString ERROR: Unknown viewer draw style");
3003 case SoQtViewer::STEREO_NONE:
return 0;
3004 case SoQtViewer::STEREO_ANAGLYPH:
return 1;
3005 case SoQtViewer::STEREO_QUADBUFFER:
return 2;
3006 case SoQtViewer::STEREO_INTERLEAVED_ROWS:
return 3;
3007 case SoQtViewer::STEREO_INTERLEAVED_COLUMNS:
return 4;
3009 VP1Msg::messageDebug(
"VP1ExaminerViewer::Imp::viewerStereoTypeToInt ERROR: Unknown viewer draw style");
3018 case 0:
return SoQtViewer::STEREO_NONE;
3019 case 1:
return SoQtViewer::STEREO_ANAGLYPH;
3020 case 2:
return SoQtViewer::STEREO_QUADBUFFER;
3021 case 3:
return SoQtViewer::STEREO_INTERLEAVED_ROWS;
3022 case 4:
return SoQtViewer::STEREO_INTERLEAVED_COLUMNS;
3025 return SoQtViewer::STEREO_NONE;
3037 QList<SoQtViewer::DrawStyle> l;
3038 l << SoQtViewer::VIEW_SAME_AS_STILL
3039 << SoQtViewer::VIEW_AS_IS
3040 << SoQtViewer::VIEW_HIDDEN_LINE
3041 << SoQtViewer::VIEW_NO_TEXTURE
3042 << SoQtViewer::VIEW_LOW_COMPLEXITY
3043 << SoQtViewer::VIEW_LINE
3044 << SoQtViewer::VIEW_POINT
3045 << SoQtViewer::VIEW_BBOX
3046 << SoQtViewer::VIEW_LOW_RES_LINE
3047 << SoQtViewer::VIEW_LOW_RES_POINT
3048 << SoQtViewer::VIEW_WIREFRAME_OVERLAY;
3056 case SoQtViewer::VIEW_AS_IS:
return 0;
3057 case SoQtViewer::VIEW_HIDDEN_LINE:
return 1;
3058 case SoQtViewer::VIEW_NO_TEXTURE:
return 2;
3059 case SoQtViewer::VIEW_LOW_COMPLEXITY:
return 3;
3060 case SoQtViewer::VIEW_LINE:
return 4;
3061 case SoQtViewer::VIEW_POINT:
return 5;
3062 case SoQtViewer::VIEW_BBOX:
return 6;
3063 case SoQtViewer::VIEW_LOW_RES_LINE:
return 7;
3064 case SoQtViewer::VIEW_LOW_RES_POINT:
return 8;
3065 case SoQtViewer::VIEW_SAME_AS_STILL:
return 9;
3066 case SoQtViewer::VIEW_WIREFRAME_OVERLAY:
return 10;
3068 VP1Msg::messageDebug(
"VP1ExaminerViewer::Imp::viewerDrawStyleToInt ERROR: Unknown viewer draw style");
3077 case 0:
return SoQtViewer::VIEW_AS_IS;
3078 case 1:
return SoQtViewer::VIEW_HIDDEN_LINE;
3079 case 2:
return SoQtViewer::VIEW_NO_TEXTURE;
3080 case 3:
return SoQtViewer::VIEW_LOW_COMPLEXITY;
3081 case 4:
return SoQtViewer::VIEW_LINE;
3082 case 5:
return SoQtViewer::VIEW_POINT;
3083 case 6:
return SoQtViewer::VIEW_BBOX;
3084 case 7:
return SoQtViewer::VIEW_LOW_RES_LINE;
3085 case 8:
return SoQtViewer::VIEW_LOW_RES_POINT;
3086 case 9:
return SoQtViewer::VIEW_SAME_AS_STILL;
3087 case 10:
return SoQtViewer::VIEW_WIREFRAME_OVERLAY;
3090 return SoQtViewer::VIEW_AS_IS;
3098 case SoQtViewer::VIEW_AS_IS:
return "As is";
3099 case SoQtViewer::VIEW_HIDDEN_LINE:
return "Hidden line";
3100 case SoQtViewer::VIEW_NO_TEXTURE:
return "No texture";
3101 case SoQtViewer::VIEW_LOW_COMPLEXITY:
return "Low complexity";
3102 case SoQtViewer::VIEW_LINE:
return "Line";
3103 case SoQtViewer::VIEW_POINT:
return "Point";
3104 case SoQtViewer::VIEW_BBOX:
return "Bounding boxes";
3105 case SoQtViewer::VIEW_LOW_RES_LINE:
return "Low resolution lines";
3106 case SoQtViewer::VIEW_LOW_RES_POINT:
return "Low resolution points";
3107 case SoQtViewer::VIEW_SAME_AS_STILL:
return "Same as still";
3108 case SoQtViewer::VIEW_WIREFRAME_OVERLAY:
return "Wireframe overlay";
3110 VP1Msg::messageDebug(
"VP1ExaminerViewer::Imp::viewerDrawStyleToInt ERROR: Unknown viewer draw style");
3120 if (!
m_d->actualSceneGraph) {
3121 m_d->actualSceneGraph =
new SoGroup;
3122 m_d->actualSceneGraph->ref();
3123 if (!
m_d->environmentNode) {
3124 m_d->environmentNode =
new SoEnvironment;
3125 m_d->environmentNode->ref();
3127 m_d->updateEnvironmentNode();
3128 m_d->actualSceneGraph->addChild(
m_d->environmentNode);
3129 SoQtExaminerViewer::setSceneGraph(
m_d->actualSceneGraph);
3131 while(
m_d->actualSceneGraph->getNumChildren()>1)
3132 m_d->actualSceneGraph->removeChild(1);
3135 m_d->actualSceneGraph->addChild(n);
3141 return (
m_d->actualSceneGraph &&
m_d->actualSceneGraph->getNumChildren()>1) ?
m_d->actualSceneGraph->getChild(1) : 0;
3147 if (!
m_d->ensureMenuInit())
3149 QString lastfile, nextfile;
3150 QString outdir =
m_d->action_movieoutdir->data().toString();
3152 m_d->movieFrameFileNamePrefix,
3153 lastfile, nextfile );
3155 QImage img0(lastfile);
3157 if (lastfile.isEmpty()||img0.isNull()) {
3161 if (nextfile.isEmpty())
3168 int nTransitionFrames = std::max(1,
static_cast<int>(
m_d->action_moviefps->data().toInt()*time_seconds+0.5));
3171 for (
int i = 0; i < nTransitionFrames; ++i) {
3172 double fadefact((i+1.0)/(nTransitionFrames+1.0));
3173 QString dummy, filename;
3179 if (!img.save(filename))
3184 QString dummy, filename;
3186 if (!img1.save(filename))
char data[hepevt_bytes_allocation_ATLAS]
void debugCameraClipPlanes(void *data, const SbVec2f &nearfar)
tune the camera clipping planes
SbVec2f fixedDistanceClipPlanesCB(void *data, const SbVec2f &nearfar)
set the clipping strategy and fix the clipping
SoGL2PSAction inherits Inventor/SoGLRenderAction.
static void initClass()
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!//
static VP1CameraHelper * animatedZoomToSubTree(SoCamera *camera, SoGroup *sceneroot, SoNode *subtreeroot, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, double slack=1.0, const SbVec3f &lookat=SbVec3f(999, 999, 999), const SbVec3f &upvec=SbVec3f(999, 999, 999), bool varySpeed=true, bool forceCircular=false)
static void getLastAndNextFrameFileNames(const QString &outputdir, const QString &prefix, QString &lastOfExistingFiles, QString &nextAvailableFile)
static VP1CameraHelper * animatedZoomToCameraState(SoCamera *camera, SoGroup *sceneroot, const QByteArray &camstate, double duration_in_secs=1.0, double clipVolPercent=100.0, double lastClipVolPercent=100.0, bool varySpeed=true, bool forceCircular=false)
static void setCustomTourEditor(VP1CustomTourEditor *editor)
bool camStateIsPerspective() const
const QByteArray & camState() const
StoredView(const QByteArray &camState, bool camPerspective, QPixmap snapShot, const QString &name)
QByteArray persistifiedState() const
const QString & name() const
QAction * customtour_launcheditor
QPushButton * button_seek
QMenu * viewmenu_storecurrentview
QPushButton * addNewButton(QString text, QString tooltip, REGION region, VIEW view, QWidget *tempparent, QString iconname="")
QAction * popup_resetCameraAction
float stereo_offset_value
VP1CustomTourEditor * customtoureditor
Imp(VP1ExaminerViewer *tc, bool dvb)
QAction * popup_tourPartsMuon
QAction * popup_tourSpeedSlow
static QList< SoQtViewer::StereoType > getAllStereoViewTypes()
std::map< QPushButton *, std::pair< REGION, VIEW > > detectorbuttons
QString toString(const REGION &r)
QAction * popup_hidedecorationsaction
QList< QAction * > restoreViewActions
SoEnvironment * environmentNode
bool decorationMenuRemoved
QAction * popup_tourSpeedVerySlow
QAction * popup_tourPartsVertex
QAction * customtour_execute
QPushButton * button_home
bool tourLoopsForeverSkipFirstFrame
QAction * action_movieenabled
QList< QAction * > deleteViewActions
bool updateAnimationSequence()
Imp & operator=(const Imp &)=delete
void updatePopupMenuStates()
QAction * popup_focalLengthAction
SoSphere * getRegionSphere(REGION, bool perspective)
QAction * popup_tourLoopTwice
SoGroup * actualSceneGraph
static QString viewerDrawStyle2PrettyString(SoQtViewer::DrawStyle)
float rotXWheelMotion(float value, float oldvalue)
static QString viewerStereoType2PrettyString(SoQtViewer::StereoType)
QAction * popup_focal_value_action
QAction * popup_bgdColAction
QAction * popup_ambientLightAction
float rotZWheelMotion(float value, float oldvalue)
QPushButton * button_viewall
QList< QAction * > storeViewActions
QAction * popup_tourSpeedMedium
QAction * popup_toSVGAction
QPushButton * button_interact
QAction * popup_tourStartEachEvent
VP1ExaminerViewer * theclass
void storedViewsChanged()
static int viewerDrawStyleToInt(SoQtViewer::DrawStyle)
int ambientLightPercentage
QList< StoredView > storedViews
QByteArray customtoureditorState
QAction * popup_tourExecute
QString movieFrameFileNamePrefix
static SoQtViewer::DrawStyle intToViewerDrawStyle(int)
void updateEnvironmentNode()
VP1ExaminerViewer_SignalCatcher * signalcatcher
QAction * popup_toEPSAction
void updateMovieMenuVisuals()
QAction * popup_antiAliasAction
VP1CustomStereoEditor * customstereoeditor
QAction * popup_dumpSceneVRMLAction
bool fitsCurrentCamType(const StoredView &sv)
QList< QAction * > zoomToViewActions
QString firstAvailableStoredViewName()
QAction * popup_tourPartsCalo
void detectorZoomButtonClicked(std::pair< REGION, VIEW >)
QPushButton * takeTourButton
void rotateCamera(SoCamera *cam, const SbVec3f &aroundaxis, const float delta)
static SoQtViewer::StereoType intToViewerStereoType(int)
ROTATIONMODE rotationMode
Which mode is left wheel in?
QPushButton * button_examine
QList< QAction * > popup_drawstyle_still_actions
QAction * action_movieheight
AnimationSequencer animationSequencer
static int viewerStereoTypeToInt(SoQtViewer::StereoType)
static int drawStyleToInt(SoQtViewer::DrawStyle)
QAction * popup_tourLoopOnce
QMenu * viewmenu_restoreview
QAction * action_moviewidth
QAction * popup_tourSpeedFast
QAction * stereo_launcheditor
bool resetCamera_isPerspective
QMenu * viewmenu_zoomtoview
static QList< SoQtViewer::DrawStyle > getAllViewerDrawStyles()
QAction * popup_headLightAction
void updateAmbientLightText()
QAction * action_moviefps
QMenu * viewmenu_deleteview
QPushButton * button_togglecamera
QAction * popup_tourLoopThrice
void takeTourButtonClicked()
QAction * popup_tourPartsInDet
QByteArray resetCamera_state
void applyMovieSettingsToAnimationSequencer()
QAction * popup_dumpSceneAction
QList< QAction * > popup_drawstyle_interactive_actions
QAction * action_moviefadetocurrentview
QList< QAction * > popup_transptype_actions
QAction * popup_tourSpeedVeryFast
QPushButton * button_sethome
QAction * popup_tourLoopForever
QAction * popup_tourReturnToStartAction
static SoQtViewer::DrawStyle intToDrawStyle(int)
QAction * action_movieoutdir
void aboutToShowMenu(QMenu *)
VP1ExaminerViewer::Imp * m_d
void storeCameraParametersForReset()
virtual void leftWheelFinish()
void fadeLastRecordedFrameToCurrent(double time_seconds)
QByteArray currentCameraState() const
void dumpSceneToVRMLFile(QString filename="")
virtual void setAntialiasing(SbBool smoothing, int numPasses)
virtual void bottomWheelStart()
VP1ExaminerViewer(QWidget *parent=0, bool detectorViewButtons=true, const char *name=0, SbBool embed=TRUE, SoQtFullViewer::BuildFlag flag=BUILD_ALL, SoQtViewer::Type type=BROWSER)
SoQtViewer::StereoType getStereoTypeSlot(void) const
virtual void setSceneGraph(SoNode *)
virtual void createViewerButtons(QWidget *parent, SbPList *buttonlist)
void setStereoOffsetSlot(float offset)
virtual ~VP1ExaminerViewer()
virtual QByteArray saveState()
float stereo_parallax_camera
virtual void setBufferingType(SoQtViewer::BufferType)
virtual SbBool processSoEvent(const SoEvent *const event)
virtual void removeDecorationMenuOption()
virtual void setDrawStyle(SoQtViewer::DrawType, SoQtViewer::DrawStyle)
void setAnaglyphStereoColorMasksSlot(const SbBool left[3], const SbBool right[3])
virtual void toggleCameraType()
void produceSVGImage(QString filename="")
virtual void buildPopupMenu()
virtual void rightWheelFinish()
float stereo_offset_viewer
QPixmap getSnapShotFromCamState(bool camStateIsPerspective, QByteArray camState, int width, int height, bool transp=false)
SbBool setStereoTypeSlot(SoQtViewer::StereoType type)
float getStereoOffsetSlot()
virtual void setViewing(SbBool enable)
void getAnaglyphStereoColorMasksSlot(SbBool left[3], SbBool right[3])
virtual void rightWheelStart()
void launchStereoEditor()
virtual void setTransparencyType(SoGLRenderAction::TransparencyType)
void setAmbientLight(int)
virtual void showPopupMenu()
bool currentCamIsPerspective() const
friend class VP1ExaminerViewer_SignalCatcher
virtual void restoreFromState(QByteArray)
virtual void leftWheelMotion(float val)
virtual void leftWheelStart()
virtual void setSeekMode(SbBool enable)
void dumpSceneToFile(QString filename="")
virtual void bottomWheelMotion(float val)
virtual void rightWheelMotion(float val)
bool startTourEachEvent() const
virtual void bottomWheelFinish()
float stereo_offset_camera
virtual void setCameraType(SoType type)
virtual SoNode * getSceneGraph()
void produceEPSImage(QString filename="")
static SoGroup * convertToStandardScene(SoGroup *)
static void messageVerbose(const QString &)
static void messageDebug(const QString &)
static void message(const QString &, IVP1System *sys=0)
static void messageWarningRed(const QString &str, IVP1System *sys=0)
static bool writeGraphToVRMLFile(SoNode *root, const QString &filename)
static QList< SoGLRenderAction::TransparencyType > getAllTransparencyTypes()
static QPixmap renderToPixmap(VP1ExaminerViewer *ra, int pixels_x, int pixels_y, bool transparent_background=false, double actualRenderedSizeFact=1.0)
static SoGLRenderAction::TransparencyType intToTransparencyType(int)
static QColor sbcol2qcol(const SbColor &)
static QByteArray serializeSoCameraParameters(const SoCamera &)
static bool writeGraphToFile(SoNode *root, const QString &filename)
static SbColor qcol2sbcol(const QColor &)
static QString transparencyType2PrettyString(SoGLRenderAction::TransparencyType)
static bool deserializeSoCameraParameters(QByteArray &, SoCamera &)
static QImage renderToImage(VP1ExaminerViewer *ra, int pixels_x, int pixels_y, bool transparent_background=false, double actualRenderedSizeFact=1.0)
static int transparencyTypeToInt(SoGLRenderAction::TransparencyType)
static QImage fadeImage(QImage img0, QImage img1, double fadefact)
static QString environmentVariableValue(const QString &name)
static bool expertSettingIsOn(const QString &type, const QString &name)
static QString defaultFileSelectDirectory()
static QString str(const QString &s)
std::string tail(std::string s, const std::string &pattern)
tail of a string
GL2PSDLL_API GLint gl2psBeginPage(const char *title, const char *producer, GLint viewport[4], GLint format, GLint sort, GLint options, GLint colormode, GLint colorsize, GL2PSrgba *colormap, GLint nr, GLint ng, GLint nb, GLint buffersize, FILE *stream, const char *filename)
GL2PSDLL_API GLint gl2psEndPage(void)
#define GL2PS_OCCLUSION_CULL
#define GL2PS_DRAW_BACKGROUND
#define GL2PS_USE_CURRENT_VIEWPORT
void search(TDirectory *td, const std::string &s, std::string cwd, node *n)
recursive directory search for TH1 and TH2 and TProfiles