10#include <TGeoManager.h>
32 void SetPlane(
const double fx,
const double fy,
const double fz,
33 const double x0,
const double y0,
const double z0)
override;
34 void SetPlane(
const double fx,
const double fy,
const double fz,
35 const double x0,
const double y0,
const double z0,
36 const double hx,
const double hy,
const double hz)
override;
41 void SetXaxisTitle(
const std::string& xtitle) { m_xaxisTitle = xtitle; }
42 void SetYaxisTitle(
const std::string& ytitle) { m_yaxisTitle = ytitle; }
47 bool Plot(
const bool twod =
true);
58 void SetColor(
int matID,
int colorID) { m_colorMap[matID] = colorID; }
60 m_colorMap_fill[matID] = colorID;
68 m_plotMeshBorders =
true;
77 m_disabledMaterial[materialID] =
true;
82 bool m_fillMesh =
false;
85 bool m_drawViewRegion =
false;
86 std::vector<double> m_viewRegionX;
87 std::vector<double> m_viewRegionY;
94 bool m_plotMeshBorders =
false;
97 TGaxis* m_xaxis =
nullptr;
98 TGaxis* m_yaxis =
nullptr;
99 std::string m_xaxisTitle =
"";
100 std::string m_yaxisTitle =
"";
101 bool m_drawAxes =
false;
104 std::map<int, int> m_colorMap;
105 std::map<int, int> m_colorMap_fill;
108 std::map<int, bool> m_disabledMaterial;
110 std::vector<TGeoVolume*> m_volumes;
111 std::vector<TGeoMedium*> m_media;
112 std::unique_ptr<TGeoManager> m_geoManager;
115 void DrawElements2d();
116 void DrawElements3d();
119 void DrawDriftLines2d();
120 void DrawDriftLines3d();
122 bool GetPlotLimits();
125 bool InView(
const double x,
const double y)
const;
127 bool LinesCrossed(
double x1,
double y1,
double x2,
double y2,
double u1,
128 double v1,
double u2,
double v2,
double& xc,
130 bool IntersectPlaneArea(
double& xmin,
double& ymin,
131 double& xmax,
double& ymax);
132 bool OnLine(
double x1,
double y1,
double x2,
double y2,
double u,
134 void RemoveCrossings(std::vector<double>& x, std::vector<double>& y);
135 bool PlaneCut(
double x1,
double y1,
double z1,
double x2,
double y2,
136 double z2, TMatrixD& xMat);
137 void ClipToView(std::vector<double>& px, std::vector<double>& py,
138 std::vector<double>& cx, std::vector<double>& cy);
139 bool IsInPolygon(
double x,
double y,
const std::vector<double>& px,
140 const std::vector<double>& py,
bool& edge)
const;
Base class for components based on finite-element field maps.
ViewBase()=delete
Default constructor.
Visualize drift lines and tracks.
bool GetDrawViewRegion(void) const
bool Plot(const bool twod=true)
Plot method to be called by user.
void CreateDefaultAxes()
Create a default set of custom-made axes.
void SetYaxisTitle(const std::string &ytitle)
void SetFillMeshWithBorders()
Show filled mesh elements.
void SetViewDrift(ViewDrift *vd)
Set the optional associated ViewDrift.
void SetFillColor(int matID, int colorID)
void SetXaxisTitle(const std::string &xtitle)
void DisableMaterial(int materialID)
Disable a material so that its mesh cells are not drawn.
void SetPlane(const double fx, const double fy, const double fz, const double x0, const double y0, const double z0) override
void SetDrawViewRegion(bool do_draw)
Display intersection of projection plane with viewing area.
void SetComponent(ComponentFieldMap *cmp)
Set the component from which to retrieve the mesh and field.
void SetColor(int matID, int colorID)
void SetXaxis(TGaxis *ax)
void SetYaxis(TGaxis *ay)
void SetFillMesh(const bool f)
Element fill switch; 2D only, set false for wireframe mesh.