// Multi-view (3d, rphi, rhoz) service class using EVE Window Manager. // Author: Matevz Tadel 2009 #include <TEveManager.h> #include <TEveViewer.h> #include <TGLViewer.h> #include <TEveScene.h> #include <TEveProjectionManager.h> #include <TEveProjectionAxes.h> #include <TEveBrowser.h> #include <TEveWindow.h> // MultiView // // Structure encapsulating standard views: 3D, r-phi and rho-z. // Includes scenes and projection managers. // // Should be used in compiled mode. struct MultiView { TEveProjectionManager *fRPhiMgr; TEveProjectionManager *fRhoZMgr; TEveViewer *f3DView; TEveViewer *fRPhiView; TEveViewer *fRhoZView; TEveScene *fRPhiGeomScene; TEveScene *fRhoZGeomScene; TEveScene *fRPhiEventScene; TEveScene *fRhoZEventScene; //------------------------------------------------------------------------- MultiView() { // Constructor --- creates required scenes, projection managers // and GL viewers. // Scenes //======== fRPhiGeomScene = gEve->SpawnNewScene("RPhi Geometry", "Scene holding projected geometry for the RPhi view."); fRhoZGeomScene = gEve->SpawnNewScene("RhoZ Geometry", "Scene holding projected geometry for the RhoZ view."); fRPhiEventScene = gEve->SpawnNewScene("RPhi Event Data", "Scene holding projected event-data for the RPhi view."); fRhoZEventScene = gEve->SpawnNewScene("RhoZ Event Data", "Scene holding projected event-data for the RhoZ view."); // Projection managers //===================== fRPhiMgr = new TEveProjectionManager(); fRPhiMgr->SetProjection(TEveProjection::kPT_RPhi); gEve->AddToListTree(fRPhiMgr, kFALSE); { TEveProjectionAxes* a = new TEveProjectionAxes(fRPhiMgr); a->SetMainColor(kWhite); a->SetTitle("R-Phi"); a->SetTitleSize(0.05); a->SetTitleFont(102); a->SetLabelSize(0.025); a->SetLabelFont(102); fRPhiGeomScene->AddElement(a); } fRhoZMgr = new TEveProjectionManager(); fRhoZMgr->SetProjection(TEveProjection::kPT_RhoZ); gEve->AddToListTree(fRhoZMgr, kFALSE); { TEveProjectionAxes* a = new TEveProjectionAxes(fRhoZMgr); a->SetMainColor(kWhite); a->SetTitle("Rho-Z"); a->SetTitleSize(0.05); a->SetTitleFont(102); a->SetLabelSize(0.025); a->SetLabelFont(102); fRhoZGeomScene->AddElement(a); } // Viewers //========= TEveWindowSlot *slot = 0; TEveWindowPack *pack = 0; slot = TEveWindow::CreateWindowInTab(gEve->GetBrowser()->GetTabRight()); pack = slot->MakePack(); pack->SetElementName("Multi View"); pack->SetHorizontal(); pack->SetShowTitleBar(kFALSE); pack->NewSlot()->MakeCurrent(); f3DView = gEve->SpawnNewViewer("3D View", ""); f3DView->AddScene(gEve->GetGlobalScene()); f3DView->AddScene(gEve->GetEventScene()); pack = pack->NewSlot()->MakePack(); pack->SetShowTitleBar(kFALSE); pack->NewSlot()->MakeCurrent(); fRPhiView = gEve->SpawnNewViewer("RPhi View", ""); fRPhiView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); fRPhiView->AddScene(fRPhiGeomScene); fRPhiView->AddScene(fRPhiEventScene); pack->NewSlot()->MakeCurrent(); fRhoZView = gEve->SpawnNewViewer("RhoZ View", ""); fRhoZView->GetGLViewer()->SetCurrentCamera(TGLViewer::kCameraOrthoXOY); fRhoZView->AddScene(fRhoZGeomScene); fRhoZView->AddScene(fRhoZEventScene); } void ImportGeomRPhi(TEveElement* el) { fRPhiMgr->ImportElements(el, fRPhiGeomScene); } void ImportGeomRhoZ(TEveElement* el) { fRhoZMgr->ImportElements(el, fRhoZGeomScene); } void ImportEventRPhi(TEveElement* el) { fRPhiMgr->ImportElements(el, fRPhiEventScene); } void ImportEventRhoZ(TEveElement* el) { fRhoZMgr->ImportElements(el, fRhoZEventScene); } void DestroyEventRPhi() { fRPhiEventScene->DestroyElements(); } void DestroyEventRhoZ() { fRhoZEventScene->DestroyElements(); } }; MultiView.C:1 MultiView.C:2 MultiView.C:3 MultiView.C:4 MultiView.C:5 MultiView.C:6 MultiView.C:7 MultiView.C:8 MultiView.C:9 MultiView.C:10 MultiView.C:11 MultiView.C:12 MultiView.C:13 MultiView.C:14 MultiView.C:15 MultiView.C:16 MultiView.C:17 MultiView.C:18 MultiView.C:19 MultiView.C:20 MultiView.C:21 MultiView.C:22 MultiView.C:23 MultiView.C:24 MultiView.C:25 MultiView.C:26 MultiView.C:27 MultiView.C:28 MultiView.C:29 MultiView.C:30 MultiView.C:31 MultiView.C:32 MultiView.C:33 MultiView.C:34 MultiView.C:35 MultiView.C:36 MultiView.C:37 MultiView.C:38 MultiView.C:39 MultiView.C:40 MultiView.C:41 MultiView.C:42 MultiView.C:43 MultiView.C:44 MultiView.C:45 MultiView.C:46 MultiView.C:47 MultiView.C:48 MultiView.C:49 MultiView.C:50 MultiView.C:51 MultiView.C:52 MultiView.C:53 MultiView.C:54 MultiView.C:55 MultiView.C:56 MultiView.C:57 MultiView.C:58 MultiView.C:59 MultiView.C:60 MultiView.C:61 MultiView.C:62 MultiView.C:63 MultiView.C:64 MultiView.C:65 MultiView.C:66 MultiView.C:67 MultiView.C:68 MultiView.C:69 MultiView.C:70 MultiView.C:71 MultiView.C:72 MultiView.C:73 MultiView.C:74 MultiView.C:75 MultiView.C:76 MultiView.C:77 MultiView.C:78 MultiView.C:79 MultiView.C:80 MultiView.C:81 MultiView.C:82 MultiView.C:83 MultiView.C:84 MultiView.C:85 MultiView.C:86 MultiView.C:87 MultiView.C:88 MultiView.C:89 MultiView.C:90 MultiView.C:91 MultiView.C:92 MultiView.C:93 MultiView.C:94 MultiView.C:95 MultiView.C:96 MultiView.C:97 MultiView.C:98 MultiView.C:99 MultiView.C:100 MultiView.C:101 MultiView.C:102 MultiView.C:103 MultiView.C:104 MultiView.C:105 MultiView.C:106 MultiView.C:107 MultiView.C:108 MultiView.C:109 MultiView.C:110 MultiView.C:111 MultiView.C:112 MultiView.C:113 MultiView.C:114 MultiView.C:115 MultiView.C:116 MultiView.C:117 MultiView.C:118 MultiView.C:119 MultiView.C:120 MultiView.C:121 MultiView.C:122 MultiView.C:123 MultiView.C:124 MultiView.C:125 MultiView.C:126 MultiView.C:127 MultiView.C:128 MultiView.C:129 MultiView.C:130 MultiView.C:131 MultiView.C:132 MultiView.C:133 MultiView.C:134 MultiView.C:135 MultiView.C:136 MultiView.C:137 MultiView.C:138 MultiView.C:139 MultiView.C:140 MultiView.C:141 MultiView.C:142 MultiView.C:143 MultiView.C:144 MultiView.C:145 MultiView.C:146 MultiView.C:147 MultiView.C:148 MultiView.C:149 MultiView.C:150 MultiView.C:151 |
|