10unsigned int Solid::s_id = 0;
13 const double d = sqrt(dx * dx + dy * dy + dz * dz);
15 std::cerr <<
m_className <<
": Direction vector has zero norm.\n";
32 theta = atan2(dt,
m_dZ);
41 std::vector<double>& )
const {
43 std::cerr <<
m_className <<
"::GetProfile: function not implemented.\n";
47double Solid::NotImplemented(
const std::string& fcn)
const {
48 std::cerr <<
m_className <<
"::" << fcn <<
": function not implemented.\n";
53 const double x2,
const double y2,
const double z2,
54 const double x0,
const double y0,
const double z0,
55 const double a,
const double b,
const double c,
56 double& xc,
double& yc,
double& zc) {
68 const double prod1 = (x0 - x1) * a + (y0 - y1) * b + (z0 - z1) * c;
69 const double prod2 = (x2 - x1) * a + (y2 - y1) * b + (z2 - z1) * c;
71 constexpr double eps = 1.e-5;
73 const double dx = x2 - x1;
74 const double dy = y2 - y1;
75 const double dz = z2 - z1;
76 const double d2 = dx * dx + dy * dy + dz * dz;
77 if (std::abs(prod2) > 1.e-6 * sqrt((a * a + b * b + c * c) * d2)) {
78 double s = prod1 / prod2;
79 if (s >= -eps && s <= 1. + eps) on =
true;
80 s = std::max(0., std::min(1., s));
double m_cTheta
Polar angle.
static bool Intersect(const double x1, const double y1, const double z1, const double x2, const double y2, const double z2, const double x0, const double y0, const double z0, const double a, const double b, const double c, double &xc, double &yc, double &zc)
double m_dX
Direction vector.
void SetDirection(const double dx, const double dy, const double dz)
virtual bool GetProfile(std::vector< double > &xv, std::vector< double > &yv) const
Get the vertices defining an extrusion.
double m_cPhi
Azimuthal angle.
std::string m_className
Class name.