Geant4  10.02.p03
G4VisCommandViewerPan Class Reference

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerPan:
Collaboration diagram for G4VisCommandViewerPan:

Public Member Functions

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

 G4VisCommandViewerPan (const G4VisCommandViewerPan &)
 
G4VisCommandViewerPanoperator= (const G4VisCommandViewerPan &)
 

Private Attributes

G4UIcommandfpCommandPan
 
G4UIcommandfpCommandPanTo
 
G4double fPanIncrementRight
 
G4double fPanIncrementUp
 
G4double fPanToRight
 
G4double fPanToUp
 

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

Constructor & Destructor Documentation

◆ G4VisCommandViewerPan() [1/2]

G4VisCommandViewerPan::G4VisCommandViewerPan ( )

Definition at line 1013 of file G4VisCommandsViewer.cc.

1013  :
1014  fPanIncrementRight (0.),
1015  fPanIncrementUp (0.),
1016  fPanToRight (0.),
1017  fPanToUp (0.)
1018 {
1019  G4bool omitable;
1020 
1022  ("/vis/viewer/pan", this);
1023  fpCommandPan -> SetGuidance
1024  ("Incremental pan.");
1025  fpCommandPan -> SetGuidance
1026  ("Moves the camera incrementally right and up by these amounts (as seen"
1027  "\nfrom viewpoint direction).");
1028  G4UIparameter* parameter;
1029  parameter = new G4UIparameter("right-increment", 'd', omitable = true);
1030  parameter -> SetCurrentAsDefault (true);
1031  fpCommandPan -> SetParameter (parameter);
1032  parameter = new G4UIparameter("up-increment", 'd', omitable = true);
1033  parameter -> SetCurrentAsDefault (true);
1034  fpCommandPan -> SetParameter (parameter);
1035  parameter = new G4UIparameter ("unit", 's', omitable = true);
1036  parameter -> SetDefaultValue ("m");
1037  fpCommandPan -> SetParameter (parameter);
1038 
1040  ("/vis/viewer/panTo", this);
1041  fpCommandPanTo -> SetGuidance
1042  ("Pan to specific coordinate.");
1043  fpCommandPanTo -> SetGuidance
1044  ("Places the camera in this position right and up relative to standard"
1045  "\ntarget point (as seen from viewpoint direction).");
1046  parameter = new G4UIparameter("right", 'd', omitable = true);
1047  parameter -> SetCurrentAsDefault (true);
1048  fpCommandPanTo -> SetParameter (parameter);
1049  parameter = new G4UIparameter("up", 'd', omitable = true);
1050  parameter -> SetCurrentAsDefault (true);
1051  fpCommandPanTo -> SetParameter (parameter);
1052  parameter = new G4UIparameter ("unit", 's', omitable = true);
1053  parameter -> SetDefaultValue ("m");
1054  fpCommandPanTo -> SetParameter (parameter);
1055 }
bool G4bool
Definition: G4Types.hh:79

◆ ~G4VisCommandViewerPan()

G4VisCommandViewerPan::~G4VisCommandViewerPan ( )
virtual

Definition at line 1057 of file G4VisCommandsViewer.cc.

1057  {
1058  delete fpCommandPan;
1059  delete fpCommandPanTo;
1060 }

◆ G4VisCommandViewerPan() [2/2]

G4VisCommandViewerPan::G4VisCommandViewerPan ( const G4VisCommandViewerPan )
private

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandViewerPan::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1062 of file G4VisCommandsViewer.cc.

1062  {
1063  G4String currentValue;
1064  if (command == fpCommandPan) {
1065  currentValue = ConvertToString(fPanIncrementRight, fPanIncrementUp, "m");
1066  }
1067  else if (command == fpCommandPanTo) {
1068  currentValue = ConvertToString(fPanToRight, fPanToUp, "m");
1069  }
1070  return currentValue;
1071 }
static G4String ConvertToString(G4double x, G4double y, const char *unitName)
Here is the call graph for this function:

◆ operator=()

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

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 1073 of file G4VisCommandsViewer.cc.

1074  {
1075 
1076 
1078 
1079  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
1080  if (!currentViewer) {
1081  if (verbosity >= G4VisManager::errors) {
1082  G4cerr <<
1083  "ERROR: G4VisCommandsViewerPan::SetNewValue: no current viewer."
1084  << G4endl;
1085  }
1086  return;
1087  }
1088 
1089  G4ViewParameters vp = currentViewer->GetViewParameters();
1090 
1091  if (command == fpCommandPan) {
1094  }
1095  else if (command == fpCommandPanTo) {
1098  }
1099 
1100  if (verbosity >= G4VisManager::confirmations) {
1101  G4cout << "Current target point now " << vp.GetCurrentTargetPoint()
1102  << G4endl;
1103  }
1104 
1105  SetViewParameters(currentViewer, vp);
1106 }
void IncrementPan(G4double right, G4double up)
G4VViewer * GetCurrentViewer() const
void SetPan(G4double right, G4double up)
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
G4GLOB_DLL std::ostream G4cout
const G4Point3D & GetCurrentTargetPoint() const
static Verbosity GetVerbosity()
const G4ViewParameters & GetViewParameters() const
#define G4endl
Definition: G4ios.hh:61
static void ConvertToDoublePair(const G4String &paramString, G4double &xval, G4double &yval)
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager
Here is the call graph for this function:

Member Data Documentation

◆ fPanIncrementRight

G4double G4VisCommandViewerPan::fPanIncrementRight
private

Definition at line 208 of file G4VisCommandsViewer.hh.

◆ fPanIncrementUp

G4double G4VisCommandViewerPan::fPanIncrementUp
private

Definition at line 208 of file G4VisCommandsViewer.hh.

◆ fPanToRight

G4double G4VisCommandViewerPan::fPanToRight
private

Definition at line 209 of file G4VisCommandsViewer.hh.

◆ fPanToUp

G4double G4VisCommandViewerPan::fPanToUp
private

Definition at line 209 of file G4VisCommandsViewer.hh.

◆ fpCommandPan

G4UIcommand* G4VisCommandViewerPan::fpCommandPan
private

Definition at line 206 of file G4VisCommandsViewer.hh.

◆ fpCommandPanTo

G4UIcommand* G4VisCommandViewerPan::fpCommandPanTo
private

Definition at line 207 of file G4VisCommandsViewer.hh.


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