Geant4  10.02.p01
G4AttDef.hh
Go to the documentation of this file.
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 78955 2014-02-05 09:45:46Z gcosmo $
28 
29 #ifndef G4ATTDEF_HH
30 #define G4ATTDEF_HH
31 
32 #include "globals.hh"
33 #include "G4TypeKey.hh"
34 #include <map>
35 
36 // Class Description:
37 //
38 // @class G4AttDef
39 //
40 // @brief This class represents a HepRep-style Attribute Definition.
41 // The G4AttDef is used to define new kinds of attributes that can
42 // then have values set for a Trajectory, Trajectory Point or Sensitive
43 // Detector Hit. These attributes are then made available to the end user
44 // in an interactive visualization system (such as WIRED).
45 // Values are set by creating G4AttValue objects and attaching them to the
46 // relevant Trajectory, Trajectory Point or Sensitive Detector Hit.
47 // The association between the G4AttValue and the G4AttDef object is
48 // made through the data member "name".
49 // For details, see the HepRep home page at http://heprep.freehep.org
50 //
51 // @author M.Frailis
52 // @author R.Giannitrapani
53 // @author J.Perl
54 // Class Description - End:
55 
56 
57  class G4AttDef{
58 
59  public:
61  const G4String& desc,
62  const G4String& category,
63  const G4String& extra,
64  const G4String& valueType):
65  m_name(name),m_desc(desc),
66  m_category(category),
67  m_extra(extra),m_valueType(valueType){};
68 
69  // G4Typekey based constructor
71  const G4String& desc,
72  const G4String& category,
73  const G4String& extra,
74  const G4TypeKey& typeKey):
75  m_name(name),m_desc(desc),
76  m_category(category),
77  m_extra(extra),m_valueType("Null"),
78  m_typeKey(typeKey)
79  {};
80 
81  G4AttDef(){};
82  virtual ~G4AttDef(){};
83 
84  const G4String& GetName()const{return m_name;};
85  const G4String& GetDesc()const{return m_desc;};
86  const G4String& GetCategory()const{return m_category;};
87  const G4String& GetExtra()const{return m_extra;};
88  const G4String& GetValueType()const{return m_valueType;};
89  const G4TypeKey& GetTypeKey()const{return m_typeKey;};
90 
91  void SetName(const G4String& name){m_name = name;};
92  void SetDesc(const G4String& desc){m_desc = desc;};
93  void SetCategory(const G4String& cat){m_category = cat;};
94  void SetExtra(const G4String& extra){m_extra = extra;};
95  void SetValueType(const G4String& type){m_valueType = type;};
96 
97  private:
108  // Type key
110 
111  };
112 
113 // Deprecated. It is not a good idea to output a pointer since failure to
114 // include this prototype will not cause a compilation error - it will merely
115 // cause your code to use a default function that outputs the pointer as an
116 // address.
117 std::ostream& operator<<
118 (std::ostream& os, const std::map<G4String,G4AttDef>* definitions);
119 
120 // Use this instead.
121 std::ostream& operator<<
122 (std::ostream& os, const std::map<G4String,G4AttDef>& definitions);
123 
124 #endif //G4ATTDEF_H
G4String m_category
The category (Draw, Physics, PickAction, Association, etc.)
Definition: G4AttDef.hh:103
void SetExtra(const G4String &extra)
Definition: G4AttDef.hh:94
G4TypeKey m_typeKey
Definition: G4AttDef.hh:109
G4String m_name
The name of the attribute.
Definition: G4AttDef.hh:95
G4String name
Definition: TRTMaterials.hh:40
const G4String & GetExtra() const
Definition: G4AttDef.hh:87
virtual ~G4AttDef()
Definition: G4AttDef.hh:82
void SetDesc(const G4String &desc)
Definition: G4AttDef.hh:92
const G4String & GetValueType() const
Definition: G4AttDef.hh:88
void SetCategory(const G4String &cat)
Definition: G4AttDef.hh:93
const G4String & GetDesc() const
Definition: G4AttDef.hh:85
void SetName(const G4String &name)
Definition: G4AttDef.hh:91
const G4String & GetName() const
Definition: G4AttDef.hh:84
G4String m_extra
Some extra property of the attribute (units, etc.)
Definition: G4AttDef.hh:105
G4String m_valueType
The type of the value of the attribute (int, double, vector, etc.)
Definition: G4AttDef.hh:107
G4AttDef(const G4String &name, const G4String &desc, const G4String &category, const G4String &extra, const G4String &valueType)
Definition: G4AttDef.hh:60
G4String m_desc
A short description of the attribute.
Definition: G4AttDef.hh:101
G4AttDef()
Definition: G4AttDef.hh:81
const G4String & GetCategory() const
Definition: G4AttDef.hh:86
void SetValueType(const G4String &type)
Definition: G4AttDef.hh:95
G4AttDef(const G4String &name, const G4String &desc, const G4String &category, const G4String &extra, const G4TypeKey &typeKey)
Definition: G4AttDef.hh:70
const G4TypeKey & GetTypeKey() const
Definition: G4AttDef.hh:89