G4VisCommandViewerAddCutawayPlane Class Reference

#include <G4VisCommandsViewer.hh>

Inheritance diagram for G4VisCommandViewerAddCutawayPlane:

G4VVisCommandViewer G4VVisCommand G4UImessenger

Public Member Functions

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

Detailed Description

Definition at line 57 of file G4VisCommandsViewer.hh.


Constructor & Destructor Documentation

G4VisCommandViewerAddCutawayPlane::G4VisCommandViewerAddCutawayPlane (  ) 

Definition at line 78 of file G4VisCommandsViewer.cc.

References G4UIcommand::SetParameter().

00078                                                                       {
00079   G4bool omitable;
00080   fpCommand = new G4UIcommand ("/vis/viewer/addCutawayPlane", this);
00081   fpCommand -> SetGuidance
00082     ("Add cutaway plane to current viewer.");
00083   G4UIparameter* parameter;
00084   parameter  =  new G4UIparameter("x",'d',omitable = true);
00085   parameter  -> SetDefaultValue  (0);
00086   parameter  -> SetGuidance      ("Coordinate of point on the plane.");
00087   fpCommand->SetParameter(parameter);
00088   parameter  =  new G4UIparameter("y",'d',omitable = true);
00089   parameter  -> SetDefaultValue  (0);
00090   parameter  -> SetGuidance      ("Coordinate of point on the plane.");
00091   fpCommand->SetParameter(parameter);
00092   parameter  =  new G4UIparameter("z",'d',omitable = true);
00093   parameter  -> SetDefaultValue  (0);
00094   parameter  -> SetGuidance      ("Coordinate of point on the plane.");
00095   fpCommand->SetParameter(parameter);
00096   parameter  =  new G4UIparameter("unit",'s',omitable = true);
00097   parameter  -> SetDefaultValue  ("m");
00098   parameter  -> SetGuidance      ("Unit of point on the plane.");
00099   fpCommand->SetParameter(parameter);
00100   parameter  =  new G4UIparameter("nx",'d',omitable = true);
00101   parameter  -> SetDefaultValue  (1);
00102   parameter  -> SetGuidance      ("Component of plane normal.");
00103   fpCommand->SetParameter(parameter);
00104   parameter  =  new G4UIparameter("ny",'d',omitable = true);
00105   parameter  -> SetDefaultValue  (0);
00106   parameter  -> SetGuidance      ("Component of plane normal.");
00107   fpCommand->SetParameter(parameter);
00108   parameter  =  new G4UIparameter("nz",'d',omitable = true);
00109   parameter  -> SetDefaultValue  (0);
00110   parameter  -> SetGuidance      ("Component of plane normal.");
00111   fpCommand->SetParameter(parameter);
00112 }

G4VisCommandViewerAddCutawayPlane::~G4VisCommandViewerAddCutawayPlane (  )  [virtual]

Definition at line 114 of file G4VisCommandsViewer.cc.

00114                                                                        {
00115   delete fpCommand;
00116 }


Member Function Documentation

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

Reimplemented from G4UImessenger.

Definition at line 118 of file G4VisCommandsViewer.cc.

00118                                                                          {
00119   return "";
00120 }

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

Reimplemented from G4UImessenger.

Definition at line 122 of file G4VisCommandsViewer.cc.

References G4ViewParameters::AddCutawayPlane(), G4VisManager::confirmations, G4VisManager::errors, G4VVisCommand::fpVisManager, G4cout, G4endl, G4ViewParameters::GetCutawayPlanes(), G4VViewer::GetName(), G4VisManager::GetVerbosity(), G4VViewer::GetViewParameters(), G4VVisCommandViewer::SetViewParameters(), and G4UIcommand::ValueOf().

00122                                                                                     {
00123 
00124   G4VisManager::Verbosity verbosity = fpVisManager->GetVerbosity();
00125 
00126   G4VViewer* viewer = fpVisManager -> GetCurrentViewer ();
00127   if (!viewer) {
00128     if (verbosity >= G4VisManager::errors) {
00129       G4cout <<
00130   "ERROR: No current viewer - \"/vis/viewer/list\" to see possibilities."
00131              << G4endl;
00132     }
00133     return;
00134   }
00135 
00136   G4double x, y, z, nx, ny, nz;
00137   G4String unit;
00138   std::istringstream is (newValue);
00139   is >> x >> y >> z >> unit >> nx >> ny >> nz;
00140   G4double F = G4UIcommand::ValueOf(unit);
00141   x *= F; y *= F; z *= F;
00142 
00143   G4ViewParameters vp = viewer->GetViewParameters();
00144   vp.AddCutawayPlane(G4Plane3D(G4Normal3D(nx,ny,nz), G4Point3D(x,y,z)));
00145   if (verbosity >= G4VisManager::confirmations) {
00146     G4cout << "Cutaway planes for viewer \"" << viewer->GetName() << "\" now:";
00147     const G4Planes& cutaways = vp.GetCutawayPlanes();
00148     for (size_t i = 0; i < cutaways.size(); ++i)
00149       G4cout << "\n  " << i << ": " << cutaways[i];
00150     G4cout << G4endl;
00151   }
00152 
00153   SetViewParameters(viewer, vp);
00154 }


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