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: G4AttDef.hh,v 1.7 2006/10/17 16:14:08 allison Exp $ |
---|
28 | // GEANT4 tag $Name: HEAD $ |
---|
29 | |
---|
30 | #ifndef G4ATTDEF_HH |
---|
31 | #define G4ATTDEF_HH |
---|
32 | |
---|
33 | #include "globals.hh" |
---|
34 | #include "G4TypeKey.hh" |
---|
35 | #include <map> |
---|
36 | |
---|
37 | // Class Description: |
---|
38 | // |
---|
39 | // @class G4AttDef |
---|
40 | // |
---|
41 | // @brief This class represents a HepRep-style Attribute Definition. |
---|
42 | // The G4AttDef is used to define new kinds of attributes that can |
---|
43 | // then have values set for a Trajectory, Trajectory Point or Sensitive |
---|
44 | // Detector Hit. These attributes are then made available to the end user |
---|
45 | // in an interactive visualization system (such as WIRED). |
---|
46 | // Values are set by creating G4AttValue objects and attaching them to the |
---|
47 | // relevant Trajectory, Trajectory Point or Sensitive Detector Hit. |
---|
48 | // The association between the G4AttValue and the G4AttDef object is |
---|
49 | // made through the data member "name". |
---|
50 | // For details, see the HepRep home page at http://heprep.freehep.org |
---|
51 | // |
---|
52 | // @author M.Frailis |
---|
53 | // @author R.Giannitrapani |
---|
54 | // @author J.Perl |
---|
55 | // Class Description - End: |
---|
56 | |
---|
57 | |
---|
58 | class G4AttDef{ |
---|
59 | |
---|
60 | public: |
---|
61 | G4AttDef(const G4String& name, |
---|
62 | const G4String& desc, |
---|
63 | const G4String& category, |
---|
64 | const G4String& extra, |
---|
65 | const G4String& valueType): |
---|
66 | m_name(name),m_desc(desc), |
---|
67 | m_category(category), |
---|
68 | m_extra(extra),m_valueType(valueType){}; |
---|
69 | |
---|
70 | // G4Typekey based constructor |
---|
71 | G4AttDef(const G4String& name, |
---|
72 | const G4String& desc, |
---|
73 | const G4String& category, |
---|
74 | const G4String& extra, |
---|
75 | const G4TypeKey& typeKey): |
---|
76 | m_name(name),m_desc(desc), |
---|
77 | m_category(category), |
---|
78 | m_extra(extra),m_valueType("Null"), |
---|
79 | m_typeKey(typeKey) |
---|
80 | {}; |
---|
81 | |
---|
82 | G4AttDef(){}; |
---|
83 | virtual ~G4AttDef(){}; |
---|
84 | |
---|
85 | const G4String& GetName()const{return m_name;}; |
---|
86 | const G4String& GetDesc()const{return m_desc;}; |
---|
87 | const G4String& GetCategory()const{return m_category;}; |
---|
88 | const G4String& GetExtra()const{return m_extra;}; |
---|
89 | const G4String& GetValueType()const{return m_valueType;}; |
---|
90 | const G4TypeKey& GetTypeKey()const{return m_typeKey;}; |
---|
91 | |
---|
92 | void SetName(const G4String& name){m_name = name;}; |
---|
93 | void SetDesc(const G4String& desc){m_desc = desc;}; |
---|
94 | void SetCategory(const G4String& cat){m_category = cat;}; |
---|
95 | void SetExtra(const G4String& extra){m_extra = extra;}; |
---|
96 | void SetValueType(const G4String& type){m_valueType = type;}; |
---|
97 | |
---|
98 | private: |
---|
99 | /// The name of the attribute |
---|
100 | G4String m_name; |
---|
101 | /// A short description of the attribute |
---|
102 | G4String m_desc; |
---|
103 | /// The category (Draw, Physics, PickAction, Association, etc.) |
---|
104 | G4String m_category; |
---|
105 | /// Some extra property of the attribute (units, etc.) |
---|
106 | G4String m_extra; |
---|
107 | /// The type of the value of the attribute (int, double, vector, etc.) |
---|
108 | G4String m_valueType; |
---|
109 | // Type key |
---|
110 | G4TypeKey m_typeKey; |
---|
111 | |
---|
112 | }; |
---|
113 | |
---|
114 | std::ostream& operator<< |
---|
115 | (std::ostream& os, const std::map<G4String,G4AttDef>* definitions); |
---|
116 | |
---|
117 | #endif //G4ATTDEF_H |
---|