14 #include "TRootEmbeddedCanvas.h"
23 using std::stringstream;
29 fCanvasWindow(0), fPlotEditWindow(0), fSuperimpose(false)
36 fCanvasWindow(plot.fCanvasWindow), fCuts(plot.fCuts), fCutsString(plot.fCutsString),
37 fNeedsRegeneration(plot.fNeedsRegeneration), fPlotEditWindow(0), fSuperimpose(plot.fSuperimpose),
38 fXVariable(plot.fXVariable), fXUnits(plot.fXUnits), fYVariable(plot.fYVariable), fYUnits(plot.fYUnits)
84 cout <<
"Duplicate not implemented for this type" << endl;
106 name = baseName + index.str();
120 if (canvasWindow !=
"") {
158 list<QGPlot*>::const_iterator plotIter;
159 for (plotIter =
fPlots.begin(); plotIter !=
fPlots.end(); ++plotIter) {
160 if ((*plotIter)->GetName() == name) {
171 list<QGPlot*>::const_iterator plotIter;
172 for (plotIter =
fPlots.begin(); plotIter !=
fPlots.end(); ++plotIter) {
173 if ((*plotIter)->GetName() == name) {
184 if (
fCuts.size() != 0) {
185 vector<string>::const_iterator cutIter =
fCuts.begin();
188 while (cutIter !=
fCuts.end()) {
Window containing a ROOT canvas.
void RemovePlot(QGPlot *plot)
Remove pointer to a plot from the list of plots associated with this window.
QGPlotFrame * GetPlotFrame()
Get pointer to the plot frame.
void AddPlot(QGPlot *plot)
Add pointer to a plot to the list of plots associated with this window.
void SetPlotsToRegenerate()
Set regenerate for each plot associated with this window.
QGFileHandler * GetFileHandler() const
Get pointer to file handler.
void UpdateVariablesDropDownBoxes()
Update variables drop down boxes for plots associated with this window.
std::vector< std::string > GetCuts()
Get cuts.
bool CheckForModifiedFiles()
Check whether any open file has been modified.
QGPlotEditButtonsFrame * GetButtonsFrame()
Get pointer to the buttons frame.
QGCutsFrame * GetCutsFrame()
Get pointer to the cuts frame.
TRootEmbeddedCanvas * GetEmbeddedCanvas()
Get pointer to canvas.
void RemoveEntry(QGPlot *plot)
Remove entry for plot.
static bool IsVisible()
Returns true if the plot list window exists.
void Refresh()
Refresh the contents of the window.
static QGPlotListWindow * Instance()
Singleton.
Base class for GUI plots including histograms, scatter plots, pulses, and graphical cuts.
virtual void SetCuts(const std::vector< std::string > &cuts)
Set cuts to apply in generating the plot.
virtual void SetSuperimpose(bool flag=false)
Set whether the plot should be superimposed.
virtual std::string GeneratePlotName(const std::string &baseName) const
Generate a name for the plot.
virtual bool IsNameInUse(const std::string &name) const
Check whether string is the name of any plot.
std::string fXVariable
X-axis variable.
virtual void GetCutsFromEditWindow()
Get cuts from edit window.
virtual ~QGPlot()
Destructor.
QGPlot()
Default constructor.
virtual const char * GetName() const
Get plot name, should be overridden by derived classes.
virtual void Duplicate()
Duplicate the plot, should be overridden by derived classes.
virtual void GetCanvasWindowFromEditWindow()
Get canvas window from edit window.
static void ShowPlotsList()
Show plots list.
virtual TCanvas * GetCanvas()
Get pointer to the associated canvas.
virtual void Generate(QChain *chain=0)
Generate plot from chain of data files, should be overridden by derived classes.
virtual void Plot()
Plot this in the associated canvas window, generating it if necessary.
static std::list< QGPlot * > fPlots
Collection of pointers to all QGPlots.
QGPlotEditWindow * fPlotEditWindow
Pointer to plot edit window.
static QGPlot * GetPlotByName(const std::string &name)
Get plot by name.
virtual void SetRegenerate(bool flag=true)
Set whether the plot needs to be regenerated.
virtual void SetCanvasWindow(QGCanvasWindow *window)
Set the canvas window to which the plot is associated.
virtual bool NeedsRegeneration() const
Check whether plot needs to be regenerated.
std::vector< std::string > fCuts
Cuts applied to make the plot.
virtual void SetProperty(const std::string &key, const std::string &value)
Set property (used for opening a session)
virtual void AutoSetStyle()
Automatically set the plot style, should be overridden by derived classes.
virtual void AddCut(const std::string &cut)
Add cut.
virtual void SetName(const char *name=0)
Set plot name.
std::string fCutsString
Cuts in a single string.
virtual void SetXVariable(const std::string &x)
Set X-axis variable.
virtual void DisplayEditWindow()
Display edit window for the plot, should be overridden by derived classes.
virtual void SetYVariable(const std::string &y)
Set Y-axis variable.
virtual void GetParametersFromEditWindow()
Get parameters from edit window, should be overridden by derived classes.
std::string fYVariable
Y-axis variable.
virtual void Erase()
Erase plot, should be overridden by derived classes.
virtual void MakeCutsString()
Make cuts string.
QGCanvasWindow * fCanvasWindow
Canvas window to which plot is associated.
virtual void SetXUnits(const std::string &units)
Set X-axis units.
virtual void SetYUnits(const std::string &units)
Set Y-axis units.
virtual void Display()
Display plot, should be overridden by derived classes.
Base class for GUI windows.
static QGWindow * GetWindowByName(const std::string &name)
Get pointer to window with a given name.