Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4VisCommandSceneAddLogo2D Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddLogo2D:
Collaboration 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, G4bool commandsToBeBroadcasted=true)
 
virtual ~G4UImessenger ()
 
G4bool operator== (const G4UImessenger &messenger) const
 
G4bool CommandsShouldBeInMaster () const
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
static const G4ColourGetCurrentColour ()
 
static G4double GetCurrentLineWidth ()
 
static const G4ColourGetCurrentTextColour ()
 
static G4Text::Layout GetCurrentTextLayout ()
 
static G4double GetCurrentTextSize ()
 
- 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, G4bool commandsToBeBroadcasted=true)
 
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
 
G4bool commandsShouldBeInMaster
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4int fErrorCode = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4double fCurrentLineWidth = 1.
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentTextSize = 12.
 
static
G4ModelingParameters::PVNameCopyNoPath 
fCurrentTouchablePath
 

Detailed Description

Definition at line 295 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

G4VisCommandSceneAddLogo2D::G4VisCommandSceneAddLogo2D ( )

Definition at line 1647 of file G4VisCommandsSceneAdd.cc.

1647  {
1648  G4bool omitable;
1649  fpCommand = new G4UIcommand ("/vis/scene/add/logo2D", this);
1650  fpCommand -> SetGuidance ("Adds 2D logo to current scene.");
1651  G4UIparameter* parameter;
1652  parameter = new G4UIparameter ("size", 'i', omitable = true);
1653  parameter -> SetGuidance ("Screen size of text in pixels.");
1654  parameter -> SetDefaultValue (48);
1655  fpCommand -> SetParameter (parameter);
1656  parameter = new G4UIparameter ("x-position", 'd', omitable = true);
1657  parameter -> SetGuidance ("x screen position in range -1 < x < 1.");
1658  parameter -> SetDefaultValue (-0.9);
1659  fpCommand -> SetParameter (parameter);
1660  parameter = new G4UIparameter ("y-position", 'd', omitable = true);
1661  parameter -> SetGuidance ("y screen position in range -1 < y < 1.");
1662  parameter -> SetDefaultValue (-0.9);
1663  fpCommand -> SetParameter (parameter);
1664  parameter = new G4UIparameter ("layout", 's', omitable = true);
1665  parameter -> SetGuidance ("Layout, i.e., adjustment: left|centre|right.");
1666  parameter -> SetDefaultValue ("left");
1667  fpCommand -> SetParameter (parameter);
1668 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandSceneAddLogo2D::~G4VisCommandSceneAddLogo2D ( )
virtual

Definition at line 1670 of file G4VisCommandsSceneAdd.cc.

1670  {
1671  delete fpCommand;
1672 }

Member Function Documentation

G4String G4VisCommandSceneAddLogo2D::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1674 of file G4VisCommandsSceneAdd.cc.

1674  {
1675  return "";
1676 }
void G4VisCommandSceneAddLogo2D::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 1678 of file G4VisCommandsSceneAdd.cc.

1679 {
1681  G4bool warn(verbosity >= G4VisManager::warnings);
1682 
1683  G4Scene* pScene = fpVisManager->GetCurrentScene();
1684  if (!pScene) {
1685  if (verbosity >= G4VisManager::errors) {
1686  G4cerr << "ERROR: No current scene. Please create one." << G4endl;
1687  }
1688  return;
1689  }
1690 
1691  G4int size;
1692  G4double x, y;
1693  G4String layoutString;
1694  std::istringstream is(newValue);
1695  is >> size >> x >> y >> layoutString;
1696  G4Text::Layout layout = G4Text::right;
1697  if (layoutString(0) == 'l') layout = G4Text::left;
1698  else if (layoutString(0) == 'c') layout = G4Text::centre;
1699  else if (layoutString(0) == 'r') layout = G4Text::right;
1700 
1701  Logo2D* logo2D = new Logo2D(fpVisManager, size, x, y, layout);
1702  G4VModel* model =
1704  model->SetType("G4Logo2D");
1705  model->SetGlobalTag("G4Logo2D");
1706  model->SetGlobalDescription("G4Logo2D: " + newValue);
1707  const G4String& currentSceneName = pScene -> GetName ();
1708  G4bool successful = pScene -> AddRunDurationModel (model, warn);
1709  if (successful) {
1710  if (verbosity >= G4VisManager::confirmations) {
1711  G4cout << "2D logo has been added to scene \""
1712  << currentSceneName << "\"."
1713  << G4endl;
1714  }
1715  }
1716  else G4VisCommandsSceneAddUnsuccessful(verbosity);
1717  UpdateVisManagerScene (currentSceneName);
1718 }
void SetGlobalTag(const G4String &)
void UpdateVisManagerScene(const G4String &sceneName="")
tuple x
Definition: test.py:50
int G4int
Definition: G4Types.hh:78
static void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void SetType(const G4String &)
Layout
Definition: G4Text.hh:77
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
const XML_Char XML_Content * model
Definition: expat.h:151
void SetGlobalDescription(const G4String &)
G4Scene * GetCurrentScene() const
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager

Here is the call graph for this function:


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