54 void Plot(
const std::string& option =
"v",
55 const std::string& drawopt =
"arr");
62 void PlotProfile(
const double x0,
const double y0,
const double z0,
63 const double x1,
const double y1,
const double z1,
64 const std::string& option =
"v",
65 const bool normalised =
true);
72 const std::string& option);
79 const std::string& drawopt);
89 const double y0,
const double z0,
90 const double x1,
const double y1,
92 const std::string& option =
"v",
93 const bool normalised =
true);
97 const bool samplePotential =
true) {
99 m_samplePotential = samplePotential;
113 const std::vector<double>& y0,
114 const std::vector<double>& z0,
115 const bool electron =
true,
const bool axis =
true,
116 const short col = kOrange - 3);
119 const double x1,
const double y1,
const double z1,
120 std::vector<double>& xf, std::vector<double>& yf,
121 std::vector<double>& zf,
122 const unsigned int nPoints = 20)
const;
125 const double x1,
const double y1,
const double z1,
126 std::vector<double>& xf, std::vector<double>& yf,
127 std::vector<double>& zf,
128 const double interval = 10.)
const;
131 enum class Parameter { Potential = 0, Magnitude, Ex, Ey, Ez, Unknown };
133 bool m_useAutoRange =
true;
134 bool m_samplePotential =
true;
135 bool m_useStatus =
false;
139 Sensor* m_sensor =
nullptr;
140 Component* m_component =
nullptr;
143 double m_vmin = 0., m_vmax = 100.;
144 double m_emin = 0., m_emax = 10000.;
145 double m_wmin = 0., m_wmax = 100.;
148 unsigned int m_nContours = 20;
150 unsigned int m_nSamples1d = 1000;
151 unsigned int m_nSamples2dX = 200;
152 unsigned int m_nSamples2dY = 200;
154 bool SetPlotLimits();
155 void Draw2d(
const std::string& option,
const bool contour,
156 const bool wfield,
const std::string& electrode,
157 const std::string& drawopt);
158 void DrawProfile(
const double x0,
const double y0,
const double z0,
159 const double x1,
const double y1,
const double z1,
160 const std::string& option,
const bool wfield,
161 const std::string& electrode,
const bool normalised);
162 Parameter GetPar(
const std::string& option, std::string& title)
const;
163 double Field(
const double x,
const double y,
const double z,
164 const Parameter par)
const;
165 double Wfield(
const double x,
const double y,
const double z,
166 const Parameter par,
const std::string& electrode)
const;
Abstract base class for components.
Base class for visualization classes.
Visualize the potential or electric field of a component or sensor.
void PlotProfileWeightingField(const std::string &label, const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const std::string &option="v", const bool normalised=true)
void SetElectricFieldRange(const double emin, const double emax)
Set the plot limits for the electric field.
void PlotWeightingField(const std::string &label, const std::string &option, const std::string &drawopt)
void SetNumberOfSamples2d(const unsigned int nx, const unsigned int ny)
Set the number of points used for drawing 2D functions.
bool FixedFluxIntervals(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, std::vector< double > &xf, std::vector< double > &yf, std::vector< double > &zf, const double interval=10.) const
Generate points along a line, spaced by a given flux interval.
void SetComponent(Component *c)
Set the component for which to plot the field.
void SetNumberOfSamples1d(const unsigned int n)
Set the number of points used for drawing 1D functions.
void PlotFieldLines(const std::vector< double > &x0, const std::vector< double > &y0, const std::vector< double > &z0, const bool electron=true, const bool axis=true, const short col=kOrange - 3)
Draw electric field lines from a set of starting points.
void SetVoltageRange(const double vmin, const double vmax)
Set the plot limits for the potential.
void PlotProfile(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, const std::string &option="v", const bool normalised=true)
bool EqualFluxIntervals(const double x0, const double y0, const double z0, const double x1, const double y1, const double z1, std::vector< double > &xf, std::vector< double > &yf, std::vector< double > &zf, const unsigned int nPoints=20) const
Generates point along a line, spaced by equal flux intervals.
void PlotContour(const std::string &option="v")
void Plot(const std::string &option="v", const std::string &drawopt="arr")
void SetNumberOfContours(const unsigned int n)
Set the number of contour levels.
void SetWeightingFieldRange(const double wmin, const double wmax)
Set the plot limits for the weighting field.
void SetSensor(Sensor *s)
Set the sensor for which to plot the field.
void EnableAutoRange(const bool on=true, const bool samplePotential=true)
~ViewField()=default
Destructor.
void PlotContourWeightingField(const std::string &label, const std::string &option)
void AcknowledgeStatus(const bool on, const double v0=0.)