[831] | 1 | // |
---|
| 2 | // ******************************************************************** |
---|
| 3 | // * License and Disclaimer * |
---|
| 4 | // * * |
---|
| 5 | // * The Geant4 software is copyright of the Copyright Holders of * |
---|
| 6 | // * the Geant4 Collaboration. It is provided under the terms and * |
---|
| 7 | // * conditions of the Geant4 Software License, included in the file * |
---|
| 8 | // * LICENSE and available at http://cern.ch/geant4/license . These * |
---|
| 9 | // * include a list of copyright holders. * |
---|
| 10 | // * * |
---|
| 11 | // * Neither the authors of this software system, nor their employing * |
---|
| 12 | // * institutes,nor the agencies providing financial support for this * |
---|
| 13 | // * work make any representation or warranty, express or implied, * |
---|
| 14 | // * regarding this software system or assume any liability for its * |
---|
| 15 | // * use. Please see the license in the file LICENSE and URL above * |
---|
| 16 | // * for the full disclaimer and the limitation of liability. * |
---|
| 17 | // * * |
---|
| 18 | // * This code implementation is the result of the scientific and * |
---|
| 19 | // * technical work of the GEANT4 collaboration and of QinetiQ Ltd, * |
---|
[1058] | 20 | // * subject to DEFCON 705 IPR conditions. * |
---|
[831] | 21 | // * By using, copying, modifying or distributing the software (or * |
---|
| 22 | // * any work based on the software) you agree to acknowledge its * |
---|
| 23 | // * use in resulting scientific publications, and indicate your * |
---|
| 24 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 25 | // ******************************************************************** |
---|
| 26 | // |
---|
[1058] | 27 | // $Id: G4QuadrangularFacet.hh,v 1.6 2008/12/18 12:57:24 gunter Exp $ |
---|
| 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
[831] | 29 | // |
---|
| 30 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 31 | // |
---|
| 32 | // MODULE: G4QuadrangularFacet.hh |
---|
| 33 | // |
---|
| 34 | // Date: 15/06/2005 |
---|
| 35 | // Author: P R Truscott |
---|
| 36 | // Organisation: QinetiQ Ltd, UK |
---|
| 37 | // Customer: UK Ministry of Defence : RAO CRP TD Electronic Systems |
---|
| 38 | // Contract: C/MAT/N03517 |
---|
| 39 | // |
---|
| 40 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 41 | // |
---|
| 42 | // CHANGE HISTORY |
---|
| 43 | // -------------- |
---|
| 44 | // |
---|
| 45 | // 31 October 2004, P R Truscott, QinetiQ Ltd, UK - Created. |
---|
| 46 | // |
---|
| 47 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 48 | // |
---|
| 49 | // Class description: |
---|
| 50 | // |
---|
| 51 | // The G4QuadrangularFacet class is used for the contruction of |
---|
| 52 | // G4TessellatedSolid. |
---|
| 53 | // It is defined by four vertices, which shall be in the same plane and be |
---|
| 54 | // supplied in anti-clockwise order looking from the outsider of the solid |
---|
| 55 | // where it belongs. Its constructor |
---|
| 56 | // |
---|
| 57 | // G4QuadrangularFacet (const G4ThreeVector Pt0, const G4ThreeVector vt1, |
---|
| 58 | // const G4ThreeVector vt2, const G4ThreeVector vt3, |
---|
| 59 | // G4FacetVertexType); |
---|
| 60 | // |
---|
| 61 | // takes 5 parameters to define the four vertices: |
---|
| 62 | // 1) G4FacetvertexType = "ABSOLUTE": in this case Pt0, vt1, vt2 and vt3 |
---|
| 63 | // are the four vertices required in anti-clockwise order when looking |
---|
| 64 | // from the outsider. |
---|
| 65 | // 2) G4FacetvertexType = "RELATIVE": in this case the first vertex is Pt0, |
---|
| 66 | // the second vertex is Pt0+vt, the third vertex is Pt0+vt2 and |
---|
| 67 | // the fourth vertex is Pt0+vt3, in anti-clockwise order when looking |
---|
| 68 | // from the outsider. |
---|
| 69 | |
---|
| 70 | /////////////////////////////////////////////////////////////////////////////// |
---|
| 71 | #ifndef G4QuadranglarFacet_HH |
---|
| 72 | #define G4QuadranglarFacet_HH 1 |
---|
| 73 | |
---|
| 74 | #include "G4VFacet.hh" |
---|
| 75 | #include "G4TriangularFacet.hh" |
---|
| 76 | #include "G4ThreeVector.hh" |
---|
| 77 | #include "globals.hh" |
---|
| 78 | |
---|
| 79 | class G4QuadrangularFacet : public G4VFacet |
---|
| 80 | { |
---|
| 81 | public: // with description |
---|
| 82 | |
---|
| 83 | G4QuadrangularFacet (const G4ThreeVector Pt0, const G4ThreeVector vt1, |
---|
| 84 | const G4ThreeVector vt2, const G4ThreeVector vt3, |
---|
| 85 | G4FacetVertexType); |
---|
| 86 | virtual ~G4QuadrangularFacet (); |
---|
| 87 | |
---|
| 88 | G4QuadrangularFacet (const G4QuadrangularFacet &right); |
---|
| 89 | const G4QuadrangularFacet &operator=(G4QuadrangularFacet &right); |
---|
| 90 | |
---|
| 91 | G4VFacet *GetClone (); |
---|
| 92 | |
---|
| 93 | G4ThreeVector Distance (const G4ThreeVector &p); |
---|
| 94 | G4double Distance (const G4ThreeVector &p, const G4double minDist); |
---|
| 95 | G4double Distance (const G4ThreeVector &p, const G4double minDist, |
---|
| 96 | const G4bool outgoing); |
---|
| 97 | G4double Extent (const G4ThreeVector axis); |
---|
| 98 | G4bool Intersect (const G4ThreeVector &p, const G4ThreeVector &v, |
---|
| 99 | const G4bool outgoing, G4double &distance, |
---|
| 100 | G4double &distFromSurface, G4ThreeVector &normal); |
---|
| 101 | |
---|
| 102 | G4double GetArea (); |
---|
| 103 | G4ThreeVector GetPointOnFace () const; |
---|
| 104 | |
---|
| 105 | private: |
---|
| 106 | |
---|
| 107 | G4TriangularFacet *facet1; |
---|
| 108 | G4TriangularFacet *facet2; |
---|
| 109 | }; |
---|
| 110 | |
---|
| 111 | #endif |
---|