15#include <TPolyLine3D.h>
39 void SetArea(
const double xmin,
const double ymin,
const double zmin,
40 const double xmax,
const double ymax,
const double zmax);
44 void SetPlane(
double fx,
double fy,
double fz,
double x0,
double y0,
47 void SetPlane(
double fx,
double fy,
double fz,
double x0,
double y0,
48 double z0,
double hx,
double hy,
double hz);
70 void SetColor(
int matID,
int colorID) { m_colorMap[matID] = colorID; }
72 m_colorMap_fill[matID] = colorID;
80 m_plotMeshBorders =
true;
89 m_disabledMaterial[materialID] =
true;
93 std::string m_label =
"Mesh";
96 bool m_fillMesh =
false;
103 bool m_hasUserArea =
false;
104 double m_xMin = -1., m_yMin = -1., m_zMin = -1.;
105 double m_xMax = 1., m_yMax = 1., m_zMax = 1.;
108 bool m_drawViewRegion =
false;
109 std::vector<TPolyLine> m_viewRegionLines;
112 double m_xPlaneMin = -1., m_xPlaneMax = 1.;
113 double m_yPlaneMin = -1., m_yPlaneMax = 1.;
120 bool m_plotMeshBorders =
false;
123 TGaxis* m_xaxis =
nullptr;
124 TGaxis* m_yaxis =
nullptr;
125 std::unique_ptr<TH2D> m_axes;
126 bool m_drawAxes =
false;
129 std::vector<TPolyLine> m_mesh;
130 std::vector<TPolyLine> m_driftLines;
134 std::map<int, int> m_colorMap;
135 std::map<int, int> m_colorMap_fill;
138 std::map<int, bool> m_disabledMaterial;
145 bool InView(
const double x,
const double y)
const;
147 bool LinesCrossed(
double x1,
double y1,
double x2,
double y2,
double u1,
148 double v1,
double u2,
double v2,
double& xc,
150 std::string CreateAxisTitle(
const double* norm)
const;
151 bool IntersectPlaneArea(
void);
152 bool PlaneVector(
double& x,
double& y,
double& z)
const;
153 bool OnLine(
double x1,
double y1,
double x2,
double y2,
double u,
155 void RemoveCrossings(std::vector<double>& x, std::vector<double>& y);
156 bool PlaneCut(
double x1,
double y1,
double z1,
double x2,
double y2,
157 double z2, TMatrixD& xMat);
158 bool PlaneCoords(
double x,
double y,
double z,
const TMatrixD& projMat,
160 void ClipToView(std::vector<double>& px, std::vector<double>& py,
161 std::vector<double>& cx, std::vector<double>& cy);
162 bool IsInPolygon(
double x,
double y, std::vector<double>& px,
163 std::vector<double>& py,
bool& edge)
const;
Base class for components based on finite-element field maps.
Base class for visualization classes.
Visualize drift lines and tracks.
Draw the mesh of a field-map component.
void SetXaxisTitle(const char *xtitle)
bool GetDrawViewRegion(void) const
void CreateDefaultAxes()
Create a default set of custom-made axes.
void SetComponent(ComponentFieldMap *comp)
Set the component from which to retrieve the mesh and field.
void SetFillMeshWithBorders()
Show filled mesh elements.
void SetViewDrift(ViewDrift *vd)
Set the optional associated ViewDrift.
void SetFillColor(int matID, int colorID)
void DisableMaterial(int materialID)
Disable a material so that its mesh cells are not drawn.
void SetYaxisTitle(const char *ytitle)
bool Plot()
Plot method to be called by user.
void SetDrawViewRegion(bool do_draw)
Display intersection of projection plane with viewing area.
void SetPlane(double fx, double fy, double fz, double x0, double y0, double z0)
Set the projection plane.
void SetArea()
Set area to be plotted to the default.
~ViewFEMesh()=default
Destructor.
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.
void SetDefaultProjection()
Reset the projection plane.