Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4VisCommandSceneAddExtent Class Reference

#include <G4VisCommandsSceneAdd.hh>

Inheritance diagram for G4VisCommandSceneAddExtent:
Collaboration diagram for G4VisCommandSceneAddExtent:

Public Member Functions

 G4VisCommandSceneAddExtent ()
 
virtual ~G4VisCommandSceneAddExtent ()
 
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 154 of file G4VisCommandsSceneAdd.hh.

Constructor & Destructor Documentation

G4VisCommandSceneAddExtent::G4VisCommandSceneAddExtent ( )

Definition at line 685 of file G4VisCommandsSceneAdd.cc.

685  {
686  fpCommand = new G4UIcommand("/vis/scene/add/extent", this);
687  fpCommand -> SetGuidance
688  ("Adds a dummy model with given extent to the current scene."
689  "\nRequires the limits: xmin, xmax, ymin, ymax, zmin, zmax unit."
690  "\nThis can be used to provide an extent to the scene even if"
691  "\nno other models with extent are available. For example,"
692  "\neven if there is no geometry. In that case, for example:"
693  "\n /vis/open OGL"
694  "\n /vis/scene/create"
695  "\n /vis/scene/add/extent -300 300 -300 300 -300 300 cm"
696  "\n /vis/sceneHandler/attach");
697  G4bool omitable;
698  G4UIparameter* parameter;
699  parameter = new G4UIparameter ("xmin", 'd', omitable = true);
700  parameter -> SetDefaultValue (0.);
701  fpCommand -> SetParameter (parameter);
702  parameter = new G4UIparameter ("xmax", 'd', omitable = true);
703  parameter -> SetDefaultValue (0.);
704  fpCommand -> SetParameter (parameter);
705  parameter = new G4UIparameter ("ymin", 'd', omitable = true);
706  parameter -> SetDefaultValue (0.);
707  fpCommand -> SetParameter (parameter);
708  parameter = new G4UIparameter ("ymax", 'd', omitable = true);
709  parameter -> SetDefaultValue (0.);
710  fpCommand -> SetParameter (parameter);
711  parameter = new G4UIparameter ("zmin", 'd', omitable = true);
712  parameter -> SetDefaultValue (0.);
713  fpCommand -> SetParameter (parameter);
714  parameter = new G4UIparameter ("zmax", 'd', omitable = true);
715  parameter -> SetDefaultValue (0.);
716  fpCommand -> SetParameter (parameter);
717  parameter = new G4UIparameter ("unit", 's', omitable = true);
718  parameter -> SetDefaultValue ("m");
719  fpCommand -> SetParameter (parameter);
720 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandSceneAddExtent::~G4VisCommandSceneAddExtent ( )
virtual

Definition at line 722 of file G4VisCommandsSceneAdd.cc.

722  {
723  delete fpCommand;
724 }

Member Function Documentation

G4String G4VisCommandSceneAddExtent::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 726 of file G4VisCommandsSceneAdd.cc.

726  {
727  return "";
728 }
void G4VisCommandSceneAddExtent::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 730 of file G4VisCommandsSceneAdd.cc.

731 {
733  G4bool warn(verbosity >= G4VisManager::warnings);
734 
735  G4Scene* pScene = fpVisManager->GetCurrentScene();
736  if (!pScene) {
737  if (verbosity >= G4VisManager::errors) {
738  G4cerr << "ERROR: No current scene. Please create one." << G4endl;
739  }
740  return;
741  }
742 
743  G4double xmin, xmax, ymin, ymax, zmin, zmax;
744  G4String unitString;
745  std::istringstream is(newValue);
746  is >> xmin >> xmax >> ymin >> ymax >> zmin >> zmax >> unitString;
747  G4double unit = G4UIcommand::ValueOf(unitString);
748  xmin *= unit; xmax *= unit;
749  ymin *= unit; ymax *= unit;
750  zmin *= unit; zmax *= unit;
751 
752  G4VisExtent visExtent(xmin, xmax, ymin, ymax, zmin, zmax);
753  Extent* extent = new Extent(xmin, xmax, ymin, ymax, zmin, zmax);
754  G4VModel* model =
756  model->SetType("Extent");
757  model->SetGlobalTag("Extent");
758  model->SetGlobalDescription("Extent: " + newValue);
759  model->SetExtent(visExtent);
760  const G4String& currentSceneName = pScene -> GetName ();
761  G4bool successful = pScene -> AddRunDurationModel (model, warn);
762  if (successful) {
763  if (verbosity >= G4VisManager::confirmations) {
764  G4cout << "A benign model with extent "
765  << visExtent
766  << " has been added to scene \""
767  << currentSceneName << "\"."
768  << G4endl;
769  }
770  }
771  else G4VisCommandsSceneAddUnsuccessful(verbosity);
772  UpdateVisManagerScene (currentSceneName);
773 }
void SetGlobalTag(const G4String &)
void UpdateVisManagerScene(const G4String &sceneName="")
void SetExtent(const G4VisExtent &)
static void G4VisCommandsSceneAddUnsuccessful(G4VisManager::Verbosity verbosity)
G4GLOB_DLL std::ostream G4cout
bool G4bool
Definition: G4Types.hh:79
void SetType(const G4String &)
static G4double ValueOf(const char *unitName)
Definition: G4UIcommand.cc:309
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: