Garfield++ 3.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
Loading...
Searching...
No Matches
Garfield::ViewBase Class Reference

Base class for visualization classes. More...

#include <ViewBase.hh>

+ Inheritance diagram for Garfield::ViewBase:

Public Member Functions

 ViewBase ()=delete
 Default constructor.
 
 ViewBase (const std::string &name)
 Constructor.
 
virtual ~ViewBase ()
 Destructor.
 
void SetCanvas (TCanvas *c)
 Set the canvas to be painted on.
 
TCanvas * GetCanvas ()
 Retrieve the canvas.
 
void EnableDebugging (const bool on=true)
 Switch on/off debugging output.
 

Protected Member Functions

std::string FindUnusedFunctionName (const std::string &s) const
 
std::string FindUnusedHistogramName (const std::string &s) const
 

Protected Attributes

std::string m_className = "ViewBase"
 
bool m_debug = false
 
TCanvas * m_canvas = nullptr
 
bool m_hasExternalCanvas = false
 
double m_proj [3][3]
 

Detailed Description

Base class for visualization classes.

Definition at line 10 of file ViewBase.hh.

Constructor & Destructor Documentation

◆ ViewBase() [1/2]

Garfield::ViewBase::ViewBase ( )
delete

Default constructor.

◆ ViewBase() [2/2]

Garfield::ViewBase::ViewBase ( const std::string &  name)

Constructor.

Definition at line 10 of file ViewBase.cc.

10 :
11 m_className(name) {
12
14}
void SetDefaultStyle()
Apply the default Garfield ROOT style.
std::string m_className
Definition: ViewBase.hh:28
PlottingEngineRoot plottingEngine

◆ ~ViewBase()

Garfield::ViewBase::~ViewBase ( )
virtual

Destructor.

Definition at line 16 of file ViewBase.cc.

16 {
18}
bool m_hasExternalCanvas
Definition: ViewBase.hh:35
TCanvas * m_canvas
Definition: ViewBase.hh:34

Member Function Documentation

◆ EnableDebugging()

void Garfield::ViewBase::EnableDebugging ( const bool  on = true)
inline

Switch on/off debugging output.

Definition at line 25 of file ViewBase.hh.

25{ m_debug = on; }

◆ FindUnusedFunctionName()

std::string Garfield::ViewBase::FindUnusedFunctionName ( const std::string &  s) const
protected

Definition at line 30 of file ViewBase.cc.

30 {
31 int idx = 0;
32 std::string fname = s + "_0";
33 while (gROOT->GetListOfFunctions()->FindObject(fname.c_str())) {
34 ++idx;
35 fname = s + "_" + std::to_string(idx);
36 }
37 return fname;
38}

◆ FindUnusedHistogramName()

std::string Garfield::ViewBase::FindUnusedHistogramName ( const std::string &  s) const
protected

Definition at line 40 of file ViewBase.cc.

40 {
41 int idx = 0;
42 std::string hname = s + "_0";
43 while (gDirectory->GetList()->FindObject(hname.c_str())) {
44 ++idx;
45 hname = s + "_" + std::to_string(idx);
46 }
47 return hname;
48}

Referenced by Garfield::ViewSignal::PlotSignal().

◆ GetCanvas()

TCanvas * Garfield::ViewBase::GetCanvas ( )
inline

Retrieve the canvas.

Definition at line 22 of file ViewBase.hh.

22{ return m_canvas; }

◆ SetCanvas()

void Garfield::ViewBase::SetCanvas ( TCanvas *  c)

Set the canvas to be painted on.

Definition at line 20 of file ViewBase.cc.

20 {
21 if (!c) return;
23 delete m_canvas;
24 m_canvas = nullptr;
25 }
26 m_canvas = c;
28}

Referenced by main().

Member Data Documentation

◆ m_canvas

TCanvas* Garfield::ViewBase::m_canvas = nullptr
protected

◆ m_className

std::string Garfield::ViewBase::m_className = "ViewBase"
protected

Definition at line 28 of file ViewBase.hh.

Referenced by Garfield::ViewDrift::AddDriftLinePoint(), Garfield::ViewDrift::AddTrackPoint(), Garfield::ViewField::Evaluate2D(), Garfield::ViewMedium::EvaluateFunction(), Garfield::ViewFEMesh::Plot(), Garfield::ViewGeometry::Plot(), Garfield::ViewCell::Plot2d(), Garfield::ViewCell::Plot3d(), Garfield::ViewMedium::PlotElectronCrossSections(), Garfield::ViewIsochrons::PlotIsochrons(), Garfield::ViewSignal::PlotSignal(), Garfield::ViewField::SetArea(), Garfield::ViewIsochrons::SetArea(), Garfield::ViewCell::SetArea(), Garfield::ViewDrift::SetArea(), Garfield::ViewFEMesh::SetArea(), Garfield::ViewIsochrons::SetAspectRatioSwitch(), Garfield::ViewDrift::SetClusterMarkerSize(), Garfield::ViewDrift::SetCollisionMarkerSize(), Garfield::ViewCell::SetComponent(), Garfield::ViewField::SetComponent(), Garfield::ViewIsochrons::SetComponent(), Garfield::ViewFEMesh::SetComponent(), Garfield::ViewIsochrons::SetConnectionThreshold(), Garfield::ViewDrift::SetDriftLinePoint(), Garfield::ViewGeometry::SetGeometry(), Garfield::ViewIsochrons::SetLoopThreshold(), Garfield::ViewMedium::SetMedium(), Garfield::ViewField::SetNumberOfContours(), Garfield::ViewField::SetNumberOfSamples1d(), Garfield::ViewField::SetNumberOfSamples2d(), Garfield::ViewField::SetPlane(), Garfield::ViewIsochrons::SetPlane(), Garfield::ViewFEMesh::SetPlane(), Garfield::ViewMedium::SetRangeA(), Garfield::ViewMedium::SetRangeB(), Garfield::ViewMedium::SetRangeE(), Garfield::ViewSignal::SetRangeX(), Garfield::ViewSignal::SetRangeY(), Garfield::ViewMedium::SetRangeY(), Garfield::ViewField::SetSensor(), Garfield::ViewIsochrons::SetSensor(), Garfield::ViewSignal::SetSensor(), and Garfield::ViewDrift::SetTrackPoint().

◆ m_debug

bool Garfield::ViewBase::m_debug = false
protected

◆ m_hasExternalCanvas

bool Garfield::ViewBase::m_hasExternalCanvas = false
protected

◆ m_proj

double Garfield::ViewBase::m_proj[3][3]
protected

Definition at line 38 of file ViewBase.hh.


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