Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
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$
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:
60 G4AttDef(const G4String& name,
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
70 G4AttDef(const G4String& name,
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
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:
98 /// The name of the attribute
99 G4String m_name;
100 /// A short description of the attribute
101 G4String m_desc;
102 /// The category (Draw, Physics, PickAction, Association, etc.)
103 G4String m_category;
104 /// Some extra property of the attribute (units, etc.)
105 G4String m_extra;
106 /// The type of the value of the attribute (int, double, vector, etc.)
107 G4String m_valueType;
108 // Type key
109 G4TypeKey m_typeKey;
110
111 };
112
113std::ostream& operator<<
114 (std::ostream& os, const std::map<G4String,G4AttDef>* definitions);
115
116#endif //G4ATTDEF_H
const G4String & GetCategory() const
Definition: G4AttDef.hh:86
virtual ~G4AttDef()
Definition: G4AttDef.hh:82
G4AttDef(const G4String &name, const G4String &desc, const G4String &category, const G4String &extra, const G4String &valueType)
Definition: G4AttDef.hh:60
const G4String & GetExtra() const
Definition: G4AttDef.hh:87
void SetValueType(const G4String &type)
Definition: G4AttDef.hh:95
const G4String & GetDesc() const
Definition: G4AttDef.hh:85
void SetCategory(const G4String &cat)
Definition: G4AttDef.hh:93
const G4TypeKey & GetTypeKey() const
Definition: G4AttDef.hh:89
void SetName(const G4String &name)
Definition: G4AttDef.hh:91
const G4String & GetName() const
Definition: G4AttDef.hh:84
G4AttDef()
Definition: G4AttDef.hh:81
G4AttDef(const G4String &name, const G4String &desc, const G4String &category, const G4String &extra, const G4TypeKey &typeKey)
Definition: G4AttDef.hh:70
void SetExtra(const G4String &extra)
Definition: G4AttDef.hh:94
const G4String & GetValueType() const
Definition: G4AttDef.hh:88
void SetDesc(const G4String &desc)
Definition: G4AttDef.hh:92