Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandsSceneAdd.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
28// /vis/scene commands - John Allison 9th August 1998
29// Michael Kelsey 31 Jan 2019 -- Add new command for electric field
30
31#ifndef G4VISCOMMANDSSCENEADD_HH
32#define G4VISCOMMANDSSCENEADD_HH
33
34#include "G4VisCommandsScene.hh"
35
39
40#include "G4Transform3D.hh"
41#include "G4VisAttributes.hh"
42#include "G4Polyline.hh"
43#include "G4Text.hh"
44#include "G4Timer.hh"
45
57
59public:
63 void SetNewValue (G4UIcommand* command, G4String newValue);
64private:
67 struct Arrow2D {
68 Arrow2D(G4double x1, G4double y1,
69 G4double x2, G4double y2,
70 G4double width, const G4Colour& colour);
71 void operator()(G4VGraphicsScene&, const G4ModelingParameters* fpMp);
72 G4Polyline fShaftPolyline;
73 G4Polyline fHeadPolyline;
74 G4double fWidth;
75 G4Colour fColour;
76 };
77 G4UIcommand* fpCommand;
78};
79
81public:
85 void SetNewValue (G4UIcommand* command, G4String newValue);
86private:
89 G4UIcommand* fpCommand;
90};
91
93public:
97 void SetNewValue (G4UIcommand* command, G4String newValue);
98private:
101 struct Date {
102 Date
103 (G4VisManager* vm, G4int size,
104 G4double x, G4double y, G4Text::Layout layout,
105 const G4String& date):
106 fpVisManager(vm), fSize(size),
107 fX(x), fY(y), fLayout(layout), fDate(date) {}
108 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
110 G4Timer fTimer;
111 G4int fSize;
112 G4double fX, fY;
113 G4Text::Layout fLayout;
114 G4String fDate;
115 };
116 G4UIcommand* fpCommand;
117};
118
130
132public:
136 void SetNewValue (G4UIcommand* command, G4String newValue);
137private:
140 struct EndOfRunMacro {
141 EndOfRunMacro(const G4String& macro): fMacro(macro){};
142 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
143 G4String fMacro;
144 };
145 G4UIcmdWithAString* fpCommand;
146};
147
149public:
153 void SetNewValue (G4UIcommand* command, G4String newValue);
154private:
157 enum ForWhat {forEndOfEvent, forEndOfRun};
158 struct EventID {
159 EventID(ForWhat w, G4VisManager* vm, G4int size,
160 G4double x, G4double y, G4Text::Layout layout):
161 fForWhat(w), fpVisManager(vm), fSize(size),
162 fX(x), fY(y), fLayout(layout) {}
163 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
164 ForWhat fForWhat;
166 G4int fSize;
167 G4double fX, fY;
168 G4Text::Layout fLayout;
169 };
170 G4UIcommand* fpCommand;
171};
172
174public:
178 void SetNewValue (G4UIcommand* command, G4String newValue);
179private:
182 struct Extent {
183 Extent(G4double xmin, G4double xmax,
184 G4double ymin, G4double ymax,
185 G4double zmin, G4double zmax);
186 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
187 G4VisExtent fExtent;
188 };
189 G4UIcommand* fpCommand;
190};
191
203
205public:
209 void SetNewValue (G4UIcommand* command, G4String newValue);
210private:
213 struct Frame {
214 Frame(G4double size, G4double width, const G4Colour& colour):
215 fSize(size), fWidth(width), fColour(colour) {}
216 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
217 G4double fSize;
218 G4double fWidth;
219 G4Colour fColour;
220 };
221 G4UIcommand* fpCommand;
222};
223
225public:
227 virtual ~G4VisCommandSceneAddGPS ();
229 void SetNewValue (G4UIcommand* command, G4String newValue);
230private:
233 G4UIcommand* fpCommand;
234};
235
248
250public:
252 virtual ~G4VisCommandSceneAddHits ();
254 void SetNewValue (G4UIcommand* command, G4String newValue);
255private:
258 G4UIcmdWithoutParameter* fpCommand;
259};
260
262public:
264 virtual ~G4VisCommandSceneAddLine ();
266 void SetNewValue (G4UIcommand* command, G4String newValue);
267private:
270 struct Line {
271 Line(G4double x1, G4double y1, G4double z1,
272 G4double x2, G4double y2, G4double z2,
273 G4double width, const G4Colour& colour);
274 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
275 G4Polyline fPolyline;
276 G4double fWidth;
277 G4Colour fColour;
278 };
279 G4UIcommand* fpCommand;
280};
281
283public:
287 void SetNewValue (G4UIcommand* command, G4String newValue);
288private:
291 struct Line2D {
292 Line2D(G4double x1, G4double y1,
293 G4double x2, G4double y2,
294 G4double width, const G4Colour& colour);
295 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
296 G4Polyline fPolyline;
297 G4double fWidth;
298 G4Colour fColour;
299 };
300 G4UIcommand* fpCommand;
301};
302
314
327
329public:
331 virtual ~G4VisCommandSceneAddLogo ();
333 void SetNewValue (G4UIcommand* command, G4String newValue);
334private:
337 // Direction of outward-facing normal to front face of logo.
338 enum Direction {X, minusX, Y, minusY, Z, minusZ};
339 struct G4Logo {
340 G4Logo(G4double height, const G4VisAttributes&, const G4Transform3D&);
341 ~G4Logo();
342 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
343 private:
344 G4Polyhedron *fpG, *fp4;
345 };
346 G4UIcommand* fpCommand;
347};
348
350public:
354 void SetNewValue (G4UIcommand* command, G4String newValue);
355private:
358 struct Logo2D {
359 Logo2D
360 (G4VisManager* vm, G4int size,
361 G4double x, G4double y, G4Text::Layout layout):
362 fpVisManager(vm), fSize(size),
363 fX(x), fY(y), fLayout(layout) {}
364 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
366 G4int fSize;
367 G4double fX, fY;
368 G4Text::Layout fLayout;
369 };
370 G4UIcommand* fpCommand;
371};
372
384
396
398public:
402 void SetNewValue (G4UIcommand* command, G4String newValue);
403private:
406 struct Scale {
407 enum Direction {x, y, z};
408 Scale (const G4VisAttributes& visAttribs,
409 G4double length, const G4Transform3D&,
410 const G4String& annotation, G4double annotationSize,
411 const G4Colour& annotationColour
412 );
413 // This creates a representation of annotated line in the specified
414 // direction with tick marks at the end. If autoPlacing is true it
415 // is required to be centred at the front, right, bottom corner of
416 // the world space, comfortably outside the existing bounding
417 // box/sphere so that existing objects do not obscure it. Otherwise
418 // it is required to be drawn with mid-point at (xmid, ymid, zmid).
419 // Annotation size is size of text labels in pixels.
420 //
421 // The auto placing algorithm might be:
422 // x = xmin + (1 + comfort) * (xmax - xmin)
423 // y = ymin - comfort * (ymax - ymin)
424 // z = zmin + (1 + comfort) * (zmax - zmin)
425 // if direction == x then (x - length,y,z) to (x,y,z)
426 // if direction == y then (x,y,z) to (x,y + length,z)
427 // if direction == z then (x,y,z - length) to (x,y,z)
428 ~Scale();
429 void operator()(G4VGraphicsScene&,const G4ModelingParameters*);
430 private:
431 G4VisAttributes fVisAtts;
432 G4Polyline fScaleLine, fTick11, fTick12, fTick21, fTick22;
433 G4Text fText;
434 };
435 G4UIcommand* fpCommand;
436};
437
439public:
441 virtual ~G4VisCommandSceneAddText ();
443 void SetNewValue (G4UIcommand* command, G4String newValue);
444private:
447 G4UIcommand* fpCommand;
448};
449
451public:
455 void SetNewValue (G4UIcommand* command, G4String newValue);
456private:
459 struct G4Text2D {
460 G4Text2D(const G4Text&);
461 void operator()(G4VGraphicsScene&, const G4ModelingParameters*);
462 private:
463 G4Text fText;
464 };
465 G4UIcommand* fpCommand;
466};
467
480
482public:
486 void SetNewValue (G4UIcommand* command, G4String newValue);
487private:
490 enum ActionType {runDuration, endOfEvent, endOfRun};
491 void AddVisAction(const G4String& name,G4VUserVisAction*,
492 G4Scene*,ActionType,G4VisManager::Verbosity);
493 G4UIcmdWithAString* fpCommand;
494};
495
497public:
501 void SetNewValue (G4UIcommand* command, G4String newValue);
502private:
505 G4UIcommand* fpCommand;
506};
507
519
520#endif
HepGeom::Transform3D G4Transform3D
double G4double
Definition G4Types.hh:83
int G4int
Definition G4Types.hh:85
static G4VisManager * fpVisManager
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
virtual ~G4VisCommandSceneAddGhosts()
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)
G4String GetCurrentValue(G4UIcommand *command)
G4String GetCurrentValue(G4UIcommand *command)
void SetNewValue(G4UIcommand *command, G4String newValue)