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

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerZoom:
Collaboration diagram for G4VisCommandViewerZoom:

Public Member Functions

 G4VisCommandViewerZoom ()
 
virtual ~G4VisCommandViewerZoom ()
 
G4String GetCurrentValue (G4UIcommand *command)
 
void SetNewValue (G4UIcommand *command, G4String newValue)
 
- Public Member Functions inherited from G4VVisCommandViewer
 G4VVisCommandViewer ()
 
virtual ~G4VVisCommandViewer ()
 
- 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 G4VVisCommandViewer
void SetViewParameters (G4VViewer *, const G4ViewParameters &)
 
void RefreshIfRequired (G4VViewer *)
 
- 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 323 of file G4VisCommandsViewer.hh.

Constructor & Destructor Documentation

G4VisCommandViewerZoom::G4VisCommandViewerZoom ( )

Definition at line 1953 of file G4VisCommandsViewer.cc.

1953  :
1954  fZoomMultiplier (1.),
1955  fZoomTo (1.)
1956 {
1957  G4bool omitable, currentAsDefault;
1958 
1959  fpCommandZoom = new G4UIcmdWithADouble
1960  ("/vis/viewer/zoom", this);
1961  fpCommandZoom -> SetGuidance ("Incremental zoom.");
1962  fpCommandZoom -> SetGuidance
1963  ("Multiplies current magnification by this factor.");
1964  fpCommandZoom -> SetParameterName("multiplier",
1965  omitable=true,
1966  currentAsDefault=true);
1967 
1968  fpCommandZoomTo = new G4UIcmdWithADouble
1969  ("/vis/viewer/zoomTo", this);
1970  fpCommandZoomTo -> SetGuidance ("Absolute zoom.");
1971  fpCommandZoomTo -> SetGuidance
1972  ("Magnifies standard magnification by this factor.");
1973  fpCommandZoomTo -> SetParameterName("factor",
1974  omitable=true,
1975  currentAsDefault=true);
1976 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandViewerZoom::~G4VisCommandViewerZoom ( )
virtual

Definition at line 1978 of file G4VisCommandsViewer.cc.

1978  {
1979  delete fpCommandZoom;
1980  delete fpCommandZoomTo;
1981 }

Member Function Documentation

G4String G4VisCommandViewerZoom::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1983 of file G4VisCommandsViewer.cc.

1983  {
1984  G4String currentValue;
1985  if (command == fpCommandZoom) {
1986  currentValue = fpCommandZoom->ConvertToString(fZoomMultiplier);
1987  }
1988  else if (command == fpCommandZoomTo) {
1989  currentValue = fpCommandZoomTo->ConvertToString(fZoomTo);
1990  }
1991  return currentValue;
1992 }
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:372

Here is the call graph for this function:

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

Reimplemented from G4UImessenger.

Definition at line 1994 of file G4VisCommandsViewer.cc.

1995  {
1996 
1997 
1999 
2000  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
2001  if (!currentViewer) {
2002  if (verbosity >= G4VisManager::errors) {
2003  G4cerr <<
2004  "ERROR: G4VisCommandsViewerZoom::SetNewValue: no current viewer."
2005  << G4endl;
2006  }
2007  return;
2008  }
2009 
2010  G4ViewParameters vp = currentViewer->GetViewParameters();
2011 
2012  if (command == fpCommandZoom) {
2013  fZoomMultiplier = fpCommandZoom->GetNewDoubleValue(newValue);
2014  vp.MultiplyZoomFactor(fZoomMultiplier);
2015  }
2016  else if (command == fpCommandZoomTo) {
2017  fZoomTo = fpCommandZoom->GetNewDoubleValue(newValue);
2018  vp.SetZoomFactor(fZoomTo);
2019  }
2020 
2021  if (verbosity >= G4VisManager::confirmations) {
2022  G4cout << "Zoom factor changed to " << vp.GetZoomFactor() << G4endl;
2023  }
2024 
2025  SetViewParameters(currentViewer, vp);
2026 }
G4double GetZoomFactor() const
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
G4GLOB_DLL std::ostream G4cout
void SetZoomFactor(G4double zoomFactor)
static G4double GetNewDoubleValue(const char *paramString)
void MultiplyZoomFactor(G4double zoomFactorMultiplier)
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
G4VViewer * GetCurrentViewer() 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: