45 ,fWarnedMissingAttribute(false)
63 const G4bool& visible)
const
70 ed<<
"Null attribute name";
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;
110 ContextMap::const_iterator iter =
fContextMap.begin();
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();
193 ostr<<
"Context for key "<<iter->first.first<<
":"<<std::endl;
194 iter->second->Print(ostr);
212 ContextMap::iterator iter =
fContextMap.find(myPair);
216 ed <<
"Interval "<< name <<
" already exists";
218 (
"G4TrajectoryDrawByAttribute::AddIntervalContext",
231 ContextMap::iterator iter =
fContextMap.find(myPair);
235 ed <<
"Single value "<< name <<
" already exists";
237 (
"G4TrajectoryDrawByAttribute::AddSingleValueContext",
void DrawLineAndPoints(const G4VTrajectory &traj, const G4VisTrajContext &)
const G4VisTrajContext & GetContext() const
std::ostringstream G4ExceptionDescription
virtual void Print(std::ostream &ostr) const
G4TrajectoryDrawByAttribute(const G4String &name="Unspecified", G4VisTrajContext *context=0)
G4VAttValueFilter * GetNewFilter(const G4AttDef &def)
void SetVisible(const G4bool &visible)
virtual void LoadIntervalElement(const G4String &)=0
void AddValueContext(const G4String &name, G4VisTrajContext *context)
G4VAttValueFilter * filter
void AddIntervalContext(const G4String &name, G4VisTrajContext *context)
virtual ~G4TrajectoryDrawByAttribute()
G4bool fWarnedMissingAttribute
virtual void Draw(const G4VTrajectory &trajectory, const G4bool &visible=true) const
void Set(const G4String &attribute)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4GLOB_DLL std::ostream G4cout
G4bool GetVerbose() const
G4bool ExtractAttValue(const T &object, const G4String &name, G4AttValue &attVal)
G4bool ExtractAttDef(const T &object, const G4String &name, G4AttDef &def)
virtual G4bool GetValidElement(const G4AttValue &, G4String &) const =0
void Print(std::ostream &ostr) const
virtual void LoadSingleValueElement(const G4String &)=0
const G4String & GetValue() const