5 #include "GeoModelKernel/GeoTrd.h" 6 #include "GeoModelKernel/GeoShapeAction.h" 8 const std::string GeoTrd::s_classType =
"Trd";
9 const ShapeType GeoTrd::s_classTypeID = 0x16;
11 GeoTrd::GeoTrd (
double XHalfLength1,
double XHalfLength2,
double YHalfLength1,
double YHalfLength2,
double ZHalfLength)
12 : m_xHalfLength1 (XHalfLength1)
13 , m_xHalfLength2 (XHalfLength2)
14 , m_yHalfLength1 (YHalfLength1)
15 , m_yHalfLength2 (YHalfLength2)
16 , m_zHalfLength (ZHalfLength)
22 double GeoTrd::volume ()
const 24 double fDz = m_zHalfLength;
25 double fDy1 = m_yHalfLength1;
26 double fDx1 = m_xHalfLength1;
27 double fDx2 = m_xHalfLength2;
28 double fDy2 = m_yHalfLength2;
29 return 4.0 * ((fDx1 + fDx2) * (fDy1 + fDy2) * (fDz * 0.5) +
30 (fDx2 - fDx1) * (fDy2 - fDy1) * (fDz * (1./6)));
33 const std::string & GeoTrd::type ()
const 38 ShapeType GeoTrd::typeID ()
const 45 action->handleTrd(
this);
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...