JG ROOT Tools libraries  version 5.0 - august 2014
RGHistoPlotAttrSelect Class Reference

#include <RGHistoPlotAttrSelect.hh>

Inheritance diagram for RGHistoPlotAttrSelect:

Public Member Functions

 RGHistoPlotAttrSelect (TGWindow *p=NULL, const Int_t mode=0, TAttLine l=TAttLine(1, 1, 1), TAttFill f=TAttFill(1, 0), TAttMarker m=TAttMarker(1, 20, 1.), UInt_t opt=0)
 
virtual ~RGHistoPlotAttrSelect ()
 
virtual void MapSubwindows ()
 
virtual Int_t DrawHisto (TH1 *hptr, const string &add_opts="", TPad *padptr=NULL) const
 
virtual Int_t DrawHistoCopy (TH1 *hptr, const string &add_opts="", TPad *padptr=NULL) const
 
virtual Int_t DrawHistoNormalized (TH1 *hptr, const Double_t norm, const string &add_opts="", TPad *padptr=NULL) const
 
virtual void SetState (const Bool_t b=kTRUE)
 
virtual RGLineAttrSelectGetLineAttrSelectWidget () const
 
virtual RGFillAttrSelectGetFillAttrSelectWidget () const
 
virtual RGMarkerAttrSelectGetMarkerAttrSelectWidget () const
 
virtual void ChangeDimension (const Int_t dim)
 
virtual void SetLineAttr (const TAttLine &att, const Bool_t emit=kTRUE)
 
virtual void SetFillAttr (const TAttFill &att, const Bool_t emit=kTRUE)
 
virtual void SetMarkerAttr (const TAttMarker &att, const Bool_t emit=kTRUE)
 
virtual void SetPlotMode (const Int_t mode, const Bool_t emit=kTRUE)
 
virtual void SetAngles (const Double_t theta, const Double_t phi, const Bool_t emit=kTRUE)
 
virtual TAttLine GetLineAttr () const
 
virtual TAttFill GetFillAttr () const
 
virtual TAttMarker GetMarkerAttr () const
 
virtual Double_t GetTheta () const
 
virtual Double_t GetPhi () const
 
virtual Int_t GetPlotMode () const
 
virtual string GetPlotOption () const
 
virtual void SetAttributes (const TH1 *h, const Bool_t emit=kTRUE)
 
virtual void AttrToHisto (TH1 *h) const
 
virtual void ModeSelectionUpdate (Int_t sel)
 
virtual void AnglesValueChanged ()
 
virtual void LineChanged ()
 
virtual void FillChanged ()
 
virtual void MarkerChanged ()
 
virtual void ModeSelected (Int_t m)
 
virtual void AnglesChanged ()
 
 ClassDef (RGHistoPlotAttrSelect, 0)
 

Static Public Member Functions

static string GetPlotOption (const Int_t dim, const Int_t mode)
 

Protected Member Functions

virtual void InitModes ()
 
virtual void Construct ()
 
virtual void ConstructDefault ()
 
virtual void ConstructGroups ()
 

Protected Attributes

UInt_t options
 Options.
 
Int_t plot_mode
 Initial plot mode.
 
TAttLine att_line
 Initial line attributes.
 
TAttFill att_fill
 Initial fill attributes.
 
TAttMarker att_marker
 Initial marker attributes.
 
Double_t angle_theta
 3D view angle
 
Double_t angle_phi
 3D view angle
 
bool inhibit_slot
 Flag to inhibit slots (TGNumberEntry)
 
RGLineAttrSelectw_line_select
 Selection.
 
RGFillAttrSelectw_fill_select
 Selection.
 
RGMarkerAttrSelectw_marker_select
 Selection.
 
TGCompositeFrame * w_mode_frame
 Mode frame.
 
RGHistoPlotModeSelectw_mode_select
 Selection widget.
 
TGHorizontalFrame * w_angles_frame
 Angles frame.
 
TGNumberEntry * w_theta_entry
 Theta angle widget.
 
TGNumberEntry * w_phi_entry
 Phi angle widget.
 

Private Member Functions

 GObject (RGHistoPlotAttrSelect)
 
 RGHistoPlotAttrSelect (const RGHistoPlotAttrSelect &original)
 

Detailed Description

class RGHistoPlotAttrSelect

Widget for histogram plot attributes selection.

Options:

  • rgHPASGroupLayout: use group frames instead of lines with labels
  • rgHPASNoLabel: no labels
  • rgHPASHisto2D: select attributes for 2D histograms (default is 1D)
  • rgHPASHisto3D: select attributes for 3D histograms (default is 1D)
  • rgHPASAngles3D: display angles widgets for 3D views
  • rgHPASExpandColorNumber: color widget is expandable, instead of fill widget (default)

See versions of the widgets for 1D and 2D (with 3D angles) histograms, in the compact version:

1D:

RGHistoPlotAttrSelect_1D.gif

2D:

RGHistoPlotAttrSelect_2D-ang.gif

The same widgets in the group version:

1D:

RGHistoPlotAttrSelect_1D-group.gif

2D:

RGHistoPlotAttrSelect_2D-group.gif

Constructor & Destructor Documentation

RGHistoPlotAttrSelect::RGHistoPlotAttrSelect ( TGWindow *  p = NULL,
const Int_t  mode = 0,
TAttLine  l = TAttLine(1,1,1),
TAttFill  f = TAttFill(1,0),
TAttMarker  m = TAttMarker(1,20,1.),
UInt_t  opt = 0 
)

Constructor.

Parameters
pparent widget
modeinitial mode
linitial line attributes
finitial fill attributes
minitial marker attributes
optoptions

References att_fill, att_line, att_marker, Construct(), options, plot_mode, w_angles_frame, w_fill_select, w_line_select, w_marker_select, w_mode_frame, w_mode_select, w_phi_entry, and w_theta_entry.

RGHistoPlotAttrSelect::RGHistoPlotAttrSelect ( const RGHistoPlotAttrSelect original)
private

Copy constructor, not implemented.

Parameters
originalobject to copy
RGHistoPlotAttrSelect::~RGHistoPlotAttrSelect ( )
virtual

Destructor.

Member Function Documentation

RGHistoPlotAttrSelect::GObject ( RGHistoPlotAttrSelect  )
private

Macro from GCpp library that defines the following functions:

  • ClassName(): return the real class name of the object
  • StaticClassName(): return the used class name of the object (that may be a base class of the real object).
  • IsInstanceOf<T>(): return true if the current object is an instance of the template class name argument
  • Clone(): return an allocated copy of the object.
void RGHistoPlotAttrSelect::InitModes ( )
protectedvirtual

Initialization of plot modes.

References RGHistoPlotModeSelect::GetPlotMode(), RGHistoPlotModeSelect::InitModes(), plot_mode, and w_mode_select.

Referenced by Construct().

void RGHistoPlotAttrSelect::Construct ( )
protectedvirtual
void RGHistoPlotAttrSelect::ConstructDefault ( )
protectedvirtual
void RGHistoPlotAttrSelect::ConstructGroups ( )
protectedvirtual
void RGHistoPlotAttrSelect::MapSubwindows ( )
virtual

Map the widgets fro display: this function is overloaded since angles widgets may not be displayed.

References RGHistoPlotModeSelect::GetDimension(), options, w_angles_frame, w_mode_frame, and w_mode_select.

Referenced by RGHistoTools::RemapToolsFrame().

Int_t RGHistoPlotAttrSelect::DrawHisto ( TH1 *  hptr,
const string &  add_opts = "",
TPad *  padptr = NULL 
) const
inlinevirtual

Draw an histogram with selected options. If histogram dimension does not fit with options, nothing is done. The additionnal options are added to the effective options (like "SAME" or "A", ...). If the pad is not specified, the histogram is plotted in the pad defined by gPad, if it is set.

Parameters
hptrhistogram pointer
add_optsadditional options
padptrpad pointer

References AttrToHisto(), RGHistoPlotModeSelect::DrawHisto(), and w_mode_select.

Referenced by RGHistoTools::PlotHisto().

Int_t RGHistoPlotAttrSelect::DrawHistoCopy ( TH1 *  hptr,
const string &  add_opts = "",
TPad *  padptr = NULL 
) const
inlinevirtual

Same as DrawHisto function, except that a copy of the histogram is plotted.

Parameters
hptrhistogram pointer
add_optsadditional options
padptrpad pointer

References AttrToHisto(), RGHistoPlotModeSelect::DrawHistoCopy(), and w_mode_select.

Int_t RGHistoPlotAttrSelect::DrawHistoNormalized ( TH1 *  hptr,
const Double_t  norm,
const string &  add_opts = "",
TPad *  padptr = NULL 
) const
inlinevirtual

Same as DrawHisto function, except that a renormalised copy of the histogram is plotted.

Parameters
hptrhistogram pointer
normnormalization value
add_optsadditional options
padptrpad pointer

References AttrToHisto(), RGHistoPlotModeSelect::DrawHistoNormalized(), and w_mode_select.

void RGHistoPlotAttrSelect::SetState ( const Bool_t  b = kTRUE)
virtual
RGLineAttrSelect * RGHistoPlotAttrSelect::GetLineAttrSelectWidget ( ) const
inlinevirtual

Get line attributes selection widget pointer..

References w_line_select.

RGFillAttrSelect * RGHistoPlotAttrSelect::GetFillAttrSelectWidget ( ) const
inlinevirtual

Get fill attributes selection widget pointer..

References w_fill_select.

RGMarkerAttrSelect * RGHistoPlotAttrSelect::GetMarkerAttrSelectWidget ( ) const
inlinevirtual

Get marker attributes selection widget pointer..

References w_marker_select.

void RGHistoPlotAttrSelect::ChangeDimension ( const Int_t  dim)
virtual

Set the dimension of histogram whose attributes are being edited.

Parameters
dimdimension (1, 2 or 3)

References RGHistoPlotModeSelect::ChangeDimension(), RGHistoPlotModeSelect::GetPlotMode(), plot_mode, and w_mode_select.

void RGHistoPlotAttrSelect::SetLineAttr ( const TAttLine &  att,
const Bool_t  emit = kTRUE 
)
virtual

Set line attributes.

Parameters
attattributes
emitflag if signal must be emitted

References LineChanged(), RGLineAttrSelect::SetLineColor(), RGLineAttrSelect::SetLineStyle(), RGLineAttrSelect::SetLineWidth(), and w_line_select.

Referenced by SetAttributes().

void RGHistoPlotAttrSelect::SetFillAttr ( const TAttFill &  att,
const Bool_t  emit = kTRUE 
)
virtual

Set fill attributes.

Parameters
attattributes
emitflag if signal must be emitted

References FillChanged(), RGFillAttrSelect::SetFillColor(), RGFillAttrSelect::SetFillStyle(), and w_fill_select.

Referenced by SetAttributes().

void RGHistoPlotAttrSelect::SetMarkerAttr ( const TAttMarker &  att,
const Bool_t  emit = kTRUE 
)
virtual

Set marker attributes.

Parameters
attattributes
emitflag if signal must be emitted

References MarkerChanged(), RGMarkerAttrSelect::SetMarkerColor(), RGMarkerAttrSelect::SetMarkerSize(), RGMarkerAttrSelect::SetMarkerStyle(), and w_marker_select.

Referenced by SetAttributes().

void RGHistoPlotAttrSelect::SetPlotMode ( const Int_t  mode,
const Bool_t  emit = kTRUE 
)
virtual

Set plot mode.

Parameters
modenew plot mode
emitflag if signal must be emitted

References ModeSelectionUpdate(), RGHistoPlotModeSelect::SelectMode(), and w_mode_select.

void RGHistoPlotAttrSelect::SetAngles ( const Double_t  theta,
const Double_t  phi,
const Bool_t  emit = kTRUE 
)
virtual

Set angles for 3D view.

Parameters
thetatheta angle
phiphi angle
emitflag if signal must be emitted

References AnglesChanged(), inhibit_slot, w_phi_entry, and w_theta_entry.

Referenced by RGHistoTools::RemapToolsFrame().

TAttLine RGHistoPlotAttrSelect::GetLineAttr ( ) const
inlinevirtual

Get selected line attributes.

References RGLineAttrSelect::GetLineAttr(), and w_line_select.

Referenced by AttrToHisto().

TAttFill RGHistoPlotAttrSelect::GetFillAttr ( ) const
inlinevirtual

Get selected fill attributes.

References RGFillAttrSelect::GetFillAttr(), and w_fill_select.

Referenced by AttrToHisto().

TAttMarker RGHistoPlotAttrSelect::GetMarkerAttr ( ) const
inlinevirtual

Get selected marker attributes.

References RGMarkerAttrSelect::GetMarkerAttr(), and w_marker_select.

Referenced by AttrToHisto().

Double_t RGHistoPlotAttrSelect::GetTheta ( ) const
inlinevirtual

Get selected theta 3D angle.

References w_theta_entry.

Double_t RGHistoPlotAttrSelect::GetPhi ( ) const
inlinevirtual

Get selected phi 3D angle.

References w_phi_entry.

Int_t RGHistoPlotAttrSelect::GetPlotMode ( ) const
inlinevirtual

Get selected plot mode.

References RGHistoPlotModeSelect::GetPlotMode(), and w_mode_select.

string RGHistoPlotAttrSelect::GetPlotOption ( ) const
inlinevirtual

Get ROOT option string for selected mode.

References RGHistoPlotModeSelect::GetPlotOption(), and w_mode_select.

Referenced by RGHistoTools::PlotModeChanged().

string RGHistoPlotAttrSelect::GetPlotOption ( const Int_t  dim,
const Int_t  mode 
)
static

Get the ROOT plotting options corresponding to the argument plot mode number.

Parameters
dimhistogram dimension
modeplot mode

References RGHistoPlotModeSelect::GetPlotOption().

void RGHistoPlotAttrSelect::SetAttributes ( const TH1 *  h,
const Bool_t  emit = kTRUE 
)
virtual

Set edited attributes from an histogram.

Parameters
hhistogram pointer
emitflag if signal must be emitted

References SetFillAttr(), SetLineAttr(), and SetMarkerAttr().

Referenced by RGHistoTools::HistoSelected().

void RGHistoPlotAttrSelect::AttrToHisto ( TH1 *  h) const
virtual

Set histogram attributes from currently selected ones.

Parameters
hhistogram pointer

References GetFillAttr(), GetLineAttr(), and GetMarkerAttr().

Referenced by DrawHisto(), DrawHistoCopy(), DrawHistoNormalized(), and RGHistoTools::HistoAttChanged().

void RGHistoPlotAttrSelect::ModeSelectionUpdate ( Int_t  sel)
virtual

Function called when plot mode has been changed.

Parameters
selselected mode

References RGHistoPlotModeSelect::GetDimension(), plot_mode, w_mode_select, w_phi_entry, and w_theta_entry.

Referenced by Construct(), SetPlotMode(), and SetState().

void RGHistoPlotAttrSelect::AnglesValueChanged ( )
virtual

Function called when an angle of 3D view is changed.

References AnglesChanged(), and inhibit_slot.

void RGHistoPlotAttrSelect::LineChanged ( )
inlinevirtual

Signal sent when line attributes are changed.

Referenced by SetLineAttr().

void RGHistoPlotAttrSelect::FillChanged ( )
inlinevirtual

Signal sent when fill attributes are changed.

Referenced by SetFillAttr().

void RGHistoPlotAttrSelect::MarkerChanged ( )
inlinevirtual

Signal sent when marker attributes are changed.

Referenced by SetMarkerAttr().

void RGHistoPlotAttrSelect::ModeSelected ( Int_t  m)
inlinevirtual

Signal sent when plot mode is changed.

void RGHistoPlotAttrSelect::AnglesChanged ( )
inlinevirtual

Signal sent when 3D view angles are changed.

Referenced by AnglesValueChanged(), and SetAngles().

RGHistoPlotAttrSelect::ClassDef ( RGHistoPlotAttrSelect  ,
 
)

For ROOT dictionary.


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