4#include <TGeoManager.h>
5#include <TMatrixDfwd.h>
37 void SetPlane(
const double fx,
const double fy,
const double fz,
38 const double x0,
const double y0,
const double z0)
override;
39 void SetPlane(
const double fx,
const double fy,
const double fz,
40 const double x0,
const double y0,
const double z0,
41 const double hx,
const double hy,
const double hz)
override;
52 bool Plot(
const bool twod =
true,
const bool outline =
false);
65 for (
const auto& c : colors)
SetColor(c.first, c.second);
71 for (
const auto& c : colors)
SetFillColor(c.first, c.second);
133 const std::vector<std::vector<Facet> >& elementFacets,
134 const std::map<
Facet, std::vector<size_t> >& facetElements,
135 std::vector<Facet>& facets, std::vector<bool>& done)
const;
143 bool InView(
const double x,
const double y)
const;
145 bool LinesCrossed(
double x1,
double y1,
double x2,
double y2,
double u1,
146 double v1,
double u2,
double v2,
double& xc,
150 bool OnLine(
double x1,
double y1,
double x2,
double y2,
double u,
153 bool PlaneCut(
double x1,
double y1,
double z1,
double x2,
double y2,
154 double z2, TMatrixD& xMat);
155 void ClipToView(std::vector<double>& px, std::vector<double>& py,
156 std::vector<double>& cx, std::vector<double>& cy);
157 bool IsInPolygon(
double x,
double y,
const std::vector<double>& px,
158 const std::vector<double>& py,
bool& edge)
const;
Component for importing and interpolating field maps from CST.
ViewBase()=delete
Default constructor.
Visualize drift lines and tracks.
Draw the mesh of a field-map component.
bool GetDrawViewRegion(void) const
void CreateDefaultAxes()
Create a default set of custom-made axes.
bool PlaneCut(double x1, double y1, double z1, double x2, double y2, double z2, TMatrixD &xMat)
void SetYaxisTitle(const std::string &ytitle)
ViewFEMesh()
Default constructor.
std::vector< double > m_viewRegionY
void SetFillMeshWithBorders()
Show filled mesh elements.
bool Plot(const bool twod=true, const bool outline=false)
Plot method to be called by user.
void SetViewDrift(ViewDrift *vd)
Set the optional associated ViewDrift.
std::vector< size_t > Facet
bool IntersectPlaneArea(double &xmin, double &ymin, double &xmax, double &ymax)
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 RemoveCrossings(std::vector< double > &x, std::vector< double > &y)
void SetPlane(const double fx, const double fy, const double fz, const double x0, const double y0, const double z0) override
Set the projection (viewing plane), if applicable.
std::vector< double > m_viewRegionX
std::vector< TGeoVolume * > m_volumes
std::unique_ptr< TGeoManager > m_geoManager
void SetDrawViewRegion(bool do_draw)
Display intersection of projection plane with viewing area.
bool LinesCrossed(double x1, double y1, double x2, double y2, double u1, double v1, double u2, double v2, double &xc, double &yc) const
void DrawCST(ComponentCST *componentCST)
std::vector< TGeoMedium * > m_media
bool IsInPolygon(double x, double y, const std::vector< double > &px, const std::vector< double > &py, bool &edge) const
bool InView(const double x, const double y) const
Return true if the specified point is in the view region.
bool OnLine(double x1, double y1, double x2, double y2, double u, double v) const
std::map< int, bool > m_disabledMaterial
void AddFacets(const size_t i, const std::vector< std::vector< Facet > > &elementFacets, const std::map< Facet, std::vector< size_t > > &facetElements, std::vector< Facet > &facets, std::vector< bool > &done) const
void SetFillColors(const std::map< int, int > &colors)
void SetColor(int matID, int colorID)
Associate a color with each element material map ID.
void SetComponent(Component *cmp)
Set the component from which to retrieve the mesh and field.
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) override
Set the projection plane specifying a hint for the in-plane x axis.
std::map< int, int > m_colorMap_fill
void SetXaxis(TGaxis *ax)
void SetYaxis(TGaxis *ay)
void SetColors(const std::map< int, int > &colors)
bool FacetSign(const Facet &f, const size_t element) const
void SetFillMesh(const bool f)
Element fill switch; 2D only, set false for wireframe mesh.
void ClipToView(std::vector< double > &px, std::vector< double > &py, std::vector< double > &cx, std::vector< double > &cy)
std::map< int, int > m_colorMap
ViewFEMesh(Component *cmp)
Constructor.