//-*- mode: c++ -*- // // $Id: BrPlane3D.h,v 1.2 2001/07/19 18:12:28 ekman Exp $ // #ifndef BRAT_BrPlane3D #define BRAT_BrPlane3D ////////////////////////////////////////////////////////////////////////////// // // // BrPlane3D // // // // 3D Plane. Part of the Geometry classes Points, Vector, Lines, Planes. // // // // Author: K. Hagel // // Created: December 1998 // // // // // ////////////////////////////////////////////////////////////////////////////// // // ROOT classes // #include #ifndef ROOT_TObject #include "TObject.h" #endif class BrVector3D; class BrLine3D; class BrPlane3D : public TObject { public: // constructors and destructors // BrPlane3D(const Double_t a=0, const Double_t b=0, const Double_t c=0 , const Double_t d=0) : fA(a), fB(b), fC(c), fD(d) {}; BrPlane3D(const BrVector3D &p1, const BrVector3D &p2, const BrVector3D &p3); BrPlane3D(const BrVector3D &point, const BrVector3D &); BrPlane3D(const Double_t x1, const Double_t y1, const Double_t z1, const Double_t x2, const Double_t y2, const Double_t z2, const Double_t x3, const Double_t y3, const Double_t z3 ); virtual ~BrPlane3D(){}; BrPlane3D(const BrPlane3D& plane) : fA(plane.fA), fB(plane.fB), fC(plane.fC), fD(plane.fD) {}; BrPlane3D& operator = (const BrPlane3D&); // // general field operators BrPlane3D& operator +=(const BrPlane3D&); BrPlane3D& operator -=(const BrPlane3D&); BrPlane3D operator - () const; BrPlane3D operator + () const; const Double_t& operator [] (size_t) const; Double_t& operator [] (size_t); const Double_t& operator () (size_t) const; Double_t& operator () (size_t); Bool_t operator == (const BrPlane3D&) const; Bool_t operator != (const BrPlane3D&) const; // access methods Double_t GetA() const {return fA;}; Double_t GetB() const {return fB;}; Double_t GetC() const {return fC;}; Double_t GetD() const {return fD;}; //Setter methods void SetA(Double_t value) { fA = value;}; void SetB(Double_t value) { fB = value;}; void SetC(Double_t value) { fC = value;}; void SetD(Double_t value) { fD = value;}; void Set(const BrVector3D &p1, const BrVector3D &p2, const BrVector3D &p3); BrVector3D UnitNormal(); BrVector3D GetIntersectionWithLine(const BrLine3D &line); Double_t GetMinimumDistanceFromPlane(const BrVector3D &point); private: //Coefficients for the planes Double_t fA; // 1. Plane Coefficient Double_t fB; // 2. Plane Coefficient Double_t fC; // 3. Plane Coefficient Double_t fD; // 4. Plane Coefficient friend BrPlane3D operator+(const BrPlane3D& v1, const BrPlane3D& v2); friend BrPlane3D operator-(const BrPlane3D& v1, const BrPlane3D& v2); friend BrPlane3D operator*(Double_t a, const BrPlane3D& v2); friend BrPlane3D operator*(const BrPlane3D& v1, Double_t a); friend BrPlane3D operator/(const BrPlane3D& v1, Double_t a); ClassDef(BrPlane3D,1) }; // // Related Global functions // ostream& operator<<(ostream& str, const BrPlane3D&); istream& operator>>(istream& str, BrPlane3D&); #endif // $Log: BrPlane3D.h,v $ // Revision 1.2 2001/07/19 18:12:28 ekman // Added method to set a,b,c,d after initialisation from 3 vectors. // // Revision 1.1.1.1 2001/06/21 14:55:20 hagel // Initial revision of brat2 // // Revision 1.8 2001/04/30 21:17:07 videbaek // Added method to create Plane3D from a point and a normal vector. // Considered removing the add, divide which have a marginal precise definition. // // // Revision 1.7 1999/03/07 00:00:44 hagel // // Revision 1.6 1999/01/21 23:23:24 hagel // 1. Changed convention for checking includes. Current convention is: // BRAT_Br...... eg BRAT_BrModule ala ROOT. // 2. Added CVS logs to .h files that didn't have them. // 3. Moved checking of include definition to first line for easier reading // 4. Put checks before all includes in the include files as per BRAT specifications // 5. Added BrGeantHeader to Geant Makefile // 6. All changes have been checked to compile on NT ala Cygnus // // Revision 1.5 1998/12/18 19:37:14 hagel // Implement UnitNormal // // Revision 1.4 1998/12/18 17:21:55 hagel // Implement minimum distance from point to plane plus add comments // // Revision 1.3 1998/12/17 21:16:12 hagel // Add CVS comments //