16 #include "TRootEmbeddedCanvas.h"
31 SetBit(kCanDelete, kFALSE);
39 SetBit(kCanDelete, kFALSE);
58 GetCanvas()->Connect(
"ProcessedEvent(Int_t, Int_t, Int_t, TObject*)",
59 "QGGraphicalCut",
this,
"HandleCanvasEvent(Int_t, Int_t, Int_t, TObject*)");
81 return TCutG::GetName();
86 bool mouseMoved = (
event == 51);
87 bool leftClick = (
event == 11);
88 bool doubleClick = (
event == 61);
90 Double_t xpad =
GetCanvas()->AbsPixeltoX(px);
91 Double_t ypad =
GetCanvas()->AbsPixeltoY(py);
95 if (leftClick &&
fPoints == 0) {
103 if (mouseMoved &&
fPoints > 0) {
119 GetCanvas()->Disconnect(
"ProcessedEvent(Int_t, Int_t, Int_t, TObject*)",
120 this,
"HandleCanvasEvent(Int_t, Int_t, Int_t, TObject*)");
136 string newName = name;
137 if (newName != oldName) {
141 TCutG::SetName(name);
160 list<QGPlot*>::const_iterator plotIter;
161 for (plotIter = drawnPlots.begin(); plotIter != drawnPlots.end(); ++plotIter) {
171 pulse->SetLineColor(scatterPlot->GetMarkerColor());
173 pulse->SetLineColor(histogram->GetFillColor());
Window containing a ROOT canvas.
void DisplayPlotFrame()
Display the plot frame.
QGPlotFrame * GetPlotFrame()
Get pointer to the plot frame.
QGFileHandler * GetFileHandler() const
Get pointer to file handler.
std::list< QGPlot * > & GetDrawnPlots()
Get collection of drawn plots.
void UpdateFileLabel()
Update the file label.
void AddCut(const std::string &cut)
Add cut.
static void ClearCopiedCuts()
Clear copied cuts.
static void CopyCut(const std::string &cut)
Copy cut.
void SetCuts(const std::vector< std::string > &cuts)
Set cuts.
void OpenFiles(const std::vector< std::string > &files)
Open files, add them to the chain.
Base class for GUI graphical cuts. This class has minimal dependencies on other GUI classes so it is ...
void SetProperty(const std::string &key, const std::string &value)
Set property (used for opening a session)
Double_t fX0
X-coordinate of first point.
Int_t fPoints
Number of points selected by the mouse.
Double_t fY0
Y-coordinate of first point.
Class for graphical cuts.
static std::list< QGGraphicalCut * > fGraphicalCuts
Static list of existing graphical cuts.
void HandleCanvasEvent(Int_t event, Int_t px, Int_t py, TObject *selected)
Handle mouse events in the canvas.
void Erase()
Erase the graphical cut.
Double_t fXLast
X-coordinate of last selected point.
virtual ~QGGraphicalCut()
Destructor.
void Create()
Create the graphical cut with the mouse.
void CopyNameToClipboard() const
Copy name to clipboard.
void Display()
Display the graphical cut.
Double_t fYLast
Y-coordinate of last selected point.
const char * GetName() const
Get graphical cut name.
void SetName(const char *name=0)
Set graphical cut name.
void SetProperty(const std::string &key, const std::string &value)
Set property (used for opening a session)
QGGraphicalCut()
Default constructor.
void ViewPulses() const
View pulses.
Class for GUI histograms.
QGCutsFrame * GetCutsFrame()
Get pointer to the cuts frame.
TRootEmbeddedCanvas * GetEmbeddedCanvas()
Get pointer to canvas.
static void Update()
Update the plot list.
Base class for GUI plots including histograms, scatter plots, pulses, and graphical cuts.
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.
virtual TCanvas * GetCanvas()
Get pointer to the associated canvas.
virtual void Plot()
Plot this in the associated canvas window, generating it if necessary.
virtual void SetCanvasWindow(QGCanvasWindow *window)
Set the canvas window to which the plot is associated.
virtual QGCanvasWindow * GetCanvasWindow() const
Get pointer to the canvas window to which the plot is associated.
virtual void SetProperty(const std::string &key, const std::string &value)
Set property (used for opening a session)
virtual QGPlotEditWindow * GetEditWindow()
Get pointer to edit window.
QGCanvasWindow * fCanvasWindow
Canvas window to which plot is associated.
Class for GUI pulse plots.
void AutoSetStyle()
Automatically set the pulse style.
void DisplayEditWindow()
Display edit window.
Class for GUI scatter plots.
static void UpdateWindowDropDownBoxes()
Update window drop down boxes.