[807] | 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 | // File name: RadmonLayoutEntityWithAttributes.hh |
---|
| 28 | // Creation date: Sep 2005 |
---|
| 29 | // Main author: Riccardo Capra <capra@ge.infn.it> |
---|
| 30 | // |
---|
| 31 | // Id: $Id: RadmonLayoutEntityWithAttributes.hh,v 1.3.2.2 2006/06/29 16:14:19 gunter Exp $ |
---|
| 32 | // Tag: $Name: geant4-09-01-patch-02 $ |
---|
| 33 | // |
---|
| 34 | // Description: Provides attributes to other detector classes |
---|
| 35 | // |
---|
| 36 | |
---|
| 37 | #ifndef RADMONLAYOUTENTITYWITHATTRIBUTES_HH |
---|
| 38 | #define RADMONLAYOUTENTITYWITHATTRIBUTES_HH |
---|
| 39 | |
---|
| 40 | // Include files |
---|
| 41 | #include "G4String.hh" |
---|
| 42 | #include "globals.hh" |
---|
| 43 | #include "G4ThreeVector.hh" |
---|
| 44 | #include "G4RotationMatrix.hh" |
---|
| 45 | |
---|
| 46 | #include <vector> |
---|
| 47 | #include <utility> |
---|
| 48 | |
---|
| 49 | class RadmonLayoutEntityWithAttributes |
---|
| 50 | { |
---|
| 51 | public: |
---|
| 52 | G4int GetNAttributes(void) const; |
---|
| 53 | const G4String & GetAttributeName(G4int index) const; |
---|
| 54 | |
---|
| 55 | G4String GetAttribute(const G4String & attributeName, const G4String & defaultValue = G4String("")) const; |
---|
| 56 | G4bool ExistsAttribute(const G4String & attributeName) const; |
---|
| 57 | void SetAttribute(const G4String & attributeName, const G4String & value); |
---|
| 58 | void ClearAttribute(const G4String & attributeName); |
---|
| 59 | void ClearAllAttributes(void); |
---|
| 60 | |
---|
| 61 | G4double GetAttributeAsDouble(const G4String & attributeName, double defaultValue) const; |
---|
| 62 | G4double GetAttributeAsMeasure(const G4String & attributeName, const char * category, double defaultValue) const; |
---|
| 63 | G4int GetAttributeAsInteger(const G4String & attributeName, G4int defaultValue) const; |
---|
| 64 | G4ThreeVector GetAttributeAsThreeVector(const G4String & attributeName, const G4ThreeVector & defaultValue) const; |
---|
| 65 | G4ThreeVector GetAttributeAsThreeVectorWithMeasure(const G4String & attributeName, const char * category, const G4ThreeVector & defaultValue) const; |
---|
| 66 | G4ThreeVector GetAttributeAsDirection(const G4String & attributeName, const G4ThreeVector & defaultValue) const; |
---|
| 67 | G4RotationMatrix GetAttributeAsRotationMatrix(const G4String & attributeName, const G4RotationMatrix & defaultValue) const; |
---|
| 68 | |
---|
| 69 | protected: |
---|
| 70 | inline RadmonLayoutEntityWithAttributes(); |
---|
| 71 | inline RadmonLayoutEntityWithAttributes(const RadmonLayoutEntityWithAttributes & copy); |
---|
| 72 | inline ~RadmonLayoutEntityWithAttributes(); |
---|
| 73 | |
---|
| 74 | void DumpAttributesLayout(std::ostream & out, const G4String & indent=G4String()) const; |
---|
| 75 | |
---|
| 76 | inline RadmonLayoutEntityWithAttributes & operator=(const RadmonLayoutEntityWithAttributes & copy); |
---|
| 77 | |
---|
| 78 | private: |
---|
| 79 | // Private methods |
---|
| 80 | void CopyFrom(const RadmonLayoutEntityWithAttributes & copy); |
---|
| 81 | |
---|
| 82 | // Private attributes |
---|
| 83 | typedef std::pair<G4String, G4String> AttributeItem; |
---|
| 84 | typedef std::vector<AttributeItem> AttributesVector; |
---|
| 85 | AttributesVector attributesVector; |
---|
| 86 | }; |
---|
| 87 | |
---|
| 88 | // Inline implementations |
---|
| 89 | #include "RadmonLayoutEntityWithAttributes.icc" |
---|
| 90 | #endif /* RADMONLAYOUTENTITYWITHATTRIBUTES_HH */ |
---|