Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:59:21

0001 //
0002 // ********************************************************************
0003 // * License and Disclaimer                                           *
0004 // *                                                                  *
0005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
0006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
0007 // * conditions of the Geant4 Software License,  included in the file *
0008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
0009 // * include a list of copyright holders.                             *
0010 // *                                                                  *
0011 // * Neither the authors of this software system, nor their employing *
0012 // * institutes,nor the agencies providing financial support for this *
0013 // * work  make  any representation or  warranty, express or implied, *
0014 // * regarding  this  software system or assume any liability for its *
0015 // * use.  Please see the license in the file  LICENSE  and URL above *
0016 // * for the full disclaimer and the limitation of liability.         *
0017 // *                                                                  *
0018 // * This  code  implementation is the result of  the  scientific and *
0019 // * technical work of the GEANT4 collaboration and of QinetiQ Ltd,   *
0020 // * subject to DEFCON 705 IPR conditions.                            *
0021 // * By using,  copying,  modifying or  distributing the software (or *
0022 // * any work based  on the software)  you  agree  to acknowledge its *
0023 // * use  in  resulting  scientific  publications,  and indicate your *
0024 // * acceptance of all terms of the Geant4 Software license.          *
0025 // ********************************************************************
0026 //
0027 // G4VFacet
0028 //
0029 // Class description:
0030 //
0031 //   Base class defining the facets which are components of a
0032 //   G4TessellatedSolid shape.
0033 
0034 // 31 October 2004, P R Truscott, QinetiQ Ltd, UK - Created.
0035 // 12 October 2012, M Gayer, CERN, - Reviewed optimised implementation.
0036 // --------------------------------------------------------------------
0037 #ifndef G4VFACET_HH
0038 #define G4VFACET_HH
0039 
0040 #include <iostream>
0041 #include <vector>
0042 
0043 #include "globals.hh"
0044 #include "windefs.hh"
0045 #include "G4ThreeVector.hh"
0046 #include "G4VSolid.hh"
0047 
0048 enum G4FacetVertexType { ABSOLUTE, RELATIVE };
0049 
0050 class G4VFacet
0051 {
0052   public:
0053 
0054     G4VFacet();
0055     virtual ~G4VFacet ();
0056 
0057     G4bool operator== (const G4VFacet& right) const;
0058 
0059     virtual G4int GetNumberOfVertices () const = 0;
0060     virtual G4ThreeVector GetVertex (G4int i) const = 0;
0061     virtual void SetVertex (G4int i, const G4ThreeVector& val) = 0;
0062     virtual G4GeometryType GetEntityType () const = 0;
0063     virtual G4ThreeVector GetSurfaceNormal () const = 0;
0064     virtual G4bool IsDefined () const = 0;
0065     virtual G4ThreeVector GetCircumcentre () const = 0;
0066     virtual G4double GetRadius () const = 0;
0067     virtual G4VFacet* GetClone () = 0;
0068     virtual G4double Distance (const G4ThreeVector&, G4double) = 0;
0069     virtual G4double Distance (const G4ThreeVector&, G4double,
0070                                const G4bool) = 0;
0071     virtual G4double Extent (const G4ThreeVector) = 0;
0072     virtual G4bool Intersect (const G4ThreeVector&, const G4ThreeVector&,
0073                               const G4bool, G4double&, G4double&,
0074                                     G4ThreeVector&) = 0;
0075     virtual G4double GetArea() const = 0;
0076     virtual G4ThreeVector GetPointOnFace() const = 0;
0077 
0078     void ApplyTranslation (const G4ThreeVector& v);
0079 
0080     std::ostream& StreamInfo(std::ostream& os) const;
0081 
0082     G4bool IsInside(const G4ThreeVector& p) const;
0083 
0084     virtual G4int AllocatedMemory() = 0;
0085     virtual void SetVertexIndex (G4int i, G4int j) = 0;
0086     virtual G4int GetVertexIndex (G4int i) const = 0;
0087 
0088     virtual void SetVertices(std::vector<G4ThreeVector>* vertices) = 0;
0089 
0090   protected:
0091 
0092     static const G4double dirTolerance;
0093     G4double kCarTolerance;
0094 };
0095 
0096 #endif