Import Geant4 9.6.0 source tree
This commit is contained in:
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILE.hh,v 1.9 2006-06-29 21:16:28 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE driver factory.
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILESceneHandler.hh,v 1.18 2010-05-30 10:18:32 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
|
||||
@@ -211,6 +210,12 @@ public:
|
||||
G4int ival4 ,
|
||||
const char* char_string );
|
||||
|
||||
void SendStrDouble3Str( const char* char_string1 ,
|
||||
G4double dval1 ,
|
||||
G4double dval2 ,
|
||||
G4double dval3 ,
|
||||
const char* char_string2 );
|
||||
|
||||
void SendStrDouble6Str( const char* char_string1 ,
|
||||
G4double dval1 ,
|
||||
G4double dval2 ,
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4DAWNFILEViewer.hh,v 1.10 2006-06-29 21:16:32 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE viewer - opens window, hard copy, etc.
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FRClientServer.hh,v 1.7 2006-06-29 21:16:34 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// Satoshi TANAKA, Wed Jul 3 14:13:52 JST 1996
|
||||
////////////////////////////////
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FRConst.hh,v 1.7 2006-06-29 21:16:36 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
// Satoshi TANAKA, Tue Jul 2 15:30:49 JST 1996
|
||||
///////////////////////////////////
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FRFeatures.hh,v 1.6 2006-06-29 21:16:38 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
#if !defined G4_FR_FEATURES_HH
|
||||
#define G4_FR_FEATURES_HH
|
||||
|
||||
@@ -24,10 +24,11 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FRSceneFunc.icc,v 1.16 2010-11-11 01:13:42 akimura Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
|
||||
#include <CLHEP/Units/PhysicalConstants.h>
|
||||
|
||||
#include "G4VisManager.hh"
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
@@ -41,6 +42,17 @@ void G4FRSCENEHANDLER::AddPrimitive (const G4Polyline& polyline)
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cout << "***** AddPrimitive\n";
|
||||
#endif
|
||||
if (fProcessing2D) {
|
||||
static G4bool warned = false;
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
G4Exception
|
||||
("G4FRSCENEHANDLER::AddPrimitive (const G4Polyline&)",
|
||||
"dawn0001", JustWarning,
|
||||
"2D polylines not implemented. Ignored.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
FRBeginModeling();
|
||||
|
||||
@@ -151,7 +163,7 @@ void G4FRSCENEHANDLER::AddPrimitive ( const G4Text& text )
|
||||
strncpy ( buf, vis_text, MAX_STR_LENGTH ) ;
|
||||
}
|
||||
|
||||
//----- select string command
|
||||
//----- select string command for 3D drawing
|
||||
char text_command[32];
|
||||
switch (size_type) {
|
||||
case world:
|
||||
@@ -164,10 +176,20 @@ void G4FRSCENEHANDLER::AddPrimitive ( const G4Text& text )
|
||||
}
|
||||
|
||||
//----- Send string command
|
||||
SendStrDouble6Str( text_command, \
|
||||
position.x() , position.y() , position.z(),
|
||||
fontsize , x_offset , y_offset ,
|
||||
buf );
|
||||
if (fProcessing2D) {
|
||||
// Map -1<x<1, -1<y<1 to 10<x<200, 53<y<243
|
||||
G4double x_mm = 95. * position.x() + 105.;
|
||||
G4double y_mm = 95. * position.y() + 148.;
|
||||
SendStrDouble3Str( FR_TEXT_2DS,
|
||||
x_mm, y_mm ,
|
||||
fontsize ,
|
||||
buf );
|
||||
} else {
|
||||
SendStrDouble6Str( text_command, \
|
||||
position.x() , position.y() , position.z(),
|
||||
fontsize , x_offset , y_offset ,
|
||||
buf );
|
||||
}
|
||||
|
||||
//----- delete buffer
|
||||
delete [] buf ;
|
||||
@@ -183,6 +205,17 @@ void G4FRSCENEHANDLER::AddPrimitive ( const G4Circle& mark_circle )
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cout << "***** AddPrimitive( G4Circle )\n";
|
||||
#endif
|
||||
if (fProcessing2D) {
|
||||
static G4bool warned = false;
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
G4Exception
|
||||
("G4FRSCENEHANDLER::AddPrimitive (const G4Circle&)",
|
||||
"dawn0002", JustWarning,
|
||||
"2D circles not implemented. Ignored.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
FRBeginModeling();
|
||||
|
||||
@@ -227,6 +260,17 @@ void G4FRSCENEHANDLER::AddPrimitive (const G4Square& mark_square )
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cout << "***** AddPrimitive( G4Square )\n";
|
||||
#endif
|
||||
if (fProcessing2D) {
|
||||
static G4bool warned = false;
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
G4Exception
|
||||
("G4FRSCENEHANDLER::AddPrimitive (const G4Square&)",
|
||||
"dawn0003", JustWarning,
|
||||
"2D squares not implemented. Ignored.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
FRBeginModeling();
|
||||
|
||||
@@ -271,6 +315,17 @@ void G4FRSCENEHANDLER::AddPrimitive ( const G4Polyhedron& polyhedron )
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cout << "***** AddPrimitive( G4Polyhedron )\n";
|
||||
#endif
|
||||
if (fProcessing2D) {
|
||||
static G4bool warned = false;
|
||||
if (!warned) {
|
||||
warned = true;
|
||||
G4Exception
|
||||
("G4FRSCENEHANDLER::AddPrimitive (const G4Polyhedron&)",
|
||||
"dawn0004", JustWarning,
|
||||
"2D polyhedrons not implemented. Ignored.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (polyhedron.GetNoFacets() == 0) return;
|
||||
|
||||
@@ -292,14 +347,13 @@ void G4FRSCENEHANDLER::AddPrimitive ( const G4Polyhedron& polyhedron )
|
||||
SendStr(FR_POLYHEDRON);
|
||||
|
||||
//---------- (2) Vertex block
|
||||
G4int i, j;
|
||||
for (i = 1, j = polyhedron.GetNoVertices(); j; j--, i++){
|
||||
for (G4int i = 1, j = polyhedron.GetNoVertices(); j; j--, i++){
|
||||
G4Point3D point = polyhedron.GetVertex(i);
|
||||
SendStrDouble3( FR_VERTEX, point.x (), point.y (), point.z ());
|
||||
}
|
||||
|
||||
//---------- (3) Facet block
|
||||
for (int f = polyhedron.GetNoFacets(); f; f--){
|
||||
for (G4int f = polyhedron.GetNoFacets(); f; f--){
|
||||
G4int notLastEdge;
|
||||
G4int index = -1; // initialization
|
||||
G4int edgeFlag = 1;
|
||||
@@ -431,8 +485,6 @@ void G4FRSCENEHANDLER::BeginPrimitives (const G4Transform3D& objectTransformatio
|
||||
FRBeginModeling();
|
||||
|
||||
G4VSceneHandler::BeginPrimitives (objectTransformation);
|
||||
fpObjectTransformation = &objectTransformation;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -654,8 +706,8 @@ void G4FRSCENEHANDLER::AddSolid ( const G4Sphere& sphere )
|
||||
SendTransformedCoordinates();
|
||||
|
||||
//----- send sphere to Fukui Renderer
|
||||
const G4double PI_minus = 0.9999 * pi ;
|
||||
const G4double PI2_minus = 1.9999 * pi ;
|
||||
const G4double PI_minus = 0.9999 * CLHEP::pi ;
|
||||
const G4double PI2_minus = 1.9999 * CLHEP::pi ;
|
||||
if( dphi > PI2_minus && dtheta > PI_minus ) {
|
||||
//----- full sphere
|
||||
SendStrDouble ( FR_SPHERE, rmax );
|
||||
@@ -787,12 +839,12 @@ void G4FRSCENEHANDLER::AddSolid (const G4Trap& trap)
|
||||
if ( ny==0. && nx ==0.) {
|
||||
phi = 0.; // std::atan2(0.,0.) gives undefined value of phi
|
||||
} else {
|
||||
phi = std::atan2( ny, nx ) ; if( phi < 0. ) { phi += twopi ; }
|
||||
phi = std::atan2( ny, nx ) ; if( phi < 0. ) { phi += CLHEP::twopi ; }
|
||||
// -PI < std::atan() < PI
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
// G4double phi = std::atan2( ny, nx ) ;
|
||||
// if( phi < 0.0 ) { phi += twopi ; }
|
||||
// if( phi < 0.0 ) { phi += CLHEP::twopi ; }
|
||||
// // -PI < std::atan() < PI
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
@@ -1006,12 +1058,12 @@ G4FRSCENEHANDLER::SendTransformedCoordinates()
|
||||
G4Vector3D y_unit_vec( 0.0 , 1.0 , 0.0 );
|
||||
|
||||
//----- transformed origin
|
||||
zero.transform( *fpObjectTransformation );
|
||||
zero.transform( fObjectTransformation );
|
||||
|
||||
//----- transformed base vectors
|
||||
x1.transform( *fpObjectTransformation );
|
||||
x1.transform( fObjectTransformation );
|
||||
x_unit_vec = x1 - zero ;
|
||||
y1.transform( *fpObjectTransformation );
|
||||
y1.transform( fObjectTransformation );
|
||||
y_unit_vec = y1 - zero ;
|
||||
|
||||
//----- send transformed origin
|
||||
@@ -1439,6 +1491,34 @@ G4FRSCENEHANDLER::SendInt4Str( G4int ival1 ,
|
||||
delete [] command ;
|
||||
}
|
||||
|
||||
//-----
|
||||
void
|
||||
G4FRSCENEHANDLER::SendStrDouble3Str( const char* char_string1 ,
|
||||
G4double dval1 ,
|
||||
G4double dval2 ,
|
||||
G4double dval3 ,
|
||||
const char* char_string2 )
|
||||
{
|
||||
//----- make command char_string and send
|
||||
G4int num_char ;
|
||||
char* command = new char [ COMMAND_BUF_SIZE ];
|
||||
|
||||
num_char = sprintf( command, "%s %*.*g %*.*g %*.*g %s", \
|
||||
char_string1,\
|
||||
fPrec2, fPrec, dval1 , \
|
||||
fPrec2, fPrec, dval2 , \
|
||||
fPrec2, fPrec, dval3 , \
|
||||
char_string2 );
|
||||
if( num_char < 0 ) {
|
||||
if (G4VisManager::GetVerbosity() >= G4VisManager::errors)
|
||||
G4cout << "ERROR G4FRSCENEHANDLER::SendStrDouble6Str(), 1\n" ;
|
||||
}
|
||||
SendStr( command );
|
||||
delete [] command ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
//-----
|
||||
void
|
||||
G4FRSCENEHANDLER::SendStrDouble6Str( const char* char_string1 ,
|
||||
@@ -1509,7 +1589,6 @@ void G4FRSCENEHANDLER::SendDouble( G4double val )
|
||||
//-----
|
||||
void G4FRSCENEHANDLER::ClearTransientStore()
|
||||
{
|
||||
G4VSceneHandler::ClearTransientStore ();
|
||||
// This is typically called after an update and before drawing hits
|
||||
// of the next event. To simulate the clearing of "transients"
|
||||
// (hits, etc.) the detector is redrawn...
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FRofstream.hh,v 1.9 2006-06-29 21:16:42 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
#include <fstream>
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRenderer.hh,v 1.8 2006-06-29 21:16:44 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRendererSceneHandler.hh,v 1.17 2010-05-30 10:18:32 allison Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 11:19:19 JST 1996
|
||||
@@ -221,6 +220,12 @@ public:
|
||||
G4int ival4 ,
|
||||
const char* char_string );
|
||||
|
||||
void SendStrDouble3Str( const char* char_string1 ,
|
||||
G4double dval1 ,
|
||||
G4double dval2 ,
|
||||
G4double dval3 ,
|
||||
const char* char_string2 );
|
||||
|
||||
void SendStrDouble6Str( const char* char_string1 ,
|
||||
G4double dval1 ,
|
||||
G4double dval2 ,
|
||||
|
||||
@@ -24,8 +24,7 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4FukuiRendererViewer.hh,v 1.8 2006-06-29 21:16:48 gunter Exp $
|
||||
// GEANT4 tag $Name: not supported by cvs2svn $
|
||||
// $Id$
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 12:10:14 JST 1996
|
||||
|
||||
Reference in New Issue
Block a user