Geant4  10.02.p03
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
 

Private Member Functions

 G4VisCommandViewerCopyViewFrom (const G4VisCommandViewerCopyViewFrom &)
 
G4VisCommandViewerCopyViewFromoperator= (const G4VisCommandViewerCopyViewFrom &)
 

Private Attributes

G4UIcmdWithAStringfpCommand
 

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

Constructor & Destructor Documentation

◆ G4VisCommandViewerCopyViewFrom() [1/2]

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::~G4VisCommandViewerCopyViewFrom ( )
virtual

Definition at line 522 of file G4VisCommandsViewer.cc.

522  {
523  delete fpCommand;
524 }

◆ G4VisCommandViewerCopyViewFrom() [2/2]

G4VisCommandViewerCopyViewFrom::G4VisCommandViewerCopyViewFrom ( const G4VisCommandViewerCopyViewFrom )
private

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 }

◆ operator=()

G4VisCommandViewerCopyViewFrom& G4VisCommandViewerCopyViewFrom::operator= ( const G4VisCommandViewerCopyViewFrom )
private

◆ 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  G4cerr <<
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  G4cerr << "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 }
G4VViewer * GetCurrentViewer() const
void SetLightpointDirection(const G4Vector3D &lightpointDirection)
void SetScaleFactor(const G4Vector3D &scaleFactor)
void SetUpVector(const G4Vector3D &upVector)
void SetViewParameters(G4VViewer *, const G4ViewParameters &)
void SetLightsMoveWithCamera(G4bool moves)
const G4Vector3D & GetUpVector() const
G4double GetZoomFactor() 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
G4double GetDolly() const
const G4Point3D & GetCurrentTargetPoint() const
const G4Vector3D & GetLightpointDirection() const
static Verbosity GetVerbosity()
const G4ViewParameters & GetViewParameters() const
const G4String & GetName() const
#define G4endl
Definition: G4ios.hh:61
G4double GetFieldHalfAngle() const
void SetViewpointDirection(const G4Vector3D &viewpointDirection)
G4bool GetLightsMoveWithCamera() const
G4GLOB_DLL std::ostream G4cerr
static G4VisManager * fpVisManager
Here is the call graph for this function:

Member Data Documentation

◆ fpCommand

G4UIcmdWithAString* G4VisCommandViewerCopyViewFrom::fpCommand
private

Definition at line 141 of file G4VisCommandsViewer.hh.


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