Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4VisCommandViewerCopyViewFrom Class Reference

#include <G4VisCommandsViewer.hh>

+ Inheritance 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)
 
virtual ~G4UImessenger ()
 
virtual G4String GetCurrentValue (G4UIcommand *command)
 
virtual void SetNewValue (G4UIcommand *command, G4String newValue)
 
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)
 
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::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:67

◆ ~G4VisCommandViewerCopyViewFrom()

G4VisCommandViewerCopyViewFrom::~G4VisCommandViewerCopyViewFrom ( )
virtual

Definition at line 522 of file G4VisCommandsViewer.cc.

522 {
523 delete fpCommand;
524}

Member Function Documentation

◆ GetCurrentValue()

G4String G4VisCommandViewerCopyViewFrom::GetCurrentValue ( G4UIcommand command)
virtual

Reimplemented from G4UImessenger.

Definition at line 526 of file G4VisCommandsViewer.cc.

526 {
527 return "";
528}

◆ SetNewValue()

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

Reimplemented from G4UImessenger.

Definition at line 530 of file G4VisCommandsViewer.cc.

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());
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}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
const G4String & GetName() const
const G4ViewParameters & GetViewParameters() const
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
static G4VisManager * fpVisManager
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
void SetScaleFactor(const G4Vector3D &scaleFactor)
const G4Vector3D & GetScaleFactor() const
void SetCurrentTargetPoint(const G4Point3D &currentTargetPoint)
const G4Vector3D & GetLightpointDirection() const
void SetFieldHalfAngle(G4double fieldHalfAngle)
const G4Vector3D & GetViewpointDirection() const
const G4Point3D & GetCurrentTargetPoint() const
G4double GetFieldHalfAngle() const
G4double GetZoomFactor() const
void SetDolly(G4double dolly)
const G4Vector3D & GetUpVector() const
void SetZoomFactor(G4double zoomFactor)
void SetUpVector(const G4Vector3D &upVector)
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
void SetLightsMoveWithCamera(G4bool moves)
G4bool GetLightsMoveWithCamera() const
G4double GetDolly() const
G4VViewer * GetCurrentViewer() const
static Verbosity GetVerbosity()

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