Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/Geant4/G4UGenericTrap.hh was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

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.                      *
0020 // * By using,  copying,  modifying or  distributing the software (or *
0021 // * any work based  on the software)  you  agree  to acknowledge its *
0022 // * use  in  resulting  scientific  publications,  and indicate your *
0023 // * acceptance of all terms of the Geant4 Software license.          *
0024 // ********************************************************************
0025 //
0026 // G4UGenericTrap
0027 //
0028 // Class description:
0029 //
0030 // Wrapper class for G4GenericTrap to make use of VecGeom GenericTrap.
0031 
0032 // 30.10.13 G.Cosmo, CERN
0033 // --------------------------------------------------------------------
0034 #ifndef G4UGENERICTRAP_HH
0035 #define G4UGENERICTRAP_HH
0036 
0037 #include "G4UAdapter.hh"
0038 
0039 #if ( defined(G4GEOM_USE_USOLIDS) || defined(G4GEOM_USE_PARTIAL_USOLIDS) )
0040 
0041 #include <VecGeom/volumes/UnplacedGenTrap.h>
0042 #include "G4TwoVector.hh"
0043 
0044 #include "G4Polyhedron.hh"
0045 
0046 class G4UGenericTrap : public G4UAdapter<vecgeom::UnplacedGenTrap> 
0047 {
0048   using Shape_t = vecgeom::UnplacedGenTrap;
0049   using Base_t  = G4UAdapter<vecgeom::UnplacedGenTrap>;
0050 
0051   public:
0052 
0053     G4UGenericTrap(const G4String& name, G4double halfZ,
0054                    const std::vector<G4TwoVector>& vertices);
0055 
0056    ~G4UGenericTrap() override;
0057 
0058     G4double    GetZHalfLength() const;
0059     G4int       GetNofVertices() const;
0060     G4TwoVector GetVertex(G4int index) const;
0061     const std::vector<G4TwoVector>& GetVertices() const;
0062     G4double    GetTwistAngle(G4int index) const;
0063     G4bool      IsTwisted() const;
0064     G4int       GetVisSubdivisions() const;
0065     void        SetVisSubdivisions(G4int subdiv);
0066     void        SetZHalfLength(G4double);
0067     void Initialise(const std::vector<G4TwoVector>& v);
0068 
0069     inline G4GeometryType GetEntityType() const override;
0070 
0071     G4UGenericTrap(__void__&);
0072       // Fake default constructor for usage restricted to direct object
0073       // persistency for clients requiring preallocation of memory for
0074       // persistifiable objects.
0075 
0076     G4UGenericTrap( const G4UGenericTrap& source );
0077     G4UGenericTrap& operator=(const G4UGenericTrap& source);
0078       // Copy constructor and assignment operator.
0079 
0080     void BoundingLimits(G4ThreeVector& pMin, G4ThreeVector& pMax) const override;
0081 
0082     G4bool CalculateExtent(const EAxis pAxis,
0083                            const G4VoxelLimits& pVoxelLimit,
0084                            const G4AffineTransform& pTransform,
0085                                  G4double& pMin, G4double& pMax) const override;
0086 
0087     G4Polyhedron* CreatePolyhedron() const override;
0088 
0089   private:
0090 
0091     G4int fVisSubdivisions;
0092     std::vector<G4TwoVector> fVertices;
0093 
0094 };
0095 
0096 // --------------------------------------------------------------------
0097 // Inline methods
0098 // --------------------------------------------------------------------
0099 
0100 inline G4GeometryType G4UGenericTrap::GetEntityType() const
0101 {
0102   return "G4GenericTrap";
0103 }
0104 
0105 #endif  // G4GEOM_USE_USOLIDS
0106 
0107 #endif