Diana Software
Public Member Functions | Static Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
QGPlot Class Reference

Base class for GUI plots including histograms, scatter plots, pulses, and graphical cuts. More...

Inheritance diagram for QGPlot:
QGGraph QGGraphicalCut QGHistogram QGPulse QGScatterPlot

Public Member Functions

 QGPlot ()
 Default constructor. More...
 
 QGPlot (const QGPlot &)
 Copy constructor. More...
 
virtual ~QGPlot ()
 Destructor. More...
 
virtual void AddCut (const std::string &cut)
 Add cut. More...
 
virtual void AutoSetStyle ()
 Automatically set the plot style, should be overridden by derived classes. More...
 
virtual void Display ()
 Display plot, should be overridden by derived classes. More...
 
virtual void DisplayEditWindow ()
 Display edit window for the plot, should be overridden by derived classes. More...
 
virtual void Duplicate ()
 Duplicate the plot, should be overridden by derived classes. More...
 
virtual void Erase ()
 Erase plot, should be overridden by derived classes. More...
 
virtual void Generate (QChain *chain=0)
 Generate plot from chain of data files, should be overridden by derived classes. More...
 
virtual std::string GeneratePlotName (const std::string &baseName) const
 Generate a name for the plot. More...
 
virtual TCanvas * GetCanvas ()
 Get pointer to the associated canvas. More...
 
virtual QGCanvasWindowGetCanvasWindow () const
 Get pointer to the canvas window to which the plot is associated. More...
 
virtual void GetCanvasWindowFromEditWindow ()
 Get canvas window from edit window. More...
 
virtual const std::vector< std::string > & GetCuts () const
 Get cuts applied to make the plot. More...
 
virtual void GetCutsFromEditWindow ()
 Get cuts from edit window. More...
 
virtual QGPlotEditWindowGetEditWindow ()
 Get pointer to edit window. More...
 
virtual const char * GetName () const
 Get plot name, should be overridden by derived classes. More...
 
virtual void GetParametersFromEditWindow ()
 Get parameters from edit window, should be overridden by derived classes. More...
 
virtual const std::string & GetXUnits () const
 Get x-axis units. More...
 
virtual const std::string & GetXVariable () const
 Get x-axis variable. More...
 
virtual const std::string & GetYUnits () const
 Get y-axis units. More...
 
virtual const std::string & GetYVariable () const
 Get y-axis variable. More...
 
virtual bool IsNameInUse (const std::string &name) const
 Check whether string is the name of any plot. More...
 
virtual bool IsSuperimposeSet () const
 Return true if plot is set to be superimposed. More...
 
virtual void MakeCutsString ()
 Make cuts string. More...
 
virtual bool NeedsRegeneration () const
 Check whether plot needs to be regenerated. More...
 
virtual void Plot ()
 Plot this in the associated canvas window, generating it if necessary. More...
 
virtual void SetCanvasWindow (QGCanvasWindow *window)
 Set the canvas window to which the plot is associated. More...
 
virtual void SetCuts (const std::vector< std::string > &cuts)
 Set cuts to apply in generating the plot. More...
 
virtual void SetName (const char *name=0)
 Set plot name. More...
 
virtual void SetPlotEditWindow (QGPlotEditWindow *window)
 Set plot edit window. More...
 
virtual void SetProperty (const std::string &key, const std::string &value)
 Set property (used for opening a session) More...
 
virtual void SetRegenerate (bool flag=true)
 Set whether the plot needs to be regenerated. More...
 
virtual void SetSuperimpose (bool flag=false)
 Set whether the plot should be superimposed. More...
 
virtual void SetXVariable (const std::string &x)
 Set X-axis variable. More...
 
virtual void SetXUnits (const std::string &units)
 Set X-axis units. More...
 
virtual void SetYVariable (const std::string &y)
 Set Y-axis variable. More...
 
virtual void SetYUnits (const std::string &units)
 Set Y-axis units. More...
 

Static Public Member Functions

static QGPlotGetPlotByName (const std::string &name)
 Get plot by name. More...
 
static const std::list< QGPlot * > & GetPlots ()
 Get collection of plots. More...
 
static void ShowPlotsList ()
 Show plots list. More...
 

Protected Attributes

QGCanvasWindowfCanvasWindow
 Canvas window to which plot is associated. More...
 
std::vector< std::string > fCuts
 Cuts applied to make the plot. More...
 
std::string fCutsString
 Cuts in a single string. More...
 
bool fNeedsRegeneration
 Indicates whether plot needs to be regenerated because settings have changed. More...
 
QGPlotEditWindowfPlotEditWindow
 Pointer to plot edit window. More...
 
bool fSuperimpose
 Indicates whether plot should be superimposed on existing plot. More...
 
std::string fXVariable
 X-axis variable. More...
 
std::string fXUnits
 X-axis units. More...
 
std::string fYVariable
 Y-axis variable. More...
 
std::string fYUnits
 Y-axis units. More...
 

Static Protected Attributes

static std::list< QGPlot * > fPlots
 Collection of pointers to all QGPlots. More...
 

Detailed Description

Base class for GUI plots including histograms, scatter plots, pulses, and graphical cuts.

Author
Adam Bryant (adam_.nosp@m.brya.nosp@m.nt@be.nosp@m.rkel.nosp@m.ey.ed.nosp@m.u)

Definition at line 21 of file QGPlot.hh.

Constructor & Destructor Documentation

◆ QGPlot() [1/2]

QGPlot::QGPlot ( )

Default constructor.

Definition at line 28 of file QGPlot.cc.

References fPlots, and SetRegenerate().

◆ QGPlot() [2/2]

QGPlot::QGPlot ( const QGPlot plot)

Copy constructor.

Definition at line 35 of file QGPlot.cc.

References QGCanvasWindow::AddPlot(), fCanvasWindow, and fPlots.

◆ ~QGPlot()

QGPlot::~QGPlot ( )
virtual

Member Function Documentation

◆ AddCut()

void QGPlot::AddCut ( const std::string &  cut)
virtual

Add cut.

Definition at line 60 of file QGPlot.cc.

References fCuts, MakeCutsString(), and SetRegenerate().

Referenced by SetProperty().

◆ AutoSetStyle()

void QGPlot::AutoSetStyle ( )
virtual

Automatically set the plot style, should be overridden by derived classes.

Reimplemented in QGScatterPlot, QGPulse, and QGHistogram.

Definition at line 67 of file QGPlot.cc.

◆ Display()

void QGPlot::Display ( )
virtual

Display plot, should be overridden by derived classes.

Reimplemented in QGScatterPlot, QGPulse, QGHistogram, and QGGraphicalCut.

Definition at line 72 of file QGPlot.cc.

Referenced by Plot().

◆ DisplayEditWindow()

void QGPlot::DisplayEditWindow ( )
virtual

Display edit window for the plot, should be overridden by derived classes.

Reimplemented in QGScatterPlot, QGPulse, and QGHistogram.

Definition at line 77 of file QGPlot.cc.

Referenced by QGPlotListEntryFrame::HandleEditButton().

◆ Duplicate()

void QGPlot::Duplicate ( )
virtual

Duplicate the plot, should be overridden by derived classes.

Reimplemented in QGScatterPlot, QGPulse, and QGHistogram.

Definition at line 82 of file QGPlot.cc.

Referenced by QGPlotEditButtonsFrame::HandleDuplicateButton().

◆ Erase()

void QGPlot::Erase ( )
virtual

Erase plot, should be overridden by derived classes.

Reimplemented in QGScatterPlot, QGPulse, QGHistogram, and QGGraphicalCut.

Definition at line 88 of file QGPlot.cc.

Referenced by QGPlotListEntryFrame::DeletePlot(), QGPlotEditButtonsFrame::HandleDeleteButton(), QGPlotEditButtonsFrame::HandleEraseButton(), and SetCanvasWindow().

◆ Generate()

void QGPlot::Generate ( QChain chain = 0)
virtual

Generate plot from chain of data files, should be overridden by derived classes.

Reimplemented in QGScatterPlot, QGPulse, and QGHistogram.

Definition at line 93 of file QGPlot.cc.

Referenced by Plot().

◆ GeneratePlotName()

string QGPlot::GeneratePlotName ( const std::string &  baseName) const
virtual

Generate a name for the plot.

Definition at line 98 of file QGPlot.cc.

References IsNameInUse().

Referenced by QGGraphicalCut::SetName(), QGHistogram::SetName(), QGPulse::SetName(), and QGScatterPlot::SetName().

◆ GetCanvas()

TCanvas * QGPlot::GetCanvas ( )
virtual

Get pointer to the associated canvas.

Definition at line 111 of file QGPlot.cc.

References fCanvasWindow, QGPlotFrame::GetEmbeddedCanvas(), and QGCanvasWindow::GetPlotFrame().

Referenced by QGGraphicalCut::Create(), and QGGraphicalCut::HandleCanvasEvent().

◆ GetCanvasWindow()

virtual QGCanvasWindow* QGPlot::GetCanvasWindow ( ) const
inlinevirtual

◆ GetCanvasWindowFromEditWindow()

void QGPlot::GetCanvasWindowFromEditWindow ( )
virtual

◆ GetCuts()

virtual const std::vector<std::string>& QGPlot::GetCuts ( ) const
inlinevirtual

Get cuts applied to make the plot.

Definition at line 66 of file QGPlot.hh.

References fCuts.

◆ GetCutsFromEditWindow()

void QGPlot::GetCutsFromEditWindow ( )
virtual

Get cuts from edit window.

Definition at line 137 of file QGPlot.cc.

References fPlotEditWindow, QGCutsFrame::GetCuts(), QGPlotEditWindow::GetCutsFrame(), and SetCuts().

Referenced by Plot().

◆ GetEditWindow()

virtual QGPlotEditWindow* QGPlot::GetEditWindow ( )
inlinevirtual

Get pointer to edit window.

Definition at line 72 of file QGPlot.hh.

References fPlotEditWindow.

Referenced by QGPlotIconsFrame::HandlePulsesButton(), and QGGraphicalCut::ViewPulses().

◆ GetName()

const char * QGPlot::GetName ( ) const
virtual

Get plot name, should be overridden by derived classes.

Reimplemented in QGHistogram, QGGraphicalCut, and QGGraph.

Definition at line 144 of file QGPlot.cc.

Referenced by QGPlotEditButtonsFrame::HandleNameButton(), QGPlotEditButtonsFrame::HandleNameEntryBox(), and QGPlotListEntryFrame::SetPlot().

◆ GetParametersFromEditWindow()

void QGPlot::GetParametersFromEditWindow ( )
virtual

Get parameters from edit window, should be overridden by derived classes.

Reimplemented in QGScatterPlot, QGPulse, and QGHistogram.

Definition at line 150 of file QGPlot.cc.

Referenced by Plot().

◆ GetPlotByName()

QGPlot * QGPlot::GetPlotByName ( const std::string &  name)
static

Get plot by name.

Definition at line 155 of file QGPlot.cc.

References fPlots.

Referenced by QGCalibrationWindow::GetCurrentPlot().

◆ GetPlots()

static const std::list<QGPlot*>& QGPlot::GetPlots ( )
inlinestatic

◆ GetXUnits()

virtual const std::string& QGPlot::GetXUnits ( ) const
inlinevirtual

Get x-axis units.

Definition at line 87 of file QGPlot.hh.

References fXUnits.

Referenced by QGHistogram::Display(), QGPulse::Display(), and QGScatterPlot::Display().

◆ GetXVariable()

virtual const std::string& QGPlot::GetXVariable ( ) const
inlinevirtual

◆ GetYUnits()

virtual const std::string& QGPlot::GetYUnits ( ) const
inlinevirtual

Get y-axis units.

Definition at line 93 of file QGPlot.hh.

References fYUnits.

Referenced by QGPulse::Display(), and QGScatterPlot::Display().

◆ GetYVariable()

virtual const std::string& QGPlot::GetYVariable ( ) const
inlinevirtual

Get y-axis variable.

Definition at line 96 of file QGPlot.hh.

References fYVariable.

Referenced by QGScatterPlot::Display(), QGPlotIconsFrame::HandleCopyLimitsButton(), and QGPlotIconsFrame::HandleGraphicalCutButton().

◆ IsNameInUse()

bool QGPlot::IsNameInUse ( const std::string &  name) const
virtual

Check whether string is the name of any plot.

Definition at line 168 of file QGPlot.cc.

References fPlots.

Referenced by GeneratePlotName(), QGGraphicalCut::SetName(), QGHistogram::SetName(), QGPulse::SetName(), and QGScatterPlot::SetName().

◆ IsSuperimposeSet()

virtual bool QGPlot::IsSuperimposeSet ( ) const
inlinevirtual

Return true if plot is set to be superimposed.

Definition at line 102 of file QGPlot.hh.

References fSuperimpose.

◆ MakeCutsString()

void QGPlot::MakeCutsString ( )
virtual

Make cuts string.

Definition at line 181 of file QGPlot.cc.

References fCuts, and fCutsString.

Referenced by AddCut(), and SetCuts().

◆ NeedsRegeneration()

virtual bool QGPlot::NeedsRegeneration ( ) const
inlinevirtual

Check whether plot needs to be regenerated.

Definition at line 108 of file QGPlot.hh.

References fNeedsRegeneration.

Referenced by Plot().

◆ Plot()

void QGPlot::Plot ( )
virtual

◆ SetCanvasWindow()

void QGPlot::SetCanvasWindow ( QGCanvasWindow window)
virtual

◆ SetCuts()

void QGPlot::SetCuts ( const std::vector< std::string > &  cuts)
virtual

Set cuts to apply in generating the plot.

Definition at line 231 of file QGPlot.cc.

References fCuts, MakeCutsString(), and SetRegenerate().

Referenced by GetCutsFromEditWindow().

◆ SetName()

void QGPlot::SetName ( const char *  name = 0)
virtual

Set plot name.

Reimplemented in QGScatterPlot, QGPulse, QGHistogram, and QGGraphicalCut.

Definition at line 240 of file QGPlot.cc.

Referenced by QGPlotEditButtonsFrame::HandleNameEntryBox(), and SetProperty().

◆ SetPlotEditWindow()

virtual void QGPlot::SetPlotEditWindow ( QGPlotEditWindow window)
inlinevirtual

◆ SetProperty()

void QGPlot::SetProperty ( const std::string &  key,
const std::string &  value 
)
virtual

◆ SetRegenerate()

virtual void QGPlot::SetRegenerate ( bool  flag = true)
inlinevirtual

Set whether the plot needs to be regenerated.

Definition at line 129 of file QGPlot.hh.

References fNeedsRegeneration.

Referenced by AddCut(), Plot(), QGPlot(), SetCanvasWindow(), SetCuts(), SetXVariable(), and SetYVariable().

◆ SetSuperimpose()

virtual void QGPlot::SetSuperimpose ( bool  flag = false)
inlinevirtual

Set whether the plot should be superimposed.

Definition at line 132 of file QGPlot.hh.

References fSuperimpose.

Referenced by QGHistogram::GetParametersFromEditWindow(), QGPulse::GetParametersFromEditWindow(), QGScatterPlot::GetParametersFromEditWindow(), and SetProperty().

◆ SetXUnits()

virtual void QGPlot::SetXUnits ( const std::string &  units)
inlinevirtual

◆ SetXVariable()

void QGPlot::SetXVariable ( const std::string &  x)
virtual

◆ SetYUnits()

virtual void QGPlot::SetYUnits ( const std::string &  units)
inlinevirtual

Set Y-axis units.

Definition at line 144 of file QGPlot.hh.

References fYUnits.

Referenced by QGScatterPlot::GetParametersFromEditWindow(), QGPulse::GetPulseFromChain(), and SetProperty().

◆ SetYVariable()

void QGPlot::SetYVariable ( const std::string &  y)
virtual

Set Y-axis variable.

Definition at line 278 of file QGPlot.cc.

References fYVariable, and SetRegenerate().

Referenced by QGScatterPlot::GetParametersFromEditWindow(), QGPlotIconsFrame::HandleGraphicalCutButton(), and SetProperty().

◆ ShowPlotsList()

void QGPlot::ShowPlotsList ( )
static

Show plots list.

Definition at line 286 of file QGPlot.cc.

References QGPlotListWindow::Instance().

Referenced by QGCanvasWindowButtonsFrame::HandlePlotsListButton().

Member Data Documentation

◆ fCanvasWindow

QGCanvasWindow* QGPlot::fCanvasWindow
protected

◆ fCuts

std::vector<std::string> QGPlot::fCuts
protected

Cuts applied to make the plot.

Definition at line 154 of file QGPlot.hh.

Referenced by AddCut(), GetCuts(), MakeCutsString(), and SetCuts().

◆ fCutsString

std::string QGPlot::fCutsString
protected

Cuts in a single string.

Definition at line 157 of file QGPlot.hh.

Referenced by QGHistogram::Generate(), QGPulse::Generate(), QGScatterPlot::Generate(), and MakeCutsString().

◆ fNeedsRegeneration

bool QGPlot::fNeedsRegeneration
protected

Indicates whether plot needs to be regenerated because settings have changed.

Definition at line 160 of file QGPlot.hh.

Referenced by NeedsRegeneration(), and SetRegenerate().

◆ fPlotEditWindow

QGPlotEditWindow* QGPlot::fPlotEditWindow
protected

◆ fPlots

list< QGPlot * > QGPlot::fPlots
staticprotected

Collection of pointers to all QGPlots.

Definition at line 166 of file QGPlot.hh.

Referenced by GetPlotByName(), GetPlots(), IsNameInUse(), QGPlot(), and ~QGPlot().

◆ fSuperimpose

bool QGPlot::fSuperimpose
protected

Indicates whether plot should be superimposed on existing plot.

Definition at line 169 of file QGPlot.hh.

Referenced by QGHistogram::Display(), QGPulse::Display(), QGScatterPlot::Display(), IsSuperimposeSet(), and SetSuperimpose().

◆ fXUnits

std::string QGPlot::fXUnits
protected

X-axis units.

Definition at line 175 of file QGPlot.hh.

Referenced by GetXUnits(), and SetXUnits().

◆ fXVariable

std::string QGPlot::fXVariable
protected

X-axis variable.

Definition at line 172 of file QGPlot.hh.

Referenced by QGHistogram::Generate(), QGScatterPlot::Generate(), GetXVariable(), and SetXVariable().

◆ fYUnits

std::string QGPlot::fYUnits
protected

Y-axis units.

Definition at line 181 of file QGPlot.hh.

Referenced by GetYUnits(), and SetYUnits().

◆ fYVariable

std::string QGPlot::fYVariable
protected

Y-axis variable.

Definition at line 178 of file QGPlot.hh.

Referenced by QGScatterPlot::Generate(), GetYVariable(), and SetYVariable().


The documentation for this class was generated from the following files: