Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions
G4VisCommandViewerCopyViewFrom Class Reference

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerCopyViewFrom:
G4VVisCommandViewer G4VVisCommand G4UImessenger

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
 

Additional Inherited Members

- Static Public Member Functions inherited from G4VVisCommand
static void SetVisManager (G4VisManager *)
 
- 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
 
- Static Protected Attributes inherited from G4VVisCommand
static G4VisManagerfpVisManager = 0
 
static G4Colour fCurrentColour = G4Colour::White()
 
static G4Colour fCurrentTextColour = G4Colour::Blue()
 
static G4Text::Layout fCurrentTextLayout = G4Text::left
 
static G4double fCurrentLineWidth = 1.
 
static
G4ModelingParameters::PVNameCopyNoPath 
fCurrentTouchablePath
 

Detailed Description

Definition at line 131 of file G4VisCommandsViewer.hh.

Constructor & Destructor Documentation

G4VisCommandViewerCopyViewFrom::G4VisCommandViewerCopyViewFrom ( )

Definition at line 511 of file G4VisCommandsViewer.cc.

511  {
512  G4bool omitable;
513  fpCommand = new G4UIcmdWithAString ("/vis/viewer/copyViewFrom", this);
514  fpCommand -> SetGuidance
515  ("Copy the camera-specific parameters from the specified viewer.");
516  fpCommand -> SetGuidance
517  ("Note: To copy scene modifications - style, etc. - please use"
518  "\n\"/vis/viewer/set/all\"");
519  fpCommand -> SetParameterName ("from-viewer-name", omitable = false);
520 }
bool G4bool
Definition: G4Types.hh:79
G4VisCommandViewerCopyViewFrom::~G4VisCommandViewerCopyViewFrom ( )
virtual

Definition at line 522 of file G4VisCommandsViewer.cc.

522  {
523  delete fpCommand;
524 }

Member Function Documentation

G4String G4VisCommandViewerCopyViewFrom::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 526 of file G4VisCommandsViewer.cc.

526  {
527  return "";
528 }
void G4VisCommandViewerCopyViewFrom::SetNewValue ( G4UIcommand command,
G4String  newValue 
)
virtual

Reimplemented from G4UImessenger.

Definition at line 530 of file G4VisCommandsViewer.cc.

References G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4ViewParameters::GetCurrentTargetPoint(), G4VisManager::GetCurrentViewer(), G4ViewParameters::GetDolly(), G4ViewParameters::GetFieldHalfAngle(), G4ViewParameters::GetLightpointDirection(), G4ViewParameters::GetLightsMoveWithCamera(), G4VViewer::GetName(), G4ViewParameters::GetScaleFactor(), G4ViewParameters::GetUpVector(), G4VisManager::GetVerbosity(), G4VViewer::GetViewParameters(), G4ViewParameters::GetViewpointDirection(), G4ViewParameters::GetZoomFactor(), G4ViewParameters::SetCurrentTargetPoint(), G4ViewParameters::SetDolly(), G4ViewParameters::SetFieldHalfAngle(), G4ViewParameters::SetLightpointDirection(), G4ViewParameters::SetLightsMoveWithCamera(), G4ViewParameters::SetScaleFactor(), G4ViewParameters::SetUpVector(), G4VVisCommandViewer::SetViewParameters(), G4ViewParameters::SetViewpointDirection(), G4ViewParameters::SetZoomFactor(), and G4VisManager::warnings.

530  {
531 
533 
534  G4VViewer* currentViewer = fpVisManager->GetCurrentViewer();
535  if (!currentViewer) {
536  if (verbosity >= G4VisManager::errors) {
537  G4cout <<
538  "ERROR: G4VisCommandsViewerCopyViewFrom::SetNewValue: no current viewer."
539  << G4endl;
540  }
541  return;
542  }
543 
544  const G4String& fromViewerName = newValue;
545  G4VViewer* fromViewer = fpVisManager -> GetViewer (fromViewerName);
546  if (!fromViewer) {
547  if (verbosity >= G4VisManager::errors) {
548  G4cout << "ERROR: Viewer \"" << fromViewerName
549  << "\" not found - \"/vis/viewer/list\" to see possibilities."
550  << G4endl;
551  }
552  return;
553  }
554 
555  if (fromViewer == currentViewer) {
556  if (verbosity >= G4VisManager::warnings) {
557  G4cout <<
558  "WARNING: G4VisCommandsViewerSet::SetNewValue:"
559  "\n from-viewer and current viewer are identical."
560  << G4endl;
561  }
562  return;
563  }
564 
565  // Copy camera-specific view parameters
566  G4ViewParameters vp = currentViewer->GetViewParameters();
567  const G4ViewParameters& fromVP = fromViewer->GetViewParameters();
571  vp.SetUpVector (fromVP.GetUpVector());
572  vp.SetFieldHalfAngle (fromVP.GetFieldHalfAngle());
573  vp.SetZoomFactor (fromVP.GetZoomFactor());
574  vp.SetScaleFactor (fromVP.GetScaleFactor());
576  vp.SetDolly (fromVP.GetDolly());
577  SetViewParameters(currentViewer, vp);
578 
579  if (verbosity >= G4VisManager::confirmations) {
580  G4cout << "Camera parameters of viewer \"" << currentViewer->GetName()
581  << "\"\n set to those of viewer \"" << fromViewer->GetName()
582  << "\"."
583  << G4endl;
584  }
585 }
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)
static G4VisManager * fpVisManager

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