BABAR C++ Course Running the Examples - HEPHY
BABAR C++ Course Running the Examples - HEPHY
BABAR C++ Course Running the Examples - HEPHY
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Circle classRectangle classPart of headerclass Circle: public Plane{public:Circle() : Plane() { radius = 1.0; }Circle( const ThreeVec& o,const ThreeVec& n, double r );virtual ~Circle() {}Circle( const Circle& c );virtual int withinBoundary( const ThreeVec& x )const;// more not shownprotected:double radius;};• has data member to describe boundary• also has member function to give <strong>the</strong> answerPart of <strong>the</strong> headerclass Rectangle: public Plane{public:Rectangle();Rectangle( const ThreeVec& o, const ThreeVec& n,double l, double w, const ThreeVec& la);virtual ~Rectangle() {}Rectangle( const Rectangle& r );virtual int withinBoundary( const ThreeVec& x ) constprotected:double length, width;ThreeVec length_axis;};• data members to describe boundary• member function to test for boundary• data member to describe direction<strong>BABAR</strong> <strong>C++</strong> <strong>Course</strong> 176 Paul F. Kunz<strong>BABAR</strong> <strong>C++</strong> <strong>Course</strong> 177 Paul F. Kunz