Diana Software
QGScatterPlotEditWindow.cc
Go to the documentation of this file.
2 #include <iostream>
3 #include <set>
4 #include <string>
5 #include "QGCanvasWindow.hh"
6 #include "QGCutsFrame.hh"
7 #include "QGDropDownBox.hh"
8 #include "QGFileHandler.hh"
9 #include "QGScatterPlot.hh"
12 #include "QGPlotStyleFrame.hh"
13 #include "TGButton.h"
14 #include "TGTextEntry.h"
15 
17 
18 using std::cout;
19 using std::endl;
20 using std::set;
21 using std::string;
22 
23 QGScatterPlotEditWindow::QGScatterPlotEditWindow(const TGWindow *p, UInt_t w, UInt_t h) :
24 QGPlotEditWindow(p, w, h),
25 fScatterPlot(0)
26 {
28  ShowCutsFrame();
31 
32  Resize(GetDefaultSize());
33  MapSubwindows();
35  Resize(w, h);
36  MapWindow();
37  fCutsFrame->GetCutsListBox()->Layout();
38 }
39 
41 {
42  if (fScatterPlot) {
44  }
45 }
46 
48 {
54  set<string> aliases = fScatterPlot->GetCanvasWindow()->GetFileHandler()->GetSetOfAliases();
55  set<string> leaves = fScatterPlot->GetCanvasWindow()->GetFileHandler()->GetSetOfLeaves();
56  set<string>::const_iterator iter;
57  for (iter = aliases.begin(); iter != aliases.end(); ++iter) {
61  }
62  for (iter = leaves.begin(); iter != leaves.end(); ++iter) {
66  }
67  }
70 }
71 
73 {
74  if (QGScatterPlot *scatterPlot = dynamic_cast<QGScatterPlot*>(plot)) {
75  fScatterPlot = scatterPlot;
76  string windowName = "Diana GUI: ";
77  windowName += scatterPlot->GetName();
78  SetWindowName(windowName.c_str());
79  fCutsFrame->SetCuts(scatterPlot->GetCuts());
80  fScatterPlotParametersFrame->SetXVariable(scatterPlot->GetXVariable());
81  fScatterPlotParametersFrame->SetYVariable(scatterPlot->GetYVariable());
82  fScatterPlotParametersFrame->SetXUnits(scatterPlot->GetXUnits());
83  fScatterPlotParametersFrame->SetYUnits(scatterPlot->GetYUnits());
84  fScatterPlotParametersFrame->SetSuperimpose(scatterPlot->IsSuperimposeSet());
85  if (scatterPlot->GetCanvasWindow()) {
88  }
89  } else {
90  cout << "QGScatterPlotEditWindow::SetPlot(QGPlot *plot) Warning: dynamic_cast<QGScatterPlot*> failed" << endl;
91  }
92 }
93 
95 {
97  AddFrame(fScatterPlotParametersFrame, new TGLayoutHints(kLHintsExpandX, 2, 2, 5, 0));
98 }
99 
ClassImp(QObject)
QGFileHandler * GetFileHandler() const
Get pointer to file handler.
TGListBox * GetCutsListBox()
Get pointer to cuts list box.
Definition: QGCutsFrame.hh:45
QGDropDownBox * GetDropDownBox()
Get drop down box.
Definition: QGCutsFrame.hh:48
void SetCuts(const std::vector< std::string > &cuts)
Set cuts.
Definition: QGCutsFrame.cc:192
void AddEntryS(const std::string &entry)
Add entry.
std::set< std::string > GetSetOfLeaves()
Get the names of the leaves of the tree.
std::set< std::string > GetSetOfAliases()
Get the aliases defined in the tree.
virtual const char * GetName() const
Get graph name.
Definition: QGGraph.cc:21
void ShowDefaultDisplay()
Show default display.
void FillWindowDropDownBox()
Fill drop down box with names of canvas windows.
Base class for plot edit windows.
void ShowPlotStyleFrame()
Show plot style frame.
void ShowCutsFrame()
Show cuts frame.
QGCutsFrame * fCutsFrame
Cuts frame.
QGPlotEditButtonsFrame * fButtonsFrame
Buttons frame.
void ShowButtonsFrame()
Show buttons frame.
Base class for GUI plots including histograms, scatter plots, pulses, and graphical cuts.
Definition: QGPlot.hh:21
virtual QGCanvasWindow * GetCanvasWindow() const
Get pointer to the canvas window to which the plot is associated.
Definition: QGPlot.hh:60
virtual void SetPlotEditWindow(QGPlotEditWindow *window)
Set plot edit window.
Definition: QGPlot.hh:123
Class for scatter plot edit window.
void SetPlot(QGPlot *plot)
Set pointer to the scatter plot.
virtual ~QGScatterPlotEditWindow()
Destructor.
QGScatterPlot * fScatterPlot
Pointer to QGScatterPlot.
QGScatterPlotParametersFrame * fScatterPlotParametersFrame
Scatter plot parameters frame.
QGScatterPlotEditWindow(const TGWindow *p=0, UInt_t w=280, UInt_t h=450)
Constructor.
void FillVariablesDropDownBoxes()
Fill drop down boxes with variables from the chain.
void ShowScatterPlotParametersFrame()
Show parameters frame.
Part of a scatter plot edit window for inputting parameters.
QGDropDownBox * GetXDropDownBox()
Get pointer to x-axis variable drop down box.
std::string GetXVariable()
Get x-axis variable.
void SetXUnits(const std::string &units)
Set the x-axis units.
void SetYUnits(const std::string &units)
Set the y-axis units.
void SetYVariable(const std::string &y)
Set the y-axis variable.
void SetSuperimpose(bool flag=true)
Set whether the superimpose box is checked.
void SetXVariable(const std::string &x)
Set the x-axis variable.
QGDropDownBox * GetYDropDownBox()
Get pointer to y-axis variable drop down box.
std::string GetYVariable()
Get y-axis variable.
Class for GUI scatter plots.
virtual void SetWindowName(const char *name=0)
Set name of window.
Definition: QGWindow.cc:52
std::string Resize(const std::string &s, size_t len)
resize a string to len, adding spaces if necessary