45 ,fWarnedMissingAttribute(false)
51 ContextMap::iterator iter = fContextMap.begin();
53 while (iter != fContextMap.end()) {
63 const G4bool& visible)
const
68 if (!fWarnedMissingAttribute) {
70 ed<<
"Null attribute name";
74 fWarnedMissingAttribute =
true;
90 static G4bool warnedUnableToExtract =
false;
91 if (!warnedUnableToExtract) {
93 ed <<
"Unable to extract attribute definition named "<<fAttName;
95 (
"G4TrajectoryDrawByAttribute::Draw",
96 "modeling0117",
JustWarning, ed,
". Invalid attribute name");
97 G4cout <<
"Available attributes:\n"
98 << *
object.GetAttDefs();
99 warnedUnableToExtract =
true;
106 assert (0 != filter);
110 ContextMap::const_iterator iter = fContextMap.begin();
112 while (iter != fContextMap.end()) {
113 if (iter->first.second == G4TrajectoryDrawByAttribute::Interval) {
116 else if (iter->first.second == G4TrajectoryDrawByAttribute::SingleValue) {
128 static G4bool warnedUnableToExtract =
false;
129 if (!warnedUnableToExtract) {
131 ed <<
"Unable to extract attribute value named "<<fAttName;
133 (
"G4TrajectoryDrawByAttribute::Draw",
134 "modeling0118",
JustWarning, ed,
". Invalid attribute name");
135 G4cout <<
"Available attributes:\n"
136 << *
object.GetAttDefs();
137 warnedUnableToExtract =
true;
151 ContextMap::const_iterator iter = fContextMap.begin();
155 while (!gotContext && (iter != fContextMap.end())) {
156 if (iter->first.first == key) {
157 myContext = *(iter->second);
169 G4cout<<
"G4TrajectoryDrawByAttribute drawer named "<<
Name();
170 G4cout<<
", drawing style selected according to value of attribute "<<fAttName;
182 ostr<<
"G4TrajectoryDrawByAttribute, dumping configuration for model named "<<
Name() <<
":"<<std::endl;;
184 ostr<<
"Default configuration:"<<
G4endl;
187 ostr<<
"\nAttribute name "<<fAttName<<std::endl;
188 ostr<<
"\nKey<->Context map dump:"<<std::endl;
190 ContextMap::const_iterator iter = fContextMap.begin();
192 while (iter != fContextMap.end()) {
193 ostr<<
"Context for key "<<iter->first.first<<
":"<<std::endl;
194 iter->second->Print(ostr);
210 std::pair<G4String, Config> myPair(name, G4TrajectoryDrawByAttribute::Interval);
212 ContextMap::iterator iter = fContextMap.find(myPair);
214 if (iter != fContextMap.end()) {
216 ed <<
"Interval "<< name <<
" already exists";
218 (
"G4TrajectoryDrawByAttribute::AddIntervalContext",
229 std::pair<G4String, Config> myPair(name, G4TrajectoryDrawByAttribute::SingleValue);
231 ContextMap::iterator iter = fContextMap.find(myPair);
233 if (iter != fContextMap.end()) {
235 ed <<
"Single value "<< name <<
" already exists";
237 (
"G4TrajectoryDrawByAttribute::AddSingleValueContext",
void AddValueContext(const G4String &name, G4VisTrajContext *context)
virtual void Print(std::ostream &ostr) const
std::ostringstream G4ExceptionDescription
G4bool ExtractAttValue(const T &object, const G4String &name, G4AttValue &attVal)
virtual G4bool GetValidElement(const G4AttValue &, G4String &) const =0
const G4String & GetValue() const
G4TrajectoryDrawByAttribute(const G4String &name="Unspecified", G4VisTrajContext *context=0)
const G4VisTrajContext & GetContext() const
G4bool ExtractAttDef(const T &object, const G4String &name, G4AttDef &def)
G4GLOB_DLL std::ostream G4cout
void DrawLineAndPoints(const G4VTrajectory &traj, const G4VisTrajContext &)
void SetVisible(const G4bool &visible)
virtual void Draw(const G4VTrajectory &trajectory, const G4bool &visible=true) const
void AddIntervalContext(const G4String &name, G4VisTrajContext *context)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
virtual ~G4TrajectoryDrawByAttribute()
void Set(const G4String &attribute)
virtual void LoadSingleValueElement(const G4String &)=0
G4VAttValueFilter * GetNewFilter(const G4AttDef &def)
G4bool GetVerbose() const
void Print(std::ostream &ostr) const
virtual void LoadIntervalElement(const G4String &)=0