Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DAWNFILE.cc,v 1.3 1999/01/11 00:47:20 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4DAWNFILE.cc,v 1.4.4.1 1999/12/07 20:53:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE factory.
|
||||
@@ -15,6 +15,8 @@
|
||||
#ifdef G4VIS_BUILD_DAWNFILE_DRIVER
|
||||
//=================//
|
||||
|
||||
//#define DEBUG_FR_SYSTEM
|
||||
|
||||
|
||||
#include "G4DAWNFILE.hh"
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DAWNFILESceneHandler.cc,v 1.1 1999/01/09 16:11:47 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4DAWNFILESceneHandler.cc,v 1.2.4.1 1999/12/07 20:53:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE scene.
|
||||
@@ -19,7 +19,7 @@
|
||||
|
||||
#define __G_ANSI_C__
|
||||
|
||||
//#define DEBUG_FR_SCENE
|
||||
// #define DEBUG_FR_SCENE
|
||||
|
||||
//----- header files
|
||||
#include <fstream.h>
|
||||
@@ -61,7 +61,7 @@ G4DAWNFILESceneHandler::G4DAWNFILESceneHandler (G4DAWNFILE& system, const G4Stri
|
||||
fSystem (system) ,
|
||||
G4VSceneHandler (system, fSceneIdCount++, name) ,
|
||||
fPrimDest () ,
|
||||
flag_in_modeling (false) ,
|
||||
FRflag_in_modeling (false) ,
|
||||
flag_saving_g4_prim (false) ,
|
||||
COMMAND_BUF_SIZE (G4FRofstream::SEND_BUFMAX)
|
||||
{
|
||||
@@ -102,6 +102,7 @@ G4DAWNFILESceneHandler::~G4DAWNFILESceneHandler ()
|
||||
|
||||
}
|
||||
|
||||
//-----
|
||||
void G4DAWNFILESceneHandler::SetG4PrimFileName()
|
||||
{
|
||||
// g4.prim, g4_1.prim, ..., g4_MAX_FILE_INDEX.prim
|
||||
@@ -155,10 +156,19 @@ void G4DAWNFILESceneHandler::SetG4PrimFileName()
|
||||
} // G4DAWNFILESceneHandler::SetG4PrimFileName()
|
||||
|
||||
|
||||
//-----
|
||||
void G4DAWNFILESceneHandler::BeginSavingG4Prim( void )
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** BeginSavingG4Prim (called)\n";
|
||||
#endif
|
||||
|
||||
if( !IsSavingG4Prim() )
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (started) " ;
|
||||
G4cerr << "(open g4.prim, ##)" << endl;
|
||||
#endif
|
||||
SetG4PrimFileName() ; // returned to fG4PrimFileName
|
||||
fPrimDest.Open(fG4PrimFileName) ;
|
||||
|
||||
@@ -169,14 +179,59 @@ void G4DAWNFILESceneHandler::BeginSavingG4Prim( void )
|
||||
|
||||
void G4DAWNFILESceneHandler::EndSavingG4Prim ( void )
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** EndSavingG4Prim (called)\n";
|
||||
#endif
|
||||
|
||||
if( IsSavingG4Prim() )
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (started) (close g4.prim)" << endl;
|
||||
#endif
|
||||
fPrimDest.Close() ;
|
||||
flag_saving_g4_prim = false ;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//-----
|
||||
void G4DAWNFILESceneHandler::FRBeginModeling( void )
|
||||
{
|
||||
if( !FRIsInModeling() )
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** G4DAWNFILESceneHandler::FRBeginModeling (called & started)" << endl;
|
||||
#endif
|
||||
|
||||
//----- Send saving command and heading comment
|
||||
BeginSavingG4Prim();
|
||||
|
||||
//----- Send bounding box command
|
||||
SendBoundingBox();
|
||||
|
||||
//----- send SET_CAMERA command
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (!SetCamera in FRBeginModeling())" << endl;
|
||||
#endif
|
||||
SendStr( FR_SET_CAMERA );
|
||||
|
||||
//----- open device
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (!OpenDevice in FRBeginModeling())" << endl;
|
||||
#endif
|
||||
SendStr( FR_OPEN_DEVICE );
|
||||
|
||||
//----- begin sending primitives
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (!BeginModeling in FRBeginModeling())" << endl;
|
||||
#endif
|
||||
SendStr( FR_BEGIN_MODELING ); FRflag_in_modeling = true ;
|
||||
|
||||
} // if
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Common to DAWN and DAWNFILE drivers //
|
||||
/////////////////////////////////////////
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DAWNFILEViewer.cc,v 1.2 1999/01/11 00:47:21 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4DAWNFILEViewer.cc,v 1.5.4.1 1999/12/07 20:53:10 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE view - opens window, hard copy, etc.
|
||||
@@ -40,7 +40,8 @@
|
||||
|
||||
|
||||
//----- constants
|
||||
const char FR_ENV_MULTI_WINDOW[] = "G4DAWN_MULTI_WINDOW" ;
|
||||
const char FR_ENV_MULTI_WINDOW [] = "G4DAWN_MULTI_WINDOW" ;
|
||||
const char FR_ENV_MULTI_WINDOW2[] = "G4DAWNFILE_MULTI_WINDOW" ;
|
||||
|
||||
//----- G4DAWNFILEViewer, constructor
|
||||
G4DAWNFILEViewer::G4DAWNFILEViewer (G4DAWNFILESceneHandler& scene,
|
||||
@@ -80,7 +81,7 @@ G4DAWNFILEViewer::~G4DAWNFILEViewer ()
|
||||
void G4DAWNFILEViewer::SetView ()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEViewer::SetView()\n";
|
||||
G4cerr << "***** G4DAWNFILEViewer::SetView(): No effects" << endl;
|
||||
#endif
|
||||
// Do nothing, since DAWN is running as a different process.
|
||||
// SendViewParameters () will do this job instead.
|
||||
@@ -92,15 +93,9 @@ void
|
||||
G4DAWNFILEViewer::ClearView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEViewer::ClearView () " << endl;
|
||||
G4cerr << "***** G4DAWNFILEViewer::ClearView (): No effects " << endl;
|
||||
#endif
|
||||
|
||||
//----- Begin saving data to g4.prim
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- Clear old data
|
||||
fSceneHandler.SendStr( FR_CLEAR_DATA );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -110,24 +105,8 @@ void G4DAWNFILEViewer::DrawView ()
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEViewer::DrawView () " << endl;
|
||||
#endif
|
||||
//----- Error recovery
|
||||
if( fSceneHandler.IsInModeling() ) {
|
||||
G4cerr << "WARNING from DAWNFILE driver:" << endl;
|
||||
G4cerr << " You've invoked a drawing command before " << endl;
|
||||
G4cerr << " completing your previous visualization." << endl;
|
||||
// G4cerr << " You should have invoked command, /vis~/show/view," << endl;
|
||||
// G4cerr << " to complete it." << endl;
|
||||
|
||||
FlushView();
|
||||
}
|
||||
|
||||
//----- Begin Saving g4.prim file
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- set view if necessary
|
||||
SendViewParameters();
|
||||
// Camera data should be sent at every time, even if
|
||||
// the setting is unchanged at GEANT 4 side.
|
||||
//-----
|
||||
fSceneHandler.FRBeginModeling() ;
|
||||
|
||||
//----- Always visit G4 kernel
|
||||
NeedKernelVisit ();
|
||||
@@ -146,21 +125,15 @@ void G4DAWNFILEViewer::ShowView( void )
|
||||
G4cerr << "***** G4DAWNFILEViewer::ShowView () " << endl;
|
||||
#endif
|
||||
|
||||
if( fSceneHandler.IsInModeling() ) // if( fSceneHandler.flag_in_modeling )
|
||||
if( fSceneHandler.FRIsInModeling() )
|
||||
{
|
||||
|
||||
//----- End of Data
|
||||
//----- End of modeling
|
||||
// !EndModeling, !DrawAll, !CloseDevice,
|
||||
// close g4.prim
|
||||
fSceneHandler.FREndModeling();
|
||||
|
||||
//----- Draw all
|
||||
fSceneHandler.SendStr( FR_DRAW_ALL );
|
||||
|
||||
//----- Close device
|
||||
fSceneHandler.SendStr( FR_CLOSE_DEVICE );
|
||||
|
||||
//----- End saving data to g4.prim
|
||||
fSceneHandler.EndSavingG4Prim() ;
|
||||
|
||||
//----- Output DAWN GUI file
|
||||
SendViewParameters();
|
||||
|
||||
//----- string for viewer invocation
|
||||
if ( !strcmp( fG4PrimViewer, "NONE" ) ) {
|
||||
@@ -198,24 +171,14 @@ void G4DAWNFILEViewer::ShowView( void )
|
||||
} // G4DAWNFILEViewer::ShowView()
|
||||
|
||||
|
||||
//----- G4DAWNFILEViewer::FlushView()
|
||||
void G4DAWNFILEViewer::FlushView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEViewer::Flush () " << endl;
|
||||
#endif
|
||||
|
||||
ShowView();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----- G4DAWNFILEViewer::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
void G4DAWNFILEViewer::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEViewer::SendDrawingStyle() " << endl;
|
||||
#endif
|
||||
///////////////////////
|
||||
//#if defined DEBUG_FR_VIEW
|
||||
// G4cerr << "***** G4DAWNFILEViewer::SendDrawingStyleToDAWNGUI()" << endl;
|
||||
//#endif
|
||||
//////////////////////
|
||||
|
||||
G4int style = fVP.GetDrawingStyle();
|
||||
|
||||
@@ -243,7 +206,7 @@ void G4DAWNFILEViewer::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
|
||||
|
||||
|
||||
//----- G4DAWNFILEViewer::SendViewParameters ()
|
||||
//-----
|
||||
void G4DAWNFILEViewer::SendViewParameters ()
|
||||
{
|
||||
// Calculates view representation based on extent of object being
|
||||
@@ -251,7 +214,8 @@ void G4DAWNFILEViewer::SendViewParameters ()
|
||||
// later due to user interaction via visualization system's GUI.)
|
||||
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEViewer::SendViewParameters()\n";
|
||||
G4cerr << "***** G4DAWNFILEViewer::SendViewParameters() ";
|
||||
G4cerr << "(GUI parameters)" << endl;
|
||||
#endif
|
||||
|
||||
//----- Magic number to decide camera distance automatically
|
||||
@@ -259,9 +223,6 @@ void G4DAWNFILEViewer::SendViewParameters ()
|
||||
const G4double MIN_HALF_ANGLE = 0.01 ;
|
||||
const G4double MAX_HALF_ANGLE = 0.499 * M_PI ;
|
||||
|
||||
//----- Send Bounding Box
|
||||
fSceneHandler.SendBoundingBox();
|
||||
|
||||
//----- CALC camera distance
|
||||
//..... Note: Camera cannot enter inside object
|
||||
G4double camera_distance ;
|
||||
@@ -296,7 +257,7 @@ void G4DAWNFILEViewer::SendViewParameters ()
|
||||
|
||||
//########### Generation of the file .DAWN.history for DAWN GUI
|
||||
//-----
|
||||
ofstream gui_out (".DAWN.history") ;
|
||||
ofstream gui_out (".DAWN_1.history") ;
|
||||
|
||||
// ######### P1
|
||||
|
||||
@@ -355,27 +316,26 @@ void G4DAWNFILEViewer::SendViewParameters ()
|
||||
//######### P4
|
||||
//----- drawing device
|
||||
// enum {PS=1, XWIN=2, PS2=3, XWIN2=4, OPEN_GL=5, DEVICE_END=6};
|
||||
if( ( getenv( FR_ENV_MULTI_WINDOW ) != NULL ) && \
|
||||
( strcmp( getenv( FR_ENV_MULTI_WINDOW ),"0" ) ) )
|
||||
if( ( ( getenv( FR_ENV_MULTI_WINDOW ) != NULL ) && \
|
||||
( strcmp( getenv( FR_ENV_MULTI_WINDOW ),"0" ) ) ) || \
|
||||
( ( getenv( FR_ENV_MULTI_WINDOW2 ) != NULL ) && \
|
||||
( strcmp( getenv( FR_ENV_MULTI_WINDOW2 ),"0" ) ) ) )
|
||||
{
|
||||
gui_out << 2 << endl; // OpenWindow
|
||||
} else {
|
||||
gui_out << 1 << endl; // Invoke PS viewer
|
||||
}
|
||||
gui_out << GetPSViewer() << endl; // PS viewer
|
||||
gui_out << 0; // Add showpage
|
||||
|
||||
|
||||
gui_out << GetPSViewer() << endl; // PS viewer
|
||||
gui_out << 0 << endl ; // Do not add showpage
|
||||
gui_out << 0 << endl ; // Non-append mode
|
||||
|
||||
gui_out.close();
|
||||
//########### end of generating file .DAWN.history
|
||||
|
||||
|
||||
//----- SET CAMERA
|
||||
fSceneHandler.SendStr( FR_SET_CAMERA );
|
||||
|
||||
|
||||
} // G4DAWNFILEViewer::SendViewParameters ()
|
||||
}
|
||||
|
||||
|
||||
#endif // G4VIS_BUILD_DAWNFILE_DRIVER
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FRClientServer.cc,v 1.2 1999/01/09 16:11:49 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4FRClientServer.cc,v 1.2.8.1 1999/12/07 20:53:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
// Satoshi TANAKA, Wed Jul 3 14:14:29 JST 1996
|
||||
////////////////////////////////
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FRSceneFunc.icc,v 1.3 1999/01/11 00:47:22 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4FRSceneFunc.icc,v 1.9.2.1 1999/12/07 20:53:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ void G4FRSCENE::AddPrimitive (const G4Polyline& polyline)
|
||||
G4cerr << "***** AddPrimitive\n";
|
||||
#endif
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- local working variables
|
||||
G4int nPoints = polyline.entries ();
|
||||
@@ -65,6 +65,9 @@ void G4FRSCENE::AddPrimitive (const G4NURBS& nurb)
|
||||
G4cerr << "***** AddPrimitive( G4NURBS )\n";
|
||||
#endif
|
||||
|
||||
//----- Initialize DAWN IF NECESSARY
|
||||
FRBeginModeling();
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// DAWN does not support NUBS visualizaition //
|
||||
///////////////////////////////////////////////
|
||||
@@ -80,7 +83,7 @@ void G4FRSCENE::AddPrimitive ( const G4Text& text )
|
||||
G4cerr << "***** AddPrimitive( G4Text )\n";
|
||||
#endif
|
||||
//----- Initialize DAWN IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- send color
|
||||
const G4Color& color = GetTextColor (text) ;
|
||||
@@ -153,7 +156,7 @@ void G4FRSCENE::AddPrimitive ( const G4Circle& mark_circle )
|
||||
G4cerr << "***** AddPrimitive( G4Circle )\n";
|
||||
#endif
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- send color
|
||||
const G4Color& color = GetColor (mark_circle) ;
|
||||
@@ -196,7 +199,7 @@ void G4FRSCENE::AddPrimitive (const G4Square& mark_square )
|
||||
G4cerr << "***** AddPrimitive( G4Square )\n";
|
||||
#endif
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- send color
|
||||
const G4Color& color = GetColor (mark_square) ;
|
||||
@@ -240,7 +243,7 @@ void G4FRSCENE::AddPrimitive ( const G4Polyhedron& polyhedron )
|
||||
#endif
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes( fpViewer->GetApplicableVisAttributes
|
||||
@@ -293,46 +296,75 @@ void G4FRSCENE::AddPrimitive ( const G4Polyhedron& polyhedron )
|
||||
} // G4FRSCENE::AddPrimitive (polyhedron)
|
||||
|
||||
|
||||
|
||||
//----- G4FRSCENE::BeginModeling ()
|
||||
void G4FRSCENE::BeginModeling ()
|
||||
//----- G4FRSCENE::SendNdiv ()
|
||||
void G4FRSCENE::SendNdiv ( void )
|
||||
{
|
||||
//////////////////////////////////////////////////
|
||||
//#if defined DEBUG_FR_SCENE
|
||||
// G4cerr << "***** SendNdiv() (/Ndiv)" << endl;
|
||||
//#endif
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
G4VSceneHandler::BeginModeling ();
|
||||
|
||||
//-----
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** BeginModeling\n";
|
||||
#endif
|
||||
//----- local
|
||||
G4int num_division ;
|
||||
|
||||
//----- open device
|
||||
SendStr( FR_OPEN_DEVICE );
|
||||
|
||||
//----- begin sending primitives
|
||||
SendStr( FR_BEGIN_MODELING ); flag_in_modeling = true ;
|
||||
G4int num_division = FR_DEFALUT_NDIV_VALUE ;
|
||||
|
||||
//----- number used for dividing a curved surface, Ndiv
|
||||
num_division = GetModel()->GetModelingParameters()->GetNoOfSides () ;
|
||||
if ( GetModel() ) {
|
||||
num_division = GetModel()->GetModelingParameters()->GetNoOfSides();
|
||||
} else {
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "WARNING: GetNoOfSides() failed. " ;
|
||||
G4cerr << "The default value " << num_division ;
|
||||
G4cerr << " is assigned." << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
//---------- Error recovery for too small Ndiv
|
||||
num_division = ( num_division < 3 ? 3 : num_division );
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
//#if defined DEBUG_FR_SCENE
|
||||
// G4cerr << "Ndiv = " << num_division << endl;
|
||||
//#endif
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
//----- Send resultant Ndiv
|
||||
this->SendStrInt( FR_NDIV, num_division );
|
||||
|
||||
} // G4FRSCENE::BeginModeling ()
|
||||
|
||||
}
|
||||
|
||||
//----- G4FRSCENE::FREndModeling ()
|
||||
void G4FRSCENE::FREndModeling ()
|
||||
{
|
||||
//-----
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** FREndModeling \n";
|
||||
G4cerr << "***** FREndModeling (called)" << endl;
|
||||
#endif
|
||||
SendStr( FR_END_MODELING ); flag_in_modeling = false ;
|
||||
if( FRIsInModeling() ) {
|
||||
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** FREndModeling (started) " ;
|
||||
G4cerr << "(/EndModeling, /DrawAll, /CloseDevice)" << endl;
|
||||
#endif
|
||||
|
||||
SendStr( "#--------------------" );
|
||||
|
||||
//----- !EndModeling
|
||||
SendStr( FR_END_MODELING );
|
||||
|
||||
//----- !DrawAll
|
||||
SendStr( FR_DRAW_ALL );
|
||||
|
||||
//----- !CloseDevice
|
||||
SendStr( FR_CLOSE_DEVICE );
|
||||
|
||||
//----- End saving data to g4.prim
|
||||
EndSavingG4Prim() ;
|
||||
|
||||
//------ Reset flag
|
||||
FRflag_in_modeling = false ;
|
||||
}
|
||||
}
|
||||
|
||||
//----- G4FRSCENE::BeginPrimitives (const G4Transform3D&)
|
||||
@@ -342,13 +374,11 @@ void G4FRSCENE::BeginPrimitives (const G4Transform3D& objectTransformation)
|
||||
G4cerr << "***** BeginPrimitives \n";
|
||||
#endif
|
||||
|
||||
FRBeginModeling();
|
||||
|
||||
G4VSceneHandler::BeginPrimitives (objectTransformation);
|
||||
fpObjectTransformation = &objectTransformation;
|
||||
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** BeginPrimitives \n";
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
//----- G4FRSCENE::EndPrimitives ()
|
||||
@@ -378,11 +408,14 @@ void G4FRSCENE::AddThis( const G4Box& box )
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
// SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -414,11 +447,14 @@ G4FRSCENE::AddThis( const G4Tubs& tubes )
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -453,11 +489,14 @@ G4FRSCENE::AddThis( const G4Cons& cons )
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -493,11 +532,14 @@ void G4FRSCENE::AddThis ( const G4Trd& trd )
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
// SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -530,11 +572,14 @@ void G4FRSCENE::AddThis ( const G4Sphere& sphere )
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -588,11 +633,14 @@ void G4FRSCENE::AddThis (const G4Para& para)
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
// SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -641,11 +689,14 @@ void G4FRSCENE::AddThis (const G4Trap& trap)
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
// SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -670,8 +721,19 @@ void G4FRSCENE::AddThis (const G4Trap& trap)
|
||||
//----- parameters (half lengths of box)
|
||||
G4double dz = trap.GetZHalfLength ();
|
||||
G4double theta = acos( cosTheta ) ;
|
||||
G4double phi = atan2( ny, nx ) ; if( phi < 0.0 ) { phi += twopi ; }
|
||||
// -PI < atan() < PI
|
||||
G4double phi;
|
||||
if ( ny==0. && nx ==0.) {
|
||||
phi = 0.; // atan2(0.,0.) gives undefined value of phi
|
||||
} else {
|
||||
phi = atan2( ny, nx ) ; if( phi < 0. ) { phi += twopi ; }
|
||||
// -PI < atan() < PI
|
||||
}
|
||||
/////////////////////////////////////////////////
|
||||
// G4double phi = atan2( ny, nx ) ;
|
||||
// if( phi < 0.0 ) { phi += twopi ; }
|
||||
// // -PI < atan() < PI
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
G4double h1 = trap.GetYHalfLength1 ();
|
||||
G4double bl1 = trap.GetXHalfLength1 ();
|
||||
G4double tl1 = trap.GetXHalfLength2 ();
|
||||
@@ -684,6 +746,11 @@ void G4FRSCENE::AddThis (const G4Trap& trap)
|
||||
//----- send coordinates to Fukui Renderer
|
||||
SendTransformedCoordinates();
|
||||
|
||||
//----- Change sign of alpha for compatibility
|
||||
// with the DAWN format
|
||||
G4double alpha_sign = -1.0 ;
|
||||
alpha1 *= alpha_sign ; alpha2 *= alpha_sign ;
|
||||
|
||||
//----- send box to Fukui Renderer
|
||||
SendStrDouble11( FR_TRAP ,
|
||||
dz ,
|
||||
@@ -712,11 +779,14 @@ G4FRSCENE::AddThis( const G4Torus& torus )
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName();
|
||||
|
||||
//----- Send Ndiv
|
||||
SendNdiv();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
@@ -747,11 +817,13 @@ void G4FRSCENE::AddThis ( const G4VSolid& solid )
|
||||
if( !IsVisible() ) { return ; }
|
||||
|
||||
//----- Initialize Fukui Renderer IF NECESSARY
|
||||
InitializeFR();
|
||||
FRBeginModeling();
|
||||
|
||||
//----- Send Name
|
||||
SendPhysVolName() ;
|
||||
|
||||
//----- Send Ndiv
|
||||
// SendNdiv();
|
||||
|
||||
//----- Send a primitive
|
||||
G4VSceneHandler::AddThis( solid ) ;
|
||||
@@ -800,12 +872,14 @@ G4FRSCENE::SendVisAttributes ( const G4VisAttributes* pAV )
|
||||
//----- G4FRSCENE::IsVisible()
|
||||
G4bool G4FRSCENE::IsVisible()
|
||||
{
|
||||
//-----
|
||||
G4bool visibility = true ;
|
||||
|
||||
//-----
|
||||
const G4VisAttributes* pVisAttribs =
|
||||
fpViewer->GetApplicableVisAttributes( fpVisAttribs );
|
||||
|
||||
//-----
|
||||
//-----
|
||||
if( ( getenv( FR_ENV_CULL_INVISIBLE_OBJECTS ) != NULL ) && \
|
||||
( strcmp( getenv( FR_ENV_CULL_INVISIBLE_OBJECTS ),"0" ) ) && \
|
||||
( pVisAttribs ) )
|
||||
@@ -813,6 +887,7 @@ G4bool G4FRSCENE::IsVisible()
|
||||
visibility = pVisAttribs->IsVisible();
|
||||
}
|
||||
|
||||
//-----
|
||||
return visibility ;
|
||||
|
||||
} // G4FRSCENE::IsVisible()
|
||||
@@ -821,6 +896,10 @@ G4bool G4FRSCENE::IsVisible()
|
||||
//----- G4FRSCENE::SendBoundingBox()
|
||||
void G4FRSCENE::SendBoundingBox( void )
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** SendBoundingBox () (/BoundingBox)" << endl;
|
||||
#endif
|
||||
|
||||
//----- (1A) CALC bounding box of the bounding sphere
|
||||
const G4VisExtent& extent = GetScene()->GetExtent();
|
||||
const G4Point3D& center = extent.GetExtentCenter();
|
||||
@@ -851,34 +930,6 @@ void G4FRSCENE::SendBoundingBox( void )
|
||||
} // G4FRSCENE::SendBoundingBox()
|
||||
|
||||
|
||||
|
||||
//----- G4FRSCENE::InitializeFR()
|
||||
G4bool
|
||||
G4FRSCENE::InitializeFR( void )
|
||||
{
|
||||
if( !IsInModeling() ) // if( !flag_in_modeling )
|
||||
{
|
||||
//----- Send saving command and heading comment
|
||||
BeginSavingG4Prim();
|
||||
|
||||
//----- Send bounding box command
|
||||
SendBoundingBox();
|
||||
|
||||
//----- sen SET_CAMERA command
|
||||
SendStr( FR_SET_CAMERA );
|
||||
|
||||
//----- send begin modeling
|
||||
//..... (1) FR_OPEN_DEVICE
|
||||
//..... (2) FR_BEGIN_MODELING
|
||||
//..... (3) FR_NDIV
|
||||
BeginModeling ();
|
||||
}
|
||||
|
||||
return flag_in_modeling ;
|
||||
|
||||
} // G4FRSCENE::InitializeFR( void )
|
||||
|
||||
|
||||
//----- G4FRSCENE::SendTransformedCoordinates()
|
||||
void
|
||||
G4FRSCENE::SendTransformedCoordinates()
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FukuiRenderer.cc,v 1.3 1999/01/11 00:47:23 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4FukuiRenderer.cc,v 1.3.8.1 1999/12/07 20:53:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FukuiRendererSceneHandler.cc,v 1.1 1999/01/09 16:11:52 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4FukuiRendererSceneHandler.cc,v 1.2.4.1 1999/12/07 20:53:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 11:34:24 JST 1996
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#define __G_ANSI_C__
|
||||
|
||||
//#define DEBUG_FR_SCENE
|
||||
// #define DEBUG_FR_SCENE
|
||||
|
||||
//----- header files
|
||||
#include <fstream.h>
|
||||
@@ -47,8 +47,8 @@
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
|
||||
//----- constants
|
||||
const char FR_ENV_CULL_INVISIBLE_OBJECTS [] = "G4DAWN_CULL_INVISIBLE_OBJECTS";
|
||||
|
||||
const char FR_ENV_CULL_INVISIBLE_OBJECTS [] = "G4DAWN_CULL_INVISIBLE_OBJECTS";
|
||||
const char FR_ENV_MULTI_WINDOW[] = "G4DAWN_MULTI_WINDOW" ;
|
||||
|
||||
///////////////////////////
|
||||
// Driver-dependent part //
|
||||
@@ -61,7 +61,7 @@ G4FukuiRendererSceneHandler::G4FukuiRendererSceneHandler (G4FukuiRenderer& syste
|
||||
fSystem (system) ,
|
||||
G4VSceneHandler (system, fSceneIdCount++, name) ,
|
||||
fPrimDest (system.GetPrimDest() ) ,
|
||||
flag_in_modeling (false) ,
|
||||
FRflag_in_modeling (false) ,
|
||||
flag_saving_g4_prim (false) ,
|
||||
COMMAND_BUF_SIZE (G4FRClientServer::SEND_BUFMAX)
|
||||
{
|
||||
@@ -103,6 +103,69 @@ G4FukuiRendererSceneHandler::~G4FukuiRendererSceneHandler ()
|
||||
|
||||
}
|
||||
|
||||
//-----
|
||||
void G4FukuiRendererSceneHandler::FRBeginModeling( void )
|
||||
{
|
||||
if( !FRIsInModeling() )
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** G4FukuiRendererSceneHandler::FRBeginModeling (called & started)" << endl;
|
||||
#endif
|
||||
|
||||
//----- Begin Saving g4.prim file
|
||||
// open g4.prim, ##
|
||||
BeginSavingG4Prim();
|
||||
|
||||
//----- Send Bounding Box
|
||||
// /BoundingBox
|
||||
SendBoundingBox();
|
||||
|
||||
//----- drawing device
|
||||
// !Device
|
||||
// (Note: Not saved in g4.prim)
|
||||
if( ( getenv( FR_ENV_MULTI_WINDOW ) != NULL ) && \
|
||||
( strcmp( getenv( FR_ENV_MULTI_WINDOW ),"0" ) ) )
|
||||
{
|
||||
((G4FukuiRendererViewer*)fpViewer)->SendDevice( G4FukuiRendererViewer::FRDEV_XWIN ) ;
|
||||
} else {
|
||||
((G4FukuiRendererViewer*)fpViewer)->SendDevice( G4FukuiRendererViewer::FRDEV_PS ) ;
|
||||
}
|
||||
|
||||
//----- drawing style
|
||||
// /WireFrame, /Surface etc
|
||||
// (Note: Not saved in g4.prim)
|
||||
((G4FukuiRendererViewer*)fpViewer)->SendDrawingStyle() ;
|
||||
|
||||
//----- set view parameters
|
||||
// /CameraPosition, /TargetPoint,
|
||||
// /ZoomFactor, /FocalDistance,
|
||||
// !GraphicalUserInterface
|
||||
((G4FukuiRendererViewer*)fpViewer)->SendViewParameters();
|
||||
|
||||
//----- send SET_CAMERA command
|
||||
// !SetCamera
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (!SetCamera in FRBeginModeling())" << endl;
|
||||
#endif
|
||||
SendStr( FR_SET_CAMERA );
|
||||
|
||||
//----- open device
|
||||
// !OpenDevice
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (!OpenDevice in FRBeginModeling())" << endl;
|
||||
#endif
|
||||
SendStr( FR_OPEN_DEVICE );
|
||||
|
||||
//----- begin sending primitives
|
||||
// !BeginModeling
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** (!BeginModeling in FRBeginModeling())" << endl;
|
||||
#endif
|
||||
SendStr( FR_BEGIN_MODELING ); FRflag_in_modeling = true ;
|
||||
|
||||
} // if
|
||||
|
||||
}
|
||||
|
||||
/////////////////////////////////////////
|
||||
// Common to DAWN and DAWNFILE drivers //
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the RD44 GEANT4 collaboration.
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FukuiRendererViewer.cc,v 1.2 1999/01/11 00:47:24 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
// $Id: G4FukuiRendererViewer.cc,v 1.3.4.1 1999/12/07 20:53:11 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-01-00 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 12:09:11 JST 1996
|
||||
@@ -39,159 +39,82 @@
|
||||
#include "G4FukuiRendererViewer.hh"
|
||||
|
||||
|
||||
//----- constants
|
||||
const char FR_ENV_MULTI_WINDOW[] = "G4DAWN_MULTI_WINDOW" ;
|
||||
|
||||
//----- G4FukuiRendererViewer, constructor
|
||||
//----- Constructor
|
||||
G4FukuiRendererViewer::G4FukuiRendererViewer (G4FukuiRendererSceneHandler& scene,
|
||||
const G4String& name):
|
||||
G4VViewer (scene, scene.IncrementViewCount (), name), fSceneHandler (scene)
|
||||
{}
|
||||
|
||||
//----- G4FukuiRendererViewer, destructor
|
||||
//----- Destructor
|
||||
G4FukuiRendererViewer::~G4FukuiRendererViewer ()
|
||||
{}
|
||||
|
||||
//----- G4FukuiRendererViewer::SetView ()
|
||||
//-----
|
||||
void G4FukuiRendererViewer::SetView ()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererViewer::SetView()\n";
|
||||
G4cerr << "***** G4FukuiRendererViewer::SetView(): No effects" << endl;
|
||||
#endif
|
||||
// Do nothing, since DAWN is running as a different process.
|
||||
// SendViewParameters () will do this job instead.
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::ClearView()
|
||||
//-----
|
||||
void
|
||||
G4FukuiRendererViewer::ClearView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererViewer::ClearView () " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::ClearView (): No effects " << endl;
|
||||
#endif
|
||||
|
||||
//----- Begin saving data to g4.prim
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- Clear old data
|
||||
fSceneHandler.SendStr( FR_CLEAR_DATA );
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::DrawView ()
|
||||
//-----
|
||||
void G4FukuiRendererViewer::DrawView ()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererViewer::DrawView () " << endl;
|
||||
#endif
|
||||
//----- Error recovery
|
||||
if( fSceneHandler.IsInModeling() ) {
|
||||
G4cerr << "WARNING from FukuiRenderer (DAWN) driver:" << endl;
|
||||
G4cerr << " You've invoked a drawing command before " << endl;
|
||||
G4cerr << " completing your previous visualization." << endl;
|
||||
// G4cerr << " You should have invoked command, /vis~/show/view," << endl;
|
||||
// G4cerr << " to complete it." << endl;
|
||||
|
||||
FlushView();
|
||||
}
|
||||
//----- Begin modeling 3D
|
||||
fSceneHandler.FRBeginModeling();
|
||||
|
||||
//----- Begin Saving g4.prim file
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- drawing device
|
||||
if( ( getenv( FR_ENV_MULTI_WINDOW ) != NULL ) && \
|
||||
( strcmp( getenv( FR_ENV_MULTI_WINDOW ),"0" ) ) )
|
||||
{
|
||||
SendDevice( FRDEV_XWIN ) ;
|
||||
} else {
|
||||
SendDevice( FRDEV_PS ) ;
|
||||
}
|
||||
|
||||
//----- drawing style
|
||||
SendDrawingStyle() ;
|
||||
|
||||
//----- set view if necessary
|
||||
SendViewParameters();
|
||||
// Camera data should be sent at every time, even if
|
||||
// the setting is unchanged at GEANT 4 side.
|
||||
|
||||
//----- Always visit G4 kernel
|
||||
//----- Always visit G4 kernel
|
||||
NeedKernelVisit ();
|
||||
|
||||
//----- Draw
|
||||
//----- Draw
|
||||
ProcessView () ;
|
||||
|
||||
} // G4FukuiRendererViewer::DrawView ()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::ShowView()
|
||||
//-----
|
||||
void G4FukuiRendererViewer::ShowView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererViewer::ShowView () " << endl;
|
||||
#endif
|
||||
|
||||
if( fSceneHandler.IsInModeling() ) // if( fSceneHandler.flag_in_modeling )
|
||||
if( fSceneHandler.FRIsInModeling() )
|
||||
{
|
||||
|
||||
//----- End of Data
|
||||
//----- End of modeling
|
||||
// !EndModeling, !DrawAll, !CloseDevice,
|
||||
// close g4.prim
|
||||
fSceneHandler.FREndModeling();
|
||||
|
||||
//----- Draw all
|
||||
fSceneHandler.SendStr( FR_DRAW_ALL );
|
||||
|
||||
//----- Close device
|
||||
fSceneHandler.SendStr( FR_CLOSE_DEVICE );
|
||||
|
||||
//----- End saving data to g4.prim
|
||||
fSceneHandler.EndSavingG4Prim() ;
|
||||
|
||||
//----- Wait user clicks drawing Area
|
||||
this->Wait();
|
||||
}
|
||||
|
||||
} // G4FukuiRendererViewer::ShowView()
|
||||
}
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::FlushView()
|
||||
void G4FukuiRendererViewer::FlushView( void )
|
||||
//-----
|
||||
void G4FukuiRendererViewer::Wait()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererViewer::Flush () " << endl;
|
||||
#endif
|
||||
|
||||
if( fSceneHandler.IsInModeling() ) // if( fSceneHandler.flag_in_modeling )
|
||||
{
|
||||
|
||||
//----- End of Data
|
||||
fSceneHandler.FREndModeling();
|
||||
|
||||
//----- Draw all
|
||||
fSceneHandler.SendStr( FR_DRAW_ALL );
|
||||
|
||||
//----- Close device
|
||||
fSceneHandler.SendStr( FR_CLOSE_DEVICE );
|
||||
|
||||
//----- End saving data to g4.prim
|
||||
fSceneHandler.EndSavingG4Prim() ;
|
||||
|
||||
}
|
||||
|
||||
} // G4FukuiRendererViewer::FlushView()
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::Wait()
|
||||
void
|
||||
G4FukuiRendererViewer::Wait()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererViewer::Wait () " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::Wait () : Begin" << endl;
|
||||
#endif
|
||||
fSceneHandler.SendStr ( FR_WAIT );
|
||||
fSceneHandler.GetPrimDest().WaitSendBack( FR_WAIT );
|
||||
@@ -202,7 +125,7 @@ G4FukuiRendererViewer::Wait()
|
||||
}
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::SendDevice()
|
||||
//-----
|
||||
void
|
||||
G4FukuiRendererViewer::SendDevice( FRDEV dev )
|
||||
{
|
||||
@@ -210,7 +133,6 @@ G4FukuiRendererViewer::SendDevice( FRDEV dev )
|
||||
G4cerr << "***** G4FukuiRendererViewer::SendDevice() " << endl;
|
||||
#endif
|
||||
|
||||
|
||||
// enum {PS=1, XWIN=2, PS2=3, XWIN2=4, OPEN_GL=5, DEVICE_END=6};
|
||||
|
||||
if( dev >= FRDEV_PS || dev < FRDEV_DEVICE_END ) {
|
||||
@@ -219,7 +141,7 @@ G4FukuiRendererViewer::SendDevice( FRDEV dev )
|
||||
}
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::SendDrawingStyle()
|
||||
//-----
|
||||
void G4FukuiRendererViewer::SendDrawingStyle()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
@@ -245,11 +167,10 @@ void G4FukuiRendererViewer::SendDrawingStyle()
|
||||
break;
|
||||
}
|
||||
|
||||
} // G4FukuiRendererViewer::SendDrawingStyle()
|
||||
}
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererViewer::SendViewParameters ()
|
||||
//-----
|
||||
void G4FukuiRendererViewer::SendViewParameters ()
|
||||
{
|
||||
// Calculates view representation based on extent of object being
|
||||
@@ -257,7 +178,7 @@ void G4FukuiRendererViewer::SendViewParameters ()
|
||||
// later due to user interaction via visualization system's GUI.)
|
||||
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererViewer::SendViewParameters()\n";
|
||||
G4cerr << "***** G4FukuiRendererViewer::SendViewParameters()" << endl;
|
||||
#endif
|
||||
|
||||
//----- Magic number to decide camera distance automatically
|
||||
@@ -265,9 +186,6 @@ void G4FukuiRendererViewer::SendViewParameters ()
|
||||
const G4double MIN_HALF_ANGLE = 0.01 ;
|
||||
const G4double MAX_HALF_ANGLE = 0.499 * M_PI ;
|
||||
|
||||
//----- Send Bounding Box
|
||||
fSceneHandler.SendBoundingBox();
|
||||
|
||||
//----- (2A) CALC camera distance
|
||||
//..... Note: Camera cannot enter inside object
|
||||
G4double camera_distance ;
|
||||
@@ -351,9 +269,8 @@ void G4FukuiRendererViewer::SendViewParameters ()
|
||||
fSceneHandler.GetPrimDest().WaitSendBack( FR_GUI );
|
||||
}
|
||||
|
||||
//----- SET CAMERA
|
||||
fSceneHandler.SendStr( FR_SET_CAMERA );
|
||||
|
||||
} // G4FukuiRendererViewer::SendViewParameters ()
|
||||
}
|
||||
|
||||
#endif // G4VIS_BUILD_DAWN_DRIVER
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user