Import Geant4 8.3.0 source tree
This commit is contained in:
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VSceneHandler.cc,v 1.77 2006/11/21 14:23:53 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VSceneHandler.cc,v 1.79 2007/01/11 16:38:14 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// John Allison 19th July 1996
|
||||
@@ -70,12 +70,15 @@
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4ModelingParameters.hh"
|
||||
#include "G4VTrajectory.hh"
|
||||
#include "G4VTrajectoryPoint.hh"
|
||||
#include "G4HitsModel.hh"
|
||||
#include "G4VHit.hh"
|
||||
#include "Randomize.hh"
|
||||
#include "G4StateManager.hh"
|
||||
#include "G4RunManager.hh"
|
||||
#include "G4Run.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
#include "G4AttHolder.hh"
|
||||
|
||||
G4VSceneHandler::G4VSceneHandler (G4VGraphicsSystem& system, G4int id, const G4String& name):
|
||||
fSystem (system),
|
||||
@@ -94,8 +97,7 @@ G4VSceneHandler::G4VSceneHandler (G4VGraphicsSystem& system, G4int id, const G4S
|
||||
fpModel (0),
|
||||
fpObjectTransformation (0),
|
||||
fNestingDepth (0),
|
||||
fpVisAttribs (0),
|
||||
fRequestedEvent (0)
|
||||
fpVisAttribs (0)
|
||||
{
|
||||
G4VisManager* pVMan = G4VisManager::GetInstance ();
|
||||
fpScene = pVMan -> GetCurrentScene ();
|
||||
@@ -420,14 +422,11 @@ void G4VSceneHandler::RequestPrimitives (const G4VSolid& solid) {
|
||||
BeginPrimitives (*fpObjectTransformation);
|
||||
G4NURBS* pNURBS = 0;
|
||||
G4Polyhedron* pPolyhedron = 0;
|
||||
const G4VisAttributes* pVisAttribs =
|
||||
fpViewer -> GetApplicableVisAttributes (fpVisAttribs);
|
||||
switch (fpViewer -> GetViewParameters () . GetRepStyle ()) {
|
||||
case G4ViewParameters::nurbs:
|
||||
pNURBS = solid.CreateNURBS ();
|
||||
if (pNURBS) {
|
||||
pNURBS -> SetVisAttributes
|
||||
(fpViewer -> GetApplicableVisAttributes (pVisAttribs));
|
||||
pNURBS -> SetVisAttributes (fpVisAttribs);
|
||||
AddPrimitive (*pNURBS);
|
||||
delete pNURBS;
|
||||
break;
|
||||
@@ -446,11 +445,11 @@ void G4VSceneHandler::RequestPrimitives (const G4VSolid& solid) {
|
||||
// Dropping through to polyhedron...
|
||||
case G4ViewParameters::polyhedron:
|
||||
default:
|
||||
G4Polyhedron::SetNumberOfRotationSteps (GetNoOfSides (pVisAttribs));
|
||||
G4Polyhedron::SetNumberOfRotationSteps (GetNoOfSides (fpVisAttribs));
|
||||
pPolyhedron = solid.GetPolyhedron ();
|
||||
G4Polyhedron::ResetNumberOfRotationSteps ();
|
||||
if (pPolyhedron) {
|
||||
pPolyhedron -> SetVisAttributes (pVisAttribs);
|
||||
pPolyhedron -> SetVisAttributes (fpVisAttribs);
|
||||
AddPrimitive (*pPolyhedron);
|
||||
}
|
||||
else {
|
||||
@@ -548,8 +547,8 @@ void G4VSceneHandler::ProcessScene (G4VViewer&) {
|
||||
|
||||
visManager->SetEventRefreshing(true);
|
||||
|
||||
if (fRequestedEvent) {
|
||||
DrawEvent(fRequestedEvent);
|
||||
if (visManager->GetRequestedEvent()) {
|
||||
DrawEvent(visManager->GetRequestedEvent());
|
||||
|
||||
} else {
|
||||
|
||||
@@ -707,6 +706,54 @@ const G4Polyhedron* G4VSceneHandler::CreateCutawayPolyhedron()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void G4VSceneHandler::LoadAtts(const G4Visible& visible, G4AttHolder* holder)
|
||||
{
|
||||
// Load G4Atts from G4VisAttributes, if any...
|
||||
const std::map<G4String,G4AttDef>* vaDefs =
|
||||
visible.GetVisAttributes()->GetAttDefs();
|
||||
if (vaDefs) {
|
||||
holder->AddAtts(visible.GetVisAttributes()->CreateAttValues(), vaDefs);
|
||||
}
|
||||
|
||||
G4PhysicalVolumeModel* pPVModel =
|
||||
dynamic_cast<G4PhysicalVolumeModel*>(fpModel);
|
||||
if (pPVModel) {
|
||||
// Load G4Atts from G4PhysicalVolumeModel...
|
||||
const std::map<G4String,G4AttDef>* defs = pPVModel->GetAttDefs();
|
||||
if (defs) {
|
||||
holder->AddAtts(pPVModel->CreateCurrentAttValues(), defs);
|
||||
}
|
||||
}
|
||||
|
||||
G4TrajectoriesModel* trajModel = dynamic_cast<G4TrajectoriesModel*>(fpModel);
|
||||
if (trajModel) {
|
||||
// Load G4Atts from trajectory...
|
||||
const G4VTrajectory* traj = trajModel->GetCurrentTrajectory();
|
||||
const std::map<G4String,G4AttDef>* defs = traj->GetAttDefs();
|
||||
if (defs) {
|
||||
holder->AddAtts(traj->CreateAttValues(), defs);
|
||||
}
|
||||
G4int nPoints = traj->GetPointEntries();
|
||||
for (G4int i = 0; i < nPoints; ++i) {
|
||||
G4VTrajectoryPoint* trajPoint = traj->GetPoint(i);
|
||||
const std::map<G4String,G4AttDef>* defs = trajPoint->GetAttDefs();
|
||||
if (defs) {
|
||||
holder->AddAtts(trajPoint->CreateAttValues(), defs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
G4HitsModel* hitsModel = dynamic_cast<G4HitsModel*>(fpModel);
|
||||
if (hitsModel) {
|
||||
// Load G4Atts from hit...
|
||||
const G4VHit* hit = hitsModel->GetCurrentHit();
|
||||
const std::map<G4String,G4AttDef>* defs = hit->GetAttDefs();
|
||||
if (defs) {
|
||||
holder->AddAtts(hit->CreateAttValues(), defs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const G4Colour& G4VSceneHandler::GetColour (const G4Visible& visible) {
|
||||
// Colour is determined by the applicable vis attributes.
|
||||
const G4Colour& colour = fpViewer ->
|
||||
@@ -723,10 +770,9 @@ const G4Colour& G4VSceneHandler::GetTextColour (const G4Text& text) {
|
||||
return colour;
|
||||
}
|
||||
|
||||
G4double G4VSceneHandler::GetLineWidth(const G4Visible& visible)
|
||||
G4double G4VSceneHandler::GetLineWidth(const G4VisAttributes* pVisAttribs)
|
||||
{
|
||||
G4double lineWidth = fpViewer->
|
||||
GetApplicableVisAttributes(visible.GetVisAttributes())->GetLineWidth();
|
||||
G4double lineWidth = pVisAttribs->GetLineWidth();
|
||||
if (lineWidth < 1.) lineWidth = 1.;
|
||||
lineWidth *= fpViewer -> GetViewParameters().GetGlobalLineWidthScale();
|
||||
if (lineWidth < 1.) lineWidth = 1.;
|
||||
@@ -738,7 +784,7 @@ G4ViewParameters::DrawingStyle G4VSceneHandler::GetDrawingStyle
|
||||
// Drawing style is normally determined by the view parameters, but
|
||||
// it can be overriddden by the ForceDrawingStyle flag in the vis
|
||||
// attributes.
|
||||
G4ViewParameters::DrawingStyle style =
|
||||
G4ViewParameters::DrawingStyle style =
|
||||
fpViewer->GetViewParameters().GetDrawingStyle();
|
||||
if (pVisAttribs -> IsForceDrawingStyle ()) {
|
||||
G4VisAttributes::ForcedDrawingStyle forcedStyle =
|
||||
@@ -810,15 +856,17 @@ G4int G4VSceneHandler::GetNoOfSides(const G4VisAttributes* pVisAttribs)
|
||||
// by the view parameters, but it can be overriddden by the
|
||||
// ForceLineSegmentsPerCircle in the vis attributes.
|
||||
G4int lineSegmentsPerCircle = fpViewer->GetViewParameters().GetNoOfSides();
|
||||
if (pVisAttribs->GetForcedLineSegmentsPerCircle() > 0)
|
||||
lineSegmentsPerCircle = pVisAttribs->GetForcedLineSegmentsPerCircle();
|
||||
const G4int nSegmentsMin = 12;
|
||||
if (lineSegmentsPerCircle < nSegmentsMin) {
|
||||
lineSegmentsPerCircle = nSegmentsMin;
|
||||
G4cout <<
|
||||
"G4VSceneHandler::GetNoOfSides: attempt to set the"
|
||||
"\nnumber of line segements per circle < " << nSegmentsMin
|
||||
<< "; forced to " << lineSegmentsPerCircle << G4endl;
|
||||
if (pVisAttribs) {
|
||||
if (pVisAttribs->IsForceLineSegmentsPerCircle())
|
||||
lineSegmentsPerCircle = pVisAttribs->GetForcedLineSegmentsPerCircle();
|
||||
const G4int nSegmentsMin = 12;
|
||||
if (lineSegmentsPerCircle < nSegmentsMin) {
|
||||
lineSegmentsPerCircle = nSegmentsMin;
|
||||
G4cout <<
|
||||
"G4VSceneHandler::GetNoOfSides: attempt to set the"
|
||||
"\nnumber of line segements per circle < " << nSegmentsMin
|
||||
<< "; forced to " << lineSegmentsPerCircle << G4endl;
|
||||
}
|
||||
}
|
||||
return lineSegmentsPerCircle;
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VViewer.cc,v 1.23 2006/06/29 21:29:26 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VViewer.cc,v 1.24 2007/01/05 16:25:15 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// John Allison 27th March 1996
|
||||
@@ -81,7 +81,7 @@ void G4VViewer::SetName (const G4String& name) {
|
||||
|
||||
const G4VisAttributes* G4VViewer::GetApplicableVisAttributes
|
||||
(const G4VisAttributes* pVisAttribs) const {
|
||||
// If the pointer is null, pick up the default vis attributes from
|
||||
// If pVisAttribs is zero, pick up the default vis attributes from
|
||||
// the view parameters.
|
||||
if (!pVisAttribs)
|
||||
pVisAttribs = GetViewParameters ().GetDefaultVisAttributes ();
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommands.cc,v 1.20 2006/11/26 15:49:10 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VisCommands.cc,v 1.21 2007/01/11 16:39:33 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
|
||||
// /vis/ top level commands - John Allison 5th February 2001
|
||||
|
||||
@@ -40,6 +40,30 @@
|
||||
#include "G4Run.hh"
|
||||
#include "G4UIsession.hh"
|
||||
|
||||
////////////// /vis/abortReviewKeptEvents /////////////////////////////
|
||||
|
||||
G4VisCommandAbortReviewKeptEvents::G4VisCommandAbortReviewKeptEvents () {
|
||||
G4bool omitable;
|
||||
|
||||
fpCommand = new G4UIcmdWithABool("/vis/abortReviewKeptEvents", this);
|
||||
fpCommand -> SetGuidance("Abort review of kept events.");
|
||||
fpCommand -> SetParameterName("abort", omitable=true);
|
||||
fpCommand -> SetDefaultValue(true);
|
||||
}
|
||||
|
||||
G4VisCommandAbortReviewKeptEvents::~G4VisCommandAbortReviewKeptEvents () {
|
||||
delete fpCommand;
|
||||
}
|
||||
|
||||
G4String G4VisCommandAbortReviewKeptEvents::GetCurrentValue (G4UIcommand*) {
|
||||
return G4String();
|
||||
}
|
||||
|
||||
void G4VisCommandAbortReviewKeptEvents::SetNewValue (G4UIcommand*,
|
||||
G4String newValue) {
|
||||
fpVisManager->SetAbortReviewKeptEvents(G4UIcommand::ConvertToBool(newValue));
|
||||
}
|
||||
|
||||
////////////// /vis/enable ///////////////////////////////////////
|
||||
|
||||
G4VisCommandEnable::G4VisCommandEnable () {
|
||||
@@ -127,11 +151,16 @@ G4VisCommandReviewKeptEvents::G4VisCommandReviewKeptEvents ()
|
||||
fpCommand -> SetGuidance("Review kept events.");
|
||||
fpCommand -> SetGuidance
|
||||
("If a macro file is specified, it is executed for each event.");
|
||||
fpCommand -> SetGuidance
|
||||
("If a macro file is not specified, each event is drawn to the current"
|
||||
"\nviewer. After each event, the session is paused. The user may issue"
|
||||
"\nany allowed command. Then enter \"continue\" to continue to the next"
|
||||
"\nevent.");
|
||||
fpCommand -> SetGuidance(
|
||||
"If a macro file is not specified, each event is drawn to the current"
|
||||
"\nviewer. After each event, the session is paused. The user may issue"
|
||||
"\nany allowed command. Then enter \"cont[inue]\" to continue to the next"
|
||||
"\nevent."
|
||||
"\nUseful commands might be:"
|
||||
"\n \"/vis/viewer/...\" to change the view (zoom, set/viewpoint,...)."
|
||||
"\n \"/vis/oglx/printEPS\" to get hard copy."
|
||||
"\n \"/vis/open\" to get alternative viewer."
|
||||
"\n \"/vis/abortReviewKeptEvents\", then \"cont[inue]\", to abort.");
|
||||
fpCommand -> SetParameterName("macro-file-name", omitable=true);
|
||||
fpCommand -> SetDefaultValue("");
|
||||
}
|
||||
@@ -184,8 +213,6 @@ void G4VisCommandReviewKeptEvents::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
return;
|
||||
}
|
||||
|
||||
G4VSceneHandler* sceneHandler = fpVisManager->GetCurrentSceneHandler();
|
||||
|
||||
G4UImanager* UImanager = G4UImanager::GetUIpointer();
|
||||
G4int keepVerbose = UImanager->GetVerboseLevel();
|
||||
G4int newVerbose(0);
|
||||
@@ -199,14 +226,26 @@ void G4VisCommandReviewKeptEvents::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
if (macroFileName.empty()) {
|
||||
|
||||
// Draw to viewer and pause session...
|
||||
G4UIsession* session = UImanager->GetSession();
|
||||
for (size_t i = 0; i < nKeptEvents; ++i) {
|
||||
const G4Event* event = (*events)[i];
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
G4cout << "Drawing event : " << event->GetEventID() <<
|
||||
". At EndOfEvent, enter any command, then \"continue\"..."
|
||||
". At EndOfEvent, enter any command, then \"cont[inue]\"..."
|
||||
<< G4endl;
|
||||
static G4bool first = true;
|
||||
if (first) {
|
||||
first = false;
|
||||
G4cout <<
|
||||
" Useful commands might be:"
|
||||
"\n \"/vis/viewer/...\" to change the view (zoom, set/viewpoint,...)."
|
||||
"\n \"/vis/oglx/printEPS\" to get hard copy."
|
||||
"\n \"/vis/open\" to get alternative viewer."
|
||||
"\n \"/vis/abortReviewKeptEvents\", then \"cont[inue]\", to abort."
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
sceneHandler->SetEvent(event);
|
||||
fpVisManager->SetRequestedEvent(event);
|
||||
UImanager->ApplyCommand("/vis/viewer/rebuild");
|
||||
/* The above command forces a rebuild of the scene, including
|
||||
the detector. This is fine for "immediate" viewers - a
|
||||
@@ -223,12 +262,12 @@ void G4VisCommandReviewKeptEvents::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
there too. This needs further investigation - enhanced
|
||||
features or a complete re-think.
|
||||
*/
|
||||
if (!viewer->GetViewParameters().IsAutoRefresh())
|
||||
UImanager->ApplyCommand("/vis/viewer/flush");
|
||||
G4UIsession* session = UImanager->GetSession();
|
||||
UImanager->ApplyCommand("/vis/viewer/flush");
|
||||
session->PauseSessionStart("EndOfEvent");
|
||||
sceneHandler->SetEvent(0);
|
||||
fpVisManager->SetRequestedEvent(0);
|
||||
if (fpVisManager->GetAbortReviewKeptEvents()) break;
|
||||
}
|
||||
fpVisManager->SetAbortReviewKeptEvents(false);
|
||||
|
||||
} else {
|
||||
|
||||
@@ -239,9 +278,9 @@ void G4VisCommandReviewKeptEvents::SetNewValue (G4UIcommand*, G4String newValue)
|
||||
G4cout << "Drawing event : " << event->GetEventID()
|
||||
<< " with macro file \"" << macroFileName << G4endl;
|
||||
}
|
||||
sceneHandler->SetEvent(event);
|
||||
fpVisManager->SetRequestedEvent(event);
|
||||
UImanager->ApplyCommand("/control/execute " + macroFileName);
|
||||
sceneHandler->SetEvent(0);
|
||||
fpVisManager->SetRequestedEvent(0);
|
||||
}
|
||||
}
|
||||
pScene->SetRefreshAtEndOfEvent(currentRefreshAtEndOfEvent);
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsCompound.cc,v 1.35 2006/12/12 11:48:13 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VisCommandsCompound.cc,v 1.38 2007/03/27 15:41:34 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
|
||||
// Compound /vis/ commands - John Allison 15th May 2000
|
||||
|
||||
@@ -201,14 +201,13 @@ void G4VisCommandDrawVolume::SetNewValue(G4UIcommand*, G4String newValue) {
|
||||
newVerbose = 2;
|
||||
UImanager->SetVerboseLevel(newVerbose);
|
||||
UImanager->ApplyCommand("/vis/scene/create");
|
||||
// UImanager->ApplyCommand("/vis/scene/add/eventID");
|
||||
UImanager->ApplyCommand(G4String("/vis/scene/add/volume " + newValue));
|
||||
UImanager->ApplyCommand("/vis/sceneHandler/attach");
|
||||
UImanager->SetVerboseLevel(keepVerbose);
|
||||
static G4bool warned = false;
|
||||
if (verbosity >= G4VisManager::warnings && !warned) {
|
||||
if (verbosity >= G4VisManager::confirmations && !warned) {
|
||||
G4cout <<
|
||||
"WARNING: For systems which are not \"auto-refresh\" you will need to"
|
||||
"NOTE: For systems which are not \"auto-refresh\" you will need to"
|
||||
"\n issue \"/vis/viewer/refresh\" or \"/vis/viewer/flush\"."
|
||||
<< G4endl;
|
||||
warned = true;
|
||||
@@ -321,9 +320,9 @@ void G4VisCommandSpecify::SetNewValue(G4UIcommand*, G4String newValue) {
|
||||
UImanager->ApplyCommand("/vis/sceneHandler/attach");
|
||||
UImanager->SetVerboseLevel(keepVerbose);
|
||||
static G4bool warned = false;
|
||||
if (verbosity >= G4VisManager::warnings && !warned) {
|
||||
if (verbosity >= G4VisManager::confirmations && !warned) {
|
||||
G4cout <<
|
||||
"WARNING: For systems which are not \"auto-refresh\" you will need to"
|
||||
"NOTE: For systems which are not \"auto-refresh\" you will need to"
|
||||
"\n issue \"/vis/viewer/refresh\" or \"/vis/viewer/flush\"."
|
||||
<< G4endl;
|
||||
warned = true;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsGeometry.cc,v 1.3 2006/06/29 21:29:38 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VisCommandsGeometry.cc,v 1.4 2007/01/05 16:29:38 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
|
||||
// /vis/geometry commands - John Allison 31st January 2006
|
||||
|
||||
@@ -146,5 +146,7 @@ void G4VisCommandGeometryRestore::SetNewValue(G4UIcommand*, G4String newValue)
|
||||
}
|
||||
return;
|
||||
}
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild");
|
||||
if (fpVisManager->GetCurrentViewer()) {
|
||||
G4UImanager::GetUIpointer()->ApplyCommand("/vis/viewer/rebuild");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsGeometrySet.cc,v 1.6 2006/09/19 16:05:13 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VisCommandsGeometrySet.cc,v 1.7 2007/01/05 16:24:19 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
|
||||
// /vis/geometry commands - John Allison 31st January 2006
|
||||
|
||||
@@ -170,7 +170,7 @@ G4VisCommandGeometrySetDaughtersInvisible::G4VisCommandGeometrySetDaughtersInvis
|
||||
{
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcommand("/vis/geometry/set/daughtersInvisible", this);
|
||||
fpCommand->SetGuidance("Sets daughters of logical volume(s) invisible.");
|
||||
fpCommand->SetGuidance("Makes daughters of logical volume(s) invisible.");
|
||||
fpCommand->SetGuidance("\"all\" sets all logical volumes.");
|
||||
fpCommand->SetGuidance
|
||||
("Optionally propagates down hierarchy to given depth.");
|
||||
@@ -242,7 +242,8 @@ G4VisCommandGeometrySetForceAuxEdgeVisible::G4VisCommandGeometrySetForceAuxEdgeV
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcommand("/vis/geometry/set/forceAuxEdgeVisible", this);
|
||||
fpCommand->SetGuidance
|
||||
("Sets auxiliary (soft) edges of logical volume(s) drawing visible.");
|
||||
("Forces auxiliary (soft) edges of logical volume(s) to be visible,"
|
||||
"\nregardless of the view parameters.");
|
||||
fpCommand->SetGuidance("\"all\" sets all logical volumes.");
|
||||
fpCommand->SetGuidance
|
||||
("Optionally propagates down hierarchy to given depth.");
|
||||
@@ -287,6 +288,59 @@ void G4VisCommandGeometrySetForceAuxEdgeVisible::SetNewValue
|
||||
Set(name, setForceAuxEdgeVisible, requestedDepth);
|
||||
}
|
||||
|
||||
////////////// /vis/geometry/set/forceLineSegmentsPerCircle /////////////////////////
|
||||
|
||||
G4VisCommandGeometrySetForceLineSegmentsPerCircle::G4VisCommandGeometrySetForceLineSegmentsPerCircle()
|
||||
{
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcommand("/vis/geometry/set/forceLineSegmentsPerCircle", this);
|
||||
fpCommand->SetGuidance
|
||||
("Forces number of line segments per circle, the precision with which a"
|
||||
"\ncurved line or surface is represented by a polygon or polyhedron,"
|
||||
"\nregardless of the view parameters.");
|
||||
fpCommand->SetGuidance("\"all\" sets all logical volumes.");
|
||||
fpCommand->SetGuidance
|
||||
("Optionally propagates down hierarchy to given depth.");
|
||||
G4UIparameter* parameter;
|
||||
parameter = new G4UIparameter ("logical-volume-name", 's', omitable = true);
|
||||
parameter->SetDefaultValue("all");
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("depth", 'd', omitable = true);
|
||||
parameter->SetDefaultValue(0);
|
||||
parameter->SetGuidance
|
||||
("Depth of propagation (-1 means unlimited depth).");
|
||||
fpCommand->SetParameter(parameter);
|
||||
parameter = new G4UIparameter("lineSegmentsPerCircle", 'd', omitable = true);
|
||||
parameter->SetGuidance
|
||||
("< 0 means not forced, i.e., under control of viewer.");
|
||||
parameter->SetDefaultValue(-1);
|
||||
fpCommand->SetParameter(parameter);
|
||||
}
|
||||
|
||||
G4VisCommandGeometrySetForceLineSegmentsPerCircle::~G4VisCommandGeometrySetForceLineSegmentsPerCircle()
|
||||
{
|
||||
delete fpCommand;
|
||||
}
|
||||
|
||||
G4String
|
||||
G4VisCommandGeometrySetForceLineSegmentsPerCircle::GetCurrentValue(G4UIcommand*)
|
||||
{
|
||||
return "";
|
||||
}
|
||||
|
||||
void G4VisCommandGeometrySetForceLineSegmentsPerCircle::SetNewValue
|
||||
(G4UIcommand*, G4String newValue)
|
||||
{
|
||||
G4String name;
|
||||
G4int requestedDepth;
|
||||
G4int lineSegmentsPerCircle;
|
||||
std::istringstream iss(newValue);
|
||||
iss >> name >> requestedDepth >> lineSegmentsPerCircle;
|
||||
|
||||
G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction setForceLineSegmentsPerCircle(lineSegmentsPerCircle);
|
||||
Set(name, setForceLineSegmentsPerCircle, requestedDepth);
|
||||
}
|
||||
|
||||
////////////// /vis/geometry/set/forceSolid /////////////////////////
|
||||
|
||||
G4VisCommandGeometrySetForceSolid::G4VisCommandGeometrySetForceSolid()
|
||||
@@ -294,7 +348,8 @@ G4VisCommandGeometrySetForceSolid::G4VisCommandGeometrySetForceSolid()
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcommand("/vis/geometry/set/forceSolid", this);
|
||||
fpCommand->SetGuidance
|
||||
("Sets logical volume(s) drawing always to be as solid (surface drawing).");
|
||||
("Forces logical volume(s) always to be drawn solid (surface drawing),"
|
||||
"\nregardless of the view parameters.");
|
||||
fpCommand->SetGuidance("\"all\" sets all logical volumes.");
|
||||
fpCommand->SetGuidance
|
||||
("Optionally propagates down hierarchy to given depth.");
|
||||
@@ -344,7 +399,8 @@ G4VisCommandGeometrySetForceWireframe::G4VisCommandGeometrySetForceWireframe()
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcommand("/vis/geometry/set/forceWireframe", this);
|
||||
fpCommand->SetGuidance
|
||||
("Sets logical volume(s) drawing always to be as wireframe.");
|
||||
("Forces logical volume(s) always to be drawn as wireframe,"
|
||||
"\nregardless of the view parameters.");
|
||||
fpCommand->SetGuidance("\"all\" sets all logical volumes.");
|
||||
fpCommand->SetGuidance
|
||||
("Optionally propagates down hierarchy to given depth.");
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4VisCommandsViewer.cc,v 1.66 2006/11/25 15:38:03 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VisCommandsViewer.cc,v 1.68 2007/01/11 16:41:30 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
|
||||
// /vis/viewer commands - John Allison 25th October 1998
|
||||
|
||||
@@ -72,7 +72,7 @@ G4VisCommandViewerAddCutawayPlane::G4VisCommandViewerAddCutawayPlane () {
|
||||
G4bool omitable;
|
||||
fpCommand = new G4UIcommand ("/vis/viewer/addCutawayPlane", this);
|
||||
fpCommand -> SetGuidance
|
||||
("Add cutaway plane A*x + B*y + C*z + D = 0 to current viewer.");
|
||||
("Add cutaway plane to current viewer.");
|
||||
G4UIparameter* parameter;
|
||||
parameter = new G4UIparameter("x",'d',omitable = true);
|
||||
parameter -> SetDefaultValue (0);
|
||||
@@ -1138,8 +1138,8 @@ void G4VisCommandViewerRefresh::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
|
||||
G4Scene* scene = sceneHandler->GetScene();
|
||||
if (!scene) {
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
G4cout << "WARNING: SceneHandler \"" << sceneHandler->GetName()
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout << "NOTE: SceneHandler \"" << sceneHandler->GetName()
|
||||
<< "\", to which viewer \"" << refreshName << "\"" <<
|
||||
"\n is attached, has no scene - \"/vis/scene/create\" and"
|
||||
" \"/vis/sceneHandler/attach\""
|
||||
@@ -1412,8 +1412,8 @@ void G4VisCommandViewerUpdate::SetNewValue (G4UIcommand*, G4String newValue) {
|
||||
|
||||
G4Scene* scene = sceneHandler->GetScene();
|
||||
if (!scene) {
|
||||
if (verbosity >= G4VisManager::warnings) {
|
||||
G4cout << "WARNING: SceneHandler \"" << sceneHandler->GetName()
|
||||
if (verbosity >= G4VisManager::confirmations) {
|
||||
G4cout << "NOTE: SceneHandler \"" << sceneHandler->GetName()
|
||||
<< "\", to which viewer \"" << updateName << "\"" <<
|
||||
"\n is attached, has no scene - \"/vis/scene/create\" and"
|
||||
" \"/vis/sceneHandler/attach\""
|
||||
|
||||
@@ -23,8 +23,8 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
// $Id: G4VisManager.cc,v 1.109 2006/11/26 15:43:51 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-02 $
|
||||
// $Id: G4VisManager.cc,v 1.111 2007/01/11 16:41:59 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-08-03 $
|
||||
//
|
||||
//
|
||||
// GEANT4 Visualization Manager - John Allison 02/Jan/1996.
|
||||
@@ -91,7 +91,9 @@ G4VisManager::G4VisManager ():
|
||||
fTransientsDrawnThisRun (false),
|
||||
fTransientsDrawnThisEvent (false),
|
||||
fEventKeepingSuspended (false),
|
||||
fKeptLastEvent (false)
|
||||
fKeptLastEvent (false),
|
||||
fpRequestedEvent (0),
|
||||
fAbortReviewKeptEvents (false)
|
||||
// All other objects use default constructors.
|
||||
{
|
||||
fpTrajDrawModelMgr = new G4VisModelManager<G4VTrajectoryModel>("/vis/modeling/trajectories");
|
||||
@@ -589,45 +591,42 @@ void G4VisManager::CreateViewer (G4String name) {
|
||||
fpSceneHandler -> AddViewerToList (fpViewer);
|
||||
fpSceneHandler -> SetCurrentViewer (fpViewer);
|
||||
|
||||
if (fVerbosity >= confirmations) {
|
||||
G4cout << "G4VisManager::CreateViewer: new viewer created:"
|
||||
<< G4endl;
|
||||
}
|
||||
|
||||
const G4ViewParameters& vp = fpViewer->GetViewParameters();
|
||||
G4bool warn = false;
|
||||
if (fVerbosity >= parameters) {
|
||||
G4cout << " view parameters are:\n " << vp << G4endl;
|
||||
}
|
||||
|
||||
if (vp.IsCulling () && vp.IsCullingInvisible ()) {
|
||||
warn = true;
|
||||
static G4bool warned = false;
|
||||
if (fVerbosity >= confirmations) {
|
||||
G4cout << "G4VisManager::CreateViewer: new viewer created:"
|
||||
<< G4endl;
|
||||
}
|
||||
if (fVerbosity >= parameters) {
|
||||
G4cout << " view parameters are:\n " << vp << G4endl;
|
||||
}
|
||||
if (fVerbosity >= warnings) {
|
||||
G4cout <<
|
||||
"WARNING: objects with visibility flag set to \"false\""
|
||||
" will not be drawn!"
|
||||
"\n \"/vis/viewer/set/culling global false\" to Draw such objects."
|
||||
<< G4endl;
|
||||
if (!warned) {
|
||||
G4cout <<
|
||||
"NOTE: objects with visibility flag set to \"false\""
|
||||
" will not be drawn!"
|
||||
"\n \"/vis/viewer/set/culling global false\" to Draw such objects."
|
||||
"\n Also see other \"/vis/viewer/set\" commands."
|
||||
<< G4endl;
|
||||
warned = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (vp.IsCullingCovered ()) {
|
||||
if (!warn) {
|
||||
if (fVerbosity >= confirmations) {
|
||||
G4cout << "G4VisManager::CreateViewer: new viewer created:"
|
||||
<< G4endl;
|
||||
static G4bool warned = false;
|
||||
if (fVerbosity >= warnings) {
|
||||
if (!warned) {
|
||||
G4cout <<
|
||||
"WARNING: covered objects in solid mode will not be rendered!"
|
||||
"\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
|
||||
"\n Also see other \"/vis/viewer/set\" commands."
|
||||
<< G4endl;
|
||||
warned = true;
|
||||
}
|
||||
}
|
||||
warn = true;
|
||||
if (fVerbosity >= warnings) {
|
||||
G4cout <<
|
||||
"WARNING: covered objects in solid mode will not be rendered!"
|
||||
"\n \"/vis/viewer/set/culling coveredDaughters false\" to reverse this."
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
if (warn) {
|
||||
if (fVerbosity >= warnings) {
|
||||
G4cout << " Also see other \"/vis/viewer/set\" commands."
|
||||
<< G4endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -892,6 +891,7 @@ void G4VisManager::RegisterMessengers () {
|
||||
G4UIcommand* directory;
|
||||
|
||||
// Top level basic commands...
|
||||
RegisterMessenger(new G4VisCommandAbortReviewKeptEvents);
|
||||
RegisterMessenger(new G4VisCommandEnable);
|
||||
RegisterMessenger(new G4VisCommandList);
|
||||
RegisterMessenger(new G4VisCommandVerbose);
|
||||
@@ -920,6 +920,7 @@ void G4VisManager::RegisterMessengers () {
|
||||
RegisterMessenger(new G4VisCommandGeometrySetLineStyle);
|
||||
RegisterMessenger(new G4VisCommandGeometrySetLineWidth);
|
||||
RegisterMessenger(new G4VisCommandGeometrySetForceAuxEdgeVisible);
|
||||
RegisterMessenger(new G4VisCommandGeometrySetForceLineSegmentsPerCircle);
|
||||
RegisterMessenger(new G4VisCommandGeometrySetForceSolid);
|
||||
RegisterMessenger(new G4VisCommandGeometrySetForceWireframe);
|
||||
RegisterMessenger(new G4VisCommandGeometrySetVisibility);
|
||||
|
||||
Reference in New Issue
Block a user