Display3DView.cxx
Go to the documentation of this file.
1 ///
2 /// \file Display3DView.cxx
3 /// \brief The "main" event display view that most people will want to use
4 /// \author messier@indiana.edu
5 ///
6 #include "TCanvas.h"
7 #include "TVirtualViewer3D.h"
10 
11 namespace evd{
12 
13  //......................................................................
14  Display3DView::Display3DView(TGMainFrame* mf) : evdb::Canvas(mf)
15  {
16  evdb::Canvas::fCanvas->cd();
17 
18  fDisplay3DPad = new Display3DPad("fDisplay3DPad","3D Display",
19  0.0, 0.0, 1.0, 1.0, "");
20 
21  this->Connect("CloseWindow()","evd::Display3DView",this,"CloseWindow()");
22 
23 // fDisplay3DPad->Draw();
24 
25  evdb::Canvas::fCanvas->Update();
26  }
27 
28  //......................................................................
30  {
31  }
32 
33  //......................................................................
35  {
36  delete this;
37  }
38 
39  //......................................................................
40  void Display3DView::Draw(const char* /*opt*/)
41  {
43  evdb::Canvas::fCanvas->Update();
44 
45  TVirtualViewer3D *viewer = fDisplay3DPad->Pad()->GetViewer3D("ogl");
46  viewer->PreferLocalFrame();
47  viewer->ResetCameras();
48  viewer->PadPaint(fDisplay3DPad->Pad());
49 
50  }
51 
52 }// end namespace
53 ////////////////////////////////////////////////////////////////////////
void Draw(const char *opt="")
A drawing pad showing a 3D rendering of the detector.
Definition: Display3DPad.h:22
LArSoft includes.
Definition: InfoTransfer.h:33
TPad * Pad()
Definition: DrawingPad.h:37
Display3DView(TGMainFrame *mf)
Display3DPad * fDisplay3DPad
Definition: Display3DView.h:32