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

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerCopyViewFrom:
Collaboration diagram for G4VisCommandViewerCopyViewFrom:

Public Member Functions

 G4VisCommandViewerCopyViewFrom ()
 
virtual ~G4VisCommandViewerCopyViewFrom ()
 
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 143 of file G4VisCommandsViewer.hh.

Constructor & Destructor Documentation

G4VisCommandViewerCopyViewFrom::G4VisCommandViewerCopyViewFrom ( )

Definition at line 564 of file G4VisCommandsViewer.cc.

564  {
565  G4bool omitable;
566  fpCommand = new G4UIcmdWithAString ("/vis/viewer/copyViewFrom", this);
567  fpCommand -> SetGuidance
568  ("Copy the camera-specific parameters from the specified viewer.");
569  fpCommand -> SetGuidance
570  ("Note: To copy scene modifications - style, etc. - please use"
571  "\n\"/vis/viewer/set/all\"");
572  fpCommand -> SetParameterName ("from-viewer-name", omitable = false);
573 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandViewerCopyViewFrom::~G4VisCommandViewerCopyViewFrom ( )
virtual

Definition at line 575 of file G4VisCommandsViewer.cc.

575  {
576  delete fpCommand;
577 }

Member Function Documentation

G4String G4VisCommandViewerCopyViewFrom::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 579 of file G4VisCommandsViewer.cc.

579  {
580  return "";
581 }
void G4VisCommandViewerCopyViewFrom::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 583 of file G4VisCommandsViewer.cc.

583  {
584 
586 
587  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
588  if (!currentViewer) {
589  if (verbosity >= G4VisManager::errors) {
590  G4cerr <<
591  "ERROR: G4VisCommandsViewerCopyViewFrom::SetNewValue: no current viewer."
592  << G4endl;
593  }
594  return;
595  }
596 
597  const G4String& fromViewerName = newValue;
598  G4VViewer* fromViewer = fpVisManager -> GetViewer (fromViewerName);
599  if (!fromViewer) {
600  if (verbosity >= G4VisManager::errors) {
601  G4cerr << "ERROR: Viewer \"" << fromViewerName
602  << "\" not found - \"/vis/viewer/list\" to see possibilities."
603  << G4endl;
604  }
605  return;
606  }
607 
608  if (fromViewer == currentViewer) {
609  if (verbosity >= G4VisManager::warnings) {
610  G4cout <<
611  "WARNING: G4VisCommandsViewerSet::SetNewValue:"
612  "\n from-viewer and current viewer are identical."
613  << G4endl;
614  }
615  return;
616  }
617 
618  // Copy camera-specific view parameters
619  G4ViewParameters vp = currentViewer->GetViewParameters();
620  const G4ViewParameters& fromVP = fromViewer->GetViewParameters();
624  vp.SetUpVector (fromVP.GetUpVector());
625  vp.SetFieldHalfAngle (fromVP.GetFieldHalfAngle());
626  vp.SetZoomFactor (fromVP.GetZoomFactor());
627  vp.SetScaleFactor (fromVP.GetScaleFactor());
629  vp.SetDolly (fromVP.GetDolly());
630  SetViewParameters(currentViewer, vp);
631 
632  if (verbosity >= G4VisManager::confirmations) {
633  G4cout << "Camera parameters of viewer \"" << currentViewer->GetName()
634  << "\"\n set to those of viewer \"" << fromViewer->GetName()
635  << "\"."
636  << G4endl;
637  }
638 }
const G4String & GetName() const
G4double GetZoomFactor() const
G4double GetDolly() const
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
void SetScaleFactor(const G4Vector3D &scaleFactor)
void SetUpVector(const G4Vector3D &upVector)
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
void SetLightsMoveWithCamera(G4bool moves)
const G4Point3D & GetCurrentTargetPoint() const
const G4Vector3D & GetLightpointDirection() const
const G4Vector3D & GetViewpointDirection() const
G4GLOB_DLL std::ostream G4cout
void SetZoomFactor(G4double zoomFactor)
void SetCurrentTargetPoint(const G4Point3D &currentTargetPoint)
void SetDolly(G4double dolly)
void SetFieldHalfAngle(G4double fieldHalfAngle)
const G4Vector3D & GetScaleFactor() const
static Verbosity GetVerbosity()
G4bool GetLightsMoveWithCamera() const
#define G4endl
Definition: G4ios.hh:61
G4VViewer * GetCurrentViewer() const
G4double GetFieldHalfAngle() const
const G4Vector3D & GetUpVector() const
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
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: