Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandSceneAddLogo2D Class Reference

#include <G4VisCommandsSceneAdd.hh>

+ Inheritance diagram for G4VisCommandSceneAddLogo2D:

Public Member Functions

 G4VisCommandSceneAddLogo2D ()
 
virtual ~G4VisCommandSceneAddLogo2D ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandScene
 G4VVisCommandScene ()
 
virtual ~G4VVisCommandScene ()
 
- Public Member Functions inherited from G4VVisCommand
 G4VVisCommand ()
 
virtual ~G4VVisCommand ()
 
- Public Member Functions inherited from G4UImessenger
 G4UImessenger ()
 
 G4UImessenger (const G4String &path, const G4String &dsc)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
G4bool operator== (const G4UImessenger &messenger) const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
- Protected Member Functions inherited from G4VVisCommandScene
G4String CurrentSceneName ()
 
- Protected Member Functions inherited from G4VVisCommand
void UpdateVisManagerScene (const G4String &sceneName="")
 
- Protected Member Functions inherited from G4UImessenger
G4String ItoS (G4int i)
 
G4String DtoS (G4double a)
 
G4String BtoS (G4bool b)
 
G4int StoI (G4String s)
 
G4double StoD (G4String s)
 
G4bool StoB (G4String s)
 
void AddUIcommand (G4UIcommand *newCommand)
 
void CreateDirectory (const G4String &path, const G4String &dsc)
 
template<typename T >
T * CreateCommand (const G4String &cname, const G4String &dsc)
 
- Static Protected Member Functions inherited from G4VVisCommand
static G4String ConvertToString (G4double x, G4double y, const char *unitName)
 
static void ConvertToDoublePair (const G4String &paramString, G4double &xval, G4double &yval)
 
- Protected Attributes inherited from G4UImessenger
G4UIdirectorybaseDir
 
G4String baseDirName
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentLineWidth = 1.
 
static G4ModelingParameters::PVNameCopyNoPath fCurrentTouchablePath
 

Detailed Description

Definition at line 276 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

◆ G4VisCommandSceneAddLogo2D()

G4VisCommandSceneAddLogo2D::G4VisCommandSceneAddLogo2D ( )

Definition at line 1565 of file G4VisCommandsSceneAdd.cc.

1565 {
1566 G4bool omitable;
1567 fpCommand = new G4UIcommand ("/vis/scene/add/logo2D", this);
1568 fpCommand -> SetGuidance ("Adds 2D logo to current scene.");
1569 G4UIparameter* parameter;
1570 parameter = new G4UIparameter ("size", 'i', omitable = true);
1571 parameter -> SetGuidance ("Screen size of text in pixels.");
1572 parameter -> SetDefaultValue (48);
1573 fpCommand -> SetParameter (parameter);
1574 parameter = new G4UIparameter ("x-position", 'd', omitable = true);
1575 parameter -> SetGuidance ("x screen position in range -1 < x < 1.");
1576 parameter -> SetDefaultValue (-0.9);
1577 fpCommand -> SetParameter (parameter);
1578 parameter = new G4UIparameter ("y-position", 'd', omitable = true);
1579 parameter -> SetGuidance ("y screen position in range -1 < y < 1.");
1580 parameter -> SetDefaultValue (-0.9);
1581 fpCommand -> SetParameter (parameter);
1582 parameter = new G4UIparameter ("layout", 's', omitable = true);
1583 parameter -> SetGuidance ("Layout, i.e., adjustment: left|centre|right.");
1584 parameter -> SetDefaultValue ("left");
1585 fpCommand -> SetParameter (parameter);
1586}
bool G4bool
Definition: G4Types.hh:67

◆ ~G4VisCommandSceneAddLogo2D()

G4VisCommandSceneAddLogo2D::~G4VisCommandSceneAddLogo2D ( )
virtual

Definition at line 1588 of file G4VisCommandsSceneAdd.cc.

1588 {
1589 delete fpCommand;
1590}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandSceneAddLogo2D::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1592 of file G4VisCommandsSceneAdd.cc.

1592 {
1593 return "";
1594}

◆ SetNewValue()

void G4VisCommandSceneAddLogo2D::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 1596 of file G4VisCommandsSceneAdd.cc.

1597{
1599 G4bool warn(verbosity >= G4VisManager::warnings);
1600
1602 if (!pScene) {
1603 if (verbosity >= G4VisManager::errors) {
1604 G4cout << "ERROR: No current scene. Please create one." << G4endl;
1605 }
1606 return;
1607 }
1608
1609 G4int size;
1610 G4double x, y;
1611 G4String layoutString;
1612 std::istringstream is(newValue);
1613 is >> size >> x >> y >> layoutString;
1615 if (layoutString(0) == 'l') layout = G4Text::left;
1616 else if (layoutString(0) == 'c') layout = G4Text::centre;
1617 else if (layoutString(0) == 'r') layout = G4Text::right;
1618
1619 Logo2D* logo2D = new Logo2D(fpVisManager, size, x, y, layout);
1620 G4VModel* model =
1622 model->SetType("G4Logo2D");
1623 model->SetGlobalTag("G4Logo2D");
1624 model->SetGlobalDescription("G4Logo2D: " + newValue);
1625 const G4String& currentSceneName = pScene -> GetName ();
1626 G4bool successful = pScene -> AddRunDurationModel (model, warn);
1627 if (successful) {
1628 if (verbosity >= G4VisManager::confirmations) {
1629 G4cout << "2D logo has been added to scene \""
1630 << currentSceneName << "\"."
1631 << G4endl;
1632 }
1633 }
1634 else G4VisCommandsSceneAddUnsuccessful(verbosity);
1635 UpdateVisManagerScene (currentSceneName);
1636}
double G4double
Definition: G4Types.hh:64
int G4int
Definition: G4Types.hh:66
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
Layout
Definition: G4Text.hh:77
@ centre
Definition: G4Text.hh:77
@ right
Definition: G4Text.hh:77
@ left
Definition: G4Text.hh:77
void SetType(const G4String &)
void SetGlobalDescription(const G4String &)
void SetGlobalTag(const G4String &)
static G4VisManager * fpVisManager
void UpdateVisManagerScene(const G4String &sceneName="")
G4Scene * GetCurrentScene() const
static Verbosity GetVerbosity()

The documentation for this class was generated from the following files: