Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Public Member Functions
G4VisCommandSceneAddFrame Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddFrame:
G4VVisCommandScene G4VVisCommand G4UImessenger

Public Member Functions

 G4VisCommandSceneAddFrame ()
 
virtual ~G4VisCommandSceneAddFrame ()
 
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
 

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, 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
 
- 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 154 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

G4VisCommandSceneAddFrame::G4VisCommandSceneAddFrame ( )

Definition at line 644 of file G4VisCommandsSceneAdd.cc.

644  {
645  fpCommand = new G4UIcommand("/vis/scene/add/frame", this);
646  fpCommand -> SetGuidance ("Adds frame to current scene.");
647  G4bool omitable;
648  G4UIparameter* parameter;
649  parameter = new G4UIparameter ("size", 'd', omitable = true);
650  parameter -> SetGuidance ("Size of frame. 1 = full window.");
651  parameter -> SetParameterRange ("size > 0 && size <=1");
652  parameter -> SetDefaultValue (0.97);
653  fpCommand -> SetParameter (parameter);
654 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandSceneAddFrame::~G4VisCommandSceneAddFrame ( )
virtual

Definition at line 656 of file G4VisCommandsSceneAdd.cc.

656  {
657  delete fpCommand;
658 }

Member Function Documentation

G4String G4VisCommandSceneAddFrame::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 660 of file G4VisCommandsSceneAdd.cc.

660  {
661  return "";
662 }
void G4VisCommandSceneAddFrame::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 664 of file G4VisCommandsSceneAdd.cc.

References G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fCurrentColour, G4VVisCommand::fCurrentLineWidth, G4VVisCommand::fpVisManager, G4cout, G4endl, G4VisManager::GetCurrentScene(), G4VisManager::GetVerbosity(), G4VModel::SetGlobalDescription(), G4VModel::SetGlobalTag(), G4VModel::SetType(), G4VVisCommand::UpdateVisManagerScene(), and G4VisManager::warnings.

665 {
667  G4bool warn(verbosity >= G4VisManager::warnings);
668 
669  G4Scene* pScene = fpVisManager->GetCurrentScene();
670  if (!pScene) {
671  if (verbosity >= G4VisManager::errors) {
672  G4cout << "ERROR: No current scene. Please create one." << G4endl;
673  }
674  return;
675  }
676 
677  G4double size;
678  std::istringstream is(newValue);
679  is >> size;
680 
681  Frame* frame = new Frame(size, fCurrentLineWidth, fCurrentColour);
682  G4VModel* model =
684  model->SetType("Frame");
685  model->SetGlobalTag("Frame");
686  model->SetGlobalDescription("Frame: " + newValue);
687  const G4String& currentSceneName = pScene -> GetName ();
688  G4bool successful = pScene -> AddRunDurationModel (model, warn);
689  if (successful) {
690  if (verbosity >= G4VisManager::confirmations) {
691  G4cout << "Frame has been added to scene \""
692  << currentSceneName << "\"."
693  << G4endl;
694  }
695  }
696  else G4VisCommandsSceneAddUnsuccessful(verbosity);
697  UpdateVisManagerScene (currentSceneName);
698 }
void SetGlobalTag(const G4String &)
static G4Colour fCurrentColour
void UpdateVisManagerScene(const G4String &sceneName="")
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void SetType(const G4String &)
const XML_Char XML_Content * model
static G4double fCurrentLineWidth
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetGlobalDescription(const G4String &)
G4Scene * GetCurrentScene() const
static G4VisManager * fpVisManager

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