[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: G4VFacet.hh,v 1.7 2008/12/18 12:57:30 gunter Exp $ |
---|
[1228] | 28 | // GEANT4 tag $Name: geant4-09-03 $ |
---|
[831] | 29 | // |
---|
| 30 | // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
---|
| 31 | // |
---|
| 32 | // MODULE: G4VFacet.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 | // Base class defining the facets which are components of a |
---|
| 52 | // G4TessellatedSolid shape. |
---|
| 53 | // |
---|
| 54 | |
---|
| 55 | /////////////////////////////////////////////////////////////////////////////// |
---|
| 56 | #ifndef G4VFacet_hh |
---|
| 57 | #define G4VFacet_hh 1 |
---|
| 58 | |
---|
| 59 | #include "G4VSolid.hh" |
---|
| 60 | #include "G4ThreeVector.hh" |
---|
| 61 | #include "globals.hh" |
---|
| 62 | |
---|
| 63 | #include <iostream> |
---|
| 64 | #include <vector> |
---|
| 65 | |
---|
| 66 | enum G4FacetVertexType {ABSOLUTE, RELATIVE}; |
---|
| 67 | |
---|
| 68 | class G4VFacet |
---|
| 69 | { |
---|
| 70 | public: // with description |
---|
| 71 | |
---|
| 72 | G4VFacet (); |
---|
| 73 | virtual ~G4VFacet (); |
---|
| 74 | |
---|
| 75 | G4bool operator== (const G4VFacet &right) const; |
---|
| 76 | |
---|
| 77 | inline size_t GetNumberOfVertices () const; |
---|
| 78 | inline G4ThreeVector GetVertex (size_t i) const; |
---|
| 79 | |
---|
| 80 | inline G4GeometryType GetEntityType () const; |
---|
| 81 | inline G4ThreeVector GetSurfaceNormal () const; |
---|
| 82 | inline G4bool IsInside(const G4ThreeVector &p) const; |
---|
| 83 | inline G4bool IsDefined () const; |
---|
| 84 | inline void SetVertexIndex (const size_t i, const size_t j); |
---|
| 85 | inline size_t GetVertexIndex (const size_t i) const; |
---|
| 86 | inline G4ThreeVector GetCircumcentre () const; |
---|
| 87 | inline G4double GetRadius () const; |
---|
| 88 | inline G4double GetRadiusSquared() const; |
---|
| 89 | |
---|
| 90 | void ApplyTranslation (const G4ThreeVector v); |
---|
| 91 | |
---|
| 92 | std::ostream &StreamInfo(std::ostream &os) const; |
---|
| 93 | |
---|
| 94 | virtual G4VFacet *GetClone (); |
---|
| 95 | virtual G4double Distance (const G4ThreeVector&, const G4double); |
---|
| 96 | virtual G4double Distance (const G4ThreeVector&, const G4double, |
---|
| 97 | const G4bool); |
---|
| 98 | virtual G4double Extent (const G4ThreeVector); |
---|
| 99 | virtual G4bool Intersect (const G4ThreeVector&, const G4ThreeVector &, |
---|
| 100 | const G4bool , G4double &, G4double &, |
---|
| 101 | G4ThreeVector &); |
---|
| 102 | virtual G4double GetArea() = 0; |
---|
| 103 | virtual G4ThreeVector GetPointOnFace() const = 0; |
---|
| 104 | |
---|
| 105 | protected: |
---|
| 106 | |
---|
| 107 | G4GeometryType geometryType; |
---|
| 108 | G4bool isDefined; |
---|
| 109 | size_t nVertices; |
---|
| 110 | G4ThreeVector P0; |
---|
| 111 | G4ThreeVectorList P; |
---|
| 112 | G4ThreeVectorList E; |
---|
| 113 | std::vector<size_t> I; |
---|
| 114 | G4ThreeVector surfaceNormal; |
---|
| 115 | G4ThreeVector circumcentre; |
---|
| 116 | G4double radius; |
---|
| 117 | G4double radiusSqr; |
---|
| 118 | |
---|
| 119 | G4double dirTolerance; |
---|
| 120 | G4double kCarTolerance; |
---|
| 121 | G4double area; |
---|
| 122 | |
---|
| 123 | private: |
---|
| 124 | |
---|
| 125 | G4VFacet (const G4VFacet &right); |
---|
| 126 | const G4VFacet &operator=(G4VFacet &right); |
---|
| 127 | }; |
---|
| 128 | |
---|
| 129 | typedef std::vector<G4VFacet*>::iterator FacetI; |
---|
| 130 | typedef std::vector<G4VFacet*>::const_iterator FacetCI; |
---|
| 131 | |
---|
| 132 | #include "G4VFacet.icc" |
---|
| 133 | |
---|
| 134 | #endif |
---|