6#include "BesVisClient/BesClient.h"
7#include "BesVisClient/BesAboutHelp.h"
8#include "BesVisClient/BesMdcPalette.h"
9#include "BesVisLib/BesVisDisplay.h"
10#include "BesVisLib/BesCursor.h"
16#include <TRootEmbeddedCanvas.h>
18#include <TApplication.h>
19#include <TInterpreter.h>
24#include <TGeoManager.h>
28#include <TGStatusBar.h>
29#include <TGFileDialog.h>
30#include <TGNumberEntry.h>
32#include <TGProgressBar.h>
34#include <TGSplitter.h>
37#include <TGListTree.h>
39#include <TGButtonGroup.h>
40#include <TGTextEntry.h>
41#include <TGTextBuffer.h>
49#include <TViewerX3D.h>
52#include <TVirtualViewer3D.h>
54#include <TVirtualGL.h>
55#include <TVirtualGeoPainter.h>
56#include <TRootHelpDialog.h>
57#include <TRootDialog.h>
59#include "RootEventData/TRecTrackEvent.h"
60#include "RootEventData/TDigiEvent.h"
61#include "RootEventData/TDisTrack.h"
62#include "RootEventData/TRecEvTime.h"
69const char gHelpBesVis[] =
"\
71 \tg\t--- save graph\n\
72 \tn\t--- next event\n\
73 \tp\t--- previous event\n\n\
77 \td\t--- move right\n\n\
84 "GDML files",
"*.gdml",
89 "ROOT files",
"*.root",
95 "raw files",
"*.rtraw",
97 "Generic Adamo files",
"*.cz",
133 UInt_t width, UInt_t height, Option_t *option, Int_t argc,
char **argv) :
134 TGMainFrame(p, width, height) {
138 if ( gDebug ) cout <<
"BesClient ctor called" << endl;
173 this->SetBackgroundPixmap(
GetPic(
"background.gif"));
177 static char optstring[] =
"g:e:B:";
182 while ((optchar = getopt(argc, argv, optstring)) != -1)
186 cout <<
"Load Geometry file with arguments" << endl;
187 cout <<
"Geofile: " << f_geoFile << endl;
191 cout <<
"Load Event file with argments" << endl;
192 cout <<
"Evtfile: " << f_evtFile << endl;
197 cout <<
"Run in the Boss Framework: " << f_bossMode << endl;
198 cout <<
"parent pid: " << f_pid << endl;
201 cout <<
"Found an option that was not in optstring!" << endl;
204 cout <<
"Left off at: " << argv[optind] << endl;
208 if ( f_bossMode ==
false){
209 if ( f_evtFile.Length() != 0){
214 else if (f_bossMode ==
true){
215 fAutoDisplayEvent = kTRUE;
217 cout <<
"Load event file: " << f_evtFile << endl;
231 cout <<
"BesClient dtor called" << endl;
249 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 1, 0);
250 fWidgets->Add(fLayout);
251 this->AddFrame(fMenuBar, fLayout);
257 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 0, 0, 1);
258 fWidgets->Add(fLayout);
259 this->AddFrame(fUpButtonBarFrame, fLayout);
265 fLayout =
new TGLayoutHints(kLHintsCenterX | kLHintsExpandX, 5, 5, 0, 0);
266 fWidgets->Add(fLayout);
267 this->AddFrame(fTitleFrame, fLayout);
273 fLayout =
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0);
274 fWidgets->Add(fLayout);
275 this->AddFrame(fMainFrame, fLayout);
279 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 0, 0);
280 fWidgets->Add(fLayout);
281 this->AddFrame(fDisplayModeBarFrame, fLayout);
285 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 3, 0, 1, 0);
286 fWidgets->Add(fLayout);
287 this->AddFrame(fToolBarFrame, fLayout);
291 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 0, 0, 0, 0);
292 fWidgets->Add(fLayout);
293 this->AddFrame(fStatusBar, fLayout);
296 TString ttitle(title);
298 ttitle.Append(gSystem->HostName());
299 SetWindowName(ttitle);
301 SetIconPixmap( (fBesVisPath + TString(
"/icons/LogoBesVisMini.gif")).Data() );
302 SetClassHints(
"BesVis",
"Bes Event Visualisation");
304 SetWMPosition(10, 10);
305 SetMWMHints(kMWMDecorAll, kMWMFuncAll, kMWMInputModeless);
307 Resize(GetDefaultSize());
308 Resize(width, height);
316 fLayout =
new TGLayoutHints(kLHintsExpandX, 2, 2, 0, 0);
317 fWidgets->Add(fLayout);
318 this->AddFrame(
new TGHorizontal3DLine(
this), fLayout);
328 fMenuBarFirstItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft,
330 fMenuBarItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft,
332 fMenuBarLastItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsRight,
336 const TGPicture *viewGeometryIcon = gClient->GetPicture(
"viewGeometry.gif");
342 fMenuFile =
new TGPopupMenu(gClient->GetRoot());
348 fMenuFile->AddSeparator();
354 fMenuEdit =
new TGPopupMenu(gClient->GetRoot());
361 fMenuViewOptionHeader =
new TGPopupMenu(gClient->GetRoot());
362 fMenuViewOptionHeader->AddEntry(
"Show Header",
kM_Header_On);
367 fMenuViewOptionMdc =
new TGPopupMenu(gClient->GetRoot());
374 fMenuViewOptionTof =
new TGPopupMenu(gClient->GetRoot());
382 fMenuViewOptionEmc =
new TGPopupMenu(gClient->GetRoot());
391 fMenuViewOptionMuc =
new TGPopupMenu(gClient->GetRoot());
400 fMenuViewOptionFull3D =
new TGPopupMenu(gClient->GetRoot());
408 fMenuViewOptionOthers =
new TGPopupMenu(gClient->GetRoot());
409 fMenuViewOptionOthers->AddEntry(
"BeamPipe",
kM_BeamPipe);
411 fMenuViewOptionOthers->AddEntry(
"Axis",
kM_Axis);
416 fMenuViewOptionMdcHits =
new TGPopupMenu(gClient->GetRoot());
421 fMenuViewOptionTofHits =
new TGPopupMenu(gClient->GetRoot());
429 fMenuViewOptionEmcHits =
new TGPopupMenu(gClient->GetRoot());
438 fMenuViewOptionMucHits =
new TGPopupMenu(gClient->GetRoot());
446 fMenuViewOptionTracks =
new TGPopupMenu(gClient->GetRoot());
457 fMenuView =
new TGPopupMenu(gClient->GetRoot());
459 fMenuView->AddLabel(
"General");
460 fMenuView->AddSeparator();
461 fMenuView->AddPopup(
"Header",fMenuViewOptionHeader);
462 fMenuView->AddSeparator();
463 fMenuView->AddLabel(
"Detector", viewGeometryIcon);
464 fMenuView->AddSeparator();
465 fMenuView->AddPopup(
"Mdc",fMenuViewOptionMdc);
466 fMenuView->AddPopup(
"Tof",fMenuViewOptionTof);
467 fMenuView->AddPopup(
"Emc",fMenuViewOptionEmc);
468 fMenuView->AddPopup(
"Muc",fMenuViewOptionMuc);
469 fMenuView->AddPopup(
"Full3D",fMenuViewOptionFull3D);
470 fMenuView->AddPopup(
"Others",fMenuViewOptionOthers);
471 fMenuView->AddSeparator();
473 fMenuView->AddLabel(
"REC");
474 fMenuView->AddSeparator();
475 fMenuView->AddPopup(
"Mdc Hits",fMenuViewOptionMdcHits);
476 fMenuView->AddPopup(
"Tof Hits",fMenuViewOptionTofHits);
477 fMenuView->AddPopup(
"Emc Hits",fMenuViewOptionEmcHits);
478 fMenuView->AddPopup(
"Muc Hits",fMenuViewOptionMucHits);
479 fMenuView->AddPopup(
"Tracks",fMenuViewOptionTracks);
480 fMenuView->AddSeparator();
481 fMenuView->AddLabel(
"Special Views");
482 fMenuView->AddSeparator();
490 fMenuHelp =
new TGPopupMenu(gClient->GetRoot());
493 fMenuHelp->AddSeparator();
497 fMenuBar =
new BesGMenuBar(
this, 1, 1, kHorizontalFrame);
498 fMenuBar->SetBackgroundPixmap(
GetPic(
"MenuBarBckgnd.gif"));
500 fMenuBar->
AddPopup(
"&File", fMenuFile, fMenuBarFirstItemLayout);
502 fMenuBar->
AddPopup(
"&View", fMenuView, fMenuBarItemLayout);
503 fMenuBar->
AddPopup(
"&Help", fMenuHelp, fMenuBarLastItemLayout);
515 fMenuFile->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleMenu(Int_t)");
516 fMenuEdit->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleMenu(Int_t)");
517 fMenuHelp->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleMenu(Int_t)");
518 fMenuView->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
519 fMenuViewOptionHeader->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
520 fMenuViewOptionMdc->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
521 fMenuViewOptionTof->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
522 fMenuViewOptionEmc->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
523 fMenuViewOptionMuc->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
524 fMenuViewOptionFull3D->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
525 fMenuViewOptionOthers->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
526 fMenuViewOptionMdcHits->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
527 fMenuViewOptionTofHits->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
528 fMenuViewOptionEmcHits->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
529 fMenuViewOptionMucHits->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
530 fMenuViewOptionTracks->Connect(
"Activated(Int_t)",
"BesClient",
this,
"HandleViewOptionMenu(Int_t)");
564 fUpButtonBarFrame =
new TGCompositeFrame(
this, 300, 25, kHorizontalFrame);
565 fUpButtonBarFrame->SetBackgroundPixmap(
GetPic(
"UpButtonBarBckgnd.gif"));
567 fUpButtonBarFirstItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 15, 0, 1, 2);
568 fUpButtonBarItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 1, 2);
569 fUpButtonBarLastItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 13, 1, 2);
571 Int_t width = 23, height = 22;
573 Int_t nUpSplitter = 0;
576 for (Int_t i = 0; i < kNUpSplitter; i++) {
578 gClient->GetPicture(
"UpButtonSplitter.gif"));
579 fUpButtonSplitter[i]->SetHeight(20);
580 fUpButtonSplitter[i]->SetWidth(5);
581 fUpButtonSplitter[i]->
SetState(kButtonDisabled);
586 gClient->GetPicture(
"ButtonLoadGeoFile.gif"),
588 fLoadGeoFileButton->
SetPictureHL(gClient->GetPicture(
"ButtonLoadGeoFileHL.gif"));
589 fLoadGeoFileButton->SetToolTipText(
"Load Geometry File");
590 fLoadGeoFileButton->SetHeight(height);
591 fLoadGeoFileButton->SetWidth(width);
592 fLoadGeoFileButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
593 fUpButtonBarFrame->AddFrame(fLoadGeoFileButton, fUpButtonBarFirstItemLayout);
597 gClient->GetPicture(
"ButtonOpenEventFile.gif"),
599 fOpenEventFileButton->
SetPictureHL(gClient->GetPicture(
"ButtonOpenEventFileHL.gif"));
600 fOpenEventFileButton->SetToolTipText(
"Open Event File");
601 fOpenEventFileButton->SetHeight(height);
602 fOpenEventFileButton->SetWidth(width);
603 fOpenEventFileButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
604 fUpButtonBarFrame->AddFrame(fOpenEventFileButton, fUpButtonBarItemLayout);
608 gClient->GetPicture(
"ButtonSavePicAs.gif"),
610 fSavePicAsButton->
SetPictureHL(gClient->GetPicture(
"ButtonSavePicAsHL.gif"));
611 fSavePicAsButton->SetToolTipText(
"Save Picture as");
612 fSavePicAsButton->SetHeight(height);
613 fSavePicAsButton->SetWidth(width);
614 fSavePicAsButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
615 fUpButtonBarFrame->AddFrame(fSavePicAsButton, fUpButtonBarItemLayout);
619 gClient->GetPicture(
"ButtonSavePicAsPS.gif"),
621 fSavePicAsPSButton->
SetPictureHL(gClient->GetPicture(
"ButtonSavePicAsPSHL.gif"));
622 fSavePicAsPSButton->SetToolTipText(
"Save Picture as besvis.ps");
623 fSavePicAsPSButton->SetHeight(height);
624 fSavePicAsPSButton->SetWidth(width);
625 fSavePicAsPSButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
626 fUpButtonBarFrame->AddFrame(fSavePicAsPSButton, fUpButtonBarItemLayout);
629 fUpButtonBarFrame->AddFrame(fUpButtonSplitter[nUpSplitter], fUpButtonBarItemLayout);
634 gClient->GetPicture(
"ButtonRefresh.gif"),
636 fRefreshButton->
SetPictureHL(gClient->GetPicture(
"ButtonRefreshHL.gif"));
637 fRefreshButton->SetToolTipText(
"Refresh");
638 fRefreshButton->SetHeight(height);
639 fRefreshButton->SetWidth(width);
640 fRefreshButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
641 fUpButtonBarFrame->AddFrame(fRefreshButton, fUpButtonBarItemLayout);
645 gClient->GetPicture(
"ButtonResetCurrent.gif"),
647 fResetCurrentButton->
SetPictureHL(gClient->GetPicture(
"ButtonResetCurrentHL.gif"));
648 fResetCurrentButton->SetToolTipText(
"Reset Current Pad");
649 fResetCurrentButton->SetHeight(height);
650 fResetCurrentButton->SetWidth(width);
651 fResetCurrentButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
652 fUpButtonBarFrame->AddFrame(fResetCurrentButton, fUpButtonBarItemLayout);
656 gClient->GetPicture(
"ButtonResetAll.gif"),
658 fResetAllButton->
SetPictureHL(gClient->GetPicture(
"ButtonResetAllHL.gif"));
659 fResetAllButton->SetToolTipText(
"Reset All Pads");
660 fResetAllButton->SetHeight(height);
661 fResetAllButton->SetWidth(width);
662 fResetAllButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
663 fUpButtonBarFrame->AddFrame(fResetAllButton, fUpButtonBarItemLayout);
666 fUpButtonBarFrame->AddFrame(fUpButtonSplitter[nUpSplitter], fUpButtonBarItemLayout);
671 gClient->GetPicture(
"ButtonZoomOut.gif"),
673 fZoomOutButton->
SetPictureHL(gClient->GetPicture(
"ButtonZoomOutHL.gif"));
674 fZoomOutButton->SetToolTipText(
"Zoom Out");
675 fZoomOutButton->SetHeight(height);
676 fZoomOutButton->SetWidth(width);
677 fZoomOutButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
678 fUpButtonBarFrame->AddFrame(fZoomOutButton, fUpButtonBarItemLayout);
683 (TGNumberFormat::EStyle) 1, (TGNumberFormat::EAttribute) 0 );
684 fZoomRatioNumber->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
685 h = Int_t(fZoomRatioNumber->GetDefaultHeight()/1.2);
686 charw = fZoomRatioNumber->GetCharWidth(
"0123456");
687 w = charw * TMath::Abs(5) / 10 + 8 + 2 * h / 3 + 2;
689 fZoomRatioNumber->Resize(w, h);
691 fLayout =
new TGLayoutHints(kLHintsCenterX | kLHintsCenterY);
692 fWidgets->Add(fLayout);
693 fUpButtonBarFrame->AddFrame(fZoomRatioNumber, fLayout);
697 gClient->GetPicture(
"ButtonZoomRatioPercent.gif"));
698 fZoomRatioPercentButton->SetHeight(20);
699 fZoomRatioPercentButton->SetWidth(10);
700 fZoomRatioPercentButton->
SetState(kButtonDisabled);
701 fUpButtonBarFrame->AddFrame(fZoomRatioPercentButton, fUpButtonBarItemLayout);
705 gClient->GetPicture(
"ButtonZoomIn.gif"),
707 fZoomInButton->
SetPictureHL(gClient->GetPicture(
"ButtonZoomInHL.gif"));
708 fZoomInButton->SetToolTipText(
"Zoom In");
709 fZoomInButton->SetHeight(height);
710 fZoomInButton->SetWidth(width);
711 fZoomInButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
712 fUpButtonBarFrame->AddFrame(fZoomInButton, fUpButtonBarItemLayout);
716 gClient->GetPicture(
"ButtonCursorPickST.gif"),
719 fCursorButton[0]->
SetPictureHL(gClient->GetPicture(
"ButtonCursorPickHL.gif"));
720 fCursorButton[0]->SetToolTipText(
"Select Tool");
725 gClient->GetPicture(
"ButtonCursorHand.gif"),
727 fCursorButton[1]->
SetPictureHL(gClient->GetPicture(
"ButtonCursorHandHL.gif"));
728 fCursorButton[1]->SetToolTipText(
"Hand Tool");
730 for (
int i = 0; i < kNCursorState; i++) {
731 fCursorButton[i]->SetHeight(height);
732 fCursorButton[i]->SetWidth(width);
733 fCursorButton[i]->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
734 fUpButtonBarFrame->AddFrame(fCursorButton[i], fUpButtonBarItemLayout);
738 fUpButtonBarFrame->AddFrame(fUpButtonSplitter[nUpSplitter], fUpButtonBarItemLayout);
743 gClient->GetPicture(
"ButtonSwitchDisplayMode.gif"),
745 fSwitchDisplayModeButton->
SetPictureHL(gClient->GetPicture(
"ButtonSwitchDisplayModeHL.gif"));
746 fSwitchDisplayModeButton->SetToolTipText(
"Switch Display Mode");
747 fSwitchDisplayModeButton->SetHeight(height);
748 fSwitchDisplayModeButton->SetWidth(width);
749 fSwitchDisplayModeButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
750 fUpButtonBarFrame->AddFrame(fSwitchDisplayModeButton, fUpButtonBarItemLayout);
754 gClient->GetPicture(
"ButtonSetHome.gif"),
756 fSetHomeButton->
SetPictureHL(gClient->GetPicture(
"ButtonSetHomeHL.gif"));
757 fSetHomeButton->SetToolTipText(
"Set home position");
758 fSetHomeButton->SetHeight(height);
759 fSetHomeButton->SetWidth(width);
760 fSetHomeButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
761 fUpButtonBarFrame->AddFrame(fSetHomeButton, fUpButtonBarItemLayout);
765 gClient->GetPicture(
"ButtonGoHome.gif"),
767 fGoHomeButton->
SetPictureHL(gClient->GetPicture(
"ButtonGoHomeHL.gif"));
768 fGoHomeButton->SetToolTipText(
"Go to home position");
769 fGoHomeButton->SetHeight(height);
770 fGoHomeButton->SetWidth(width);
771 fGoHomeButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
772 fUpButtonBarFrame->AddFrame(fGoHomeButton, fUpButtonBarItemLayout);
776 gClient->GetPicture(
"ButtonSaveMyConfig.gif"),
778 fSaveMyConfigButton->
SetPictureHL(gClient->GetPicture(
"ButtonSaveMyConfigHL.gif"));
779 fSaveMyConfigButton->SetToolTipText(
"Save My Style");
780 fSaveMyConfigButton->SetHeight(height);
781 fSaveMyConfigButton->SetWidth(width);
782 fSaveMyConfigButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
783 fUpButtonBarFrame->AddFrame(fSaveMyConfigButton, fUpButtonBarItemLayout);
787 gClient->GetPicture(
"ButtonLoadMyConfig.gif"),
789 fLoadMyConfigButton->
SetPictureHL(gClient->GetPicture(
"ButtonLoadMyConfigHL.gif"));
790 fLoadMyConfigButton->SetToolTipText(
"Load My Style");
791 fLoadMyConfigButton->SetHeight(height);
792 fLoadMyConfigButton->SetWidth(width);
793 fLoadMyConfigButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
794 fUpButtonBarFrame->AddFrame(fLoadMyConfigButton, fUpButtonBarItemLayout);
798 gClient->GetPicture(
"ButtonPalette.gif"),
800 fPaletteButton->
SetPictureHL(gClient->GetPicture(
"ButtonPaletteHL.gif"));
801 fPaletteButton->SetToolTipText(
"Palette");
802 fPaletteButton->SetHeight(height);
803 fPaletteButton->SetWidth(width);
804 fPaletteButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
805 fUpButtonBarFrame->AddFrame(fPaletteButton, fUpButtonBarItemLayout);
808 fUpButtonBarFrame->AddFrame(fUpButtonSplitter[nUpSplitter], fUpButtonBarItemLayout);
813 gClient->GetPicture(
"ButtonHelp.gif"),
815 fHelpButton->
SetPictureHL(gClient->GetPicture(
"ButtonHelpHL.gif"));
816 fHelpButton->SetToolTipText(
"Help");
817 fHelpButton->SetHeight(height);
818 fHelpButton->SetWidth(width);
819 fHelpButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
820 fUpButtonBarFrame->AddFrame(fHelpButton, fUpButtonBarLastItemLayout);
827 fDisplayModeBarFrame =
new TGCompositeFrame(
this, 300, 16, kHorizontalFrame);
828 fDisplayModeBarItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 0, 0);
836 fDisplayModeButton[0]->
SetState(
true);
837 fDisplayModeButton[1]->
SetState(
false);
838 fDisplayModeButton[2]->
SetState(
false);
839 fDisplayModeButton[3]->
SetState(
false);
840 fDisplayModeButton[4]->
SetState(
false);
842 fDisplayModeButton[0]->
SetPictureHL(gClient->GetPicture(
"DisplayMode2DHL.gif"));
843 fDisplayModeButton[1]->
SetPictureHL(gClient->GetPicture(
"DisplayModeXYHL.gif"));
844 fDisplayModeButton[2]->
SetPictureHL(gClient->GetPicture(
"DisplayModeZRHL.gif"));
845 fDisplayModeButton[3]->
SetPictureHL(gClient->GetPicture(
"DisplayMode3DHL.gif"));
846 fDisplayModeButton[4]->
SetPictureHL(gClient->GetPicture(
"DisplayModeAllHL.gif"));
848 fDisplayModeButton[0]->SetToolTipText(
"XY+ZR view");
849 fDisplayModeButton[1]->SetToolTipText(
"XY view");
850 fDisplayModeButton[2]->SetToolTipText(
"ZR view");
851 fDisplayModeButton[3]->SetToolTipText(
"3D view");
852 fDisplayModeButton[4]->SetToolTipText(
"All view");
854 Int_t width = 16, height = 16;
855 for (Int_t i = 0; i < kNDisplayMode; i++) {
856 fDisplayModeButton[i]->
SetState(kButtonUp);
857 fDisplayModeButton[i]->SetHeight(height);
858 fDisplayModeButton[i]->SetWidth(width);
859 fDisplayModeButton[i]->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
860 fDisplayModeBarFrame->AddFrame(fDisplayModeButton[i], fDisplayModeBarItemLayout);
868 fToolBarFrame =
new TGCompositeFrame(
this, 300, 25, kHorizontalFrame);
869 fToolBarFrame->SetBackgroundPixmap(
GetPic(
"ToolButtonBarBckgnd.gif"));
871 fToolBarFirstItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 0, 1, 2);
872 fToolBarItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 0, 1, 2);
873 fToolBarLastItemLayout =
new TGLayoutHints(kLHintsTop | kLHintsLeft, 0, 14, 1, 2);
875 Int_t width = 23, height = 22;
876 Int_t nToolSplitter = 0;
879 for (Int_t i = 0; i < kNToolSplitter; i++) {
881 gClient->GetPicture(
"ToolButtonSplitter.gif"));
882 fToolButtonSplitter[i]->SetHeight(20);
883 fToolButtonSplitter[i]->SetWidth(5);
884 fToolButtonSplitter[i]->
SetState(kButtonDisabled);
889 gClient->GetPicture(
"ButtonSwitchPad.gif"),
891 fSwitchPadButton->
SetPictureHL(gClient->GetPicture(
"ButtonSwitchPadHL.gif"));
892 fSwitchPadButton->SetToolTipText(
"Switch Among Pads");
893 fSwitchPadButton->SetHeight(height);
894 fSwitchPadButton->SetWidth(width);
895 fSwitchPadButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
896 fToolBarFrame->AddFrame(fSwitchPadButton, fToolBarFirstItemLayout);
899 fToolBarFrame->AddFrame(fToolButtonSplitter[nToolSplitter], fToolBarItemLayout);
904 gClient->GetPicture(
"ButtonShowInfoST.gif"),
907 fShowInfoButton->
SetPictureHL(gClient->GetPicture(
"ButtonShowInfoHL.gif"));
908 fShowInfoButton->SetToolTipText(
"Show Info");
909 fShowInfoButton->SetHeight(height);
910 fShowInfoButton->SetWidth(width);
911 fShowInfoButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
912 fToolBarFrame->AddFrame(fShowInfoButton, fToolBarItemLayout);
916 gClient->GetPicture(
"ButtonShowAxis.gif"),
918 fShowAxisButton->
SetPictureHL(gClient->GetPicture(
"ButtonShowAxisHL.gif"));
919 fShowAxisButton->SetToolTipText(
"Show Axis");
920 fShowAxisButton->SetHeight(height);
921 fShowAxisButton->SetWidth(width);
922 fShowAxisButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
923 fToolBarFrame->AddFrame(fShowAxisButton, fToolBarItemLayout);
926 fToolBarFrame->AddFrame(fToolButtonSplitter[nToolSplitter], fToolBarItemLayout);
931 gClient->GetPicture(
"ButtonFishEyeView.gif"),
933 fFishEyeViewButton->
SetPictureHL(gClient->GetPicture(
"ButtonFishEyeViewHL.gif"));
934 fFishEyeViewButton->SetToolTipText(
"FishEye View");
935 fFishEyeViewButton->SetHeight(height);
936 fFishEyeViewButton->SetWidth(width);
937 fFishEyeViewButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
938 fToolBarFrame->AddFrame(fFishEyeViewButton, fToolBarItemLayout);
942 gClient->GetPicture(
"ButtonParallelViewST.gif"),
944 fParallelViewButton->
SetState(
true);
945 fParallelViewButton->
SetPictureHL(gClient->GetPicture(
"ButtonParallelViewHL.gif"));
946 fParallelViewButton->SetToolTipText(
"Parallel View");
947 fParallelViewButton->SetHeight(height);
948 fParallelViewButton->SetWidth(width);
949 fParallelViewButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
950 fToolBarFrame->AddFrame(fParallelViewButton, fToolBarItemLayout);
954 gClient->GetPicture(
"ButtonPerspectiveView.gif"),
956 fPerspectiveViewButton->
SetPictureHL(gClient->GetPicture(
"ButtonPerspectiveViewHL.gif"));
957 fPerspectiveViewButton->SetToolTipText(
"Perspective View");
958 fPerspectiveViewButton->SetHeight(height);
959 fPerspectiveViewButton->SetWidth(width);
960 fPerspectiveViewButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
961 fToolBarFrame->AddFrame(fPerspectiveViewButton, fToolBarItemLayout);
964 fToolBarFrame->AddFrame(fToolButtonSplitter[nToolSplitter], fToolBarItemLayout);
969 gClient->GetPicture(
"ButtonOpenGL.gif"),
971 fOpenGLButton->
SetPictureHL(gClient->GetPicture(
"ButtonOpenGLHL.gif"));
972 fOpenGLButton->SetToolTipText(
"OpenGL View");
973 fOpenGLButton->SetHeight(height);
974 fOpenGLButton->SetWidth(width);
975 fOpenGLButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
976 fToolBarFrame->AddFrame(fOpenGLButton, fToolBarItemLayout);
980 gClient->GetPicture(
"ButtonX3D.gif"),
982 fX3DButton->
SetPictureHL(gClient->GetPicture(
"ButtonX3DHL.gif"));
983 fX3DButton->SetToolTipText(
"X3D View");
984 fX3DButton->SetHeight(height);
985 fX3DButton->SetWidth(width);
986 fX3DButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
987 fToolBarFrame->AddFrame(fX3DButton, fToolBarItemLayout);
990 fToolBarFrame->AddFrame(fToolButtonSplitter[nToolSplitter], fToolBarLastItemLayout);
1001 fTitleFrame =
new TGHorizontalFrame(
this, this->GetWidth(), 10);
1010 Int_t parts[] = {40, 50, 10};
1011 fStatusBar =
new TGStatusBar(
this, this->GetWidth(), 20, kHorizontalFrame);
1012 fStatusBar->SetParts(parts, nPart);
1013 fStatusBar->SetBackgroundPixmap(
GetPic(
"StatusBarBckgnd.gif"));
1014 for (Int_t iPart = 0; iPart < nPart; iPart++) {
1015 fStatusBar->GetBarPart(iPart)->SetBackgroundPixmap(
GetPic(
"StatusBarBckgnd.gif"));
1019 fStatusBar->SetText(
"Ready", 0);
1028 fMainFrame =
new TGHorizontalFrame(
this, this->GetWidth(), this->GetHeight()-26);
1031 fV1 =
new TGVerticalFrame(fMainFrame, 250, fMainFrame->GetHeight(), kFixedWidth);
1039 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 0, 2, 0, 0);
1040 fWidgets->Add(fLayout);
1041 fV1->AddFrame(fTabs, fLayout);
1046 fMainFrame->AddFrame(fEmbeddedCanvas, fECLayout);
1048 fLayout =
new TGLayoutHints(kLHintsRight | kLHintsExpandY);
1049 fWidgets->Add(fLayout);
1050 fMainFrame->AddFrame(fV1, fLayout);
1052 TGVSplitter *VSplitter =
new TGVSplitter(fMainFrame);
1053 VSplitter->SetFrame(fV1, kFALSE);
1054 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsExpandY);
1055 fWidgets->Add(fLayout);
1056 fMainFrame->AddFrame(VSplitter, fLayout);
1066 fECLayout =
new TGLayoutHints( kLHintsLeft | kLHintsExpandX | kLHintsExpandY, 0, 0, 0, 0);
1067 fEmbeddedCanvas =
new TRootEmbeddedCanvas(0, fMainFrame, fMainFrame->GetWidth()/4*3-12, fMainFrame->GetHeight()-46);
1068 Int_t wid = fEmbeddedCanvas->GetCanvasWindowId();
1069 fCanvas =
new TCanvas(
"BesVis", fEmbeddedCanvas->GetWidth(), fEmbeddedCanvas->GetHeight()-10, wid);
1070 fEmbeddedCanvas->AdoptCanvas(fCanvas);
1085 fTabs =
new TGTab(fV1, fV1->GetWidth(), fV1->GetHeight());
1089 TGCompositeFrame *tf = 0;
1095 tf = fTabs->AddTab(
"View");
1096 tf->SetBackgroundPixmap(
GetPic(
"8.gif"));
1101 fAutoFrame =
new TGCompositeFrame(tf, tf->GetWidth(), tf->GetHeight(), kVerticalFrame);
1102 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX , 15, 15, 15, 10);
1103 fWidgets->Add(fLayout);
1104 tf->AddFrame(fAutoFrame, fLayout);
1105 fAutoFrame->SetBackgroundPixmap(
GetPic(
"AutoFrameBckgnd.gif"));
1108 fAutoTextFrame =
new TGCompositeFrame(fAutoFrame, fAutoFrame->GetWidth(), 30, kHorizontalFrame);
1109 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX, 0, 0, 0, 0);
1110 fWidgets->Add(fLayout);
1111 fAutoFrame->AddFrame(fAutoTextFrame, fLayout);
1112 fAutoTextFrame->SetBackgroundPixmap(
GetPic(
"AutoControlBckgnd.gif"));
1114 fAutoTextLabel =
new TGLabel(fAutoTextFrame,
"Auto Control ");
1115 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX , 2, 73, 4, 0);
1116 fWidgets->Add(fLayout);
1117 fAutoTextFrame->AddFrame(fAutoTextLabel, fLayout);
1118 fAutoTextLabel->SetBackgroundPixmap(
GetPic(
"AutoControlBckgnd.gif"));
1121 fFrameAutoRotate =
new TGGroupFrame(fAutoFrame,
"");
1122 fLayout =
new TGLayoutHints(kLHintsExpandX, 0, 0, 0, 0);
1124 fWidgets->Add(fLayout);
1125 fAutoFrame->AddFrame(fFrameAutoRotate, fLayout);
1129 fLayout =
new TGLayoutHints(kLHintsExpandX, 5, 5, 3, 2);
1130 fFrameAutoRotate->AddFrame(fChkBtnAutoRotate, fLayout);
1131 fChkBtnAutoRotate->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1134 fRotateSpeedFrame =
new TGCompositeFrame(fFrameAutoRotate, fFrameAutoRotate->GetWidth()-20, 30, kHorizontalFrame);
1135 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 2, 2);
1136 fWidgets->Add(fLayout);
1137 fFrameAutoRotate->AddFrame(fRotateSpeedFrame, fLayout);
1142 (TGNumberFormat::EStyle) 1, (TGNumberFormat::EAttribute) 1 );
1143 h = fNumEntryRotateSpeed->GetDefaultHeight();
1144 charw = fNumEntryRotateSpeed->GetCharWidth(
"0123456");
1145 w = charw * TMath::Abs(4) / 10 + 8 + 2 * h / 3;
1146 fNumEntryRotateSpeed->Resize(w, h);
1149 fNumEntryRotateSpeed->SetHeight(20);
1151 fNumEntryRotateSpeed->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1152 fNumEntryRotateSpeed->Connect(
"TabPressed()",
"BesClient",
this,
"ChangeFocus()");
1153 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 4, 2, 2);
1154 fWidgets->Add(fLayout);
1155 fRotateSpeedFrame->AddFrame(fNumEntryRotateSpeed, fLayout);
1158 fRotateSpeedLabel =
new TGLabel(fRotateSpeedFrame,
" deg/sec ");
1159 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 4, 2, 2);
1160 fWidgets->Add(fLayout);
1161 fRotateSpeedFrame->AddFrame(fRotateSpeedLabel, fLayout);
1164 fRotateFPSFrame =
new TGCompositeFrame(fFrameAutoRotate, fFrameAutoRotate->GetWidth()-20, 30, kHorizontalFrame);
1165 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 2, 2);
1166 fWidgets->Add(fLayout);
1167 fFrameAutoRotate->AddFrame(fRotateFPSFrame, fLayout);
1170 fNumEntryRotateFPS =
new TGNumberEntry(fRotateFPSFrame,this->
GetRotateFPS(), 3,
kM_Button_RotateFPS,(TGNumberFormat::EStyle) 0,(TGNumberFormat::EAttribute) 1);
1171 fNumEntryRotateFPS->SetHeight(20);
1173 fNumEntryRotateFPS->GetNumberEntry()->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1174 fNumEntryRotateFPS->GetNumberEntry()->Connect(
"TabPressed()",
"BesClient",
this,
"ChangeFocus()");
1175 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 4, 2, 2);
1176 fWidgets->Add(fLayout);
1177 fRotateFPSFrame->AddFrame(fNumEntryRotateFPS, fLayout);
1180 fRotateFPSLabel =
new TGLabel(fRotateFPSFrame,
" fps ");
1181 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 4, 2, 2);
1182 fWidgets->Add(fLayout);
1183 fRotateFPSFrame->AddFrame(fRotateFPSLabel, fLayout);
1189 fViewFrame =
new TGCompositeFrame(tf, tf->GetWidth(), tf->GetHeight(), kVerticalFrame);
1190 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX , 15, 15, 15, 10);
1191 fWidgets->Add(fLayout);
1192 tf->AddFrame(fViewFrame, fLayout);
1193 fViewFrame->SetBackgroundPixmap(
GetPic(
"ViewFrameBckgnd.gif"));
1196 fViewTextFrame =
new TGCompositeFrame(fViewFrame, fViewFrame->GetWidth(), 30, kHorizontalFrame);
1197 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX, 0, 0, 0, 0);
1198 fWidgets->Add(fLayout);
1199 fViewFrame->AddFrame(fViewTextFrame, fLayout);
1200 fViewTextFrame->SetBackgroundPixmap(
GetPic(
"ViewControlBckgnd.gif"));
1202 fViewTextLabel =
new TGLabel(fViewTextFrame,
"View Control ");
1203 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX , 2, 73, 4, 4);
1204 fWidgets->Add(fLayout);
1205 fViewTextFrame->AddFrame(fViewTextLabel, fLayout);
1206 fViewTextLabel->SetBackgroundPixmap(
GetPic(
"ViewControlBckgnd.gif"));
1210 fRotateStepFrame =
new TGCompositeFrame(fViewFrame, fViewFrame->GetWidth()-20, 30, kHorizontalFrame);
1211 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop, 0, 0, 8, 5);
1212 fWidgets->Add(fLayout);
1213 fViewFrame->AddFrame(fRotateStepFrame, fLayout);
1216 fRotateStepLabel =
new TGLabel(fRotateStepFrame,
" Step:");
1217 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 10, 2, 0, 0);
1218 fWidgets->Add(fLayout);
1219 fRotateStepFrame->AddFrame(fRotateStepLabel, fLayout);
1224 (TGNumberFormat::EStyle) 2, (TGNumberFormat::EAttribute) 1 );
1225 h = fNumEntryRotateStep->GetDefaultHeight();
1226 charw = fNumEntryRotateStep->GetCharWidth(
"0123456");
1227 w = charw * TMath::Abs(5) / 10 + 8 + 2 * h / 3;
1228 fNumEntryRotateStep->Resize(w, h);
1230 fNumEntryRotateStep->SetHeight(20);
1232 fNumEntryRotateStep->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1233 fNumEntryRotateStep->Connect(
"TabPressed()",
"BesClient",
this,
"ChangeFocus()");
1234 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 0, 0, 0);
1235 fWidgets->Add(fLayout);
1236 fRotateStepFrame->AddFrame(fNumEntryRotateStep, fLayout);
1239 fRotateStepUnitLabel =
new TGLabel(fRotateStepFrame,
" deg ");
1240 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 0, 4, 0, 0);
1241 fWidgets->Add(fLayout);
1242 fRotateStepFrame->AddFrame(fRotateStepUnitLabel, fLayout);
1245 fViewContentFrame =
new TGCompositeFrame(fViewFrame, fViewFrame->GetWidth(), fViewFrame->GetHeight()-30, kVerticalFrame);
1246 fLayout =
new TGLayoutHints(kLHintsExpandX | kLHintsExpandY , 0, 0, 0, 0);
1247 fWidgets->Add(fLayout);
1248 fViewFrame->AddFrame(fViewContentFrame, fLayout);
1251 fViewContent1Frame =
new TGCompositeFrame(fViewContentFrame, fViewFrame->GetWidth(), 39, kHorizontalFrame);
1252 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop , 0, 0, 3, 0);
1253 fWidgets->Add(fLayout);
1254 fViewContent1Frame->SetBackgroundPixmap(
GetPic(
"ViewContent1Bckgnd.gif"));
1255 fViewContentFrame->AddFrame(fViewContent1Frame, fLayout);
1259 gClient->GetPicture(
"ViewCounterClockwise.gif"),
1261 fViewCounterClockWiseButton->SetToolTipText(
"Rotate Counter Clockwise");
1262 fViewCounterClockWiseButton->SetHeight(37);
1263 fViewCounterClockWiseButton->SetWidth(37);
1264 fViewCounterClockWiseButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1266 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 5, 22, 0, 0);
1267 fWidgets->Add(fLayout);
1268 fViewContent1Frame->AddFrame(fViewCounterClockWiseButton, fLayout);
1272 gClient->GetPicture(
"ViewMoveUp.gif"),
1274 fViewMoveUpButton->SetToolTipText(
"Move Up");
1275 fViewMoveUpButton->SetHeight(20);
1276 fViewMoveUpButton->SetWidth(23);
1277 fViewMoveUpButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1279 fLayout =
new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 5, 5, 0, 0);
1280 fWidgets->Add(fLayout);
1281 fViewContent1Frame->AddFrame(fViewMoveUpButton, fLayout);
1285 gClient->GetPicture(
"ViewClockwise.gif"),
1287 fViewClockWiseButton->SetToolTipText(
"Rotate Clockwise");
1288 fViewClockWiseButton->SetHeight(37);
1289 fViewClockWiseButton->SetWidth(37);
1290 fViewClockWiseButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1292 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 22, 5, 0, 0);
1293 fWidgets->Add(fLayout);
1294 fViewContent1Frame->AddFrame(fViewClockWiseButton, fLayout);
1297 fViewContent2Frame =
new TGCompositeFrame(fViewContentFrame, fViewFrame->GetWidth(), 23, kHorizontalFrame);
1298 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop , 0, 0, 0, 0);
1299 fWidgets->Add(fLayout);
1300 fViewContent2Frame->SetBackgroundPixmap(
GetPic(
"ViewContent2Bckgnd.gif"));
1301 fViewContentFrame->AddFrame(fViewContent2Frame, fLayout);
1305 gClient->GetPicture(
"ViewMoveLeft.gif"),
1307 fViewMoveLeftButton->SetToolTipText(
"Move Left");
1308 fViewMoveLeftButton->SetHeight(23);
1309 fViewMoveLeftButton->SetWidth(23);
1310 fViewMoveLeftButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1312 fLayout =
new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 49, 2, 0, 0);
1313 fWidgets->Add(fLayout);
1314 fViewContent2Frame->AddFrame(fViewMoveLeftButton, fLayout);
1318 gClient->GetPicture(
"ViewMoveCenter.gif"),
1320 fViewMoveCenterButton->SetToolTipText(
"Move Center");
1321 fViewMoveCenterButton->SetHeight(13);
1322 fViewMoveCenterButton->SetWidth(13);
1323 fViewMoveCenterButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1325 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsCenterX, 0, 0, 0, 0);
1326 fWidgets->Add(fLayout);
1327 fViewContent2Frame->AddFrame(fViewMoveCenterButton, fLayout);
1331 gClient->GetPicture(
"ViewMoveRight.gif"),
1333 fViewMoveRightButton->SetToolTipText(
"Move Right");
1334 fViewMoveRightButton->SetHeight(23);
1335 fViewMoveRightButton->SetWidth(23);
1336 fViewMoveRightButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1338 fLayout =
new TGLayoutHints(kLHintsBottom | kLHintsCenterX, 2, 49, 0, 0);
1339 fWidgets->Add(fLayout);
1340 fViewContent2Frame->AddFrame(fViewMoveRightButton, fLayout);
1343 fViewContent3Frame =
new TGCompositeFrame(fViewContentFrame, fViewFrame->GetWidth(), 32, kHorizontalFrame);
1344 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop , 0, 0, 0, 3);
1345 fWidgets->Add(fLayout);
1346 fViewContent3Frame->SetBackgroundPixmap(
GetPic(
"ViewContent3Bckgnd.gif"));
1347 fViewContentFrame->AddFrame(fViewContent3Frame, fLayout);
1351 gClient->GetPicture(
"ViewMoveDown.gif"),
1353 fViewMoveDownButton->SetToolTipText(
"Move Down");
1354 fViewMoveDownButton->SetHeight(32);
1355 fViewMoveDownButton->SetWidth(23);
1356 fViewMoveDownButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1359 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 69, 0, 0, 0);
1360 fWidgets->Add(fLayout);
1361 fViewContent3Frame->AddFrame(fViewMoveDownButton, fLayout);
1365 gClient->GetPicture(
"ViewResetAngle.gif"),
1368 fViewResetAngleButton->SetToolTipText(
"Reset Angles");
1369 fViewResetAngleButton->SetHeight(27);
1370 fViewResetAngleButton->SetWidth(27);
1371 fViewResetAngleButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1373 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 30, 0, 0, 0);
1374 fWidgets->Add(fLayout);
1375 fViewContent3Frame->AddFrame(fViewResetAngleButton, fLayout);
1379 fViewAngleFrame =
new TGCompositeFrame(fViewContentFrame, fViewContentFrame->GetWidth(), 50, kHorizontalFrame);
1380 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop , 4, 4, 0, 0);
1381 fWidgets->Add(fLayout);
1382 fViewContentFrame->AddFrame(fViewAngleFrame, fLayout);
1385 fViewAngleThetaFrame =
new TGCompositeFrame(fViewAngleFrame, fViewAngleFrame->GetWidth(), 50, kVerticalFrame);
1386 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop , 3, 3, 3, 3);
1387 fWidgets->Add(fLayout);
1388 fViewAngleFrame->AddFrame(fViewAngleThetaFrame, fLayout);
1392 gClient->GetPicture(
"ViewAngleMinus.gif"),
1394 fViewAngleThetaMinusButton->SetToolTipText(
"Theta -");
1395 fViewAngleThetaMinusButton->SetHeight(22);
1396 fViewAngleThetaMinusButton->SetWidth(22);
1397 fViewAngleThetaMinusButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1399 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 0, 0);
1400 fWidgets->Add(fLayout);
1401 fViewAngleThetaFrame->AddFrame(fViewAngleThetaMinusButton, fLayout);
1405 fViewAngleThetaSlider->Connect(
"PositionChanged(Int_t)",
"BesClient",
this,
"HandleSliders(Int_t)");
1406 fViewAngleThetaSlider->SetRange(0, 180);
1407 fViewAngleThetaSlider->SetPosition(0);
1408 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsCenterX | kLHintsExpandY, 5, 5, 0, 0);
1409 fWidgets->Add(fLayout);
1410 fViewAngleThetaFrame->AddFrame(fViewAngleThetaSlider, fLayout);
1414 gClient->GetPicture(
"ViewAnglePlus.gif"),
1416 fViewAngleThetaPlusButton->SetToolTipText(
"Theta +");
1417 fViewAngleThetaPlusButton->SetHeight(22);
1418 fViewAngleThetaPlusButton->SetWidth(22);
1419 fViewAngleThetaPlusButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1421 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 0, 0);
1422 fWidgets->Add(fLayout);
1423 fViewAngleThetaFrame->AddFrame(fViewAngleThetaPlusButton, fLayout);
1429 fViewAngleThetaSlider->GetPosition(),
1430 (TGNumberFormat::EStyle) 1, (TGNumberFormat::EAttribute) 0 );
1431 fViewAngleThetaNumber->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1432 h = fViewAngleThetaNumber->GetDefaultHeight();
1433 charw = fViewAngleThetaNumber->GetCharWidth(
"0123456");
1434 w = charw * TMath::Abs(4) / 10 + 8 + 2 * h / 3;
1435 fViewAngleThetaNumber->Resize(w, h);
1437 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 2, 2, 0);
1438 fWidgets->Add(fLayout);
1439 fViewAngleThetaFrame->AddFrame(fViewAngleThetaNumber, fLayout);
1442 fViewAngleThetaLabel =
new TGLabel(fViewAngleThetaFrame,
"theta");
1443 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 2, 2, 2);
1444 fWidgets->Add(fLayout);
1445 fViewAngleThetaFrame->AddFrame(fViewAngleThetaLabel, fLayout);
1448 fViewAnglePhiFrame =
new TGCompositeFrame(fViewAngleFrame, fViewAngleFrame->GetWidth(), 50, kVerticalFrame);
1449 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop , 3, 3, 3, 3);
1450 fWidgets->Add(fLayout);
1451 fViewAngleFrame->AddFrame(fViewAnglePhiFrame, fLayout);
1455 gClient->GetPicture(
"ViewAngleMinus.gif"),
1457 fViewAnglePhiMinusButton->SetToolTipText(
"Phi -");
1458 fViewAnglePhiMinusButton->SetHeight(22);
1459 fViewAnglePhiMinusButton->SetWidth(22);
1460 fViewAnglePhiMinusButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1462 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 0, 0);
1463 fWidgets->Add(fLayout);
1464 fViewAnglePhiFrame->AddFrame(fViewAnglePhiMinusButton, fLayout);
1467 fViewAnglePhiSlider =
new TGVSlider(fViewAnglePhiFrame, 120, kSlider2 | kScaleBoth,
kM_Slider_ViewAnglePhi);
1468 fViewAnglePhiSlider->Connect(
"PositionChanged(Int_t)",
"BesClient",
this,
"HandleSliders(Int_t)");
1469 fViewAnglePhiSlider->SetRange(0, 360);
1470 fViewAnglePhiSlider->SetPosition(0);
1471 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsCenterX | kLHintsExpandY, 5, 5, 0, 0);
1472 fWidgets->Add(fLayout);
1473 fViewAnglePhiFrame->AddFrame(fViewAnglePhiSlider, fLayout);
1477 gClient->GetPicture(
"ViewAnglePlus.gif"),
1479 fViewAnglePhiPlusButton->SetToolTipText(
"Phi +");
1480 fViewAnglePhiPlusButton->SetHeight(22);
1481 fViewAnglePhiPlusButton->SetWidth(22);
1482 fViewAnglePhiPlusButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1484 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 0, 0);
1485 fWidgets->Add(fLayout);
1486 fViewAnglePhiFrame->AddFrame(fViewAnglePhiPlusButton, fLayout);
1492 fViewAnglePhiSlider->GetPosition(),
1493 (TGNumberFormat::EStyle) 1, (TGNumberFormat::EAttribute) 0 );
1494 fViewAnglePhiNumber->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1495 h = fViewAnglePhiNumber->GetDefaultHeight();
1496 charw = fViewAnglePhiNumber->GetCharWidth(
"0123456");
1497 w = charw * TMath::Abs(4) / 10 + 8 + 2 * h / 3;
1498 fViewAnglePhiNumber->Resize(w, h);
1500 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 2, 2, 0);
1501 fWidgets->Add(fLayout);
1502 fViewAnglePhiFrame->AddFrame(fViewAnglePhiNumber, fLayout);
1505 fViewAnglePhiLabel =
new TGLabel(fViewAnglePhiFrame,
"phi");
1506 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 2, 2, 2);
1507 fWidgets->Add(fLayout);
1508 fViewAnglePhiFrame->AddFrame(fViewAnglePhiLabel, fLayout);
1511 fViewAnglePsiFrame =
new TGCompositeFrame(fViewAngleFrame, fViewAngleFrame->GetWidth(), 50, kVerticalFrame);
1512 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop , 3, 3, 3, 3);
1513 fWidgets->Add(fLayout);
1514 fViewAngleFrame->AddFrame(fViewAnglePsiFrame, fLayout);
1518 gClient->GetPicture(
"ViewAngleMinus.gif"),
1520 fViewAnglePsiMinusButton->SetToolTipText(
"Psi -");
1521 fViewAnglePsiMinusButton->SetHeight(22);
1522 fViewAnglePsiMinusButton->SetWidth(22);
1523 fViewAnglePsiMinusButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1525 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 0, 0);
1526 fWidgets->Add(fLayout);
1527 fViewAnglePsiFrame->AddFrame(fViewAnglePsiMinusButton, fLayout);
1530 fViewAnglePsiSlider =
new TGVSlider(fViewAnglePsiFrame, 120, kSlider2 | kScaleBoth,
kM_Slider_ViewAnglePsi);
1531 fViewAnglePsiSlider->Connect(
"PositionChanged(Int_t)",
"BesClient",
this,
"HandleSliders(Int_t)");
1532 fViewAnglePsiSlider->SetRange(0, 360);
1533 fViewAnglePsiSlider->SetPosition(270);
1534 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsCenterX | kLHintsExpandY, 5, 5, 0, 0);
1535 fWidgets->Add(fLayout);
1536 fViewAnglePsiFrame->AddFrame(fViewAnglePsiSlider, fLayout);
1540 gClient->GetPicture(
"ViewAnglePlus.gif"),
1542 fViewAnglePsiPlusButton->SetToolTipText(
"Psi +");
1543 fViewAnglePsiPlusButton->SetHeight(22);
1544 fViewAnglePsiPlusButton->SetWidth(22);
1545 fViewAnglePsiPlusButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1547 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 5, 5, 0, 0);
1548 fWidgets->Add(fLayout);
1549 fViewAnglePsiFrame->AddFrame(fViewAnglePsiPlusButton, fLayout);
1555 fViewAnglePsiSlider->GetPosition(),
1556 (TGNumberFormat::EStyle) 1, (TGNumberFormat::EAttribute) 0 );
1557 fViewAnglePsiNumber->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1558 h = fViewAnglePsiNumber->GetDefaultHeight();
1559 charw = fViewAnglePsiNumber->GetCharWidth(
"0123456");
1560 w = charw * TMath::Abs(4) / 10 + 8 + 2 * h / 3;
1561 fViewAnglePsiNumber->Resize(w, h);
1563 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 2, 2, 0);
1564 fWidgets->Add(fLayout);
1565 fViewAnglePsiFrame->AddFrame(fViewAnglePsiNumber, fLayout);
1568 fViewAnglePsiLabel =
new TGLabel(fViewAnglePsiFrame,
"psi");
1569 fLayout =
new TGLayoutHints(kLHintsTop | kLHintsCenterX, 2, 2, 2, 2);
1570 fWidgets->Add(fLayout);
1571 fViewAnglePsiFrame->AddFrame(fViewAnglePsiLabel, fLayout);
1576 tf = fTabs->AddTab(
"Event");
1577 tf->SetBackgroundPixmap(
GetPic(
"8.gif"));
1582 fEventControlFrame =
new TGCompositeFrame(tf, tf->GetWidth(), tf->GetHeight(), kVerticalFrame);
1583 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX , 15, 15, 15, 10);
1584 fWidgets->Add(fLayout);
1585 tf->AddFrame(fEventControlFrame, fLayout);
1586 fEventControlFrame->SetBackgroundPixmap(
GetPic(
"EventFrameBckgnd.gif"));
1590 fEventControlTextFrame =
new TGCompositeFrame(fEventControlFrame, fEventControlFrame->GetWidth(), 30, kHorizontalFrame);
1591 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsTop | kLHintsExpandX, 0, 0, 0, 0);
1592 fWidgets->Add(fLayout);
1593 fEventControlFrame->AddFrame(fEventControlTextFrame, fLayout);
1594 fEventControlTextFrame->SetBackgroundPixmap(
GetPic(
"EventControlBckgnd.gif"));
1596 fEventControlTextLabel =
new TGLabel(fEventControlTextFrame,
"Event Control ");
1597 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft | kLHintsExpandX , 2, 73, 4, 4);
1598 fWidgets->Add(fLayout);
1599 fEventControlTextFrame->AddFrame(fEventControlTextLabel, fLayout);
1600 fEventControlTextLabel->SetBackgroundPixmap(
GetPic(
"EventControlBckgnd.gif"));
1603 fBesRunFrame =
new TGHorizontalFrame(fEventControlFrame, fEventControlFrame->GetWidth(), 25);
1604 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 4, 4, 4, 4);
1605 fWidgets->Add(fLayout);
1606 fEventControlFrame->AddFrame(fBesRunFrame, fLayout);
1607 fBesRunFrame->SetBackgroundPixmap(
GetPic(
"EventFrameBckgnd.gif"));
1609 fBesLabelRun =
new TGLabel(fBesRunFrame,
"Run : ");
1610 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 4, 4, 4);
1611 fWidgets->Add(fLayout);
1612 fBesRunFrame->AddFrame(fBesLabelRun, fLayout);
1614 fNumEntryRunNo =
new TGNumberEntry(fBesRunFrame,this->
GetBesRunNo(),12,
kM_Button_BesRun,(TGNumberFormat::EStyle) 0,(TGNumberFormat::EAttribute) 1);
1615 fNumEntryRunNo->SetHeight(20);
1617 fNumEntryRunNo->GetNumberEntry()->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1618 fNumEntryRunNo->GetNumberEntry()->Connect(
"TabPressed()",
"BesClient",
this,
"ChangeFocus()");
1619 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 4, 4, 4, 4);
1620 fWidgets->Add(fLayout);
1621 fBesRunFrame->AddFrame(fNumEntryRunNo, fLayout);
1624 fBesEventFrame =
new TGHorizontalFrame(fEventControlFrame, fEventControlFrame->GetWidth(), 25);
1625 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsExpandX , 4, 4, 4, 4);
1626 fWidgets->Add(fLayout);
1627 fEventControlFrame->AddFrame(fBesEventFrame, fLayout);
1629 fBesLabelEvent =
new TGLabel(fBesEventFrame,
"Event : ");
1630 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 4, 4, 4);
1631 fWidgets->Add(fLayout);
1632 fBesEventFrame->AddFrame(fBesLabelEvent, fLayout);
1634 fNumEntryEventNo =
new TGNumberEntry(fBesEventFrame,this->
GetBesEventNo(),12,
kM_Button_BesEvent,(TGNumberFormat::EStyle) 0,(TGNumberFormat::EAttribute) 1);
1635 fNumEntryEventNo->SetHeight(20);
1637 fNumEntryEventNo->GetNumberEntry()->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1638 fNumEntryEventNo->GetNumberEntry()->Connect(
"TabPressed()",
"BesClient",
this,
"ChangeFocus()");
1639 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 4, 4, 4, 4);
1640 fWidgets->Add(fLayout);
1641 fBesEventFrame->AddFrame(fNumEntryEventNo, fLayout);
1648 fEventPlaySlider =
new TGHSlider(fEventControlFrame, 40, kSlider1 | kScaleNo,
kM_Slider_EventPlay);
1649 fEventPlaySlider->Connect(
"PositionChanged(Int_t)",
"BesClient",
this,
"HandleSliders(Int_t)");
1650 fEventPlaySlider->SetRange(0, 100);
1651 fEventPlaySlider->SetPosition(0);
1652 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsCenterX | kLHintsExpandX, 5, 5, 5, 0);
1653 fWidgets->Add(fLayout);
1654 fEventControlFrame->AddFrame(fEventPlaySlider, fLayout);
1657 fEventPlayButtonFrame =
new TGCompositeFrame(fEventControlFrame, fEventControlFrame->GetWidth(), 30, kHorizontalFrame);
1659 fLayout =
new TGLayoutHints(kLHintsCenterX | kLHintsTop, 2, 2, 2, 2);
1660 fWidgets->Add(fLayout);
1661 fEventControlFrame->AddFrame(fEventPlayButtonFrame, fLayout);
1665 gClient->GetPicture(
"ButtonEventPrev.gif"),
1667 fPrevEventButton->SetToolTipText(
"Previous Event");
1668 fPrevEventButton->SetHeight(26);
1669 fPrevEventButton->SetWidth(25);
1670 fPrevEventButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1672 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 8, 0, 0, 4);
1673 fWidgets->Add(fLayout);
1674 fEventPlayButtonFrame->AddFrame(fPrevEventButton, fLayout);
1679 fNextEventButton->SetToolTipText(
"Next Event");
1680 fNextEventButton->SetHeight(26);
1681 fNextEventButton->SetWidth(26);
1682 fNextEventButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1684 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 10, 0, 4);
1685 fWidgets->Add(fLayout);
1686 fEventPlayButtonFrame->AddFrame(fNextEventButton, fLayout);
1690 gClient->GetPicture(
"ButtonEventPlay.gif"),
1692 fPlayEventButton->SetToolTipText(
"Play Event");
1693 fPlayEventButton->SetHeight(35);
1694 fPlayEventButton->SetWidth(34);
1695 fPlayEventButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1697 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 5, 0, 0, 4);
1698 fWidgets->Add(fLayout);
1699 fEventPlayButtonFrame->AddFrame(fPlayEventButton, fLayout);
1703 gClient->GetPicture(
"ButtonEventReturn.gif"),
1705 fFirstEventButton->SetToolTipText(
"First Event");
1706 fFirstEventButton->SetHeight(35);
1707 fFirstEventButton->SetWidth(25);
1708 fFirstEventButton->Connect(
"Clicked()",
"BesClient",
this,
"HandleButtons()");
1710 fLayout =
new TGLayoutHints(kLHintsLeft | kLHintsCenterY, 0, 8, 0, 4);
1711 fWidgets->Add(fLayout);
1712 fEventPlayButtonFrame->AddFrame(fFirstEventButton, fLayout);
1715 fEventPlayTextFrame =
new TGCompositeFrame(fEventControlFrame, fEventControlFrame->GetWidth(), 30, kHorizontalFrame);
1716 fLayout =
new TGLayoutHints(kLHintsCenterX | kLHintsTop, 2, 2, 2, 2);
1717 fWidgets->Add(fLayout);
1718 fEventControlFrame->AddFrame(fEventPlayTextFrame, fLayout);
1720 fEventPlayTextLabel =
new TGLabel(fEventPlayTextFrame,
"Prev,Next,Play/Stop,Return");
1721 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 5, 4, 2, 5);
1722 fWidgets->Add(fLayout);
1723 fEventPlayTextFrame->AddFrame(fEventPlayTextLabel, fLayout);
1727 fEventPlaySpeedFrame =
new TGCompositeFrame(fEventControlFrame, fEventControlFrame->GetWidth(), 30, kHorizontalFrame);
1728 fLayout =
new TGLayoutHints(kLHintsCenterX | kLHintsTop, 4, 4, 4, 4);
1729 fWidgets->Add(fLayout);
1730 fEventControlFrame->AddFrame(fEventPlaySpeedFrame, fLayout);
1733 fNumEntryEventPlaySpeed =
new TGNumberEntry(fEventPlaySpeedFrame,(Double_t)this->
GetEventPlaySpeed()/1000.0,4,
1735 (TGNumberFormat::EStyle) 1,(TGNumberFormat::EAttribute) 1);
1736 fNumEntryEventPlaySpeed->SetHeight(20);
1738 fNumEntryEventPlaySpeed->GetNumberEntry()->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
1739 fNumEntryEventPlaySpeed->GetNumberEntry()->Connect(
"TabPressed()",
"BesClient",
this,
"ChangeFocus()");
1740 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 4, 4, 4);
1741 fWidgets->Add(fLayout);
1742 fEventPlaySpeedFrame->AddFrame(fNumEntryEventPlaySpeed, fLayout);
1745 fEventPlaySpeedLabel =
new TGLabel(fEventPlaySpeedFrame,
" sec/event ");
1746 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsRight, 2, 4, 4, 10);
1747 fWidgets->Add(fLayout);
1748 fEventPlaySpeedFrame->AddFrame(fEventPlaySpeedLabel, fLayout);
1803 tf = fTabs->AddTab(
"REC");
1805 tf->SetBackgroundPixmap(
GetPic(
"8.gif"));
1808 fFrameHeader =
new TGGroupFrame(tf,
"Header");
1809 fLayout =
new TGLayoutHints(kLHintsExpandX, 15, 15, 15, 15);
1810 fWidgets->Add(fLayout);
1811 tf->AddFrame(fFrameHeader, fLayout);
1812 fChkBtnHeaderGlobal =
new TGCheckButton(fFrameHeader,
"Header",
kM_Header_Global);
1813 fFrameHeader->AddFrame(fChkBtnHeaderGlobal);
1814 fChkBtnHeaderGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1817 fFrameHits =
new TGGroupFrame(tf,
"Hits");
1818 fLayout =
new TGLayoutHints(kLHintsExpandX, 15, 15, 15, 15);
1819 fWidgets->Add(fLayout);
1820 tf->AddFrame(fFrameHits, fLayout);
1822 fChkBtnMdcHitsGlobal =
new TGCheckButton(fFrameHits,
"Mdc hits",
kM_MdcHits_Global);
1823 fFrameHits->AddFrame(fChkBtnMdcHitsGlobal);
1825 fChkBtnTofHitsGlobal =
new TGCheckButton(fFrameHits,
"Tof hits",
kM_TofHits_Global);
1826 fFrameHits->AddFrame(fChkBtnTofHitsGlobal);
1828 fChkBtnTofHitsEast =
new TGCheckButton(fFrameHits,
" East ",
kM_TofHits_East);
1829 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1830 fWidgets->Add(fLayout);
1831 fFrameHits->AddFrame(fChkBtnTofHitsEast, fLayout);
1833 fChkBtnTofHitsBarrel =
new TGCheckButton(fFrameHits,
" Barrel ",
kM_TofHits_Barrel);
1834 fFrameHits->AddFrame(fChkBtnTofHitsBarrel, fLayout);
1836 fChkBtnTofHitsWest =
new TGCheckButton(fFrameHits,
" West ",
kM_TofHits_West);
1837 fFrameHits->AddFrame(fChkBtnTofHitsWest, fLayout);
1839 fChkBtnEmcHitsGlobal =
new TGCheckButton(fFrameHits,
"Emc hits",
kM_EmcHits_Global);
1840 fFrameHits->AddFrame(fChkBtnEmcHitsGlobal);
1842 fChkBtnEmcHitsEast =
new TGCheckButton(fFrameHits,
" East ",
kM_EmcHits_East);
1843 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1844 fWidgets->Add(fLayout);
1845 fFrameHits->AddFrame(fChkBtnEmcHitsEast, fLayout);
1847 fChkBtnEmcHitsBarrel =
new TGCheckButton(fFrameHits,
" Barrel ",
kM_EmcHits_Barrel);
1848 fFrameHits->AddFrame(fChkBtnEmcHitsBarrel, fLayout);
1850 fChkBtnEmcHitsWest =
new TGCheckButton(fFrameHits,
" West ",
kM_EmcHits_West);
1851 fFrameHits->AddFrame(fChkBtnEmcHitsWest, fLayout);
1853 fChkBtnEmcHitsSide =
new TGCheckButton(fFrameHits,
" Side ",
kM_EmcHits_Side);
1854 fFrameHits->AddFrame(fChkBtnEmcHitsSide, fLayout);
1856 fChkBtnMucHitsGlobal =
new TGCheckButton(fFrameHits,
"Muc hits",
kM_MucHits_Global);
1857 fFrameHits->AddFrame(fChkBtnMucHitsGlobal);
1859 fChkBtnMucHitsEast =
new TGCheckButton(fFrameHits,
" East ",
kM_MucHits_East);
1860 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1861 fWidgets->Add(fLayout);
1862 fFrameHits->AddFrame(fChkBtnMucHitsEast, fLayout);
1864 fChkBtnMucHitsBarrel =
new TGCheckButton(fFrameHits,
" Barrel ",
kM_MucHits_Barrel);
1865 fFrameHits->AddFrame(fChkBtnMucHitsBarrel, fLayout);
1867 fChkBtnMucHitsWest =
new TGCheckButton(fFrameHits,
" West ",
kM_MucHits_West);
1868 fFrameHits->AddFrame(fChkBtnMucHitsWest, fLayout);
1870 fChkBtnMdcHitsGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1871 fChkBtnTofHitsGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1872 fChkBtnTofHitsEast ->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1873 fChkBtnTofHitsBarrel->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1874 fChkBtnTofHitsWest ->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1875 fChkBtnEmcHitsGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1876 fChkBtnEmcHitsEast ->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1877 fChkBtnEmcHitsBarrel->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1878 fChkBtnEmcHitsWest ->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1879 fChkBtnEmcHitsSide ->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1880 fChkBtnMucHitsGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1881 fChkBtnMucHitsEast ->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1882 fChkBtnMucHitsBarrel->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1883 fChkBtnMucHitsWest ->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1886 fFrameTracks =
new TGGroupFrame(tf,
"Tracks");
1887 fLayout =
new TGLayoutHints(kLHintsExpandX, 15, 15, 15, 15);
1888 fWidgets->Add(fLayout);
1889 tf->AddFrame(fFrameTracks, fLayout);
1891 fChkBtnTracksGlobal =
new TGCheckButton(fFrameTracks,
"Tracks",
kM_Tracks_Global);
1892 fFrameTracks->AddFrame(fChkBtnTracksGlobal);
1894 fChkBtnTracksMdc =
new TGCheckButton(fFrameTracks,
" Mdc ",
kM_Tracks_Mdc);
1895 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1896 fWidgets->Add(fLayout);
1897 fFrameTracks->AddFrame(fChkBtnTracksMdc, fLayout);
1899 fChkBtnTracksTof =
new TGCheckButton(fFrameTracks,
" Tof ",
kM_Tracks_Tof);
1900 fFrameTracks->AddFrame(fChkBtnTracksTof, fLayout);
1902 fChkBtnTracksEmc =
new TGCheckButton(fFrameTracks,
" Emc ",
kM_Tracks_Emc);
1903 fFrameTracks->AddFrame(fChkBtnTracksEmc, fLayout);
1905 fChkBtnTracksMuc =
new TGCheckButton(fFrameTracks,
" Muc ",
kM_Tracks_Muc);
1906 fFrameTracks->AddFrame(fChkBtnTracksMuc, fLayout);
1908 fChkBtnTracksExt =
new TGCheckButton(fFrameTracks,
" Ext ",
kM_Tracks_Ext);
1909 fFrameTracks->AddFrame(fChkBtnTracksExt, fLayout);
1911 fChkBtnTracksGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1912 fChkBtnTracksMdc->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1913 fChkBtnTracksTof->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1914 fChkBtnTracksEmc->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1915 fChkBtnTracksMuc->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1916 fChkBtnTracksExt->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1921 tf = fTabs->AddTab(
"Detector");
1922 tf->SetBackgroundPixmap(
GetPic(
"8.gif"));
1925 fFrameSubDetector =
new TGGroupFrame(tf,
"Sub-Detector");
1928 fLayout =
new TGLayoutHints(kLHintsExpandX, 15, 15, 15, 15);
1929 fWidgets->Add(fLayout);
1930 tf->AddFrame(fFrameSubDetector, fLayout);
1933 fChkBtnMdcGlobal =
new TGCheckButton(fFrameSubDetector,
"Mdc",
kM_Mdc_Global);
1934 fLayout =
new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0);
1935 fFrameSubDetector->AddFrame(fChkBtnMdcGlobal, fLayout);
1936 fChkBtnMdcGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1938 fChkBtnMdcTubes =
new TGCheckButton(fFrameSubDetector,
"Tubes",
kM_Mdc_Tubes);
1939 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1940 fFrameSubDetector->AddFrame(fChkBtnMdcTubes, fLayout);
1941 fChkBtnMdcTubes->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1943 fChkBtnMdcWires =
new TGCheckButton(fFrameSubDetector,
"Wires",
kM_Mdc_Wires);
1944 fFrameSubDetector->AddFrame(fChkBtnMdcWires, fLayout);
1945 fChkBtnMdcWires->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1948 fChkBtnTofGlobal =
new TGCheckButton(fFrameSubDetector,
"Tof",
kM_Tof_Global);
1949 fLayout =
new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0);
1950 fFrameSubDetector->AddFrame(fChkBtnTofGlobal, fLayout);
1951 fChkBtnTofGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1953 fChkBtnTofEast =
new TGCheckButton(fFrameSubDetector,
"East EC",
kM_Tof_East);
1954 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1955 fFrameSubDetector->AddFrame(fChkBtnTofEast, fLayout);
1956 fChkBtnTofEast->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1958 fChkBtnTofBarrel =
new TGCheckButton(fFrameSubDetector,
"Barrel",
kM_Tof_Barrel);
1959 fFrameSubDetector->AddFrame(fChkBtnTofBarrel, fLayout);
1960 fChkBtnTofBarrel->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1962 fChkBtnTofWest =
new TGCheckButton(fFrameSubDetector,
"West EC",
kM_Tof_West);
1963 fFrameSubDetector->AddFrame(fChkBtnTofWest, fLayout);
1964 fChkBtnTofWest->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1967 fChkBtnEmcGlobal =
new TGCheckButton(fFrameSubDetector,
"Emc",
kM_Emc_Global);
1968 fLayout =
new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0);
1969 fFrameSubDetector->AddFrame(fChkBtnEmcGlobal, fLayout);
1970 fChkBtnEmcGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1972 fChkBtnEmcEast =
new TGCheckButton(fFrameSubDetector,
"East EC",
kM_Emc_East);
1973 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1974 fFrameSubDetector->AddFrame(fChkBtnEmcEast, fLayout);
1975 fChkBtnEmcEast->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1977 fChkBtnEmcBarrel =
new TGCheckButton(fFrameSubDetector,
"Barrel",
kM_Emc_Barrel);
1978 fFrameSubDetector->AddFrame(fChkBtnEmcBarrel, fLayout);
1979 fChkBtnEmcBarrel->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1981 fChkBtnEmcWest =
new TGCheckButton(fFrameSubDetector,
"West EC",
kM_Emc_West);
1982 fFrameSubDetector->AddFrame(fChkBtnEmcWest, fLayout);
1983 fChkBtnEmcWest->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1985 fChkBtnEmcSide =
new TGCheckButton(fFrameSubDetector,
"Side ",
kM_Emc_Side);
1986 fFrameSubDetector->AddFrame(fChkBtnEmcSide, fLayout);
1987 fChkBtnEmcSide->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1990 fChkBtnMucGlobal =
new TGCheckButton(fFrameSubDetector,
"Muc",
kM_Muc_Global);
1991 fLayout =
new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0);
1992 fFrameSubDetector->AddFrame(fChkBtnMucGlobal, fLayout);
1993 fChkBtnMucGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
1995 fChkBtnMucEast =
new TGCheckButton(fFrameSubDetector,
"East EC",
kM_Muc_East);
1996 fLayout =
new TGLayoutHints(kLHintsLeft, 20, 0, 0, 0);
1997 fFrameSubDetector->AddFrame(fChkBtnMucEast, fLayout);
1998 fChkBtnMucEast->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2000 fChkBtnMucBarrel =
new TGCheckButton(fFrameSubDetector,
"Barrel",
kM_Muc_Barrel);
2001 fFrameSubDetector->AddFrame(fChkBtnMucBarrel, fLayout);
2002 fChkBtnMucBarrel->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2004 fChkBtnMucWest =
new TGCheckButton(fFrameSubDetector,
"West EC",
kM_Muc_West);
2005 fFrameSubDetector->AddFrame(fChkBtnMucWest, fLayout);
2006 fChkBtnMucWest->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2008 fChkBtnMucStrips =
new TGCheckButton(fFrameSubDetector,
"Strips",
kM_Muc_Strips);
2009 fFrameSubDetector->AddFrame(fChkBtnMucStrips, fLayout);
2010 fChkBtnMucStrips->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2013 fFrameOthers =
new TGGroupFrame (tf,
"Others");
2014 fLayout =
new TGLayoutHints (kLHintsExpandX, 15, 15, 15, 15);
2015 fWidgets->Add(fLayout);
2016 tf->AddFrame (fFrameOthers, fLayout);
2018 fChkBtnBeamPipe =
new TGCheckButton (fFrameOthers,
"Beam Pipe",
kM_BeamPipe);
2019 fFrameOthers->AddFrame (fChkBtnBeamPipe);
2020 fChkBtnBeamPipe->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2022 fChkBtnZRPlaneOnXY =
new TGCheckButton (fFrameOthers,
"ZR plane on XY",
kM_ZRPlaneOnXY);
2023 fFrameOthers->AddFrame (fChkBtnZRPlaneOnXY);
2024 fChkBtnZRPlaneOnXY->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2026 fChkBtnAxis =
new TGCheckButton (fFrameOthers,
"Axis",
kM_Axis);
2027 fFrameOthers->AddFrame (fChkBtnAxis);
2028 fChkBtnAxis->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2033 tf = fTabs->AddTab(
"Others");
2034 tf->SetBackgroundPixmap(
GetPic(
"8.gif"));
2037 fFrameMdcMatch =
new TGGroupFrame(tf,
"Mdc Status");
2038 fLayout =
new TGLayoutHints(kLHintsExpandX, 15, 15, 15, 15);
2039 fWidgets->Add(fLayout);
2040 tf->AddFrame(fFrameMdcMatch, fLayout);
2043 fChkBtnMdcTMatchGlobal->SetState(kButtonDown);
2045 fFrameMdcMatch->AddFrame(fChkBtnMdcTMatchGlobal);
2046 fChkBtnMdcTMatchGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2049 fChkBtnMdcQMatchGlobal->SetState(kButtonDown);
2051 fFrameMdcMatch->AddFrame(fChkBtnMdcQMatchGlobal);
2052 fChkBtnMdcQMatchGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2055 fChkBtnMdcQOverflowGlobal->SetState(kButtonUp);
2057 fFrameMdcMatch->AddFrame(fChkBtnMdcQOverflowGlobal);
2058 fChkBtnMdcQOverflowGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2062 fChkBtnMdcColorfulWireGlobal->SetState(kButtonUp);
2063 fFrameMdcMatch->AddFrame(fChkBtnMdcColorfulWireGlobal);
2064 fChkBtnMdcColorfulWireGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2068 fChkBtnMdcTimeSubEvTimeGlobal->SetState(kButtonUp);
2069 fFrameMdcMatch->AddFrame(fChkBtnMdcTimeSubEvTimeGlobal);
2070 fChkBtnMdcTimeSubEvTimeGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2073 fFrameTofMatch =
new TGGroupFrame(tf,
"Tof TQ Match");
2074 fLayout =
new TGLayoutHints(kLHintsExpandX, 15, 15, 15, 15);
2075 fWidgets->Add(fLayout);
2076 tf->AddFrame(fFrameTofMatch, fLayout);
2079 fChkBtnTofTMatchGlobal->SetState(kButtonDown);
2081 fFrameTofMatch->AddFrame(fChkBtnTofTMatchGlobal);
2082 fChkBtnTofTMatchGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2085 fChkBtnTofQMatchGlobal->SetState(kButtonDown);
2087 fFrameTofMatch->AddFrame(fChkBtnTofQMatchGlobal);
2088 fChkBtnTofQMatchGlobal->Connect(
"Clicked()",
"BesClient",
this,
"SetState()");
2091 fFrameMagnetic =
new TGGroupFrame(tf,
"Magnetic Field(Tesla)");
2092 fLayout =
new TGLayoutHints(kLHintsExpandX, 15, 15, 15, 15);
2093 fWidgets->Add(fLayout);
2094 tf->AddFrame(fFrameMagnetic, fLayout);
2097 fNumEntryMagnetic =
new TGNumberEntry(fFrameMagnetic,
2100 TGNumberFormat::kNESRealTwo,
2101 TGNumberFormat::kNEAAnyNumber);
2102 fNumEntryMagnetic->SetHeight(20);
2103 fNumEntryMagnetic->SetNumber(1.0);
2104 fNumEntryMagnetic->GetNumberEntry()
2105 ->Connect(
"ReturnPressed()",
"BesClient",
this,
"ExecuteReturn()");
2106 fNumEntryMagnetic->GetNumberEntry()
2107 ->Connect(
"TabPressed()",
"BesClient",
this,
"ChangeFocus()");
2108 fLayout =
new TGLayoutHints(kLHintsCenterY | kLHintsLeft, 4, 4, 4, 4);
2109 fWidgets->Add(fLayout);
2110 fFrameMagnetic->AddFrame(fNumEntryMagnetic, fLayout);
2113 for (Int_t iTab = 0; iTab < fTabs->GetNumberOfTabs(); iTab++) {
2114 fTabs->GetTabTab(iTab)->SetBackgroundPixmap(
GetPic(
"8.gif"));
2118void BesClient::SetMdcQNotOverflow(Bool_t input){
2125void BesClient::SetMdcTFire(Bool_t input){
2131void BesClient::SetMdcQFire(Bool_t input){
2137void BesClient::SetMdcColorfulWire(Bool_t input){
2143void BesClient::SetMdcTimeSubEvTime(Bool_t input){
2149void BesClient::SetTofTMatch(Bool_t input){
2155void BesClient::SetTofQMatch(Bool_t input){
2165 if (gDebug) cout <<
"BesClient::InitLocal called!" << endl;
2168 fWidgets =
new TList();
2176 fAutoDisplayEventTimer =
new TTimer(fEventPlaySpeed);
2177 Connect(fAutoDisplayEventTimer,
"Timeout()",
"BesClient",
this,
"AutoDisplayEventCommand()");
2179 fAutoRotateTimer =
new TTimer((Int_t)1000/fRotateFPS);
2180 Connect(fAutoRotateTimer,
"Timeout()",
"BesClient",
this,
"AutoRotateCommand()");
2183 new TColor(1001, 1.0, 1.0, 225/255.0);
2185 new TColor(1002, 227/255.0, 186/255.0, 227/255.0);
2187 new TColor(1003, 232/255.0, 234/255.0, 117/255.0);
2189 new TColor(1004, 254/255.0, 216/255.0, 31/255.0);
2191 new TColor(1005, 175/255.0, 192/255.0, 227/255.0);
2193 new TColor(1006, 192/255.0, 227/255.0, 226/255.0);
2195 new TColor(1007, 225/255.0, 199/255.0, 162/255.0);
2203 if (gDebug) cout <<
"BesClient::InitParameter called!" << endl;
2206 fWindowWidth = 1000;
2207 fWindowHeight = 710;
2209 fBesVisPath = TString(getenv(
"BESVISLIBROOT"));
2211 fEventPlaySpeed = 1000;
2212 fAutoDisplayEvent = kFALSE;
2214 for (Int_t i = 0; i < 3; i++) {
2221 fRotateSpeed = 10.0;
2224 fAutoRotate = kFALSE;
2225 fAutoRotateClockWise = 0;
2226 fAutoRotateTheta = 0;
2241 if (gDebug) cout <<
"BesClient::InitConnections called!" << endl;
2244 Connect((TCanvas*)fEmbeddedCanvas->GetCanvas(),
"ProcessedEvent(Int_t, Int_t, Int_t, TObject*)",
"BesClient",
2245 this,
"ExecuteEvent(Int_t, Int_t, Int_t, TObject*)");
2248 Connect(
"CloseWindow()",
"BesClient",
this,
"CloseWindow()");
2273 gInterpreter->DeleteGlobal(
this);
2282 fEmbeddedCanvas->GetCanvas()->EditorBar();
2296 cerr <<
"Menu item" <<
id <<
"selected" << endl;
2308 cout <<
"BesClient::HandleViewOptionMenu(), BesView does not exist in this pad" << endl;
2317 if ( fMenuViewOptionHeader->IsEntryChecked(
kM_Header_On) ) {
2337 if ( fMenuViewOptionMdc->IsEntryChecked(
kM_Mdc_Tubes) ) {
2347 if ( fMenuViewOptionMdc->IsEntryChecked(
kM_Mdc_Wires) ) {
2367 if ( fMenuViewOptionTof->IsEntryChecked(
kM_Tof_East) ) {
2387 if ( fMenuViewOptionTof->IsEntryChecked(
kM_Tof_West) ) {
2407 if ( fMenuViewOptionEmc->IsEntryChecked(
kM_Emc_East) ) {
2427 if ( fMenuViewOptionEmc->IsEntryChecked(
kM_Emc_West) ) {
2437 if ( fMenuViewOptionEmc->IsEntryChecked(
kM_Emc_Side) ) {
2457 if ( fMenuViewOptionMuc->IsEntryChecked(
kM_Muc_East) ) {
2477 if ( fMenuViewOptionMuc->IsEntryChecked(
kM_Muc_West) ) {
2497 if ( fMenuViewOptionFull3D->IsEntryChecked(
kM_Full3D_Mdc) ) {
2512 if ( fMenuViewOptionFull3D->IsEntryChecked(
kM_Full3D_Tof) ) {
2527 if ( fMenuViewOptionFull3D->IsEntryChecked(
kM_Full3D_Emc) ) {
2542 if ( fMenuViewOptionFull3D->IsEntryChecked(
kM_Full3D_Muc) ) {
2557 if ( fMenuViewOptionOthers->IsEntryChecked(
kM_BeamPipe) ) {
2577 if ( fMenuViewOptionOthers->IsEntryChecked(
kM_Axis) ) {
2578 fMenuViewOptionOthers->UnCheckEntry(
kM_Axis);
2581 fMenuViewOptionOthers->CheckEntry(
kM_Axis);
2737 if ( fMenuViewOptionTracks->IsEntryChecked(
kM_Tracks_Mdc) ) {
2747 if ( fMenuViewOptionTracks->IsEntryChecked(
kM_Tracks_Tof) ) {
2757 if ( fMenuViewOptionTracks->IsEntryChecked(
kM_Tracks_Emc) ) {
2767 if ( fMenuViewOptionTracks->IsEntryChecked(
kM_Tracks_Muc) ) {
2777 if ( fMenuViewOptionTracks->IsEntryChecked(
kM_Tracks_Ext) ) {
2796 cerr <<
"MenuViewOption item" <<
id <<
"selected" << endl;
2803 ((TCanvas*)fEmbeddedCanvas->GetCanvas())->Modified();
2804 ((TCanvas*)fEmbeddedCanvas->GetCanvas())->Update();
2812 new TGMsgBox(gClient->GetRoot(),
this,
2814 gClient->GetPicture(
"mb_stop_s.xpm"));
2822 fStatusBar->SetText(msg, 1);
2830 fStatusBar->SetText(msg, 0);
2848 if ( f_geoFile.Length() != 0){
2849 cout <<
"Load geoFile f_geoFile: " << f_geoFile << endl;
2854 static TString GeoDir = fBesVisPath + TString(
"/geom/");
2857 fi.fIniDir = StrDup(GeoDir);
2859 sprintf(msg,
"Loading Geometry File");
2861 new TGFileDialog(fClient->GetRoot(),
this, kFDOpen, &fi);
2862 if (&fi == 0)
return;
2863 GeoDir = fi.fIniDir;
2876 if (gDebug) cout << fname <<
" fname Length " << fname.Length() << endl;
2877 Ssiz_t posLastSlash = fname.Last(
'/');
2879 TString fpath = fname;
2880 fpath = fpath.Remove(posLastSlash+1, fname.Length()-posLastSlash-1);
2882 if (fpath.Length() == 0)
return;
2887 txt = Form(
"Geometry has already been build, Yes to rebuild it? \n (Each rebuild increase memory ~80MB)");
2888 new TGMsgBox(fClient->GetRoot(), GetMainFrame(),
2889 "Geometry Exist", txt, kMBIconExclamation,
2890 kMBYes | kMBNo, &ret);
2891 if (ret == kMBNo)
return;
2894 if ( fname.Contains(
".gdml") ) {
2900 if ( fname.Contains(
".root") ) {
2901 fGeoFile = TFile::Open(fname,
"read");
2903 TGeoVolume *volBes = (TGeoVolume*)(fGeoFile->Get(
"volBes"));
2911 this->
HandleError(
"This File is not a valid BesVis geometry file : \n TopVolume \"volBes\" not found!");
2912 sprintf(msg,
"This File is not a valid BesVis geometry file");
2933 this->
HandleError(
"Bes Geometry not found, Load from ROOT or GDML files first !");
2940 static TString EventDir(
".");
2943 fi.fIniDir = StrDup(EventDir);
2945 sprintf(msg,
"Saving Geometry ----> BUSY!");
2947 new TGFileDialog(fClient->GetRoot(),
this, kFDSave, &fi);
2949 TFile *f =
new TFile( fi.fFilename,
"RECREATE");
2954 this->
HandleError(
"TGeoVolume \"volBes\" not found !");
2967 this->
HandleError(
"Geometry not intialized, Load Geometry file first!");
2972 static TString EventDir(
".");
2975 fi.fIniDir = StrDup(EventDir);
2977 sprintf(msg,
"Loading Event File");
2979 new TGFileDialog(fClient->GetRoot(),
this, kFDOpen, &fi);
2980 EventDir = fi.fIniDir;
2990 std::cout <<
"OpenEventFile: " << fname << std::endl;
2993 f_evtFile_1 = fname;
2994 if ( fname.Contains(
".root")||fname.Contains(
".rtraw")||fname.Contains(
".rec") ) {
3000 fEventFile = TFile::Open(fname,
"read");
3004 fEventTree = (TTree*)fEventFile->Get(
"Event");
3007 this->
HandleError(
"This File is not a valid BesVis ROOT Event File!");
3008 sprintf(msg,
"This File is not valid");
3014 Long64_t nEvents = fEventTree->GetEntries();
3015 fEventPlaySlider->SetRange(0, nEvents-1);
3016 fEventPlaySlider->SetPosition(0);
3020 if(f_bossMode ==
false){
3025 fEventTree->SetBranchAddress(
"TDigiEvent" , &fDigiEvent);
3026 fEventTree->SetBranchAddress(
"TRecEvent" , &fRecEvent_1);
3027 fEventTree->SetBranchAddress(
"TEvtHeader" , &fEvtHeader);
3034 fEventPlaySlider->SetRange(0, nEvents);
3035 fEventPlaySlider->SetPosition(0);
3038 this->
HandleError(
"This File is not a valid BesVis ROOT Event File : \n Event Tree \"Event\" not found!");
3039 sprintf(msg,
"This File contains no Event Tree \"Event\"");
3055 static TString EventDir(
".");
3058 fi.fIniDir = StrDup(EventDir);
3060 sprintf(msg,
"Saving Picture ----> BUSY!");
3062 new TGFileDialog(fClient->GetRoot(),
this, kFDSave, &fi);
3064 if ( fi.fFilename ) {
3065 TString filename = fi.fFilename;
3066 if ( filename.EndsWith(
"gif") || filename.EndsWith(
"GIF") ) {
3067 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"gif");
3069 else if ( filename.EndsWith(
"jpg") || filename.EndsWith(
"JPG") ) {
3070 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"jpg");
3072 else if ( filename.EndsWith(
"eps") || filename.EndsWith(
"EPS") ) {
3073 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"eps");
3075 else if ( filename.EndsWith(
"ps") || filename.EndsWith(
"PS") ) {
3076 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"ps");
3078 else if ( filename.EndsWith(
"xpm") || filename.EndsWith(
"XPM") ) {
3079 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"xmp");
3081 else if ( filename.EndsWith(
"png") || filename.EndsWith(
"PNG") ) {
3082 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"png");
3084 else if ( filename.EndsWith(
"tiff") || filename.EndsWith(
"TIFF") ) {
3085 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"tiff");
3087 else if ( filename.EndsWith(
"cxx") || filename.EndsWith(
"CXX") ) {
3088 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"cxx");
3090 else if ( filename.EndsWith(
"xml") || filename.EndsWith(
"XML") ) {
3091 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"xml");
3093 else if ( filename.EndsWith(
"root") || filename.EndsWith(
"ROOT") ) {
3094 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"root");
3097 new TGMsgBox(gClient->GetRoot(),
this,
"Error",
"Please give Name and Extension of Filename! \n Valid Extensions are *.gif, *.jpg, *.ps, *.eps, *.xpm, *.png, *.tiff!",gClient->GetPicture(
"mb_stop_s.xpm"));
3113 static TString PSEventDir(
".");
3116 fi.fIniDir = StrDup(PSEventDir);
3118 sprintf(msg,
"Saving Picture as PS ----> BUSY!");
3120 new TGFileDialog(fClient->GetRoot(),
this, kFDSave, &fi);
3122 if ( fi.fFilename ) {
3123 TString filename = fi.fFilename;
3124 if ( filename.EndsWith(
"ps") || filename.EndsWith(
"PS") ) {
3125 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"ps");
3129 fEmbeddedCanvas->GetCanvas()->Print(filename.Data(),
"ps");
3141 Double_t x1, y1, x2, y2;
3148 fHomeX[iPad] = 0.5*(x1+x2);
3149 fHomeY[iPad] = 0.5*(y1+y2);
3159 Double_t x1, y1, x2, y2, dx, dy;
3169 gPad->Range(fHomeX[iPad]-0.5*dx, fHomeY[iPad]-0.5*dy, fHomeX[iPad]+0.5*dx, fHomeY[iPad]+0.5*dy);
3181 txt = Form(
"Save current style to ~/.besvisMyConfig.txt, Yes to save it? ");
3182 new TGMsgBox(fClient->GetRoot(), GetMainFrame(),
3183 "Save My Style", txt, kMBIconExclamation,
3184 kMBYes | kMBNo, &ret);
3185 if (ret == kMBNo)
return;
3187 string homePath = getenv(
"HOME");
3188 string fileName = homePath + string(
"/.besvisMyConfig.txt");
3190 ofstream fileMyConfig(fileName.c_str(), ios_base::out);
3196 fileMyConfig << *status;
3203 fileMyConfig << *status;
3210 fileMyConfig << *status;
3222 string homePath = getenv(
"HOME");
3223 string fileName = homePath + string(
"/.besvisMyConfig.txt");
3227 s <<
"The config file: " << fileName.c_str() <<
" does not exist ! \n Maybe You have not save your config";
3233 ifstream fileMyConfig(fileName.c_str());
3238 fileMyConfig >> status;
3245 fileMyConfig >> status;
3252 fileMyConfig >> status;
3264 cout<<
"BesClient Loading PaletteAxis ... "<<endl;
3281 TRootHelpDialog * hd =
new TRootHelpDialog(
this,
"Help on BesVis...", 600, 400);
3282 hd->SetText(gHelpBesVis);
3290 fDisplayModeButton[0]->
SetPicture(gClient->GetPicture(
"DisplayMode2D.gif"));
3291 fDisplayModeButton[1]->
SetPicture(gClient->GetPicture(
"DisplayModeXY.gif"));
3292 fDisplayModeButton[2]->
SetPicture(gClient->GetPicture(
"DisplayModeZR.gif"));
3293 fDisplayModeButton[3]->
SetPicture(gClient->GetPicture(
"DisplayMode3D.gif"));
3294 fDisplayModeButton[4]->
SetPicture(gClient->GetPicture(
"DisplayModeAll.gif"));
3296 for (Int_t i = 0; i < 5; i++) fDisplayModeButton[i]->
SetState(
false);
3317 gPad->GetViewer3D();
3322 TViewerX3D *x3d = 0;
3323 x3d = (TViewerX3D*)gPad->GetViewer3D();
3325 if (!x3d) cout <<
" x3d does not exist "<< endl;
3327 x3d->ExecCommand(0,0,
'r');
3331 string s(
"Could not start X3D for 2D view, swith to 3D view first");
3374 TGMainFrame::CloseWindow();
3375 gApplication->Terminate(0);
3384 Long64_t nEvents = fEventTree->GetEntries();
3385 if (i >= 0 && i < nEvents) {
3392 if (f_bossMode ==
true){
3393 TBranch *digiEvent = fEventTree->GetBranch(
"TDigiEvent");
3394 TBranch *evtHeader = fEventTree->GetBranch(
"TEvtHeader");
3396 TBranch *disTrack = fEventTree->GetBranch(
"TDisTrack");
3397 digiEvent->SetAddress(&fDigiEvent);
3399 disTrack->SetAddress(&fRecEvent);
3400 disTrack->GetEntry(i);
3401 digiEvent->GetEntry(i);
3402 evtHeader->GetEntry(i);
3406 if (f_bossMode ==
false){
3407 fEventTree->GetEntry(i);
3409 delete [] recTrack1;
3417 cout<<
"WARNING:EsTimeCol size!=1, size="<<fRecEvent_1->
getEvTimeCol()->GetEntries()<<endl;
3431 for (
int i=0;i<no;i++){
3433 (recTrack1+i)->setTRecMdcTrack(recTrack);
3465 if (no>200) no =200;
3466 for (
int i=0;i<no;i++){
3468 (tofTrack+i)->setTRecTofTrack(tofTrack1);
3481 if (no>1000) no =1000;
3482 for (
int i=0;i<no;i++){
3484 (mdchit+i)->setTRecMdcHit(mdchit1);
3498 for (
int i=0;i<no;i++){
3500 (muctrk+i)->setTRecMucTrack(mucTrack1);
3505 delete [] emcshower;
3514 for (
int i=0;i<no;i++){
3516 (emcshower+i)->setTRecEmcShower(rec_emc);
3524 fEvent->
SetEvent(fDigiEvent, fRecEvent, fEvtHeader, fRecEvTime);
3531 fAutoDisplayEvent = kFALSE;
3532 if (fAutoDisplayEventTimer) {
3533 fAutoDisplayEventTimer->TurnOff();
3534 fPlayEventButton->
SetPicture(gClient->GetPicture(
"ButtonEventPlay.gif"));
3538 s <<
"Request event entry " << i
3539 <<
" does not exist ! \n valid ("
3540 << 0 <<
"~" << nEvents - 1 <<
")";
3546 fAutoDisplayEvent = kFALSE;
3547 if (fAutoDisplayEventTimer) fAutoDisplayEventTimer->TurnOff();
3554 int semid, shmid,
n,
runNo;
3556 int sem_value_F, sem_value_O;
3559 if (fAutoDisplayEvent){
3560 if (fAutoDisplayEventTimer)
3561 fAutoDisplayEventTimer->TurnOn();
3562 fPlayEventButton->
SetPicture(gClient->GetPicture(
"ButtonEventStop.gif"));
3566 if ((semid = semget(f_pid, 2, 0)) == -1){
3567 perror(
"concumer -- access -- semget");
3594 if ((sem_value_O = semctl(semid,
OUTPUT_STORE, GETVAL, 0)) == -1){
3595 perror(
"Can not get OUTPUT_STORE");
3598 if (sem_value_O == 0)
return true;
3601 if (semop(semid, &
release, 1) == -1){
3602 perror(
"consumer -- increase -- freeSpace");
3605 std::cout <<
"read data error " << std::endl;
3611 if (semop(semid, &
acquire, 1) == -1){
3612 perror(
"consumer -- decrease -- storage");
3634 if (fCurrentEvent >= 1){
3641 fEvtHeader->
Clear();
3661 if (fEventFile == NULL){
3666 fEventFile->Close();
3697 if (semop(semid, &
release, 1) == -1){
3698 perror(
"consumer -- increase -- freeSpace");
3701 std::cout <<
"Current Event No. : " << fCurrentEvent++ << std::endl;
3729 if ( f_bossMode ==
false) {
3732 else if ( f_bossMode ==
true) {
3733 std::cout <<
"In Boss Mode, execute NextEvent()" << std::endl;
3736 if (!status) fBesEventNo--;
3746 if ( f_bossMode ==
false){
3749 else if ( f_bossMode ==
true){
3751 this->
HandleError(
"Boss Mode can not get previous event!");
3753 if (!status) fBesEventNo++;
3762 if ( f_bossMode ==
false){
3766 else if ( f_bossMode ==
true){
3768 this->
HandleError(
"Boss Mode can not get first event!");
3778 fAutoDisplayEvent = !fAutoDisplayEvent;
3779 std::cout <<
"(AutoDisplayEvent)fAutoDisplayEvent: " << fAutoDisplayEvent << std::endl;
3780 if (fAutoDisplayEventTimer) {
3781 if (fAutoDisplayEvent) {
3782 fPlayEventButton->
SetPicture(gClient->GetPicture(
"ButtonEventStop.gif"));
3783 fAutoDisplayEventTimer->TurnOn();
3786 fPlayEventButton->
SetPicture(gClient->GetPicture(
"ButtonEventPlay.gif"));
3787 fAutoDisplayEventTimer->TurnOff();
3812 fAutoRotate = !fAutoRotate;
3815 fAutoRotateClockWise = 0;
3816 fAutoRotateTheta = 0;
3821 if (fAutoRotateTimer) {
3822 if (fAutoRotate) fAutoRotateTimer->TurnOn();
3823 else fAutoRotateTimer->TurnOff();
3831 if (fAutoRotateClockWise != 0) {
3835 if (fAutoRotateTheta != 0) {
3839 if (fAutoRotatePhi != 0) {
3843 if (fAutoRotatePsi != 0) {
3875 if (fDisplay->
GetPadXY()->GetView()) {
3876 phi = fDisplay->
GetPadXY()->GetView()->GetLongitude();
3877 phi += clockwise * fRotateStep;
3878 fDisplay->
GetPadXY()->GetView()->SetView(phi,
3879 fDisplay->
GetPadXY()->GetView()->GetLatitude(),
3880 fDisplay->
GetPadXY()->GetView()->GetPsi(), iret);
3884 if (fDisplay->
GetPadZR()->GetView()) {
3888 fDisplay->
GetPadZR()->GetView()->SetView(phi,
3889 fDisplay->
GetPadZR()->GetView()->GetLatitude(),
3890 fDisplay->
GetPadZR()->GetView()->GetPsi(), iret);
3903 Double_t theta = view->
GetLatitude() + pn*fRotateStep;
3935 Double_t psi = view->
GetPsi() + pn*fRotateStep;
3950 if ( entry->GetFirstChild() != 0 ) {
3952 if ( entry->IsOpen() ) {
3953 fEventListTree->CloseItem(entry);
3955 fEventListTree->OpenItem(entry);
3958 fEventListTree->HighlightItem(entry);
3959 gClient->NeedRedraw(fEventListTree);
3963 fRunItem = entry->GetParent();
3964 TString msg1(
"Displaying Run ");
3969 TString msg2(
"Run ");
3974 TCanvas *canvas = (TCanvas*)fEmbeddedCanvas->GetCanvas();
3987 cout <<
"there is not BesGeometry" << endl;
4001 if ( py <= 0 ) py = 1;
4002 switch ( Char_t(px) ) {
4022 fEmbeddedCanvas->GetCanvas()->Update();
4029 fEmbeddedCanvas->GetCanvas()->Update();
4036 fEmbeddedCanvas->GetCanvas()->Update();
4043 fEmbeddedCanvas->GetCanvas()->Update();
4064 if ( gPad->GetName() != TString(
"PadHeader")) {
4065 TString info(sel->GetTitle());
4067 info.Append(sel->GetObjectInfo(px, py));
4084 TGButton *btn = (TGButton *) gTQSender;
4085 id = btn->WidgetId();
4263 this->SetMdcTFire(fChkBtnMdcTMatchGlobal->GetState());
4267 this->SetMdcQFire(fChkBtnMdcQMatchGlobal->GetState());
4275 this->SetMdcQNotOverflow(fChkBtnMdcQOverflowGlobal->GetState());
4279 this->SetMdcColorfulWire(fChkBtnMdcColorfulWireGlobal->GetState());
4283 this->SetMdcTimeSubEvTime(fChkBtnMdcTimeSubEvTimeGlobal->GetState());
4287 this->SetTofTMatch(fChkBtnTofTMatchGlobal->GetState());
4291 this->SetTofQMatch(fChkBtnTofQMatchGlobal->GetState());
4298 ((TCanvas*)fEmbeddedCanvas->GetCanvas())->Modified();
4299 ((TCanvas*)fEmbeddedCanvas->GetCanvas())->Update();
4581 fMenuViewOptionOthers->CheckEntry(
kM_Axis);
4582 fShowAxisButton->
SetPicture(gClient->GetPicture(
"ButtonShowAxisST.gif"));
4586 fMenuViewOptionOthers->UnCheckEntry(
kM_Axis);
4587 fShowAxisButton->
SetPicture(gClient->GetPicture(
"ButtonShowAxis.gif"));
4713 fFishEyeViewButton->
SetPicture(gClient->GetPicture(
"ButtonFishEyeViewST.gif"));
4716 fFishEyeViewButton->
SetPicture(gClient->GetPicture(
"ButtonFishEyeView.gif"));
4721 fParallelViewButton->
SetPicture(gClient->GetPicture(
"ButtonParallelView.gif"));
4722 fPerspectiveViewButton->
SetPicture(gClient->GetPicture(
"ButtonPerspectiveViewST.gif"));
4725 fParallelViewButton->
SetPicture(gClient->GetPicture(
"ButtonParallelViewST.gif"));
4726 fPerspectiveViewButton->
SetPicture(gClient->GetPicture(
"ButtonPerspectiveView.gif"));
4738 TGButton *btn = (TGButton *) gTQSender;
4739 id = btn->WidgetId();
4744 Int_t displayMode = 0;
4746 Double_t xmin=0.0, ymin=0.0, xmax=0.0, ymax=0.0;
4748 xmin = gPad->GetX1();
4749 ymin = gPad->GetY1();
4750 xmax = gPad->GetX2();
4751 ymax = gPad->GetY2();
4755 if (gPad) view = (
BesView*)gPad->GetView();
4763 fLoadGeoFileButton->
SetPicture(gClient->GetPicture(
"ButtonLoadGeoFile.gif"));
4768 fOpenEventFileButton->
SetPicture(gClient->GetPicture(
"ButtonOpenEventFile.gif"));
4773 fSavePicAsButton->
SetPicture(gClient->GetPicture(
"ButtonSavePicAs.gif"));
4777 fSavePicAsPSButton->
SetPicture(gClient->GetPicture(
"ButtonSavePicAsPSHL.gif"));
4779 fEmbeddedCanvas->GetCanvas()->Print(
"besvis.ps",
"ps");
4780 fSavePicAsPSButton->
SetPicture(gClient->GetPicture(
"ButtonSavePicAsPS.gif"));
4790 if (view) view->
Reset();
4794 if (view) fDisplay->
Reset();
4799 fCursorButton[0]->
SetPicture(gClient->GetPicture(
"ButtonCursorPickST.gif"));
4801 fCursorButton[1]->
SetPicture(gClient->GetPicture(
"ButtonCursorHand.gif"));
4809 fCursorButton[0]->
SetPicture(gClient->GetPicture(
"ButtonCursorPick.gif"));
4811 fCursorButton[1]->
SetPicture(gClient->GetPicture(
"ButtonCursorHandST.gif"));
4820 if (view) view->
ZoomIn();
4833 fSaveMyConfigButton->
SetPicture(gClient->GetPicture(
"ButtonSaveMyConfig.gif"));
4838 fLoadMyConfigButton->
SetPicture(gClient->GetPicture(
"ButtonLoadMyConfig.gif"));
4843 fPaletteButton->
SetPicture(gClient->GetPicture(
"ButtonPalette.gif"));
4854 fShowInfoButton->
SetPicture(gClient->GetPicture(
"ButtonShowInfoST.gif"));
4858 fShowInfoButton->
SetPicture(gClient->GetPicture(
"ButtonShowInfo.gif"));
4866 fShowAxisButton->
SetPicture(gClient->GetPicture(
"ButtonShowAxisST.gif"));
4870 fShowAxisButton->
SetPicture(gClient->GetPicture(
"ButtonShowAxis.gif"));
4881 fFishEyeViewButton->
SetPicture(gClient->GetPicture(
"ButtonFishEyeViewST.gif"));
4882 fFishEyeViewButton->
SetState(
true);
4885 fFishEyeViewButton->
SetPicture(gClient->GetPicture(
"ButtonFishEyeView.gif"));
4886 fFishEyeViewButton->
SetState(
false);
4893 fParallelViewButton->
SetPicture(gClient->GetPicture(
"ButtonParallelViewST.gif"));
4894 fParallelViewButton->
SetState(
true);
4895 fPerspectiveViewButton->
SetPicture(gClient->GetPicture(
"ButtonPerspectiveView.gif"));
4896 fPerspectiveViewButton->
SetState(
false);
4907 fParallelViewButton->
SetPicture(gClient->GetPicture(
"ButtonParallelView.gif"));
4908 fParallelViewButton->
SetState(
false);
4909 fPerspectiveViewButton->
SetPicture(gClient->GetPicture(
"ButtonPerspectiveViewST.gif"));
4910 fPerspectiveViewButton->
SetState(
true);
4918 fX3DButton->
SetPicture(gClient->GetPicture(
"ButtonX3D.gif"));
4923 fOpenGLButton->
SetPicture(gClient->GetPicture(
"ButtonOpenGL.gif"));
4951 if (fAutoRotateClockWise != -1) {
4952 fAutoRotateClockWise = -1;
4955 else fAutoRotateClockWise = 0;
4962 if (fAutoRotateClockWise != 1) {
4963 fAutoRotateClockWise = 1;
4966 else fAutoRotateClockWise = 0;
4994 if (fAutoRotateTheta != 1) fAutoRotateTheta = 1;
4995 else fAutoRotateTheta = 0;
5002 if (fAutoRotateTheta != -1) fAutoRotateTheta = -1;
5003 else fAutoRotateTheta = 0;
5010 if (fAutoRotatePhi != 1) {
5012 fAutoRotateClockWise = 0;
5014 else fAutoRotatePhi = 0;
5021 if (fAutoRotatePhi != -1) {
5022 fAutoRotatePhi = -1;
5023 fAutoRotateClockWise = 0;
5025 else fAutoRotatePhi = 0;
5033 if (fAutoRotatePsi != 1) fAutoRotatePsi = 1;
5034 else fAutoRotatePsi = 0;
5043 if (fAutoRotatePsi != -1) fAutoRotatePsi = -1;
5044 else fAutoRotatePsi = 0;
5055 fDisplayModeButton[0]->
SetState(
true);
5056 fDisplayModeButton[0]->
SetPicture(gClient->GetPicture(
"DisplayMode2DST.gif"));
5062 fDisplayModeButton[1]->
SetState(
true);
5063 fDisplayModeButton[1]->
SetPicture(gClient->GetPicture(
"DisplayModeXYST.gif"));
5069 fDisplayModeButton[2]->
SetState(
true);
5070 fDisplayModeButton[2]->
SetPicture(gClient->GetPicture(
"DisplayModeZRST.gif"));
5076 fDisplayModeButton[3]->
SetState(
true);
5077 fDisplayModeButton[3]->
SetPicture(gClient->GetPicture(
"DisplayMode3DST.gif"));
5083 fDisplayModeButton[4]->
SetState(
true);
5084 fDisplayModeButton[4]->
SetPicture(gClient->GetPicture(
"DisplayModeAllST.gif"));
5091 if (displayMode >= 5) displayMode -= 5;
5095 switch (displayMode) {
5097 fDisplayModeButton[displayMode]->
SetPicture(gClient->GetPicture(
"DisplayMode2DST.gif"));
5100 fDisplayModeButton[displayMode]->
SetPicture(gClient->GetPicture(
"DisplayModeXYST.gif"));
5103 fDisplayModeButton[displayMode]->
SetPicture(gClient->GetPicture(
"DisplayModeZRST.gif"));
5106 fDisplayModeButton[displayMode]->
SetPicture(gClient->GetPicture(
"DisplayMode3DST.gif"));
5109 fDisplayModeButton[displayMode]->
SetPicture(gClient->GetPicture(
"DisplayModeAllST.gif"));
5132 if (gDebug) cout <<
"BesClient::DoSlider called!" << endl;
5134 TGButton *btn = (TGButton *) gTQSender;
5135 Int_t
id = btn->WidgetId();
5143 fEventPlaySlider->SetPosition(slider);
5145 fBesEventNo = slider;
5177 TCanvas *canvas = (TCanvas*)fEmbeddedCanvas->GetCanvas();
5178 TPad *curPad = (TPad*)gPad;
5184 cout <<
"update xy view" << endl;
5186 else cout <<
"no xy view" << endl;
5192 cout <<
"update zr view" << endl;
5194 else cout <<
"no zr view" << endl;
5200 cout <<
"update 3d view" << endl;
5202 else cout <<
"no 3d view" << endl;
5300 fZoomRatioNumber->SetNumber(view->
GetZoomRatio()*100.0);
5304 Double_t psi = view->
GetPsi();
5308 fViewAngleThetaNumber->SetNumber(theta);
5309 fViewAnglePhiNumber->SetNumber(phi);
5310 fViewAnglePsiNumber->SetNumber(psi);
5312 fViewAngleThetaSlider->SetPosition((Int_t)fViewAngleThetaNumber->GetNumber());
5313 fViewAnglePhiSlider->SetPosition((Int_t)fViewAnglePhiNumber->GetNumber());
5314 fViewAnglePsiSlider->SetPosition((Int_t)fViewAnglePsiNumber->GetNumber());
5316 fChkBtnAutoRotate->SetOn(fAutoRotate);
5324 if (gDebug) cout <<
"BesClient::ChangeFocus called!" << endl;
5326 if ( gTQSender == fNumEntryRunNo->GetNumberEntry() ) {
5327 fNumEntryEventNo->GetNumberEntry()->SelectAll();
5328 fNumEntryEventNo->GetNumberEntry()->SetFocus();
5330 else if ( gTQSender == fNumEntryEventPlaySpeed->GetNumberEntry() ) {
5331 fNumEntryEventPlaySpeed->GetNumberEntry()->SelectAll();
5332 fNumEntryEventPlaySpeed->GetNumberEntry()->SetFocus();
5334 else if ( gTQSender == fNumEntryMagnetic->GetNumberEntry() ) {
5335 fNumEntryMagnetic->GetNumberEntry()->SelectAll();
5336 fNumEntryMagnetic->GetNumberEntry()->SetFocus();
5345 if (gDebug) cout <<
"BesClient::ExecuteReturn called!" << endl;
5351 if ( gTQSender == fZoomRatioNumber ) {
5352 if (view) view->
SetZoomRatio(fZoomRatioNumber->GetNumber()/100.0);
5355 if ( gTQSender == fNumEntryEventNo->GetNumberEntry() ) {
5356 fBesEventNo = fNumEntryEventNo->GetIntNumber();
5360 else if ( gTQSender == fNumEntryEventPlaySpeed->GetNumberEntry() ) {
5361 fEventPlaySpeed = Int_t(fNumEntryEventPlaySpeed->GetNumber() * 1000);
5362 fAutoDisplayEventTimer->SetTime(fEventPlaySpeed);
5365 else if ( gTQSender == fNumEntryRotateSpeed ) {
5366 fRotateSpeed = fNumEntryRotateSpeed->GetNumber();
5368 cout <<
"fRotateSpeed " << fRotateSpeed <<
" fRotateStep " << fRotateStep << endl;
5372 else if ( gTQSender == fNumEntryRotateFPS->GetNumberEntry() ) {
5373 fRotateFPS = fNumEntryRotateFPS->GetIntNumber();
5375 fAutoRotateTimer->SetTime((Int_t)1000/fRotateFPS);
5376 cout <<
"fRotateFPS " << fRotateFPS <<
" fRotateStep " << fRotateStep << endl;
5379 else if ( gTQSender == fNumEntryMagnetic->GetNumberEntry() ) {
5385 else if ( gTQSender == fNumEntryRotateStep ) {
5386 fRotateStep = fNumEntryRotateStep->GetNumber();
5387 fRotateSpeed = fRotateStep * fRotateFPS;
5388 cout <<
"fRotateSpeed " << fRotateSpeed <<
" fRotateStep " << fRotateStep << endl;
5391 else if ( gTQSender == fViewAngleThetaNumber ) {
5397 else if ( gTQSender == fViewAnglePhiNumber ) {
5403 else if ( gTQSender == fViewAnglePsiNumber ) {
5409 fEmbeddedCanvas->RequestFocus();
5416 TString filePath = fBesVisPath;
5417 filePath +=
"/icons/";
5420 TASImage asImage(filePath);
5421 Pixmap_t pic = asImage.GetPixmap();
5429 return (!gSystem->AccessPathName(fname, kFileExists));
5435 Double_t range =
max -
min;
5440 while (input <
min);
5447 while (input >=
max);
const char * OpenEventTypes[]
const char * SavePicTypes[]
const char * OpenGeoTypes[]
const char * SaveGeoTypes[]
ClassImp(BesClient) const char gHelpBesVis[]
R__EXTERN BesCursor * gBesCursor
R__EXTERN BesEvent * gEvent
R__EXTERN BesGeometry * gBesGeometry
@ kM_Mdc_QNotOverflow_Global
@ kM_Mdc_ColorfulWire_Global
@ kM_Mdc_MdcTimeSubEvTime_Global
@ kM_Button_SwitchDisplayMode
@ kM_Button_ViewAnglePhiMinus
@ kM_Button_ViewAnglePsiNumber
@ kM_Button_ViewAnglePhiNumber
@ kM_Button_ViewResetAngle
@ kM_Slider_ViewAngleTheta
@ kM_Button_OpenEventFile
@ kM_Button_ViewAnglePhiPlus
@ kM_Button_DisplayMode2D
@ kM_Button_DisplayModeZR
@ kM_Button_ZoomRatioNumber
@ kM_Button_ViewMoveRight
@ kM_Button_DisplayMode3D
@ kM_Button_ViewMoveCenter
@ kM_Button_EventPlaySpeed
@ kM_Button_ViewClockWise
@ kM_Button_ViewAngleThetaMinus
@ kM_Button_ViewAnglePsiMinus
@ kM_Button_ViewAnglePsiPlus
@ kM_Button_DisplayModeXY
@ kM_Button_PerspectiveView
@ kM_Button_DisplayModeAll
@ kM_Button_ViewCounterClockWise
@ kM_Button_ViewAngleThetaPlus
@ kM_Button_ViewAngleThetaNumber
Int_t GetEventPlaySpeed()
virtual void CreateMainFrame()
virtual void CreateTitleBar()
virtual void UpdateAllView()
virtual void HandleMenu(Int_t id)
virtual void SetAllDisplayModeButtonUnHL()
virtual void CreateToolBar()
virtual void SavePicAsPS()
virtual void CreateDisplayModeBar()
virtual void HandleSliders(Int_t id)
virtual void CreateTabs()
virtual void SaveMyConfig()
virtual void RotatePsi(int pn)
virtual void RotateClockWise(int clockwise)
virtual void CreateMenuBar()
BesClient(const TGWindow *p, const char *title, UInt_t width, UInt_t height, Option_t *option="", Int_t argc=0, char **argv=0)
virtual Bool_t GetEvent(Long64_t i)
virtual void RotateTheta(int pn)
virtual void RotatePhi(int pn)
virtual void HandleViewOptionMenu(Int_t id)
virtual void HandleEventList(TGListTreeItem *entry, Int_t btn)
virtual void OpenEventFile()
virtual void HandleStatusBar(const char *msg)
virtual Pixmap_t GetPic(const char *file)
virtual void AutoRotateCommand()
virtual void UpdateStatus()
virtual void CreateWidget(const char *title, UInt_t width, UInt_t height)
virtual void CloseWindow()
virtual void CreateHorizontalRuler()
virtual void InitConnections()
virtual void UpdateCurrentPad()
virtual void HandleError(const char *msg)
virtual void CreateCanvas()
virtual void HandleInfoBar(const char *msg)
virtual Bool_t FirstEvent()
virtual void LoadMdcPalette()
virtual Bool_t GetRecEvent()
virtual void SetRange(Double_t &input, Double_t min, Double_t max)
virtual void AutoDisplayEvent()
virtual Bool_t NextEvent()
virtual void CreateStatusBar()
virtual void CreateUpButtonBar()
virtual void AutoDisplayEventCommand()
virtual void ExecuteEvent(Int_t event, Int_t px, Int_t py, TObject *sel)
virtual void ExecuteReturn()
virtual void LoadMyConfig()
virtual Bool_t PrevEvent()
virtual void HandleButtons(Int_t id=-1)
virtual Bool_t FileExists(TString fname)
virtual void SetState(Int_t id=-1)
virtual void AutoRotate()
virtual void OpenGeoFile(TString filename)
virtual void ChangeFocus()
Double_t GetRotateSpeed()
virtual void InitParameter()
virtual void UpdateBesInputFields()
virtual void LoadGeoFile()
void SetType(EBESCursorType cursorType)
void SetShowInfo(Bool_t show)
void SetMagnetic(Double_t input)
virtual void SetEvent(TDigiEvent *digiEvent, TDisTrack *recEvent, TEvtHeader *evtHeader, TRecEvTime *recEvTime)
EmcROOTGeo * GetEmcROOTGeo()
MdcROOTGeo * GetMdcROOTGeo()
MucROOTGeo * GetMucROOTGeo()
TofROOTGeo * GetTofROOTGeo()
void Transfer(BesStatus *right, Bool_t set)
Bool_t IsPerspective() const
virtual void SetParallel()
virtual void GetRange(Float_t *min, Float_t *max)
virtual void SetView(Double_t longitude, Double_t latitude, Double_t psi, Int_t &irep)
virtual void SetPerspective()
void SetVisEmcGlobal(Bool_t input)
void SetVisMucHitsBarrel(Bool_t input)
Bool_t GetVisMucHitsWest()
void SetVisTofWest(Bool_t input)
BesStatus * GetStatusCurrent()
void SetVisEmcSide(Bool_t input)
void SetVisEmcHitsWest(Bool_t input)
Bool_t GetVisMucHitsGlobal()
void SetVisTofHitsBarrel(Bool_t input)
void SetVisEmcHitsGlobal(Bool_t input)
void SetVisEmcEast(Bool_t input)
Bool_t GetVisMucHitsEast()
void SetVisTracksExt(Bool_t input)
void SetVisMdcHits(Bool_t input)
void SetVisTracksTof(Bool_t input)
void SetVisMucWest(Bool_t input)
Bool_t GetVisTracksGlobal()
void SetVisTracksMdc(Bool_t input)
Bool_t GetVisMdcHitsGlobal()
void SetVisMdcGlobal(Bool_t input)
void SetVisTofBarrel(Bool_t input)
BesStatus * GetStatus3D()
void SetVisTofHitsWest(Bool_t input)
Bool_t GetVisEmcHitsBarrel()
Bool_t GetVisEmcHitsGlobal()
void Move(Int_t px, Int_t py)
void SetVisMucHitsEast(Bool_t input)
void SetVisMucEast(Bool_t input)
void SetVisTofHitsGlobal(Bool_t input)
virtual void UpdateView(Bool_t resetview=kFALSE)
void SetVisFull3DTof(Bool_t input)
Bool_t GetVisEmcHitsSide()
virtual char * GetObjectInfo(Int_t px, Int_t py) const
void SetVisMdcTubes(Bool_t input)
BesStatus * GetStatusZR()
Bool_t GetVisMucHitsBarrel()
void SetVisMucStrips(Bool_t input)
Bool_t GetFishEyeStatus()
void SetFishEye(Bool_t input=0)
void SetVisFull3DEmc(Bool_t input)
void SetVisTracksGlobal(Bool_t input)
void SetVisEmcHitsEast(Bool_t input)
void SetVisTofGlobal(Bool_t input)
Bool_t GetVisEmcHitsWest()
void SetVisEmcHitsSide(Bool_t input)
EBESViewType GetViewType()
void SetVisMucHitsGlobal(Bool_t input)
void SetVisEmcBarrel(Bool_t input)
void SetVisTracksEmc(Bool_t input)
void SetVisTofHitsEast(Bool_t input)
void SetVisZRPlaneOnXY(Bool_t input)
void SetVisTracksMuc(Bool_t input)
void SetVisAxis(Bool_t input)
void SetVisMdcWires(Bool_t input)
void SetVisEmcHitsBarrel(Bool_t input)
BesStatus * GetStatusXY()
Bool_t GetVisTofHitsWest()
Bool_t GetVisTofHitsGlobal()
void SetVisFull3DMuc(Bool_t input)
Bool_t GetVisZRPlaneOnXY()
void SetVisFull3DMdc(Bool_t input)
void SetZoomRatio(Double_t ratio)
void SetVisBeamPipe(Bool_t input)
void SetVisTofEast(Bool_t input)
Bool_t GetVisEmcHitsEast()
void SetVisMdcHitsGlobal(Bool_t input)
void SetVisMucHitsWest(Bool_t input)
void SetVisMucBarrel(Bool_t input)
void SetVisMucGlobal(Bool_t input)
Bool_t GetVisTofHitsBarrel()
void SetVisEmcWest(Bool_t input)
Bool_t GetVisTofHitsEast()
BesGeometry * GetBesGeometry()
virtual void DrawHeader()
virtual void Draw(Option_t *option="")
virtual void InitGeometryFromROOT(TGeoVolume *bes)
virtual void InitGeometryFromGDML(const TString fPath)
virtual void SwitchDisplayMode(Int_t mode)
virtual void SetCanvas(TCanvas *c=0)
void SetVisEmcDetector()
Set Emc detector visibility;.
void SetDetector()
Set default physical node attributes;.
void SetTFire(Bool_t input)
void SetMdcTimeSubEvTime(Bool_t input)
void SetQFire(Bool_t input)
void SetQNotOverflow(Bool_t input)
void SetColorfulWire(Bool_t input)
void SetVisMdcDetector()
Set Mdc default detector visibility;.
void SetDetector()
Set default physical node attributes;.
void SetDetector()
Set Detecor (what is detector depends on you)
void SetVisMucDetector()
Set Muc detector visibility;.
void addRecMdcTrack(TRecMdcTrack *Track)
Add a TkrTrack into the Mdc data collection.
void addTofTrack(TRecTofTrack *Track)
void addMucTrack(TRecMucTrack *Track)
Add a MucTrack into the TOF Data collection.
void addRecMdcHit(TRecMdcHit *Hit)
Add a Rec Mdc Hit into the Mdc data collection.
void addEmcShower(TRecEmcShower *Track)
Add a TkrTrack into the Emc data collection.
const TObjArray * getTofTrackCol() const
retrieve the whole TObjArray of TofTrack Data
const TObjArray * getEvTimeCol() const
const TRecTofTrack * getTofTrack(Int_t i) const
retrieve a TofTrack From the collection, using the index into the array
const TRecMdcTrack * getRecMdcTrack(Int_t i) const
retrieve a MdcTrack from the collection, using the index into the array
const TObjArray * getEmcShowerCol() const
retrieve the whole TObjArray of EmcShower Data
const TObjArray * getRecMdcTrackCol() const
retrieve the whole TObjArray of RecMdcTrack Data
const TRecEmcShower * getEmcShower(Int_t i) const
retrieve a EmcShower from the collection, using the index into the array */
const TObjArray * getMucTrackCol() const
retrieve the whole TObjArray of MucTrack Data
const TRecMucTrack * getMucTrack(Int_t i) const
retrieve a MucTrack From the collection, using the index into the array
const TRecMdcHit * getRecMdcHit(Int_t i) const
retrieve a RecMdcHit from the collection, using the index into the array
const TObjArray * getRecMdcHitCol() const
retrieve the whole TObjArray of RecMdcHit Data
void SetQMatch(Bool_t input)
void SetDetector()
Draw Detecor (what is detector depends on you)
void SetVisTofDetector()
Set Tof detector visibility;.
void SetTMatch(Bool_t input)