Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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
 

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

Constructor & Destructor Documentation

G4VisCommandViewerPan::G4VisCommandViewerPan ( )

Definition at line 1304 of file G4VisCommandsViewer.cc.

1304  :
1305  fPanIncrementRight (0.),
1306  fPanIncrementUp (0.),
1307  fPanToRight (0.),
1308  fPanToUp (0.)
1309 {
1310  G4bool omitable;
1311 
1312  fpCommandPan = new G4UIcommand
1313  ("/vis/viewer/pan", this);
1314  fpCommandPan -> SetGuidance
1315  ("Incremental pan.");
1316  fpCommandPan -> SetGuidance
1317  ("Moves the camera incrementally right and up by these amounts (as seen"
1318  "\nfrom viewpoint direction).");
1319  G4UIparameter* parameter;
1320  parameter = new G4UIparameter("right-increment", 'd', omitable = true);
1321  parameter -> SetCurrentAsDefault (true);
1322  fpCommandPan -> SetParameter (parameter);
1323  parameter = new G4UIparameter("up-increment", 'd', omitable = true);
1324  parameter -> SetCurrentAsDefault (true);
1325  fpCommandPan -> SetParameter (parameter);
1326  parameter = new G4UIparameter ("unit", 's', omitable = true);
1327  parameter -> SetDefaultValue ("m");
1328  fpCommandPan -> SetParameter (parameter);
1329 
1330  fpCommandPanTo = new G4UIcommand
1331  ("/vis/viewer/panTo", this);
1332  fpCommandPanTo -> SetGuidance
1333  ("Pan to specific coordinate.");
1334  fpCommandPanTo -> SetGuidance
1335  ("Places the camera in this position right and up relative to standard"
1336  "\ntarget point (as seen from viewpoint direction).");
1337  parameter = new G4UIparameter("right", 'd', omitable = true);
1338  parameter -> SetCurrentAsDefault (true);
1339  fpCommandPanTo -> SetParameter (parameter);
1340  parameter = new G4UIparameter("up", 'd', omitable = true);
1341  parameter -> SetCurrentAsDefault (true);
1342  fpCommandPanTo -> SetParameter (parameter);
1343  parameter = new G4UIparameter ("unit", 's', omitable = true);
1344  parameter -> SetDefaultValue ("m");
1345  fpCommandPanTo -> SetParameter (parameter);
1346 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandViewerPan::~G4VisCommandViewerPan ( )
virtual

Definition at line 1348 of file G4VisCommandsViewer.cc.

1348  {
1349  delete fpCommandPan;
1350  delete fpCommandPanTo;
1351 }

Member Function Documentation

G4String G4VisCommandViewerPan::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 1353 of file G4VisCommandsViewer.cc.

1353  {
1354  G4String currentValue;
1355  if (command == fpCommandPan) {
1356  currentValue = ConvertToString(fPanIncrementRight, fPanIncrementUp, "m");
1357  }
1358  else if (command == fpCommandPanTo) {
1359  currentValue = ConvertToString(fPanToRight, fPanToUp, "m");
1360  }
1361  return currentValue;
1362 }
static G4String ConvertToString(G4double x, G4double y, const char *unitName)

Here is the call graph for this function:

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

Reimplemented from G4UImessenger.

Definition at line 1364 of file G4VisCommandsViewer.cc.

1365  {
1366 
1367 
1369 
1370  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
1371  if (!currentViewer) {
1372  if (verbosity >= G4VisManager::errors) {
1373  G4cerr <<
1374  "ERROR: G4VisCommandsViewerPan::SetNewValue: no current viewer."
1375  << G4endl;
1376  }
1377  return;
1378  }
1379 
1380  G4ViewParameters vp = currentViewer->GetViewParameters();
1381 
1382  if (command == fpCommandPan) {
1383  ConvertToDoublePair(newValue, fPanIncrementRight, fPanIncrementUp);
1384  vp.IncrementPan(fPanIncrementRight, fPanIncrementUp);
1385  }
1386  else if (command == fpCommandPanTo) {
1387  ConvertToDoublePair(newValue, fPanToRight, fPanToUp);
1388  vp.SetPan(fPanToRight, fPanToUp);
1389  }
1390 
1391  if (verbosity >= G4VisManager::confirmations) {
1392  G4cout << "Current target point now " << vp.GetCurrentTargetPoint()
1393  << G4endl;
1394  }
1395 
1396  SetViewParameters(currentViewer, vp);
1397 }
void IncrementPan(G4double right, G4double up)
void SetPan(G4double right, G4double up)
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
const G4Point3D & GetCurrentTargetPoint() const
G4GLOB_DLL std::ostream G4cout
static Verbosity GetVerbosity()
#define G4endl
Definition: G4ios.hh:61
G4VViewer * GetCurrentViewer() const
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:


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