Geant4  10.02.p03
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
 

Private Member Functions

 G4VisCommandViewerZoom (const G4VisCommandViewerZoom &)
 
G4VisCommandViewerZoomoperator= (const G4VisCommandViewerZoom &)
 

Private Attributes

G4UIcmdWithADoublefpCommandZoom
 
G4UIcmdWithADoublefpCommandZoomTo
 
G4double fZoomMultiplier
 
G4double fZoomTo
 

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 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 299 of file G4VisCommandsViewer.hh.

Constructor & Destructor Documentation

◆ G4VisCommandViewerZoom() [1/2]

G4VisCommandViewerZoom::G4VisCommandViewerZoom ( )

Definition at line 1642 of file G4VisCommandsViewer.cc.

1642  :
1643  fZoomMultiplier (1.),
1644  fZoomTo (1.)
1645 {
1646  G4bool omitable, currentAsDefault;
1647 
1649  ("/vis/viewer/zoom", this);
1650  fpCommandZoom -> SetGuidance ("Incremental zoom.");
1651  fpCommandZoom -> SetGuidance
1652  ("Multiplies current magnification by this factor.");
1653  fpCommandZoom -> SetParameterName("multiplier",
1654  omitable=true,
1655  currentAsDefault=true);
1656 
1658  ("/vis/viewer/zoomTo", this);
1659  fpCommandZoomTo -> SetGuidance ("Absolute zoom.");
1660  fpCommandZoomTo -> SetGuidance
1661  ("Magnifies standard magnification by this factor.");
1662  fpCommandZoomTo -> SetParameterName("factor",
1663  omitable=true,
1664  currentAsDefault=true);
1665 }
G4UIcmdWithADouble * fpCommandZoom
bool G4bool
Definition: G4Types.hh:79
G4UIcmdWithADouble * fpCommandZoomTo

◆ ~G4VisCommandViewerZoom()

G4VisCommandViewerZoom::~G4VisCommandViewerZoom ( )
virtual

Definition at line 1667 of file G4VisCommandsViewer.cc.

1667  {
1668  delete fpCommandZoom;
1669  delete fpCommandZoomTo;
1670 }
G4UIcmdWithADouble * fpCommandZoom
G4UIcmdWithADouble * fpCommandZoomTo

◆ G4VisCommandViewerZoom() [2/2]

G4VisCommandViewerZoom::G4VisCommandViewerZoom ( const G4VisCommandViewerZoom )
private

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandViewerZoom::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1672 of file G4VisCommandsViewer.cc.

1672  {
1673  G4String currentValue;
1674  if (command == fpCommandZoom) {
1676  }
1677  else if (command == fpCommandZoomTo) {
1678  currentValue = fpCommandZoomTo->ConvertToString(fZoomTo);
1679  }
1680  return currentValue;
1681 }
G4UIcmdWithADouble * fpCommandZoom
static G4String ConvertToString(G4bool boolVal)
Definition: G4UIcommand.cc:371
G4UIcmdWithADouble * fpCommandZoomTo
Here is the call graph for this function:

◆ operator=()

G4VisCommandViewerZoom& G4VisCommandViewerZoom::operator= ( const G4VisCommandViewerZoom )
private

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 1683 of file G4VisCommandsViewer.cc.

1684  {
1685 
1686 
1688 
1689  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
1690  if (!currentViewer) {
1691  if (verbosity >= G4VisManager::errors) {
1692  G4cerr <<
1693  "ERROR: G4VisCommandsViewerZoom::SetNewValue: no current viewer."
1694  << G4endl;
1695  }
1696  return;
1697  }
1698 
1699  G4ViewParameters vp = currentViewer->GetViewParameters();
1700 
1701  if (command == fpCommandZoom) {
1704  }
1705  else if (command == fpCommandZoomTo) {
1707  vp.SetZoomFactor(fZoomTo);
1708  }
1709 
1710  if (verbosity >= G4VisManager::confirmations) {
1711  G4cout << "Zoom factor changed to " << vp.GetZoomFactor() << G4endl;
1712  }
1713 
1714  SetViewParameters(currentViewer, vp);
1715 }
G4UIcmdWithADouble * fpCommandZoom
G4VViewer * GetCurrentViewer() const
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
G4double GetZoomFactor() const
G4GLOB_DLL std::ostream G4cout
void SetZoomFactor(G4double zoomFactor)
static G4double GetNewDoubleValue(const char *paramString)
G4UIcmdWithADouble * fpCommandZoomTo
void MultiplyZoomFactor(G4double zoomFactorMultiplier)
static Verbosity GetVerbosity()
const G4ViewParameters & GetViewParameters() const
#define G4endl
Definition: G4ios.hh:61
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager
Here is the call graph for this function:

Member Data Documentation

◆ fpCommandZoom

G4UIcmdWithADouble* G4VisCommandViewerZoom::fpCommandZoom
private

Definition at line 308 of file G4VisCommandsViewer.hh.

◆ fpCommandZoomTo

G4UIcmdWithADouble* G4VisCommandViewerZoom::fpCommandZoomTo
private

Definition at line 309 of file G4VisCommandsViewer.hh.

◆ fZoomMultiplier

G4double G4VisCommandViewerZoom::fZoomMultiplier
private

Definition at line 310 of file G4VisCommandsViewer.hh.

◆ fZoomTo

G4double G4VisCommandViewerZoom::fZoomTo
private

Definition at line 311 of file G4VisCommandsViewer.hh.


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