G4VFacet.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration and of QinetiQ Ltd,   *
00020 // * subject to DEFCON 705 IPR conditions.                            *
00021 // * By using,  copying,  modifying or  distributing the software (or *
00022 // * any work based  on the software)  you  agree  to acknowledge its *
00023 // * use  in  resulting  scientific  publications,  and indicate your *
00024 // * acceptance of all terms of the Geant4 Software license.          *
00025 // ********************************************************************
00026 //
00027 // $Id: G4VFacet.hh 67011 2013-01-29 16:17:41Z gcosmo $
00028 //
00029 // %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
00030 //
00031 // Class G4VFacet
00032 //
00033 // Class description:
00034 //
00035 //   Base class defining the facets which are components of a
00036 //   G4TessellatedSolid shape.
00037 
00038 // CHANGE HISTORY
00039 // --------------
00040 //
00041 // 31 October 2004, P R Truscott, QinetiQ Ltd, UK - Created.
00042 // 12 October 2012, M Gayer, CERN, - Reviewed optimized implementation.
00043 //
00045 
00046 #ifndef G4VFacet_hh
00047 #define G4VFacet_hh
00048 
00049 #include <iostream>
00050 #include <vector>
00051 
00052 #include "globals.hh"
00053 #include "G4ThreeVector.hh"
00054 #include "G4VSolid.hh"
00055 
00056 enum G4FacetVertexType {ABSOLUTE, RELATIVE};
00057 
00058 class G4TessellatedSolid;
00059 
00060 class G4VFacet
00061 {
00062   public:
00063 
00064     virtual ~G4VFacet ();
00065 
00066     G4bool operator== (const G4VFacet &right) const;
00067 
00068     virtual G4int GetNumberOfVertices () const = 0;
00069     virtual G4ThreeVector GetVertex (G4int i) const = 0;
00070     virtual void SetVertex (G4int i, const G4ThreeVector &val) = 0;
00071     virtual G4GeometryType GetEntityType () const = 0;
00072     virtual G4ThreeVector GetSurfaceNormal () const = 0;
00073     virtual G4bool IsDefined () const = 0;
00074     virtual G4ThreeVector GetCircumcentre () const = 0;
00075     virtual G4double GetRadius () const = 0;
00076     virtual G4VFacet *GetClone () = 0;
00077     virtual G4double Distance (const G4ThreeVector&, G4double) = 0;
00078     virtual G4double Distance (const G4ThreeVector&, G4double,
00079                                const G4bool) = 0;
00080     virtual G4double Extent (const G4ThreeVector) = 0;
00081     virtual G4bool Intersect (const G4ThreeVector&, const G4ThreeVector &,
00082                               const G4bool , G4double &, G4double &,
00083                                     G4ThreeVector &) = 0;
00084     virtual G4double GetArea() = 0;
00085     virtual G4ThreeVector GetPointOnFace() const = 0;
00086 
00087     void ApplyTranslation (const G4ThreeVector v);
00088 
00089     std::ostream &StreamInfo(std::ostream &os) const;
00090 
00091     G4bool IsInside(const G4ThreeVector &p) const;
00092 
00093     virtual G4int AllocatedMemory() = 0;
00094     virtual void SetVertexIndex (G4int i, G4int j) = 0;
00095     virtual G4int GetVertexIndex (G4int i) const = 0;
00096 
00097     virtual void SetVertices(std::vector<G4ThreeVector> *vertices) = 0;
00098 
00099   protected:
00100 
00101     static const G4double dirTolerance;
00102     static const G4double kCarTolerance;
00103 };
00104 
00105 #endif

Generated on Mon May 27 17:50:12 2013 for Geant4 by  doxygen 1.4.7