1 #ifndef STI_CYLINDRICAL_SHAPE_H
2 #define STI_CYLINDRICAL_SHAPE_H
20 :
StiShape(name,halfDepth_, thickness_),
21 _outerRadius(outerRadius_),
22 _openingAngle(openingAngle_) {}
24 float getOuterRadius()
const {
return _outerRadius; }
25 float getOpeningAngle()
const {
return _openingAngle; }
26 float getHalfWidth()
const;
27 StiShapeCode getShapeCode()
const {
return kCylindrical; };
28 virtual double getVolume()
const;
31 void setOuterRadius(
float val) {
if (val >= 0.) _outerRadius = val; }
32 void setOpeningAngle(
float val){_openingAngle = val;}
41 inline float StiCylindricalShape::getHalfWidth()
const
43 return _outerRadius*sin(_openingAngle/2.);
45 inline double StiCylindricalShape::getVolume()
const
47 double rmax = _outerRadius,rmin=rmax-getThickness();
48 return _openingAngle*(rmax-rmin)*(rmax+rmin)*getHalfDepth();