Garfield++ 4.0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
Base class for visualization classes. More...
#include <ViewBase.hh>
Public Member Functions | |
ViewBase ()=delete | |
Default constructor. | |
ViewBase (const std::string &name) | |
Constructor. | |
virtual | ~ViewBase ()=default |
Destructor. | |
void | SetCanvas (TPad *pad) |
Set the canvas to be painted on. | |
void | SetCanvas () |
Unset an external canvas. | |
TPad * | GetCanvas () |
Retrieve the canvas. | |
void | SetArea (const double xmin, const double ymin, const double xmax, const double ymax) |
virtual void | SetArea (const double xmin, const double ymin, const double zmin, const double xmax, const double ymax, const double zmax) |
Set a bounding box (if applicable). | |
void | SetArea () |
virtual void | SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0) |
virtual void | SetPlane (const double fx, const double fy, const double fz, const double x0, const double y0, const double z0, const double hx, const double hy, const double hz) |
Set the projection plane specifying a hint for the in-plane x axis. | |
void | Rotate (const double angle) |
Rotate the viewing plane (angle in radian). | |
void | SetPlaneXY () |
Set the viewing plane to x-y. | |
void | SetPlaneXZ () |
Set the viewing plane to x-z. | |
void | SetPlaneYZ () |
Set the viewing plane to y-z. | |
void | EnableDebugging (const bool on=true) |
Switch on/off debugging output. | |
Static Public Member Functions | |
static std::string | FindUnusedFunctionName (const std::string &s) |
Find an unused function name. | |
static std::string | FindUnusedHistogramName (const std::string &s) |
Find an unused histogram name. | |
static std::string | FindUnusedCanvasName (const std::string &s) |
Find an unused canvas name. | |
Protected Member Functions | |
void | UpdateProjectionMatrix () |
template<typename T > | |
void | ToPlane (const T x, const T y, const T z, T &xp, T &yp) const |
template<typename T > | |
bool | InBox (const std::array< T, 3 > &x) const |
void | Clip (const std::array< float, 3 > &x0, const std::array< float, 3 > &x1, std::array< float, 3 > &xc) const |
void | DrawLine (const std::vector< std::array< float, 3 > > &xl, const short col, const short lw) |
std::string | LabelX () |
std::string | LabelY () |
std::string | PlaneDescription () |
bool | PlotLimits (Sensor *sensor, double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | PlotLimits (Component *cmp, double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | PlotLimitsFromUserBox (double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | PlotLimits (std::array< double, 3 > &bbmin, std::array< double, 3 > &bbmax, double &xmin, double &ymin, double &xmax, double &ymax) const |
bool | RangeSet (TPad *) |
void | SetRange (TPad *pad, const double x0, const double y0, const double x1, const double y1) |
Protected Attributes | |
std::string | m_className = "ViewBase" |
bool | m_debug = false |
bool | m_userPlotLimits = false |
double | m_xMinPlot = -1. |
double | m_xMaxPlot = 1. |
double | m_yMinPlot = -1. |
double | m_yMaxPlot = 1. |
bool | m_userBox = false |
double | m_xMinBox = -1. |
double | m_xMaxBox = 1. |
double | m_yMinBox = -1. |
double | m_yMaxBox = 1. |
double | m_zMinBox = -1. |
double | m_zMaxBox = 1. |
std::array< std::array< double, 3 >, 3 > | m_proj |
std::array< double, 4 > | m_plane {{0, 0, 1, 0}} |
std::array< std::array< double, 3 >, 3 > | m_prmat |
Base class for visualization classes.
Definition at line 18 of file ViewBase.hh.
|
delete |
Default constructor.
Garfield::ViewBase::ViewBase | ( | const std::string & | name | ) |
Constructor.
Definition at line 68 of file ViewBase.cc.
|
virtualdefault |
Destructor.
|
protected |
Definition at line 347 of file ViewBase.cc.
Referenced by DrawLine().
|
protected |
Definition at line 371 of file ViewBase.cc.
Referenced by Garfield::ViewDrift::Plot2d(), and Garfield::ViewField::PlotFieldLines().
|
inline |
|
static |
Find an unused canvas name.
Definition at line 310 of file ViewBase.cc.
Referenced by GetCanvas(), Garfield::ComponentAnalyticField::MultipoleMoments(), Garfield::TrackSrim::PlotEnergyLoss(), Garfield::TrackSrim::PlotRange(), and Garfield::TrackSrim::PlotStraggling().
|
static |
Find an unused function name.
Definition at line 290 of file ViewBase.cc.
|
static |
Find an unused histogram name.
Definition at line 300 of file ViewBase.cc.
Referenced by Garfield::ViewSignal::Plot(), and Garfield::ViewSignal::PlotSignal().
TPad * Garfield::ViewBase::GetCanvas | ( | ) |
Retrieve the canvas.
Definition at line 74 of file ViewBase.cc.
Referenced by Garfield::ViewFEMesh::Plot(), Garfield::ViewSignal::Plot(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewDrift::Plot2d(), Garfield::ViewGeometry::Plot3d(), Garfield::ViewDrift::Plot3d(), Garfield::ViewField::PlotFieldLines(), Garfield::ViewIsochrons::PlotIsochrons(), and Garfield::ViewSignal::PlotSignal().
|
inlineprotected |
Definition at line 115 of file ViewBase.hh.
Referenced by Clip(), DrawLine(), and Garfield::ViewDrift::Plot2d().
|
protected |
Definition at line 420 of file ViewBase.cc.
Referenced by Garfield::ViewFEMesh::CreateDefaultAxes(), Garfield::ViewFEMesh::Plot(), Garfield::ViewDrift::Plot2d(), Garfield::ViewField::PlotFieldLines(), and Garfield::ViewIsochrons::PlotIsochrons().
|
protected |
Definition at line 483 of file ViewBase.cc.
Referenced by Garfield::ViewFEMesh::CreateDefaultAxes(), Garfield::ViewFEMesh::Plot(), Garfield::ViewDrift::Plot2d(), Garfield::ViewField::PlotFieldLines(), and Garfield::ViewIsochrons::PlotIsochrons().
|
protected |
Definition at line 545 of file ViewBase.cc.
|
protected |
Definition at line 626 of file ViewBase.cc.
|
protected |
Definition at line 608 of file ViewBase.cc.
Referenced by Garfield::ViewGeometry::Plot2d(), PlotLimits(), and PlotLimitsFromUserBox().
|
protected |
Definition at line 671 of file ViewBase.cc.
|
protected |
Definition at line 663 of file ViewBase.cc.
Referenced by Garfield::ViewGeometry::Plot2d().
|
protected |
Definition at line 83 of file ViewBase.cc.
Referenced by Garfield::ViewFEMesh::Plot(), Garfield::ViewDrift::Plot2d(), and Garfield::ViewField::PlotFieldLines().
void Garfield::ViewBase::Rotate | ( | const double | angle | ) |
Rotate the viewing plane (angle in radian).
Definition at line 255 of file ViewBase.cc.
|
inline |
Use default x- and y-axis limits (based on the bounding box of the sensor/component, if applicable).
Definition at line 43 of file ViewBase.hh.
void Garfield::ViewBase::SetArea | ( | const double | xmin, |
const double | ymin, | ||
const double | xmax, | ||
const double | ymax | ||
) |
Set the x- and y-axis limits (in local coordinates of the current viewing plane, if applicable).
Definition at line 109 of file ViewBase.cc.
Referenced by main().
|
virtual |
Set a bounding box (if applicable).
Definition at line 125 of file ViewBase.cc.
|
inline |
|
inline |
Set the canvas to be painted on.
Definition at line 28 of file ViewBase.hh.
Referenced by main().
|
virtual |
Set the projection (viewing plane), if applicable.
fx,fy,fz | normal vector |
x0,y0,z0 | in-plane point |
Reimplemented in Garfield::ViewFEMesh.
Definition at line 142 of file ViewBase.cc.
Referenced by main(), and Garfield::ViewFEMesh::SetPlane().
|
virtual |
Set the projection plane specifying a hint for the in-plane x axis.
Reimplemented in Garfield::ViewFEMesh.
Definition at line 182 of file ViewBase.cc.
void Garfield::ViewBase::SetPlaneXY | ( | ) |
Set the viewing plane to x-y.
Definition at line 272 of file ViewBase.cc.
Referenced by SetPlane(), and UpdateProjectionMatrix().
void Garfield::ViewBase::SetPlaneXZ | ( | ) |
Set the viewing plane to x-z.
Definition at line 278 of file ViewBase.cc.
Referenced by main().
void Garfield::ViewBase::SetPlaneYZ | ( | ) |
Set the viewing plane to y-z.
Definition at line 284 of file ViewBase.cc.
|
protected |
Definition at line 93 of file ViewBase.cc.
Referenced by Garfield::ViewFEMesh::Plot(), Garfield::ViewDrift::Plot2d(), and Garfield::ViewField::PlotFieldLines().
|
inlineprotected |
Definition at line 109 of file ViewBase.hh.
Referenced by DrawLine(), Garfield::ViewFEMesh::Plot(), Garfield::ViewGeometry::Plot2d(), and Garfield::ViewDrift::Plot2d().
|
protected |
Definition at line 320 of file ViewBase.cc.
Referenced by Rotate(), SetPlane(), SetPlaneXZ(), and SetPlaneYZ().
|
protected |
Definition at line 78 of file ViewBase.hh.
Referenced by Garfield::ViewDrift::AddDriftLinePoint(), Garfield::ViewDrift::AddTrackPoint(), Garfield::ViewFEMesh::CreateDefaultAxes(), Garfield::ViewField::EqualFluxIntervals(), Garfield::ViewField::FixedFluxIntervals(), GetCanvas(), Garfield::ViewFEMesh::Plot(), Garfield::ViewSignal::Plot(), Garfield::ViewCell::Plot2d(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewDrift::Plot2d(), Garfield::ViewCell::Plot3d(), Garfield::ViewGeometry::Plot3d(), Garfield::ViewDrift::Plot3d(), Garfield::ViewMedium::PlotElectronCrossSections(), Garfield::ViewField::PlotFieldLines(), Garfield::ViewIsochrons::PlotIsochrons(), PlotLimits(), Garfield::ViewSignal::PlotSignal(), SetArea(), Garfield::ViewIsochrons::SetAspectRatioSwitch(), Garfield::ViewDrift::SetClusterMarkerSize(), Garfield::ViewDrift::SetCollisionMarkerSize(), Garfield::ViewField::SetComponent(), Garfield::ViewIsochrons::SetComponent(), Garfield::ViewCell::SetComponent(), Garfield::ViewFEMesh::SetComponent(), Garfield::ViewIsochrons::SetConnectionThreshold(), Garfield::ViewDrift::SetDriftLinePoint(), Garfield::ViewGeometry::SetGeometry(), Garfield::ViewIsochrons::SetLoopThreshold(), Garfield::ViewMedium::SetMedium(), 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(), Garfield::ViewDrift::SetTrackPoint(), and UpdateProjectionMatrix().
|
protected |
Definition at line 81 of file ViewBase.hh.
Referenced by EnableDebugging(), Garfield::ViewField::EqualFluxIntervals(), Garfield::ViewField::FixedFluxIntervals(), and Garfield::ViewIsochrons::PlotIsochrons().
|
protected |
Definition at line 99 of file ViewBase.hh.
Referenced by Garfield::ViewField::EqualFluxIntervals(), Garfield::ViewField::FixedFluxIntervals(), PlaneDescription(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewIsochrons::PlotIsochrons(), SetPlane(), SetPlaneXY(), SetPlaneXZ(), SetPlaneYZ(), and UpdateProjectionMatrix().
|
protected |
Definition at line 101 of file ViewBase.hh.
Referenced by SetPlane(), SetPlaneXY(), ToPlane(), and UpdateProjectionMatrix().
|
protected |
Definition at line 96 of file ViewBase.hh.
Referenced by LabelX(), LabelY(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewIsochrons::PlotIsochrons(), PlotLimits(), Rotate(), SetPlane(), SetPlaneXY(), SetPlaneXZ(), SetPlaneYZ(), and UpdateProjectionMatrix().
|
protected |
Definition at line 89 of file ViewBase.hh.
Referenced by InBox(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewField::PlotFieldLines(), and SetArea().
|
protected |
Definition at line 84 of file ViewBase.hh.
Referenced by Garfield::ViewGeometry::Plot2d(), and SetArea().
|
protected |
Definition at line 90 of file ViewBase.hh.
Referenced by Clip(), InBox(), Garfield::ViewDrift::Plot3d(), Garfield::ViewField::PlotFieldLines(), PlotLimitsFromUserBox(), and SetArea().
|
protected |
Definition at line 85 of file ViewBase.hh.
Referenced by Garfield::ViewFEMesh::CreateDefaultAxes(), Garfield::ViewFEMesh::Plot(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewDrift::Plot2d(), Garfield::ViewField::PlotFieldLines(), Garfield::ViewIsochrons::PlotIsochrons(), and SetArea().
|
protected |
Definition at line 90 of file ViewBase.hh.
Referenced by Clip(), InBox(), Garfield::ViewDrift::Plot3d(), Garfield::ViewField::PlotFieldLines(), PlotLimitsFromUserBox(), and SetArea().
|
protected |
Definition at line 85 of file ViewBase.hh.
Referenced by Garfield::ViewFEMesh::CreateDefaultAxes(), Garfield::ViewFEMesh::Plot(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewDrift::Plot2d(), Garfield::ViewField::PlotFieldLines(), Garfield::ViewIsochrons::PlotIsochrons(), and SetArea().
|
protected |
Definition at line 91 of file ViewBase.hh.
Referenced by Clip(), InBox(), Garfield::ViewDrift::Plot3d(), Garfield::ViewField::PlotFieldLines(), PlotLimitsFromUserBox(), and SetArea().
|
protected |
Definition at line 86 of file ViewBase.hh.
Referenced by Garfield::ViewFEMesh::CreateDefaultAxes(), Garfield::ViewFEMesh::Plot(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewDrift::Plot2d(), Garfield::ViewField::PlotFieldLines(), Garfield::ViewIsochrons::PlotIsochrons(), and SetArea().
|
protected |
Definition at line 91 of file ViewBase.hh.
Referenced by Clip(), InBox(), Garfield::ViewDrift::Plot3d(), Garfield::ViewField::PlotFieldLines(), PlotLimitsFromUserBox(), and SetArea().
|
protected |
Definition at line 86 of file ViewBase.hh.
Referenced by Garfield::ViewFEMesh::CreateDefaultAxes(), Garfield::ViewFEMesh::Plot(), Garfield::ViewGeometry::Plot2d(), Garfield::ViewDrift::Plot2d(), Garfield::ViewField::PlotFieldLines(), Garfield::ViewIsochrons::PlotIsochrons(), and SetArea().
|
protected |
Definition at line 92 of file ViewBase.hh.
Referenced by Clip(), InBox(), Garfield::ViewDrift::Plot3d(), Garfield::ViewField::PlotFieldLines(), PlotLimitsFromUserBox(), and SetArea().
|
protected |
Definition at line 92 of file ViewBase.hh.
Referenced by Clip(), Garfield::ViewDrift::Plot3d(), Garfield::ViewField::PlotFieldLines(), PlotLimitsFromUserBox(), and SetArea().