Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file visualization/perspective/src/PerspectiveVisAction.cc
|
||||
/// \brief Implementation of the PerspectiveVisAction class
|
||||
//
|
||||
// $Id: PerspectiveVisAction.cc,v 1.2 2006-06-29 17:45:48 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#include "PerspectiveVisAction.hh"
|
||||
|
||||
@@ -37,6 +39,7 @@
|
||||
#include "G4Polyhedron.hh"
|
||||
#include "G4Vector3D.hh"
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4SystemOfUnits.hh"
|
||||
|
||||
PerspectiveVisAction::PerspectiveVisAction():
|
||||
fpVisManager(0),
|
||||
@@ -75,7 +78,7 @@ void PerspectiveVisAction::Draw()
|
||||
|
||||
if (fScene == "room-and-chair" )
|
||||
{
|
||||
RoomAndChair();
|
||||
RoomAndChair();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -144,13 +147,13 @@ void PerspectiveVisAction::Chair
|
||||
for (int i = -1; i < 2; i+=2) {
|
||||
for (int j = -1; j < 2; j+=2) {
|
||||
ExtendedDraw
|
||||
(G4Box("chair-leg",fChairThickness,
|
||||
fChairThickness,
|
||||
fChairSeat - fChairThickness),
|
||||
visAtts, transform *
|
||||
G4Translate3D(i * (fChairX - fChairThickness),
|
||||
j * (fChairY - fChairThickness),
|
||||
fChairSeat - fChairThickness));
|
||||
(G4Box("chair-leg",fChairThickness,
|
||||
fChairThickness,
|
||||
fChairSeat - fChairThickness),
|
||||
visAtts, transform *
|
||||
G4Translate3D(i * (fChairX - fChairThickness),
|
||||
j * (fChairY - fChairThickness),
|
||||
fChairSeat - fChairThickness));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -177,36 +180,36 @@ void PerspectiveVisAction::ExtendedDraw
|
||||
G4bool isAuxEdgeVisible = false; // How do I pick this up??? Can't.
|
||||
G4bool notLastFace;
|
||||
do {
|
||||
G4int n;
|
||||
G4Point3D nodes[4];
|
||||
notLastFace = polyhedron->GetNextFacet(n, nodes);
|
||||
G4bool notLastEdge;
|
||||
do {
|
||||
G4Point3D v1, v2;
|
||||
G4int edgeFlag;
|
||||
notLastEdge = polyhedron->GetNextEdge(v1, v2, edgeFlag);
|
||||
if (isAuxEdgeVisible || edgeFlag > 0) {
|
||||
G4Vector3D v21 = v2 - v1;
|
||||
// Check for components of actual edge...
|
||||
G4Vector3D v21a = v21;
|
||||
v21a.transform(transform);
|
||||
// G4cout << "v21a: " << v21a << G4endl;
|
||||
using namespace std;
|
||||
if (A ||
|
||||
(Z && abs(v21a.z()) >
|
||||
sqrt(v21a.x()*v21a.x()+v21a.y()*v21a.y())) ||
|
||||
(X && abs(v21a.x()) >
|
||||
sqrt(v21a.y()*v21a.y()+v21a.z()*v21a.z())) ||
|
||||
(Y && abs(v21a.y()) >
|
||||
sqrt(v21a.x()*v21a.x()+v21a.x()*v21a.z()))) {
|
||||
G4Polyline edge;
|
||||
edge.SetVisAttributes(G4Colour(.2,.2,.2));
|
||||
edge.push_back(v1 - extender * v21.unit());
|
||||
edge.push_back(v2 + extender * v21.unit());
|
||||
fpVisManager->Draw(edge, transform);
|
||||
}
|
||||
}
|
||||
} while (notLastEdge);
|
||||
G4int n;
|
||||
G4Point3D nodes[4];
|
||||
notLastFace = polyhedron->GetNextFacet(n, nodes);
|
||||
G4bool notLastEdge;
|
||||
do {
|
||||
G4Point3D v1, v2;
|
||||
G4int edgeFlag;
|
||||
notLastEdge = polyhedron->GetNextEdge(v1, v2, edgeFlag);
|
||||
if (isAuxEdgeVisible || edgeFlag > 0) {
|
||||
G4Vector3D v21 = v2 - v1;
|
||||
// Check for components of actual edge...
|
||||
G4Vector3D v21a = v21;
|
||||
v21a.transform(transform);
|
||||
// G4cout << "v21a: " << v21a << G4endl;
|
||||
using namespace std;
|
||||
if (A ||
|
||||
(Z && abs(v21a.z()) >
|
||||
sqrt(v21a.x()*v21a.x()+v21a.y()*v21a.y())) ||
|
||||
(X && abs(v21a.x()) >
|
||||
sqrt(v21a.y()*v21a.y()+v21a.z()*v21a.z())) ||
|
||||
(Y && abs(v21a.y()) >
|
||||
sqrt(v21a.x()*v21a.x()+v21a.x()*v21a.z()))) {
|
||||
G4Polyline edge;
|
||||
edge.SetVisAttributes(G4Colour(.2,.2,.2));
|
||||
edge.push_back(v1 - extender * v21.unit());
|
||||
edge.push_back(v2 + extender * v21.unit());
|
||||
fpVisManager->Draw(edge, transform);
|
||||
}
|
||||
}
|
||||
} while (notLastEdge);
|
||||
} while (notLastFace);
|
||||
}
|
||||
|
||||
|
||||
@@ -23,9 +23,11 @@
|
||||
// * acceptance of all terms of the Geant4 Software license. *
|
||||
// ********************************************************************
|
||||
//
|
||||
/// \file visualization/perspective/src/PerspectiveVisActionMessenger.cc
|
||||
/// \brief Implementation of the PerspectiveVisActionMessenger class
|
||||
//
|
||||
// $Id: PerspectiveVisActionMessenger.cc,v 1.3 2006-11-06 20:07:36 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
//
|
||||
// $Id$
|
||||
|
||||
#include "PerspectiveVisActionMessenger.hh"
|
||||
|
||||
@@ -48,6 +50,8 @@ PerspectiveVisActionMessenger::PerspectiveVisActionMessenger
|
||||
fpCommandOS = new G4UIcmdWithAString ("/perspectiveDemo/optionString", this);
|
||||
fpCommandOS -> SetGuidance
|
||||
("Option string - any combination of \"x\", \"y\", \"z\", \"a[ll]\".");
|
||||
fpCommandOS -> SetGuidance
|
||||
("Controls direction of perspective lines.");
|
||||
fpCommandOS -> SetParameterName ("option-string", omitable = true);
|
||||
fpCommandOS -> SetDefaultValue("all");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user