00001 #ifndef STI_CYLINDRICAL_SHAPE_H
00002 #define STI_CYLINDRICAL_SHAPE_H
00003
00004 #include "StiShape.h"
00005
00010 class StiCylindricalShape: public StiShape{
00011 public:
00012
00013
00014 StiCylindricalShape(): StiShape(), _outerRadius(0.), _openingAngle(0.){}
00015 StiCylindricalShape(const string &name,
00016 float halfDepth_,
00017 float thickness_,
00018 float outerRadius_,
00019 float openingAngle_)
00020 : StiShape(name,halfDepth_, thickness_),
00021 _outerRadius(outerRadius_),
00022 _openingAngle(openingAngle_) {}
00023
00024 float getOuterRadius() const { return _outerRadius; }
00025 float getOpeningAngle() const { return _openingAngle; }
00026 float getHalfWidth() const;
00027 StiShapeCode getShapeCode() const { return kCylindrical; };
00028
00029
00030 void setOuterRadius(float val) {if (val >= 0.) _outerRadius = val; }
00031 void setOpeningAngle(float val){_openingAngle = val;}
00032
00033 protected:
00034
00035 float _outerRadius;
00036 float _openingAngle;
00037
00038 };
00039
00040 inline float StiCylindricalShape::getHalfWidth() const
00041 {
00042 return _outerRadius*sin(_openingAngle/2.);
00043 }
00044 #endif