11 #include <top/dbobjects/TOPGeoHoneycombPanel.h>
23 void TOPGeoHoneycombPanel::appendContour(std::vector<std::pair<double, double> >& contour,
25 bool fromLeftToRight)
const
29 typedef std::pair<double, double>
Pair;
31 double R = getRadius();
32 double yc = getMaxThickness() - getMinThickness() - R;
33 double x0 = sqrt(R * R - yc * yc);
34 if (!fromLeftToRight) x0 = -x0;
35 double dx = 2.0 * x0 / m_N;
37 contour.push_back(
Pair(x, y0));
38 for (
int i = 1; i < m_N; i++) {
40 double y = y0 + sqrt(R * R - x * x) + yc;
41 contour.push_back(
Pair(x, y));
43 contour.push_back(
Pair(x0, y0));
48 bool TOPGeoHoneycombPanel::isConsistent()
const
50 if (m_width <= 0)
return false;
51 if (m_length <= 0)
return false;
52 if (m_minThickness <= 0)
return false;
53 if (m_maxThickness < m_minThickness)
return false;
54 if (m_radius <= 0)
return false;
55 if (m_edgeWidth <= 0)
return false;
56 if (m_material.empty())
return false;
57 if (m_edgeMaterial.empty())
return false;
62 void TOPGeoHoneycombPanel::print(
const std::string& title)
const
64 TOPGeoBase::print(title);
66 cout <<
" width = " << getWidth() <<
" " << s_unitName;
67 cout <<
", length = " << getLength() <<
" " << s_unitName;
68 cout <<
", thickness: min = " << getMinThickness() <<
" " << s_unitName;
69 cout <<
", max = " << getMaxThickness() <<
" " << s_unitName;
70 cout <<
", radius = " << getRadius() <<
" " << s_unitName << endl;
72 cout <<
" edge width = " << getEdgeWidth() <<
" " << s_unitName;
73 cout <<
", y = " << getY() <<
" " << s_unitName;
74 cout <<
", N = " << m_N << endl;
76 cout <<
" materials: body = " << getMaterial();
77 cout <<
", edge = " << getEdgeMaterial() << endl;