25 const std::vector<const Surface*>& surfaces) {
31 const std::vector<std::shared_ptr<const Surface>>& surfaces) {
42 double L = p1p2.norm();
49 double f = p1p2.dot(p1O) /
L;
54 Vector2D closest = f * p1p2.normalized() + p1;
55 double dist = (closest - O).
norm();
61 sl <<
"ProtoLayer with dimensions (min/max)" << std::endl;
62 sl <<
" - r : " <<
minR <<
" - " <<
envR.first <<
" / " <<
maxR <<
" + "
63 <<
envR.second << std::endl;
64 sl <<
" - z : " <<
minZ <<
" - " <<
envZ.first <<
" / " <<
maxZ <<
" + "
65 <<
envZ.second << std::endl;
67 <<
" + " <<
envPhi.second << std::endl;
73 const std::vector<const Surface*>& surfaces) {
75 maxR = std::numeric_limits<double>::lowest();
77 maxX = std::numeric_limits<double>::lowest();
79 maxY = std::numeric_limits<double>::lowest();
81 maxZ = std::numeric_limits<double>::lowest();
83 maxPhi = std::numeric_limits<double>::lowest();
85 for (
const auto& sf : surfaces) {
90 if (element !=
nullptr) {
101 if (pBounds !=
nullptr) {
102 const auto& sTransform = sf->
transform(gctx);
105 std::vector<Vector2D> vertices = pBounds->
vertices();
106 size_t nVertices = vertices.size();
109 for (
int side = 0; side < (element !=
nullptr ? 2 : 1); ++side) {
111 for (
size_t iv = 0; iv < nVertices; ++iv) {
112 size_t ivp = iv != 0
u ? iv - 1 : nVertices - 1;
114 double locz = side != 0 ? 0.5 * thickness : -0.5 *
thickness;
117 Vector3D(vertices.at(iv).x(), vertices.at(iv).y(), locz));
119 vertices.at(ivp).y(), locz));
137 }
else if (cylSurface !=
nullptr) {
146 for (
const auto& vtx : ph.
vertices) {
163 for (
const auto& face : ph.
faces) {
164 for (
size_t i = 0; i < face.size(); i++) {
173 double env = cylBoundsR / 2.;
180 double cylPosR =
perp(cylSurface->
center(gctx));
181 double dPhi = std::atan((cylBoundsR + env) / cylPosR) -
182 std::atan(cylBoundsR / cylPosR);
194 if (cBounds !=
nullptr) {
196 double z = sf->center(gctx).z();
216 }
else if (aBounds !=
nullptr) {
219 double z = sf->center(gctx).z();
234 throw std::domain_error(
235 "Not implemented yet for the given bounds type.");