2441{
2443 if (!
m_d->ensureMenuInit())
2444 return;
2445 m_d->updatePopupMenuStates();
2446
2447
2448 QAction * selAct =
m_d->popup_menu->exec(QCursor::pos());
2449
2450
2451 if (!selAct) {
2453 return;
2454 }
2455 if ( selAct ==
m_d->popup_bgdColAction ) {
2457 if (isAnimating())
2458 stopAnimating();
2460 QColor col = QColorDialog::getColor(oldcol, getWidget());
2461 if (col!=oldcol)
2463 return;
2464 }
2465 if ( selAct ==
m_d->popup_ambientLightAction ) {
2467 bool ok;
2468
2469 int newamb = QInputDialog::getInt(getWidget(), "Change ambient light",
2470 "New ambient light percentage:",
2472 if (ok)
2474 return;
2475 }
2476 if ( selAct ==
m_d->popup_headLightAction ) {
2478 setHeadlight(
m_d->popup_headLightAction->isChecked());
2479 return;
2480 }
2481 if ( selAct ==
m_d->popup_hidedecorationsaction ) {
2483 setDecoration(!
m_d->popup_hidedecorationsaction->isChecked());
2484 return;
2485 }
2486 if ( selAct ==
m_d->popup_antiAliasAction ) {
2491 return;
2492 }
2493 if ( selAct ==
m_d->popup_dumpSceneAction ) {
2496 return;
2497 }
2498 if ( selAct ==
m_d->popup_dumpSceneVRMLAction ) {
2501 return;
2502 }
2503
2504 if ( selAct ==
m_d->popup_toSVGAction ) {
2507 return;
2508 }
2509
2510 if ( selAct ==
m_d->popup_toEPSAction ) {
2513 return;
2514 }
2515
2516 if ( selAct ==
m_d->popup_resetCameraAction ) {
2519 return;
2520 }
2521 if (
m_d->popup_drawstyle_still_actions.contains(selAct)) {
2526 if (ds!=getDrawStyle(STILL))
2528 return;
2529 }
2530 if (
m_d->popup_drawstyle_interactive_actions.contains(selAct)) {
2535 if (ds!=getDrawStyle(INTERACTIVE))
2537 return;
2538 }
2539 if (
m_d->popup_transptype_actions.contains(selAct)) {
2545 return;
2546 }
2547
2548 if (
m_d->storeViewActions.contains(selAct)) {
2549 QString
name = selAct->data().toString();
2551
2555
2557
2559 bool replaced(false);
2561 if (oldsv.name()==name) {
2562 m_d->storedViews.replace(i,sv);
2563 replaced = true;
2564 break;
2565 }
2567 }
2568 if (!replaced)
2569 m_d->storedViews <<
sv;
2570 m_d->storedViewsChanged();
2571 return;
2572 }
2573
2574 if (
m_d->zoomToViewActions.contains(selAct)) {
2575 QString
name = selAct->data().toString();
2577 SoCamera * camera = getCamera();
2578 if (root&&camera) {
2580 if (
sv.name()==name) {
2581 if (isAnimating())
2582 stopAnimating();
2584 break;
2585 }
2586 }
2587 } else {
2589 " to stored view, but can't get root and camera pointers");
2590 }
2591 return;
2592 }
2593
2594
2595
2596 if (
m_d->restoreViewActions.contains(selAct)) {
2597 QString
name = selAct->data().toString();
2599 SoCamera * camera = getCamera();
2600 if (root&&camera) {
2602 if (
sv.name()==name) {
2603 if (!
m_d->fitsCurrentCamType(sv))
2605 if (isAnimating())
2606 stopAnimating();
2607 QByteArray ba =
sv.camState();
2609 break;
2610 }
2611 }
2612 } else {
2614 " to stored view, but can't get root and camera pointers");
2615 }
2616 return;
2617
2618 }
2619
2620 if (
m_d->deleteViewActions.contains(selAct)) {
2621 QString
name = selAct->data().toString();
2624 if (
sv.name()==name) {
2625 m_d->storedViews.removeAt(i);
2626 break;
2627 }
2629 }
2630 m_d->storedViewsChanged();
2631 return;
2632 }
2633
2634 if (selAct==
m_d->customtour_launcheditor) {
2636 if (!
m_d->customtoureditor) {
2637 m_d->customtoureditor =
new VP1CustomTourEditor(
this);
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();
2644 }
2645 }
2646 m_d->customtoureditor->show();
2647
2648 return;
2649 }
2650
2651 if (selAct==
m_d->customtour_execute) {
2654 return;
2655 }
2656
2657 if (selAct==
m_d->action_movieenabled) {
2659 m_d->updateMovieMenuVisuals();
2660 return;
2661 }
2662 if (selAct==
m_d->action_moviewidth) {
2663 int old =
m_d->action_moviewidth->data().toInt();
2664 bool ok;
2665
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();
2672 }
2673 return;
2674 }
2675 if (selAct==
m_d->action_movieheight) {
2676 int old =
m_d->action_movieheight->data().toInt();
2677 bool ok;
2678
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();
2685 }
2686 return;
2687 }
2688 if (selAct==
m_d->action_moviefps) {
2689 int old =
m_d->action_moviefps->data().toInt();
2690 bool ok;
2691
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();
2698 }
2699 return;
2700 }
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();
2708 }
2709 return;
2710 }
2711 if (selAct==
m_d->action_moviefadetocurrentview) {
2713 return;
2714 }
2715
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) {
2732 return;
2733 }
2734 if (selAct==
m_d->popup_tourExecute) {
2737 return;
2738 }
2739
2740
2741
2742
2743
2744 if (selAct==
m_d->stereo_launcheditor) {
2746 if (!
m_d->customstereoeditor) {
2747 m_d->customstereoeditor =
new VP1CustomStereoEditor(
this);
2748
2749
2750
2751
2752
2753 }
2754 m_d->customstereoeditor->show();
2755
2756 return;
2757 }
2758
2759
2760
2761
2762
2763
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796 if (selAct==
m_d->popup_focal_value_action) {
2797
2798
2799 bool ok;
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: ",
2806 current_value,
2807 0.1,
2808 2147483647,
2809 1,
2810 &ok);
2811 if (ok && current_value != newfocal) {
2813 m_d->popup_focal_value_action->setData(newfocal);
2814
2815 camera->focalDistance.setValue(newfocal);
2816
2817 m_d->popup_focal_value_action->setText(
"Change FOCAL LENGTH value [current: "+QString::number(newfocal)+
"]");
2818 }
2819 } else {
2821 }
2822 return;
2823 }
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2939 return;
2940
2941}
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 QString viewerDrawStyle2PrettyString(SoQtViewer::DrawStyle)
static SoQtViewer::DrawStyle intToViewerDrawStyle(int)
void fadeLastRecordedFrameToCurrent(double time_seconds)
void dumpSceneToVRMLFile(QString filename="")
void produceSVGImage(QString filename="")
void setAmbientLight(int)
void dumpSceneToFile(QString filename="")
void produceEPSImage(QString filename="")
static QString transparencyType2PrettyString(SoGLRenderAction::TransparencyType)