39 void SetArea(
const double xmin,
const double ymin,
const double xmax,
42 virtual void SetArea(
const double xmin,
const double ymin,
const double zmin,
43 const double xmax,
const double ymax,
const double zmax);
55 virtual void SetPlane(
const double fx,
const double fy,
const double fz,
56 const double x0,
const double y0,
const double z0);
58 virtual void SetPlane(
const double fx,
const double fy,
const double fz,
59 const double x0,
const double y0,
const double z0,
60 const double hx,
const double hy,
const double hz);
103 std::array<std::array<double, 3>, 3>
m_proj{
104 {{{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 0}}}};
108 {{{1, 0, 0}}, {{0, 1, 0}}, {{0, 0, 1}}}};
113 template <
typename T>
114 void ToPlane(
const T x,
const T y,
const T z, T& xp, T& yp)
const {
119 template <
typename T>
120 bool InBox(
const std::array<T, 3>& x)
const {
128 void Clip(
const std::array<float, 3>& x0,
const std::array<float, 3>& x1,
129 std::array<float, 3>& xc)
const;
131 void DrawLine(
const std::vector<std::array<float, 3> >& xl,
const short col,
141 bool PlotLimits(Sensor* sensor,
double& xmin,
double& ymin,
double& xmax,
143 bool PlotLimits(Component* cmp,
double& xmin,
double& ymin,
double& xmax,
147 bool PlotLimits(std::array<double, 3>& bbmin, std::array<double, 3>& bbmax,
148 double& xmin,
double& ymin,
double& xmax,
double& ymax)
const;
151 static void SetRange(TVirtualPad* pad,
const double x0,
const double y0,
152 const double x1,
const double y1);
std::array< double, 4 > m_plane
void EnableDebugging(const bool on=true)
Switch on/off debugging output.
std::array< std::array< double, 3 >, 3 > m_prmat
std::unique_ptr< TCanvas > m_canvas
void Clip(const std::array< float, 3 > &x0, const std::array< float, 3 > &x1, std::array< float, 3 > &xc) const
static void SetRange(TVirtualPad *pad, const double x0, const double y0, const double x1, const double y1)
static std::string FindUnusedCanvasName(const std::string &s)
Find an unused canvas name.
bool InBox(const std::array< T, 3 > &x) const
static bool RangeSet(TVirtualPad *)
void DrawLine(const std::vector< std::array< float, 3 > > &xl, const short col, const short lw)
void SetCanvas(TPad *pad)
Set the canvas to be painted on.
void SetPlaneZX()
Set the viewing plane to z-x.
void SetPlaneYZ()
Set the viewing plane to y-z.
static std::string FindUnusedHistogramName(const std::string &s)
Find an unused histogram name.
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).
bool PlotLimits(std::array< double, 3 > &bbmin, std::array< double, 3 > &bbmax, double &xmin, double &ymin, double &xmax, double &ymax) const
std::array< std::array< double, 3 >, 3 > m_proj
void SetArea()
Use default x- and y-axis limits (based on the bounding box of the sensor/component,...
bool PlotLimits(Component *cmp, double &xmin, double &ymin, double &xmax, double &ymax) const
TPad * GetCanvas()
Retrieve the canvas.
void SetPlaneXZ()
Set the viewing plane to x-z.
virtual void SetPlane(const double fx, const double fy, const double fz, const double x0, const double y0, const double z0)
Set the projection (viewing plane), if applicable.
void 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).
bool PlotLimits(Sensor *sensor, double &xmin, double &ymin, double &xmax, double &ymax) const
void SetPlaneXY()
Set the viewing plane to x-y.
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.
virtual ~ViewBase()=default
Destructor.
static std::string FindUnusedFunctionName(const std::string &s)
Find an unused function name.
void ToPlane(const T x, const T y, const T z, T &xp, T &yp) const
void SetCanvas()
Unset an external canvas.
std::string PlaneDescription()
void SetPlaneZY()
Set the viewing plane to z-y.
ViewBase(const std::string &name)
Constructor.
bool PlotLimitsFromUserBox(double &xmin, double &ymin, double &xmax, double &ymax) const
void Rotate(const double angle)
Rotate the viewing plane (angle in radian).
ViewBase()=delete
Default constructor.
void UpdateProjectionMatrix()