Import Geant4 8.3.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 15:07:44 +02:00
parent fe73f43734
commit 75c7fd177d
764 changed files with 45230 additions and 95238 deletions
+38 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.398 2006/11/26 22:07:44 allison Exp $
$Id: History,v 1.401 2007/01/11 16:46:41 allison Exp $
-------------------------------------------------------------------
=========================================================
@@ -24,6 +24,43 @@ committal in the CVS repository !
History file for visualization category
---------------------------------------
11th January 2007 John Allison (vis-V08-02-01)
- visman-V08-02-01:
o Added /vis/abortReviewKeptEvents.
o /vis/reviewKeptEvents: Improved guidance.
o Bug fix: /vis/open in /vis/reviewKeptEvents loop.
o Reduced WARNING noise.
9th January 2007 John Allison
- opengl-V08-02-01:
o Implemented bitmap markers (for MarkerSizeType == screen).
o Bug fix: Added missing break in X colormap lookup routine.
5th January 2007 John Allison (vis-V08-02-00 - needs greps-V08-02-00)
- modeling-V08-02-00 (needs greps-V08-02-00):
o Bug fix: Correct treatment of ForcedLineSegmentsPerCircle when clipping.
- visman-V08-02-00:
o G4VSceneHandler:
~ Introduced utility LoadAtts for G4AttValues and G4AttDefs.
~ Improved other utilities (changed signature of GetLineWidth).
o Introduced /vis/geometry/set/forceLineSegmentsPerCircle.
o Re-introduced /vis/scene/add/eventID into /vis/drawVolume (removed
in visman-V08-01-16 for release 8.2).
o Other minor improvements.
- opengl-V08-02-00:
o Followed change of signature of GetLineWidth in visman-V08-02-00.
- openinventor-V08-02-00: Moved LoadAtts to vis management.
- raytracer-V08-02-00: Bug fix: use of window size hints.
- vistree-V08-02-00: Bug fix: Format of total mass.
- vistest-V08-02-00: test19.cc: Refined usage.
12th December 2006 Gabriele Cosmo
- visman-V08-01-16: Commented command "vis/scene/add/eventID" forcing
event ID to scene in G4VisCommandsCompound.cc.
11th December 2006 John Allison
- Tree: Trapped sequential G4PVPlacements.
25th November 2006 John Allison (vis-V08-01-17)
- visman-V08-01-15: Follow change of behaviour of G4StateManager and
minor message corrections.
+21 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.82 2006/11/21 16:24:58 allison Exp $
$Id: History,v 1.86 2007/03/27 15:15:12 allison Exp $
-------------------------------------------------------------------
=========================================================
@@ -19,6 +19,26 @@ committal in the CVS repository !
History file for visualization/OpenGL
-------------------------------------
25th March 2007 John Allison (opengl-V08-02-03)
- Fix compiler warnings.
8th February 2007 John Allison (opengl-V08-02-02)
- Fixed Windows problem with DBL_MAX. (Introduced G4OPENGL_DBL_MAX.)
- G4OpenGLXViewer.cc: Small bug fix in print(). (Context was switched
but not switched back. Not serious, because context was always set
before normal drawing.)
9th January 2007 John Allison (opengl-V08-02-01)
- Implemented bitmap markers for MarkerSizeType == screen. (The old
polygon implementation remains for MarkerSizeType == world.)
- Added G4OpenGLBitMapStore to assist the above.
- G4OpenGLXViewer::CreateGLXContext:
o Bug fix: Added missing break in colormap lookup routine.
5th January 2007 John Allison (opengl-V08-02-00)
- G4OpenGLSceneHandler.cc:
o Followed change of signature of GetLineWidth in visman-V08-02-00.
o Minor efficiency improvements.
21st November 2006 John Allison (opengl-V08-01-09)
- Fixed compiler warnings.
@@ -23,8 +23,8 @@
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
// $Id: G4OpenGL.hh,v 1.4 2006/06/29 21:17:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGL.hh,v 1.5 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
// G.Barrand.
@@ -38,4 +38,6 @@
#include <GL/gl.h>
#include <GL/glu.h>
#define G4OPENGL_DBL_MAX 1.e308
#endif
@@ -0,0 +1,75 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4OpenGLBitMapStore.hh,v 1.1 2007/01/09 10:11:16 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 6th January 2007
//
// Class description
//
// Keeps bit maps on byte boundaries suitable for drawing. For
// example, in OpenGL:
//
// const char* circle = G4OpenGLBitMapStore::GetCircle(size, true);
// glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
// glBitmap(size, size, size/2., size/2., 0., 0., circle);
#ifndef G4OPENGLBITMAPSTORE_HH
#define G4OPENGLBITMAPSTORE_HH
#include "globals.hh"
#include "G4OpenGL.hh"
#include <map>
namespace G4OpenGLBitMapStore {
enum Shape {circle, square};
const GLubyte* GetBitMap(Shape, G4double& size, G4bool filled);
// Size in pixels (gets changed to a rationalised value).
struct Key{
Key(Shape shape, G4int size, G4bool filled):
fShape(shape), fSize(size), fFilled(filled) {}
bool operator<(const Key& rhs) const {
if (fShape < rhs.fShape) return true;
else if (fSize < rhs.fSize) return true;
else if (fFilled != rhs.fFilled) return true;
else return false;
}
Shape fShape;
G4int fSize;
G4bool fFilled;
};
extern std::map<Key, GLubyte*> fStore;
}
#endif
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLSceneHandler.hh,v 1.20 2006/08/30 11:37:34 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLSceneHandler.hh,v 1.21 2007/01/09 10:11:16 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 27th March 1996
@@ -44,6 +44,7 @@
#include "G4VSceneHandler.hh"
#include "G4OpenGLViewer.hh"
#include "G4OpenGLBitMapStore.hh"
// Base class for various OpenGLScene classes.
class G4OpenGLSceneHandler: public G4VSceneHandler {
@@ -90,18 +91,13 @@ protected:
private:
void AddCircleSquare (const G4VMarker&, G4int nSides);
/**************************************************
Not needed - but see note on future development in .cc.
void DrawScreenPolygon (G4double size,
const G4Point3D& centre,
G4int nSides);
// Draws in screen coordinates.
*********************************/
void AddCircleSquare (const G4VMarker&, G4OpenGLBitMapStore::Shape);
void DrawXYPolygon (G4double size,
const G4Point3D& centre,
G4int nSides);
void DrawXYPolygon
(G4OpenGLBitMapStore::Shape,
G4double size,
const G4Point3D& centre,
const G4VisAttributes* pApplicableVisAtts);
// Draws in world coordinates a polygon in the screen plane knowing
// viewpoint direction and up vector.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLStoredSceneHandler.hh,v 1.21 2006/08/30 11:43:57 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLStoredSceneHandler.hh,v 1.22 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 10th February 1997
@@ -107,7 +107,7 @@ protected:
struct TO {
TO(G4int id, const G4Transform3D& tr = G4Transform3D()):
fDisplayListId(id), fTransform(tr),
fStartTime(-DBL_MAX), fEndTime(DBL_MAX) {}
fStartTime(-G4OPENGL_DBL_MAX), fEndTime(G4OPENGL_DBL_MAX) {}
G4int fDisplayListId;
G4Transform3D fTransform;
G4double fStartTime, fEndTime; // Time range (e.g., for trajectory steps).
@@ -0,0 +1,102 @@
//
// ********************************************************************
// * License and Disclaimer *
// * *
// * The Geant4 software is copyright of the Copyright Holders of *
// * the Geant4 Collaboration. It is provided under the terms and *
// * conditions of the Geant4 Software License, included in the file *
// * LICENSE and available at http://cern.ch/geant4/license . These *
// * include a list of copyright holders. *
// * *
// * Neither the authors of this software system, nor their employing *
// * institutes,nor the agencies providing financial support for this *
// * work make any representation or warranty, express or implied, *
// * regarding this software system or assume any liability for its *
// * use. Please see the license in the file LICENSE and URL above *
// * for the full disclaimer and the limitation of liability. *
// * *
// * This code implementation is the result of the scientific and *
// * technical work of the GEANT4 collaboration. *
// * By using, copying, modifying or distributing the software (or *
// * any work based on the software) you agree to acknowledge its *
// * use in resulting scientific publications, and indicate your *
// * acceptance of all terms of the Geant4 Software license. *
// ********************************************************************
//
//
// $Id: G4OpenGLBitMapStore.cc,v 1.2 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 6th January 2007
#include "G4OpenGLBitMapStore.hh"
namespace G4OpenGLBitMapStore {
std::map<Key, GLubyte*> fStore;
void SetBit(G4int i, G4int j, GLubyte* bitmap, G4int byteColumns)
{
G4int k = i / 8 + byteColumns * j;
bitmap[k] |= 0x80 >> i % 8;
}
const GLubyte* GetBitMap(Shape shape, G4double& size, G4bool filled)
{
// Rationalise size
G4int bitSize = std::abs(size) + 0.49;
if (bitSize < 1) bitSize = 1;
// Modify size in calling function (passed by reference).
size = bitSize;
Key key(shape, bitSize, filled);
// If previously encountered, return.
if (fStore.find(key) != fStore.end()) return fStore[key];
// Create and store new bitmap.
G4int byteColumns = (G4int(bitSize - 1) / 8) + 1;
G4int byteRows = bitSize;
G4int nBytes = byteColumns*byteRows;
GLubyte* bitmap = new GLubyte[nBytes];
fStore[key] = bitmap;
if (shape == square && filled) { // Set all bits and return.
for (G4int i = 0; i < nBytes; ++i) bitmap[i] = 0xff;
return bitmap;
} else { // Clear ready for setting bits.
for (G4int i = 0; i < nBytes; ++i) bitmap[i] = 0x00;
}
// Fill bitmap.
GLint linewidth;
glGetIntegerv(GL_LINE_WIDTH, &linewidth);
if (linewidth > bitSize) linewidth = bitSize;
G4double outer = bitSize / 2.;
G4double outer2 = outer * outer;
G4double inner = bitSize / 2. - linewidth;
G4double inner2 = inner * inner;
for (G4int i = 0; i < bitSize; ++i) {
for (G4int j = 0; j < bitSize; ++j) {
G4double x = i - (bitSize - 1) * 0.5;
G4double y = j - (bitSize - 1) * 0.5;
G4double r2 = x * x + y * y;
if (shape == circle) {
if (filled) {
if (r2 < outer2) SetBit(i, j, bitmap, byteColumns);
} else {
if (r2 < outer2 && r2 > inner2) SetBit(i, j, bitmap, byteColumns);
}
} else { // Unfilled square.
if (x < -inner || x > inner || y < -inner || y > inner)
SetBit(i, j, bitmap, byteColumns);
}
}
}
return bitmap;
}
} // End namespace G4OpenGLBitMapStore.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.24 2006/09/04 12:03:25 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.25 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 10th February 1997
@@ -121,7 +121,7 @@ void G4OpenGLImmediateSceneHandler::BeginPrimitives2D()
glMatrixMode (GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho (-1., 1., -1., 1., -DBL_MAX, DBL_MAX);
glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
glMatrixMode (GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLSceneHandler.cc,v 1.45 2006/08/30 11:37:34 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLSceneHandler.cc,v 1.48 2007/03/27 15:15:12 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 27th March 1996
@@ -127,7 +127,11 @@ void G4OpenGLSceneHandler::AddPrimitive (const G4Polyline& line)
glDisable (GL_LIGHTING);
G4double lineWidth = GetLineWidth(line);
// Get vis attributes - pick up defaults if none.
const G4VisAttributes* pVA =
fpViewer -> GetApplicableVisAttributes (line.GetVisAttributes ());
G4double lineWidth = GetLineWidth(pVA);
glLineWidth(lineWidth);
glBegin (GL_LINE_STRIP);
@@ -174,7 +178,7 @@ void G4OpenGLSceneHandler::AddPrimitive (const G4Text& text) {
glDisable (GL_DEPTH_TEST);
glDisable (GL_LIGHTING);
glRasterPos3f(position.x(),position.y(),position.z());
glRasterPos3d(position.x(),position.y(),position.z());
// No action on offset or layout at present.
glPushAttrib(GL_LIST_BIT);
glListBase(font_base);
@@ -184,17 +188,17 @@ void G4OpenGLSceneHandler::AddPrimitive (const G4Text& text) {
void G4OpenGLSceneHandler::AddPrimitive (const G4Circle& circle) {
glEnable (GL_POINT_SMOOTH);
AddCircleSquare (circle, 24);
AddCircleSquare (circle, G4OpenGLBitMapStore::circle);
}
void G4OpenGLSceneHandler::AddPrimitive (const G4Square& square) {
glDisable (GL_POINT_SMOOTH);
AddCircleSquare (square, 4);
AddCircleSquare (square, G4OpenGLBitMapStore::square);
}
void G4OpenGLSceneHandler::AddCircleSquare
(const G4VMarker& marker,
G4int nSides) {
G4OpenGLBitMapStore::Shape shape) {
// Note: colour treated in sub-class.
@@ -204,174 +208,78 @@ void G4OpenGLSceneHandler::AddCircleSquare
glDisable (GL_LIGHTING);
G4double lineWidth = GetLineWidth(marker);
// Get vis attributes - pick up defaults if none.
const G4VisAttributes* pVA =
fpViewer -> GetApplicableVisAttributes (marker.GetVisAttributes ());
G4double lineWidth = GetLineWidth(pVA);
glLineWidth(lineWidth);
G4VMarker::FillStyle style = marker.GetFillStyle();
G4bool filled = false;
static G4bool hashedWarned = false;
switch (style) {
case G4VMarker::noFill:
glPolygonMode (GL_FRONT_AND_BACK, GL_LINE);
filled = false;
break;
case G4VMarker::hashed:
/*
G4cout << "Hashed fill style in G4OpenGLSceneHandler."
<< "\n Not implemented. Using G4VMarker::filled."
<< G4endl;
*/
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
glPolygonStipple (fStippleMaskHashed);
// See also:
// if (style == G4VMarker::filled || style == G4VMarker::hashed)...
// (twice) below.
break;
if (!hashedWarned) {
G4cout << "Hashed fill style in G4OpenGLSceneHandler."
<< "\n Not implemented. Using G4VMarker::filled."
<< G4endl;
hashedWarned = true;
}
// Maybe use
//glPolygonStipple (fStippleMaskHashed);
// Drop through to filled...
case G4VMarker::filled:
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
break;
default:
G4cout << "Unrecognised fill style in G4OpenGLSceneHandler."
<< "\n Using G4VMarker::filled."
<< G4endl;
glPolygonMode (GL_FRONT_AND_BACK, GL_FILL);
filled = true;
break;
}
// A few useful quantities...
G4Point3D centre = marker.GetPosition();
const G4Vector3D& viewpointDirection =
fpViewer -> GetViewParameters().GetViewpointDirection();
const G4Vector3D& up = fpViewer->GetViewParameters().GetUpVector();
MarkerSizeType sizeType;
G4double size = GetMarkerSize(marker, sizeType);
// Find "size" of marker in world space (but see note below)...
G4double worldSize;
if (sizeType == world) { // Size specified in world coordinates.
worldSize = size;
}
else { // Size specified in screen (window) coordinates.
// Find window coordinates of centre...
GLdouble modelMatrix[16];
glGetDoublev (GL_MODELVIEW_MATRIX, modelMatrix);
G4double projectionMatrix[16];
glGetDoublev (GL_PROJECTION_MATRIX, projectionMatrix);
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT,viewport);
GLdouble winx, winy, winz;
gluProject(centre.x(), centre.y(), centre.z(),
modelMatrix, projectionMatrix, viewport,
&winx, &winy, &winz);
// Determine ratio window:world...
const G4Vector3D inScreen = (up.cross(viewpointDirection)).unit();
const G4Vector3D p = centre + inScreen;
GLdouble winDx, winDy, winDz;
gluProject(p.x(), p.y(), p.z(),
modelMatrix, projectionMatrix, viewport,
&winDx, &winDy, &winDz);
G4double winWorldRatio = std::sqrt(std::pow(winx - winDx, 2) +
std::pow(winy - winDy, 2));
worldSize = size / winWorldRatio;
}
// Draw...
DrawXYPolygon (worldSize, centre, nSides);
}
if (sizeType == world) { // Size specified in world coordinates.
/***************************************************
Note: We have to do it this way round so that when a global
transformation is applied, such as with /vis/viewer/set/viewpoint,
the markers follow the world coordinates without having to
recreate the display lists. The down side is that the markers
rotate. The only way to avoid this is to play with the modelview
and projection matrices of OpenGL - which I need to think about.
For future reference, here is the code to draw in window
coordinates; its down side is that markers do not follow global
transformations. Some clever stuff is needed.
DrawXYPolygon (shape, size, centre, pVA);
...
// Find window coordinates of centre...
GLdouble modelMatrix[16];
glGetDoublev (GL_MODELVIEW_MATRIX, modelMatrix);
G4double projectionMatrix[16];
glGetDoublev (GL_PROJECTION_MATRIX, projectionMatrix);
GLint viewport[4];
glGetIntegerv(GL_VIEWPORT,viewport);
GLdouble winx, winy, winz;
gluProject(centre.x(), centre.y(), centre.z(),
modelMatrix, projectionMatrix, viewport,
&winx, &winy, &winz);
} else { // Size specified in screen (window) coordinates.
// Find window size...
G4double winSize;
if (size) { // Size specified in world coordinates.
// Determine size in window coordinates...
(Note: improve this by using an inScreen vector as above.)
GLdouble winx1, winy1, winz1;
gluProject(centre.x() + size, centre.y() + size, centre.z() + size,
modelMatrix, projectionMatrix, viewport,
&winx1, &winy1, &winz1);
winSize = std::sqrt((std::pow(winx - winx1, 2) +
std::pow(winy - winy1, 2) +
std::pow(winz - winz1, 2)) / 3.);
glRasterPos3d(centre.x(),centre.y(),centre.z());
const GLubyte* marker =
G4OpenGLBitMapStore::GetBitMap(shape, size, filled);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glBitmap(size, size, size/2., size/2., 0., 0., marker);
}
else {
winSize = scale *
userSpecified ? marker.GetScreenSize() : def.GetScreenSize();
}
// Prepare to draw in window coordinates...
glMatrixMode (GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
gluOrtho2D(GLdouble(viewport[0]),
GLdouble(viewport[0] + viewport[2]),
GLdouble(viewport[1]),
GLdouble(viewport[1] + viewport[3]));
glMatrixMode (GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
// Draw in window coordinates...
DrawScreenPolygon (winSize, G4Point3D(winx, winy, winz), nSides);
// Re-instate matrices...
glMatrixMode (GL_PROJECTION);
glPopMatrix();
glMatrixMode (GL_MODELVIEW);
glPopMatrix();
...
}
void G4OpenGLSceneHandler::DrawScreenPolygon
(G4double size,
const G4Point3D& centre,
G4int nSides) {
glBegin (GL_POLYGON);
const G4double dPhi = twopi / nSides;
const G4double r = size / 2.;
G4double phi;
G4int i;
for (i = 0, phi = -dPhi / 2.; i < nSides; i++, phi += dPhi) {
G4double x, y, z;
x = centre.x() + r * std::cos(phi);
y = centre.y() + r * std::sin(phi);
z = centre.z();
glVertex3d (x, y, z);
}
glEnd ();
}
**********************************************/
void G4OpenGLSceneHandler::DrawXYPolygon
(G4double size,
(G4OpenGLBitMapStore::Shape shape,
G4double size,
const G4Point3D& centre,
G4int nSides) {
const G4VisAttributes* pApplicableVisAtts)
{
G4int nSides;
G4double startPhi;
if (shape == G4OpenGLBitMapStore::circle) {
nSides = GetNoOfSides(pApplicableVisAtts);
startPhi = 0.;
} else {
nSides = 4;
startPhi = -pi / 4.;
}
const G4Vector3D& viewpointDirection =
fpViewer -> GetViewParameters().GetViewpointDirection();
const G4Vector3D& up = fpViewer->GetViewParameters().GetUpVector();
@@ -380,8 +288,9 @@ void G4OpenGLSceneHandler::DrawXYPolygon
G4Vector3D start = radius * (up.cross(viewpointDirection)).unit();
G4double phi;
G4int i;
glBegin (GL_POLYGON);
for (i = 0, phi = 0.; i < nSides; i++, phi += dPhi) {
for (i = 0, phi = startPhi; i < nSides; i++, phi += dPhi) {
G4Vector3D r = start; r.rotate(phi, viewpointDirection);
G4Vector3D p = centre + r;
glVertex3d (p.x(), p.y(), p.z());
@@ -409,7 +318,7 @@ void G4OpenGLSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron) {
G4bool transparency_enabled = true;
G4OpenGLViewer* pViewer = dynamic_cast<G4OpenGLViewer*>(fpViewer);
if (pViewer) transparency_enabled = pViewer->transparency_enabled;
const G4Colour& c = GetColour (polyhedron);
const G4Colour& c = pVA->GetColour();
GLfloat materialColour [4];
materialColour [0] = c.GetRed ();
materialColour [1] = c.GetGreen ();
@@ -420,7 +329,7 @@ void G4OpenGLSceneHandler::AddPrimitive (const G4Polyhedron& polyhedron) {
materialColour [3] = 1.;
}
G4double lineWidth = GetLineWidth(polyhedron);
G4double lineWidth = GetLineWidth(pVA);
glLineWidth(lineWidth);
GLfloat clear_colour[4];
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLStoredSceneHandler.cc,v 1.31 2006/08/30 11:43:57 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLStoredSceneHandler.cc,v 1.32 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 10th February 1997
@@ -211,7 +211,7 @@ void G4OpenGLStoredSceneHandler::BeginPrimitives2D()
glMatrixMode (GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho (-1., 1., -1., 1., -DBL_MAX, DBL_MAX);
glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
glMatrixMode (GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLStoredViewer.cc,v 1.20 2006/10/24 06:23:18 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLStoredViewer.cc,v 1.21 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 7th February 1997
@@ -166,11 +166,11 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
}
// Display time at "head" of time range, which is fEndTime...
if (fDisplayHeadTime && fEndTime < DBL_MAX) {
if (fDisplayHeadTime && fEndTime < G4OPENGL_DBL_MAX) {
glMatrixMode (GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glOrtho (-1., 1., -1., 1., -DBL_MAX, DBL_MAX);
glOrtho (-1., 1., -1., 1., -G4OPENGL_DBL_MAX, G4OPENGL_DBL_MAX);
glMatrixMode (GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
@@ -190,7 +190,7 @@ void G4OpenGLStoredViewer::DrawDisplayLists () {
}
// Display light front...
if (fDisplayLightFront && fEndTime < DBL_MAX) {
if (fDisplayLightFront && fEndTime < G4OPENGL_DBL_MAX) {
G4double lightFrontRadius = (fEndTime - fDisplayLightFrontT) * c_light;
if (lightFrontRadius > 0.) {
G4Point3D lightFrontCentre(fDisplayLightFrontX, fDisplayLightFrontY, fDisplayLightFrontZ);
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLViewer.cc,v 1.29 2006/09/19 16:13:15 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLViewer.cc,v 1.30 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 27th March 1996
@@ -52,8 +52,8 @@ background (G4Colour(0.,0.,0.)),
transparency_enabled (true),
antialiasing_enabled (false),
haloing_enabled (false),
fStartTime(-DBL_MAX),
fEndTime(DBL_MAX),
fStartTime(-G4OPENGL_DBL_MAX),
fEndTime(G4OPENGL_DBL_MAX),
fFadeFactor(0.),
fDisplayHeadTime(false),
fDisplayHeadTimeX(-0.9),
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLViewerMessenger.cc,v 1.5 2006/10/24 06:20:42 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLViewerMessenger.cc,v 1.6 2007/02/08 14:01:55 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
#include "G4OpenGLViewerMessenger.hh"
@@ -145,7 +145,7 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
new G4UIcommand("/vis/ogl/set/endTime", this);
fpCommandEndTime->SetGuidance("Set end and range of track time.");
parameter = new G4UIparameter ("end-time", 'd', omitable = false);
parameter->SetDefaultValue(DBL_MAX);
parameter->SetDefaultValue(G4OPENGL_DBL_MAX);
fpCommandEndTime->SetParameter(parameter);
parameter = new G4UIparameter ("end-time-unit", 's', omitable = false);
parameter->SetDefaultValue("ns");
@@ -168,7 +168,7 @@ G4OpenGLViewerMessenger::G4OpenGLViewerMessenger()
new G4UIcommand("/vis/ogl/set/startTime", this);
fpCommandStartTime->SetGuidance("Set start and range of track time.");
parameter = new G4UIparameter ("start-time", 'd', omitable = false);
parameter->SetDefaultValue(-DBL_MAX);
parameter->SetDefaultValue(-G4OPENGL_DBL_MAX);
fpCommandStartTime->SetParameter(parameter);
parameter = new G4UIparameter ("start-time-unit", 's', omitable = false);
parameter->SetDefaultValue("ns");
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenGLXViewer.cc,v 1.34 2006/11/01 11:22:26 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenGLXViewer.cc,v 1.36 2007/02/08 13:47:22 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Andrew Walkden 7th February 1997
@@ -180,17 +180,27 @@ void G4OpenGLXViewer::CreateGLXContext (XVisualInfo* v) {
True);
if (status == 1) {
cmap = 0;
status = XGetRGBColormaps (dpy,
XRootWindow (dpy, vi -> screen),
&standardCmaps,
&numCmaps,
XA_RGB_DEFAULT_MAP);
if (status == 1)
for (i = 0; i < numCmaps; i++)
for (i = 0; i < numCmaps; i++) {
if (standardCmaps[i].visualid == vi -> visualid) {
cmap = standardCmaps[i].colormap;
XFree (standardCmaps);
break;
}
}
if (!cmap) {
fViewId = -1; // This flags an error.
G4cerr <<
"G4OpenGLViewer::G4OpenGLViewer failed to allocate a standard colormap."
<< G4endl;
return;
}
G4cout << "Got standard cmap" << G4endl;
} else {
cmap = XCreateColormap (dpy,
@@ -344,7 +354,8 @@ G4OpenGLViewer (scene),
print_colour (true),
vectored_ps (true),
vi_immediate (0),
vi_stored (0)
vi_stored (0),
cmap (0)
{
strcpy (print_string, "G4OpenGL.eps");
@@ -479,7 +490,7 @@ void G4OpenGLXViewer::print() {
win=glxpmap;
glXMakeCurrent (dpy,
glxpmap,
win,
cx);
glViewport (0, 0, WinSize_x, WinSize_y);
@@ -495,7 +506,7 @@ void G4OpenGLXViewer::print() {
cx=tmp_cx;
glXMakeCurrent (dpy,
glxpmap,
win,
cx);
}
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.90 2006/11/05 20:49:09 allison Exp $
$Id: History,v 1.91 2007/01/05 16:53:12 allison Exp $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +20,9 @@ committal in the CVS repository !
History file for visualization/OpenInventor
-------------------------------------------
5th January 2007 John Allison (openinventor-V08-02-00)
- Moved LoadAtts to vis management.
5th November 2006 John Allison (openinventor-V08-01-04)
- Protected against zero material pointer.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenInventorSceneHandler.hh,v 1.31 2006/11/02 12:01:20 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenInventorSceneHandler.hh,v 1.32 2007/01/05 16:52:47 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// J Kallenbach 27th Aug 1996
@@ -47,7 +47,6 @@
class G4OpenInventor;
class SoSeparator;
class Geant4_SoStyleCache;
class G4AttHolder;
// Base class for various OpenInventorScene classes.
class G4OpenInventorSceneHandler: public G4VSceneHandler {
@@ -85,7 +84,6 @@ public:
private:
void LoadAtts(const G4Visible&, G4AttHolder*);
static G4int fSceneIdCount; // static counter for OpenInventor scenes.
enum G4OIMarker {G4OICircle, G4OISquare};
void AddCircleSquare (G4OIMarker markerType, const G4VMarker&);
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4OpenInventorSceneHandler.cc,v 1.50 2006/11/05 20:48:57 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4OpenInventorSceneHandler.cc,v 1.51 2007/01/05 16:52:47 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// Jeff Kallenbach 01 Aug 1996
@@ -95,12 +95,6 @@ typedef HEPVis_SoMarkerSet SoMarkerSet;
#include "G4Cons.hh"
#include "G4Trap.hh"
#include "G4Trd.hh"
#include "G4PhysicalVolumeModel.hh"
#include "G4TrajectoriesModel.hh"
#include "G4VTrajectory.hh"
#include "G4VTrajectoryPoint.hh"
#include "G4HitsModel.hh"
#include "G4VHit.hh"
#include "G4ModelingParameters.hh"
#include "G4VPhysicalVolume.hh"
#include "G4LogicalVolume.hh"
@@ -188,56 +182,6 @@ void G4OpenInventorSceneHandler::BeginPrimitives
}
}
void G4OpenInventorSceneHandler::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);
}
}
}
//
// Method for handling G4Polyline objects (from tracking).
//
@@ -256,7 +200,7 @@ void G4OpenInventorSceneHandler::AddPrimitive (const G4Polyline& line) {
//
// Color
//
const G4Colour& c = GetColour (line);
const G4Colour& c = GetColour(line);
SoMaterial* material =
fStyleCache->getMaterial((float)c.GetRed(),
(float)c.GetGreen(),
@@ -306,7 +250,7 @@ void G4OpenInventorSceneHandler::AddPrimitive (const G4Polymarker& polymarker) {
// Don't understand why I have to do this again (done in
// GeneratePrerequisites) - JA.
const G4Colour& c = GetColour (polymarker);
const G4Colour& c = GetColour(polymarker);
SoMaterial* material =
fStyleCache->getMaterial((float)c.GetRed(),
(float)c.GetGreen(),
@@ -482,7 +426,7 @@ void G4OpenInventorSceneHandler::AddCircleSquare
//
// Color
//
const G4Colour& c = GetColour (marker);
const G4Colour& c = GetColour(marker);
SoMaterial* material =
fStyleCache->getMaterial((float)c.GetRed(),
(float)c.GetGreen(),
@@ -621,7 +565,7 @@ void G4OpenInventorSceneHandler::AddPrimitive (const G4NURBS& nurb) {
//
// Color
//
const G4Colour& c = GetColour (nurb);
const G4Colour& c = GetColour(nurb);
SoMaterial* material =
fStyleCache->getMaterial((float)c.GetRed(),
(float)c.GetGreen(),
+4 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.49 2006/11/17 21:34:12 perl Exp $
$Id: History,v 1.51 2007/01/05 17:06:36 allison Exp $
-------------------------------------------------------------------
=========================================================
@@ -24,6 +24,9 @@ committal in the CVS repository !
History file for Ray Tracer category
---------------------------------------
5th January 2007 John Allison (raytracer-V08-02-00)
- Bug fix: use of window size hints.
17th November 2006 Joseph Perl (raytracer-V08-01-02)
- Deprecate /vis/rayTracer/backgroundColour.
- Hasn't worked for some time anyway.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4RayTracerViewer.cc,v 1.16 2006/06/29 21:24:15 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4RayTracerViewer.cc,v 1.17 2007/01/05 17:05:11 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
#include "G4RayTracerViewer.hh"
@@ -79,6 +79,8 @@ void G4RayTracerViewer::SetView()
actualLightpointDirection(-fVP.GetActualLightpointDirection());
theTracer->SetLightDirection(actualLightpointDirection);
theTracer->SetBackgroundColour(fVP.GetBackgroundColour());
theTracer->SetNColumn(fVP.GetWindowSizeHintX());
theTracer->SetNRow(fVP.GetWindowSizeHintY());
}
+7 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.27 2006/11/05 20:46:32 allison Exp $
$Id: History,v 1.29 2007/01/05 17:01:16 allison Exp $
-------------------------------------------------------------------
=========================================================
@@ -24,6 +24,12 @@ committal in the CVS repository !
History file for visualization/Tree sub-category
------------------------------------------------
5th January 2007 John Allison (vistree-V08-02-00)
- Bug fix: Format of total mass.
11th December 2006 John Allison
- Trapped sequential G4PVPlacements.
5th November 2006 John Allison (vistree-V08-01-02)
- Protected against zero material pointer.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITreeSceneHandler.hh,v 1.16 2006/06/29 21:24:31 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4ASCIITreeSceneHandler.hh,v 1.17 2006/12/11 21:14:45 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 5th April 2001
@@ -42,6 +42,7 @@
#include <vector>
#include <iostream>
#include <fstream>
#include <sstream>
class G4VPhysicalVolume;
@@ -59,10 +60,15 @@ protected:
void WriteHeader (std::ostream &);
const G4VPhysicalVolume* fpLastPV; // Records last physical volume.
G4int fPVPCount; // Counts parameterisations.
std::ostream* fpOutFile; // Pointer to output file.
std::ofstream fOutFile; // Actual output file (if not G4cout).
std::ostringstream fRestOfLine; // For accumulating rest of line
// pending arrival of new
// G4PVPlacement.
const G4VPhysicalVolume* fpLastPV;
G4String fLastPVName;
G4int fLastCopyNo;
G4int fLastNonSequentialCopyNo;
std::set<G4LogicalVolume*> fLVSet;
typedef std::set<G4LogicalVolume*>::iterator LVSetIterator;
+2 -2
View File
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITree.cc,v 1.10 2006/06/29 21:24:53 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4ASCIITree.cc,v 1.12 2007/01/05 16:59:43 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 5th April 2001
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITreeMessenger.cc,v 1.16 2006/06/29 21:24:55 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4ASCIITreeMessenger.cc,v 1.19 2007/01/05 16:59:43 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 5th April 2001
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4ASCIITreeSceneHandler.cc,v 1.32 2006/11/05 20:44:28 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4ASCIITreeSceneHandler.cc,v 1.34 2007/01/05 17:00:27 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 5th April 2001
@@ -55,9 +55,10 @@ G4ASCIITreeSceneHandler::G4ASCIITreeSceneHandler
(G4VGraphicsSystem& system,
const G4String& name):
G4VTreeSceneHandler(system, name),
fpLastPV (0),
fPVPCount (0),
fpOutFile (0)
fpOutFile(0),
fpLastPV(0),
fLastCopyNo(-99),
fLastNonSequentialCopyNo(-99)
{}
G4ASCIITreeSceneHandler::~G4ASCIITreeSceneHandler () {}
@@ -116,6 +117,21 @@ void G4ASCIITreeSceneHandler::EndModeling () {
const G4int detail = verbosity % 10;
const G4String& outFileName = pSystem -> GetOutFileName();
// Output left over copy number, if any...
if (fLastCopyNo != fLastNonSequentialCopyNo) {
if (fLastCopyNo == fLastNonSequentialCopyNo + 1) *fpOutFile << ',';
else *fpOutFile << '-';
*fpOutFile << fLastCopyNo;
}
// Output outstanding rest of line, if any...
if (!fRestOfLine.str().empty()) *fpOutFile << fRestOfLine.str();
fRestOfLine.str("");
fpLastPV = 0;
fLastPVName.clear();
fLastCopyNo = -99;
fLastNonSequentialCopyNo = -99;
// This detail to G4cout regardless of outFileName...
if (detail >= 4) {
G4cout << "Calculating mass(es)..." << G4endl;
const std::vector<G4VModel*>& models = fpScene->GetRunDurationModelList();
@@ -164,8 +180,6 @@ void G4ASCIITreeSceneHandler::EndModeling () {
fOutFile.close();
G4cout << "Output file \"" << outFileName << "\" closed." << G4endl;
}
fpLastPV = 0;
fPVPCount = 0;
fLVSet.clear();
fReplicaSet.clear();
G4cout << "G4ASCIITreeSceneHandler::EndModeling" << G4endl;
@@ -195,12 +209,6 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
G4ASCIITree* pSystem = (G4ASCIITree*)GetGraphicsSystem();
G4int verbosity = pSystem->GetVerbosity();
G4int detail = verbosity % 10;
const G4String& outFileName = pSystem -> GetOutFileName();
if (pCurrentPV != fpLastPV) {
fpLastPV = pCurrentPV;
fPVPCount = 0;
}
if (verbosity < 10 && pCurrentPV->IsReplicated()) {
// See if this has been a replica found before with same mother LV...
@@ -245,110 +253,149 @@ void G4ASCIITreeSceneHandler::RequestPrimitives(const G4VSolid& solid) {
}
}
// Print indented text...
if (pCurrentPV) {
for (size_t i = 0; i < drawnPVPath.size(); i++ ) *fpOutFile << " ";
*fpOutFile << "\"" << pCurrentPV->GetName()
<< "\":" << pCurrentPV->GetCopyNo();
const G4String& currentPVName = pCurrentPV->GetName();
const G4int currentCopyNo = pCurrentPV->GetCopyNo();
if (verbosity < 10 &&
currentPVName == fLastPVName &&
currentCopyNo != fLastCopyNo) {
// For low verbosity, trap series of G4PVPlacements with the same name but
// different copy number (replicas should have been taken out above)...
// Check...
if (pCurrentPV->IsReplicated()) {
if (verbosity < 10) {
// Add printing for replicas (when replicas are ignored)...
EAxis axis;
G4int nReplicas;
G4double width;
G4double offset;
G4bool consuming;
pCurrentPV->GetReplicationData(axis,nReplicas,width,offset,consuming);
G4VPVParameterisation* pP = pCurrentPV->GetParameterisation();
if (pP) {
if (detail < 3) {
fReplicaSet.insert(drawnPVPath);
*fpOutFile << " (" << nReplicas << " parametrised volumes)";
}
}
else {
fReplicaSet.insert(drawnPVPath);
*fpOutFile << " (" << nReplicas << " replicas)";
}
}
G4Exception("G4ASCIITreeSceneHandler::RequestPrimitives",
"",
JustWarning,
"Replica unexpected");
}
else {
if (fLVSet.find(pCurrentLV) != fLVSet.end()) {
if (verbosity < 10) {
// Add printing for repeated LV...
*fpOutFile << " (repeated LV)";
// ...and curtail descent.
pPVModel->CurtailDescent();
}
// Check mothers are identical...
else if (pCurrentLV == (fpLastPV? fpLastPV->GetLogicalVolume(): 0)) {
if (currentCopyNo != fLastCopyNo + 1) {
// Non-sequential copy number...
*fpOutFile << ',' << currentCopyNo;
fLastNonSequentialCopyNo = currentCopyNo;
}
fLastCopyNo = currentCopyNo;
pPVModel->CurtailDescent();
return;
}
}
fpLastPV = pCurrentPV;
if (detail >= 1) {
*fpOutFile << " / \""
<< pCurrentLV->GetName() << "\"";
G4VSensitiveDetector* sd = pCurrentLV->GetSensitiveDetector();
if (sd) {
*fpOutFile << " (SD=\"" << sd->GetName() << "\"";
G4VReadOutGeometry* roGeom = sd->GetROgeometry();
if (roGeom) {
*fpOutFile << ",RO=\"" << roGeom->GetName() << "\"";
// High verbosity or a new G4VPhysicalVolume...
// Output copy number, if any, from previous invocation...
if (fLastCopyNo != fLastNonSequentialCopyNo) {
if (fLastCopyNo == fLastNonSequentialCopyNo + 1) *fpOutFile << ',';
else *fpOutFile << '-';
*fpOutFile << fLastCopyNo;
}
// Output rest of line, if any, from previous invocation...
if (!fRestOfLine.str().empty()) *fpOutFile << fRestOfLine.str();
fRestOfLine.str("");
fLastPVName = currentPVName;
fLastCopyNo = currentCopyNo;
fLastNonSequentialCopyNo = currentCopyNo;
// Indent according to drawn path depth...
for (size_t i = 0; i < drawnPVPath.size(); i++ ) *fpOutFile << " ";
// Start next line...
*fpOutFile << "\"" << currentPVName
<< "\":" << currentCopyNo;
if (pCurrentPV->IsReplicated()) {
if (verbosity < 10) {
// Add printing for replicas (when replicas are ignored)...
EAxis axis;
G4int nReplicas;
G4double width;
G4double offset;
G4bool consuming;
pCurrentPV->GetReplicationData(axis,nReplicas,width,offset,consuming);
G4VPVParameterisation* pP = pCurrentPV->GetParameterisation();
if (pP) {
if (detail < 3) {
fReplicaSet.insert(drawnPVPath);
if (nReplicas > 2) fRestOfLine << '-';
else fRestOfLine << ',';
fRestOfLine << nReplicas - 1
<< " (" << nReplicas << " parametrised volumes)";
}
*fpOutFile << ")";
}
else {
fReplicaSet.insert(drawnPVPath);
if (nReplicas > 2) fRestOfLine << '-';
else fRestOfLine << ',';
fRestOfLine << nReplicas - 1
<< " (" << nReplicas << " replicas)";
}
}
} // if (pCurrentPV)
} else {
if (fLVSet.find(pCurrentLV) != fLVSet.end()) {
if (verbosity < 10) {
// Add printing for repeated LV (if it has daughters)...
if (pCurrentLV->GetNoDaughters()) fRestOfLine << " (repeated LV)";
// ...and curtail descent.
pPVModel->CurtailDescent();
}
}
}
if (detail >= 1) {
fRestOfLine << " / \""
<< pCurrentLV->GetName() << "\"";
G4VSensitiveDetector* sd = pCurrentLV->GetSensitiveDetector();
if (sd) {
fRestOfLine << " (SD=\"" << sd->GetName() << "\"";
G4VReadOutGeometry* roGeom = sd->GetROgeometry();
if (roGeom) {
fRestOfLine << ",RO=\"" << roGeom->GetName() << "\"";
}
fRestOfLine << ")";
}
}
if (detail >= 2) {
*fpOutFile << " / \""
fRestOfLine << " / \""
<< solid.GetName()
<< "\"("
<< solid.GetEntityType() << ")";
}
if (pCurrentPV) {
if (detail >= 3) {
*fpOutFile << ", "
<< G4BestUnit(((G4VSolid&)solid).GetCubicVolume(),"Volume")
<< ", ";
if (pCurrentMaterial) {
*fpOutFile
<< G4BestUnit(pCurrentMaterial->GetDensity(), "Volumic Mass")
<< " (" << pCurrentMaterial->GetName() << ")";
} else {
*fpOutFile << "(No material)";
}
if (detail >= 3) {
fRestOfLine << ", "
<< G4BestUnit(((G4VSolid&)solid).GetCubicVolume(),"Volume")
<< ", ";
if (pCurrentMaterial) {
fRestOfLine
<< G4BestUnit(pCurrentMaterial->GetDensity(), "Volumic Mass")
<< " (" << pCurrentMaterial->GetName() << ")";
} else {
fRestOfLine << "(No material)";
}
if (detail >= 5) {
if (pCurrentMaterial) {
G4Material* pMaterial = const_cast<G4Material*>(pCurrentMaterial);
// ...and find daughter-subtracted mass...
G4double daughter_subtracted_mass = pCurrentLV->GetMass
(pCurrentPV->IsParameterised(), // Force if parametrised.
false, // Do not propagate - calculate for this volume minus
// volume of daughters.
pMaterial);
G4double daughter_subtracted_volume =
daughter_subtracted_mass / pCurrentMaterial->GetDensity();
*fpOutFile << ", "
<< G4BestUnit(daughter_subtracted_volume,"Volume")
<< ", "
<< G4BestUnit(daughter_subtracted_mass,"Mass");
}
}
if (fLVSet.find(pCurrentLV) == fLVSet.end()) {
fLVSet.insert(pCurrentLV); // Record new logical volume.
}
} // if (pCurrentPV)
if (outFileName == "G4cout") {
G4cout << G4endl;
} else {
*fpOutFile << std::endl;
}
if (detail >= 5) {
if (pCurrentMaterial) {
G4Material* pMaterial = const_cast<G4Material*>(pCurrentMaterial);
// ...and find daughter-subtracted mass...
G4double daughter_subtracted_mass = pCurrentLV->GetMass
(pCurrentPV->IsParameterised(), // Force if parametrised.
false, // Do not propagate - calculate for this volume minus
// volume of daughters.
pMaterial);
G4double daughter_subtracted_volume =
daughter_subtracted_mass / pCurrentMaterial->GetDensity();
fRestOfLine << ", "
<< G4BestUnit(daughter_subtracted_volume,"Volume")
<< ", "
<< G4BestUnit(daughter_subtracted_mass,"Mass");
}
}
if (fLVSet.find(pCurrentLV) == fLVSet.end()) {
fLVSet.insert(pCurrentLV); // Record new logical volume.
}
fRestOfLine << std::endl;
return;
}
+27 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.90 2006/12/12 11:51:13 gcosmo Exp $
$Id: History,v 1.92 2007/01/11 16:43:49 allison Exp $
-------------------------------------------------------------------
@@ -26,6 +26,32 @@ committal in the CVS repository !
History file for visualization management sub-category
------------------------------------------------------
11th January 2007 John Allison (visman-V08-02-01)
- Added /vis/abortReviewKeptEvents.
- /vis/reviewKeptEvents: Improved guidance.
- Bug fix: /vis/open in /vis/reviewKeptEvents loop.
o Moved fpRequestedEvent from G4VSceneHandler to G4VisManager.
- Reduced WARNING noise.
5th January 2007 John Allison (visman-V08-02-00)
- G4VSceneHandler:
o Introduced LoadAtts (from G4OpenInventorSceneHandler, but now
available to all scene handlers). Loads G4AttValues and G4AttDefs
onto any object that inherits G4AttHolder.
o Change signature of GetLineWidth from G4Visible& to
G4VisAttributes* for consistency with similar utility functions.
(Only used by OpenGL at present; requires opengl-V08-02-00.)
o GetLineSegmentsPerCircle: protected against null vis atts pointer.
- G4VisCommandsGeometrySet and G4VisManager.cc:
o Introduced /vis/geometry/set/forceLineSegmentsPerCircle
(inadvertently omitted in previous release).
o Improved guidance.
- G4VisCommandsGeometry.cc: Invoke /vis/viewer/rebuild only if viewer current.
- G4VViewer.cc: Improved comment.
- G4VisCommandsCompound.cc:
o Re-introduced /vis/scene/add/eventID into /vis/drawVolume.
- G4VisCommandsViewer.cc: Improve guidance for /vis/viewer/addCutawayPlane.
12th December 2006 Gabriele Cosmo (visman-V08-01-16)
- Commented command "vis/scene/add/eventID" forcing event ID to scene in
G4VisCommandsCompound.cc.
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VSceneHandler.hh,v 1.37 2006/11/15 19:25:31 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4VSceneHandler.hh,v 1.39 2007/01/11 16:38:14 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 19th July 1996.
@@ -58,6 +58,7 @@ class G4LogicalVolume;
class G4VPhysicalVolume;
class G4Material;
class G4Event;
class G4AttHolder;
class G4VSceneHandler: public G4VGraphicsScene {
@@ -216,10 +217,6 @@ public: // With description
void SetTransientsDrawnThisEvent (G4bool);
void SetTransientsDrawnThisRun (G4bool);
// Maintained by vis manager.
void SetEvent (const G4Event*);
// If non-zero, this event is used in ProcessScene. Otherwise, the
// current event, or last event(s) are used. The user must
// SetEvent(0) when finished.
//////////////////////////////////////////////////////////////
// Public utility functions.
@@ -232,9 +229,8 @@ public: // With description
const G4Colour& GetTextColor (const G4Text&);
// Returns colour of G4Text object, or default text colour.
G4double GetLineWidth(const G4Visible& visible);
// Returns line width of G4Visible object, or default line width.
// Multiplies by GlobalLineWidthScale.
G4double GetLineWidth(const G4VisAttributes*);
// Returns line width of G4VisAttributes multiplied by GlobalLineWidthScale.
G4ViewParameters::DrawingStyle GetDrawingStyle (const G4VisAttributes*);
// Returns drawing style from current view parameters, unless the user
@@ -246,7 +242,7 @@ public: // With description
// unless the user has forced through the vis attributes, thereby
// over-riding the current view parameter.
G4int GetNoOfSides(const G4VisAttributes* pVisAttribs);
G4int GetNoOfSides(const G4VisAttributes*);
// Returns no. of sides (lines segments per circle) from current
// view parameters, unless the user has forced through the vis
// attributes, thereby over-riding the current view parameter.
@@ -313,6 +309,15 @@ protected:
// Generic clipping using the BooleanProcessor in graphics_reps is
// implemented in this class. Subclasses that implement their own
// clipping should provide an override that returns zero.
void LoadAtts(const G4Visible&, G4AttHolder*);
// Load G4AttValues and G4AttDefs associated with the G4Visible
// object onto the G4AttHolder object. It checks fpModel, and also
// loads the G4AttValues and G4AttDefs from G4PhysicalVolumeModel,
// G4VTrajectory, G4VTrajectoryPoint, or G4VHits, as appropriate.
// The G4AttHolder object is an object of a class that publicly
// inherits G4AttHolder - see, e.g., SoG4Polyhedron in the Open
// Inventor driver. G4AttHolder deletes G4AttValues in its
// destructor to ensure proper clean-up of G4AttValues.
//////////////////////////////////////////////////////////////
// Data members
@@ -337,7 +342,6 @@ protected:
// object transformation.
G4int fNestingDepth; // For Begin/EndPrimitives.
const G4VisAttributes* fpVisAttribs; // Working vis attributes.
const G4Event* fRequestedEvent; // If non-zero, use this event.
const G4Transform3D fIdentityTransformation;
private:
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VSceneHandler.icc,v 1.18 2006/11/15 19:25:31 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4VSceneHandler.icc,v 1.20 2007/01/11 16:38:14 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 19th July 1996.
@@ -123,9 +123,6 @@ inline void G4VSceneHandler::SetTransientsDrawnThisRun (G4bool drawn) {
fTransientsDrawnThisRun = drawn;
}
inline void G4VSceneHandler::SetEvent (const G4Event* event) {
fRequestedEvent = event;
}
inline const G4Colour& G4VSceneHandler::GetColor (const G4Visible& visible) {
return GetColour (visible);
}
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VisCommands.hh,v 1.6 2006/11/14 14:59:54 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4VisCommands.hh,v 1.7 2007/01/11 16:39:33 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
// /vis/ top level commands - John Allison 5th February 2001
@@ -38,6 +38,18 @@ class G4UIcmdWithABool;
class G4UIcmdWithAString;
class G4UIcmdWithoutParameter;
class G4VisCommandAbortReviewKeptEvents: public G4VVisCommand {
public:
G4VisCommandAbortReviewKeptEvents ();
virtual ~G4VisCommandAbortReviewKeptEvents ();
G4String GetCurrentValue (G4UIcommand* command);
void SetNewValue (G4UIcommand* command, G4String newValue);
private:
G4VisCommandAbortReviewKeptEvents (const G4VisCommandAbortReviewKeptEvents&);
G4VisCommandAbortReviewKeptEvents& operator = (const G4VisCommandAbortReviewKeptEvents&);
G4UIcmdWithABool* fpCommand;
};
class G4VisCommandEnable: public G4VVisCommand {
public:
G4VisCommandEnable ();
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VisCommandsGeometrySet.hh,v 1.2 2006/06/29 21:28:36 gunter Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4VisCommandsGeometrySet.hh,v 1.3 2007/01/05 16:24:19 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
// /vis/geometry commands - John Allison 31st January 2006
@@ -81,6 +81,19 @@ private:
G4bool fForceAuxEdgeVisible;
};
class G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction:
public G4VVisCommandGeometrySetFunction {
public:
G4VisCommandGeometrySetForceLineSegmentsPerCircleFunction
(G4int lineSegmentsPerCircle):
fLineSegmentsPerCircle(lineSegmentsPerCircle) {}
void operator()
(G4VisAttributes* visAtts) const
{visAtts->SetForceLineSegmentsPerCircle(fLineSegmentsPerCircle);}
private:
G4int fLineSegmentsPerCircle;
};
class G4VisCommandGeometrySetForceSolidFunction:
public G4VVisCommandGeometrySetFunction {
public:
@@ -211,6 +224,21 @@ private:
G4UIcommand* fpCommand;
};
class G4VisCommandGeometrySetForceLineSegmentsPerCircle:
public G4VVisCommandGeometrySet {
public:
G4VisCommandGeometrySetForceLineSegmentsPerCircle ();
virtual ~G4VisCommandGeometrySetForceLineSegmentsPerCircle ();
G4String GetCurrentValue (G4UIcommand* command);
void SetNewValue (G4UIcommand* command, G4String newValue);
private:
G4VisCommandGeometrySetForceLineSegmentsPerCircle
(const G4VisCommandGeometrySetForceLineSegmentsPerCircle&);
G4VisCommandGeometrySetForceLineSegmentsPerCircle& operator=
(const G4VisCommandGeometrySetForceLineSegmentsPerCircle&);
G4UIcommand* fpCommand;
};
class G4VisCommandGeometrySetForceWireframe:
public G4VVisCommandGeometrySet {
public:
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VisManager.hh,v 1.65 2006/11/21 14:23:20 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4VisManager.hh,v 1.66 2007/01/11 16:40:05 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
@@ -348,6 +348,8 @@ public: // With description
G4int GetLastRunID () const;
G4bool GetTransientsDrawnThisRun () const;
G4bool GetTransientsDrawnThisEvent () const;
const G4Event* GetRequestedEvent () const;
G4bool GetAbortReviewKeptEvents () const;
void SetUserAction (G4VUserVisAction* pVisAction,
const G4VisExtent& = G4VisExtent::NullExtent);
@@ -365,6 +367,9 @@ public: // With description
void SetXGeometryString (const G4String&);
void SetEventRefreshing (G4bool);
void ResetTransientsDrawnFlags ();
// If non-zero, requested event is used in G4VSceneHandler::ProcessScene.
void SetRequestedEvent (const G4Event*);
void SetAbortReviewKeptEvents (G4bool);
/////////////////////////////////////////////////////////////////////
// Utility functions.
@@ -435,13 +440,15 @@ private:
std::vector<G4UIcommand*> fDirectoryList;
G4VisStateDependent* fpStateDependent; // Friend state dependent class.
G4int fWindowSizeHintX, fWindowSizeHintY; // For viewer...
G4String fXGeometryString; // ...construction.
G4TrajectoriesModel dummyTrajectoriesModel; // For passing drawing mode.
G4bool fEventRefreshing;
G4bool fTransientsDrawnThisRun;
G4bool fTransientsDrawnThisEvent;
G4bool fEventKeepingSuspended;
G4bool fKeptLastEvent;
G4String fXGeometryString; // ...construction.
G4TrajectoriesModel dummyTrajectoriesModel; // For passing drawing mode.
G4bool fEventRefreshing;
G4bool fTransientsDrawnThisRun;
G4bool fTransientsDrawnThisEvent;
G4bool fEventKeepingSuspended;
G4bool fKeptLastEvent;
const G4Event* fpRequestedEvent; // If non-zero, scene handler uses.
G4bool fAbortReviewKeptEvents;
// Trajectory draw model manager
G4VisModelManager<G4VTrajectoryModel>* fpTrajDrawModelMgr;
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4VisManager.icc,v 1.19 2006/11/14 14:59:55 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4VisManager.icc,v 1.20 2007/01/11 16:40:58 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// GEANT4 Visualization Manager - John Allison 02/Jan/1996.
@@ -89,6 +89,14 @@ inline G4bool G4VisManager::GetTransientsDrawnThisRun() const {
return fTransientsDrawnThisRun;
}
inline const G4Event* G4VisManager::GetRequestedEvent() const {
return fpRequestedEvent;
}
inline G4bool G4VisManager::GetAbortReviewKeptEvents() const {
return fAbortReviewKeptEvents;
}
inline void G4VisManager::SetUserActionExtent (const G4VisExtent& extent) {
fUserVisActionExtent = extent;
}
@@ -121,3 +129,11 @@ inline void G4VisManager::RegisterMessenger(G4UImessenger* msgr)
{
fMessengerList.push_back(msgr);
}
inline void G4VisManager::SetRequestedEvent (const G4Event* event) {
fpRequestedEvent = event;
}
inline void G4VisManager::SetAbortReviewKeptEvents (G4bool abort) {
fAbortReviewKeptEvents = abort;
}
@@ -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);
+5 -1
View File
@@ -1,4 +1,4 @@
$Id: History,v 1.96 2006/11/16 12:12:49 allison Exp $
$Id: History,v 1.97 2007/01/05 16:07:43 allison Exp $
-------------------------------------------------------------------
=========================================================
@@ -20,6 +20,10 @@ committal in the CVS repository !
History file for visualization/modeling
---------------------------------------
5th January 2007 John Allison (modeling-V08-02-00 - needs greps-V08-02-00)
- G4PhysicalVolumeModel.cc: Bug fix:
o Correct treatment of ForcedLineSegmentsPerCircle when clipping.
16th November 2006 John Allison (modeling-V08-01-15)
- Added protection for parallel worlds (zero region pointer).
@@ -24,8 +24,8 @@
// ********************************************************************
//
//
// $Id: G4PhysicalVolumeModel.cc,v 1.57 2006/11/16 12:11:30 allison Exp $
// GEANT4 tag $Name: geant4-08-02 $
// $Id: G4PhysicalVolumeModel.cc,v 1.58 2007/01/05 16:07:02 allison Exp $
// GEANT4 tag $Name: geant4-08-03 $
//
//
// John Allison 31st December 1997.
@@ -545,9 +545,13 @@ void G4PhysicalVolumeModel::DescribeSolid
// Clipping, etc., performed by Boolean operations on polyhedron objects.
// First, get polyhedron for current solid...
G4Polyhedron::SetNumberOfRotationSteps (fpMP->GetNoOfSides());
if (pVisAttribs->IsForceLineSegmentsPerCircle())
G4Polyhedron::SetNumberOfRotationSteps
(pVisAttribs->GetForcedLineSegmentsPerCircle());
else
G4Polyhedron::SetNumberOfRotationSteps(fpMP->GetNoOfSides());
G4Polyhedron* pOriginal = pSol->GetPolyhedron();
G4Polyhedron::ResetNumberOfRotationSteps ();
G4Polyhedron::ResetNumberOfRotationSteps();
if (!pOriginal) {
if (fpMP->IsWarning())
G4cout <<