14#include <TPolyLine3D.h>
44 void SetArea(
const double xmin,
const double ymin,
const double zmin,
45 const double xmax,
const double ymax,
const double zmax);
50 void SetPlane(
double fx,
double fy,
double fz,
double x0,
double y0,
69 void SetColor(
int matID,
int colorID) { m_colorMap[matID] = colorID; }
71 m_colorMap_fill[matID] = colorID;
79 m_plotMeshBorders =
true;
91 m_disabledMaterial[materialID] =
true;
95 std::string m_className;
104 bool m_hasExternalCanvas;
107 double project[3][3];
112 double m_xMin, m_yMin, m_zMin;
113 double m_xMax, m_yMax, m_zMax;
120 bool m_plotMeshBorders;
123 TGaxis* m_xaxis, *m_yaxis;
128 std::vector<TPolyLine*> m_mesh;
129 std::vector<TPolyLine*> m_driftLines;
133 std::map<int, int> m_colorMap;
134 std::map<int, int> m_colorMap_fill;
137 std::map<int, bool> m_disabledMaterial;
142 bool InView(
double x,
double y);
143 bool LinesCrossed(
double x1,
double y1,
double x2,
double y2,
double u1,
144 double v1,
double u2,
double v2,
double& xc,
double& yc);
145 bool OnLine(
double x1,
double y1,
double x2,
double y2,
double u,
double v);
146 void RemoveCrossings(std::vector<double>& x, std::vector<double>& y);
147 bool PlaneCut(
double x1,
double y1,
double z1,
double x2,
double y2,
148 double z2, TMatrixD& xMat);
149 bool PlaneCoords(
double x,
double y,
double z,
const TMatrixD& projMat,
151 void ClipToView(std::vector<double>& px, std::vector<double>& py,
152 std::vector<double>& cx, std::vector<double>& cy);
153 bool IsInPolygon(
double x,
double y, std::vector<double>& px,
154 std::vector<double>& py,
bool& edge);
Base class for components based on finite-element field maps.
Visualize drift lines and tracks.
Draw the mesh of a field-map component.
void SetXaxisTitle(const char *xtitle)
void CreateDefaultAxes()
Create a default set of custom-made axes.
void SetCanvas(TCanvas *c)
Set the canvas to be painted on.
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 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.
void EnableDebugging(const bool on=true)
Switch on/off debugging output.
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.