G4VisCommandViewerDolly Class Reference

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerDolly:

G4VVisCommandViewer G4VVisCommand G4UImessenger

Public Member Functions

 G4VisCommandViewerDolly ()
virtual ~G4VisCommandViewerDolly ()
G4String GetCurrentValue (G4UIcommand *command)
void SetNewValue (G4UIcommand *command, G4String newValue)

Detailed Description

Definition at line 158 of file G4VisCommandsViewer.hh.


Constructor & Destructor Documentation

G4VisCommandViewerDolly::G4VisCommandViewerDolly (  ) 

Definition at line 774 of file G4VisCommandsViewer.cc.

00774                                                  :
00775   fDollyIncrement  (0.),
00776   fDollyTo (0.)
00777 {
00778   G4bool omitable, currentAsDefault;
00779 
00780   fpCommandDolly = new G4UIcmdWithADoubleAndUnit
00781     ("/vis/viewer/dolly", this);
00782   fpCommandDolly -> SetGuidance
00783     ("Incremental dolly.");
00784   fpCommandDolly -> SetGuidance
00785     ("Moves the camera incrementally towards target point.");
00786   fpCommandDolly -> SetParameterName("increment",
00787                                      omitable=true,
00788                                      currentAsDefault=true);
00789   fpCommandDolly -> SetDefaultUnit("m");
00790 
00791   fpCommandDollyTo = new G4UIcmdWithADoubleAndUnit
00792     ("/vis/viewer/dollyTo", this);
00793   fpCommandDollyTo -> SetGuidance
00794     ("Dolly to specific coordinate.");
00795   fpCommandDollyTo -> SetGuidance
00796  ("Places the camera towards target point relative to standard camera point.");
00797   fpCommandDollyTo -> SetParameterName("distance",
00798                                        omitable=true,
00799                                        currentAsDefault=true);
00800   fpCommandDollyTo -> SetDefaultUnit("m");
00801 }

G4VisCommandViewerDolly::~G4VisCommandViewerDolly (  )  [virtual]

Definition at line 803 of file G4VisCommandsViewer.cc.

00803                                                    {
00804   delete fpCommandDolly;
00805   delete fpCommandDollyTo;
00806 }


Member Function Documentation

G4String G4VisCommandViewerDolly::GetCurrentValue ( G4UIcommand command  )  [virtual]

Reimplemented from G4UImessenger.

Definition at line 808 of file G4VisCommandsViewer.cc.

References G4UIcommand::ConvertToString().

00808                                                                        {
00809   G4String currentValue;
00810   if (command == fpCommandDolly) {
00811     currentValue = fpCommandDolly->ConvertToString(fDollyIncrement, "m");
00812   }
00813   else if (command == fpCommandDollyTo) {
00814     currentValue = fpCommandDollyTo->ConvertToString(fDollyTo, "m");
00815   }
00816   return currentValue;
00817 }

void G4VisCommandViewerDolly::SetNewValue ( G4UIcommand command,
G4String  newValue 
) [virtual]

Reimplemented from G4UImessenger.

Definition at line 819 of file G4VisCommandsViewer.cc.

References G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4VisManager::GetCurrentViewer(), G4ViewParameters::GetDolly(), G4UIcmdWithADoubleAndUnit::GetNewDoubleValue(), G4VisManager::GetVerbosity(), G4VViewer::GetViewParameters(), G4ViewParameters::IncrementDolly(), G4ViewParameters::SetDolly(), and G4VVisCommandViewer::SetViewParameters().

00820                                                               {
00821 
00822 
00823   G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
00824 
00825   G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
00826   if (!currentViewer) {
00827     if (verbosity >= G4VisManager::errors) {
00828       G4cout <<
00829         "ERROR: G4VisCommandsViewerDolly::SetNewValue: no current viewer."
00830              << G4endl;
00831     }
00832     return;
00833   }
00834 
00835   G4ViewParameters vp = currentViewer->GetViewParameters();
00836 
00837   if (command == fpCommandDolly) {
00838     fDollyIncrement = fpCommandDolly->GetNewDoubleValue(newValue);
00839     vp.IncrementDolly(fDollyIncrement);
00840   }
00841   else if (command == fpCommandDollyTo) {
00842     fDollyTo = fpCommandDolly->GetNewDoubleValue(newValue);
00843     vp.SetDolly(fDollyTo);
00844   }
00845 
00846   if (verbosity >= G4VisManager::confirmations) {
00847     G4cout << "Dolly distance changed to " << vp.GetDolly() << G4endl;
00848   }
00849 
00850   SetViewParameters(currentViewer, vp);
00851 }


The documentation for this class was generated from the following files:
Generated on Mon May 27 17:53:47 2013 for Geant4 by  doxygen 1.4.7