[827] | 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. * |
---|
| 20 | // * By using, copying, modifying or distributing the software (or * |
---|
| 21 | // * any work based on the software) you agree to acknowledge its * |
---|
| 22 | // * use in resulting scientific publications, and indicate your * |
---|
| 23 | // * acceptance of all terms of the Geant4 Software license. * |
---|
| 24 | // ******************************************************************** |
---|
| 25 | // |
---|
| 26 | // |
---|
| 27 | // $Id: G4SmoothTrajectoryPoint.hh,v 1.13 2006/06/29 21:15:29 gunter Exp $ |
---|
[1011] | 28 | // GEANT4 tag $Name: geant4-09-02-ref-02 $ |
---|
[827] | 29 | // |
---|
| 30 | //--------------------------------------------------------------- |
---|
| 31 | // |
---|
| 32 | // G4SmoothTrajectoryPoint.hh |
---|
| 33 | // |
---|
| 34 | // class description: |
---|
| 35 | // This class contains position and auxiliary points of a trajectory point. |
---|
| 36 | // |
---|
| 37 | // --------------------------------------------------------------- |
---|
| 38 | |
---|
| 39 | #ifndef G4SmoothTrajectoryPoint_h |
---|
| 40 | #define G4SmoothTrajectoryPoint_h 1 |
---|
| 41 | |
---|
| 42 | #include "G4VTrajectoryPoint.hh" |
---|
| 43 | #include "globals.hh" // Include from 'global' |
---|
| 44 | #include "G4ThreeVector.hh" // Include from 'geometry' |
---|
| 45 | #include "G4Allocator.hh" // Include from 'particle+matter' |
---|
| 46 | |
---|
| 47 | |
---|
| 48 | class G4SmoothTrajectoryPoint : public G4VTrajectoryPoint |
---|
| 49 | { |
---|
| 50 | |
---|
| 51 | //-------- |
---|
| 52 | public: // without description |
---|
| 53 | //-------- |
---|
| 54 | |
---|
| 55 | // Constructor/Destructor |
---|
| 56 | G4SmoothTrajectoryPoint(); |
---|
| 57 | // No auxiliary points setter, so must set the points in the |
---|
| 58 | // constructor already (jacek 31/10/2002) |
---|
| 59 | G4SmoothTrajectoryPoint(G4ThreeVector pos, |
---|
| 60 | std::vector<G4ThreeVector>* auxiliaryPoints); |
---|
| 61 | G4SmoothTrajectoryPoint(G4ThreeVector pos); |
---|
| 62 | G4SmoothTrajectoryPoint(const G4SmoothTrajectoryPoint &right); |
---|
| 63 | virtual ~G4SmoothTrajectoryPoint(); |
---|
| 64 | |
---|
| 65 | // Operators |
---|
| 66 | inline void *operator new(size_t); |
---|
| 67 | inline void operator delete(void *aTrajectoryPoint); |
---|
| 68 | inline int operator==(const G4SmoothTrajectoryPoint& right) const |
---|
| 69 | { return (this==&right); }; |
---|
| 70 | |
---|
| 71 | // Get/Set functions |
---|
| 72 | inline const G4ThreeVector GetPosition() const |
---|
| 73 | { return fPosition; } |
---|
| 74 | inline const std::vector<G4ThreeVector>* GetAuxiliaryPoints() const |
---|
| 75 | { return fAuxiliaryPointVector; } |
---|
| 76 | |
---|
| 77 | // Get method for HEPRep style attributes |
---|
| 78 | virtual const std::map<G4String,G4AttDef>* GetAttDefs() const; |
---|
| 79 | virtual std::vector<G4AttValue>* CreateAttValues() const; |
---|
| 80 | |
---|
| 81 | //--------- |
---|
| 82 | private: |
---|
| 83 | //--------- |
---|
| 84 | |
---|
| 85 | // Member data |
---|
| 86 | G4ThreeVector fPosition; |
---|
| 87 | std::vector<G4ThreeVector>* fAuxiliaryPointVector; |
---|
| 88 | }; |
---|
| 89 | |
---|
| 90 | #if defined G4TRACKING_ALLOC_EXPORT |
---|
| 91 | extern G4DLLEXPORT G4Allocator<G4SmoothTrajectoryPoint> aSmoothTrajectoryPointAllocator; |
---|
| 92 | #else |
---|
| 93 | extern G4DLLIMPORT G4Allocator<G4SmoothTrajectoryPoint> aSmoothTrajectoryPointAllocator; |
---|
| 94 | #endif |
---|
| 95 | |
---|
| 96 | inline void* G4SmoothTrajectoryPoint::operator new(size_t) |
---|
| 97 | { |
---|
| 98 | void *aTrajectoryPoint; |
---|
| 99 | aTrajectoryPoint = (void *) aSmoothTrajectoryPointAllocator.MallocSingle(); |
---|
| 100 | return aTrajectoryPoint; |
---|
| 101 | } |
---|
| 102 | |
---|
| 103 | inline void G4SmoothTrajectoryPoint::operator delete(void *aTrajectoryPoint) |
---|
| 104 | { |
---|
| 105 | aSmoothTrajectoryPointAllocator.FreeSingle((G4SmoothTrajectoryPoint *) aTrajectoryPoint); |
---|
| 106 | } |
---|
| 107 | |
---|
| 108 | #endif |
---|
| 109 | |
---|