Import Geant4 0.1.0 source tree
This commit is contained in:
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DAWNFILE.cc,v 2.2 1998/11/06 13:41:44 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4DAWNFILE.cc,v 1.3 1999/01/11 00:47:20 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE factory.
|
||||
@@ -22,9 +22,9 @@
|
||||
|
||||
//#include "G4VisFeaturesOfDAWNFILE.hh"
|
||||
#include "G4FRFeatures.hh"
|
||||
#include "G4VScene.hh"
|
||||
#include "G4DAWNFILEScene.hh"
|
||||
#include "G4DAWNFILEView.hh"
|
||||
#include "G4VSceneHandler.hh"
|
||||
#include "G4DAWNFILESceneHandler.hh"
|
||||
#include "G4DAWNFILEViewer.hh"
|
||||
#include "G4FRConst.hh"
|
||||
|
||||
|
||||
@@ -41,22 +41,22 @@ G4DAWNFILE::~G4DAWNFILE ()
|
||||
{}
|
||||
|
||||
|
||||
//----- G4DAWNFILE::CreateScene (const G4String& name)
|
||||
G4VScene* G4DAWNFILE::CreateScene (const G4String& name)
|
||||
//----- G4DAWNFILE::CreateSceneHandler (const G4String& name)
|
||||
G4VSceneHandler* G4DAWNFILE::CreateSceneHandler (const G4String& name)
|
||||
{
|
||||
G4VScene* p = new G4DAWNFILEScene (*this, name);
|
||||
G4VSceneHandler* p = new G4DAWNFILESceneHandler (*this, name);
|
||||
|
||||
G4cout << G4DAWNFILEScene::GetSceneCount ()
|
||||
G4cout << G4DAWNFILESceneHandler::GetSceneCount ()
|
||||
<< ' ' << fName << " scenes extanct." << endl;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
//----- G4DAWNFILE::CreateView ()
|
||||
G4VView* G4DAWNFILE::CreateView (G4VScene& scene, const G4String& name)
|
||||
//----- G4DAWNFILE::CreateViewer ()
|
||||
G4VViewer* G4DAWNFILE::CreateViewer (G4VSceneHandler& scene, const G4String& name)
|
||||
{
|
||||
G4VView* pView =
|
||||
new G4DAWNFILEView ((G4DAWNFILEScene&) scene, name);
|
||||
G4VViewer* pView =
|
||||
new G4DAWNFILEViewer ((G4DAWNFILESceneHandler&) scene, name);
|
||||
return pView;
|
||||
}
|
||||
|
||||
|
||||
+17
-17
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DAWNFILEScene.cc,v 2.6 1998/12/04 07:31:12 stanaka Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4DAWNFILESceneHandler.cc,v 1.1 1999/01/09 16:11:47 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE scene.
|
||||
@@ -28,8 +28,8 @@
|
||||
#include "globals.hh"
|
||||
#include "G4FRConst.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4DAWNFILEScene.hh"
|
||||
#include "G4DAWNFILEView.hh"
|
||||
#include "G4DAWNFILESceneHandler.hh"
|
||||
#include "G4DAWNFILEViewer.hh"
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
@@ -56,10 +56,10 @@ const char DEFAULT_G4PRIM_FILE_NAME[] = "g4.prim";
|
||||
///////////////////////////
|
||||
|
||||
|
||||
//----- G4DAWNFILEScene, constructor
|
||||
G4DAWNFILEScene::G4DAWNFILEScene (G4DAWNFILE& system, const G4String& name):
|
||||
//----- G4DAWNFILESceneHandler, constructor
|
||||
G4DAWNFILESceneHandler::G4DAWNFILESceneHandler (G4DAWNFILE& system, const G4String& name):
|
||||
fSystem (system) ,
|
||||
G4VScene (system, fSceneIdCount++, name) ,
|
||||
G4VSceneHandler (system, fSceneIdCount++, name) ,
|
||||
fPrimDest () ,
|
||||
flag_in_modeling (false) ,
|
||||
flag_saving_g4_prim (false) ,
|
||||
@@ -91,18 +91,18 @@ COMMAND_BUF_SIZE (G4FRofstream::SEND_BUFMAX)
|
||||
}
|
||||
|
||||
|
||||
//----- G4DAWNFILEScene, destructor
|
||||
G4DAWNFILEScene::~G4DAWNFILEScene ()
|
||||
//----- G4DAWNFILESceneHandler, destructor
|
||||
G4DAWNFILESceneHandler::~G4DAWNFILESceneHandler ()
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** ~G4DAWNFILEScene" << endl;
|
||||
G4cerr << "***** ~G4DAWNFILESceneHandler" << endl;
|
||||
#endif
|
||||
fSceneCount--;
|
||||
ClearStore (); // clear current scene
|
||||
|
||||
}
|
||||
|
||||
void G4DAWNFILEScene::SetG4PrimFileName()
|
||||
void G4DAWNFILESceneHandler::SetG4PrimFileName()
|
||||
{
|
||||
// g4.prim, g4_1.prim, ..., g4_MAX_FILE_INDEX.prim
|
||||
const int MAX_FILE_INDEX = fMaxFileNum - 1 ;
|
||||
@@ -152,10 +152,10 @@ void G4DAWNFILEScene::SetG4PrimFileName()
|
||||
G4cerr << " (Customizable as: setenv G4DAWNFILE_MAX_FILE_NUM number) " << endl;
|
||||
G4cerr << "===========================================" << endl;
|
||||
|
||||
} // G4DAWNFILEScene::SetG4PrimFileName()
|
||||
} // G4DAWNFILESceneHandler::SetG4PrimFileName()
|
||||
|
||||
|
||||
void G4DAWNFILEScene::BeginSavingG4Prim( void )
|
||||
void G4DAWNFILESceneHandler::BeginSavingG4Prim( void )
|
||||
{
|
||||
if( !IsSavingG4Prim() )
|
||||
{
|
||||
@@ -167,7 +167,7 @@ void G4DAWNFILEScene::BeginSavingG4Prim( void )
|
||||
}
|
||||
}
|
||||
|
||||
void G4DAWNFILEScene::EndSavingG4Prim ( void )
|
||||
void G4DAWNFILESceneHandler::EndSavingG4Prim ( void )
|
||||
{
|
||||
if( IsSavingG4Prim() )
|
||||
{
|
||||
@@ -181,7 +181,7 @@ void G4DAWNFILEScene::EndSavingG4Prim ( void )
|
||||
// Common to DAWN and DAWNFILE drivers //
|
||||
/////////////////////////////////////////
|
||||
|
||||
#define G4FRSCENE G4DAWNFILEScene
|
||||
#define G4FRSCENE G4DAWNFILESceneHandler
|
||||
#include "G4FRSceneFunc.icc"
|
||||
#undef G4FRSCENE
|
||||
|
||||
@@ -190,9 +190,9 @@ void G4DAWNFILEScene::EndSavingG4Prim ( void )
|
||||
//////////////////////
|
||||
|
||||
//----- static variables
|
||||
G4int G4DAWNFILEScene::fSceneIdCount = 0;
|
||||
G4int G4DAWNFILESceneHandler::fSceneIdCount = 0;
|
||||
|
||||
G4int G4DAWNFILEScene::fSceneCount = 0;
|
||||
G4int G4DAWNFILESceneHandler::fSceneCount = 0;
|
||||
// num of existing instances
|
||||
|
||||
#endif // G4VIS_BUILD_DAWNFILE_DRIVER
|
||||
+53
-53
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4DAWNFILEView.cc,v 2.5 1998/11/29 21:33:12 stanaka Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4DAWNFILEViewer.cc,v 1.2 1999/01/11 00:47:21 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
// DAWNFILE view - opens window, hard copy, etc.
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "G4SceneData.hh"
|
||||
#include "G4Scene.hh"
|
||||
#include "G4Vector3D.hh"
|
||||
#include "G4VisExtent.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
@@ -34,18 +34,18 @@
|
||||
|
||||
#include "G4FRConst.hh"
|
||||
#include "G4DAWNFILE.hh"
|
||||
#include "G4DAWNFILEScene.hh"
|
||||
#include "G4DAWNFILEView.hh"
|
||||
#include "G4DAWNFILESceneHandler.hh"
|
||||
#include "G4DAWNFILEViewer.hh"
|
||||
|
||||
|
||||
|
||||
//----- constants
|
||||
const char FR_ENV_MULTI_WINDOW[] = "G4DAWN_MULTI_WINDOW" ;
|
||||
|
||||
//----- G4DAWNFILEView, constructor
|
||||
G4DAWNFILEView::G4DAWNFILEView (G4DAWNFILEScene& scene,
|
||||
//----- G4DAWNFILEViewer, constructor
|
||||
G4DAWNFILEViewer::G4DAWNFILEViewer (G4DAWNFILESceneHandler& scene,
|
||||
const G4String& name):
|
||||
G4VView (scene, scene.IncrementViewCount (), name), fScene (scene)
|
||||
G4VViewer (scene, scene.IncrementViewCount (), name), fSceneHandler (scene)
|
||||
{
|
||||
// Set a g4.prim-file viewer
|
||||
strcpy( fG4PrimViewer, "dawn" );
|
||||
@@ -61,7 +61,7 @@ G4DAWNFILEView::G4DAWNFILEView (G4DAWNFILEScene& scene,
|
||||
|
||||
strcpy( fG4PrimViewerInvocation, fG4PrimViewer );
|
||||
strcat( fG4PrimViewerInvocation, " ");
|
||||
strcat( fG4PrimViewerInvocation, fScene.GetG4PrimFileName() );
|
||||
strcat( fG4PrimViewerInvocation, fSceneHandler.GetG4PrimFileName() );
|
||||
}
|
||||
|
||||
// Set a PostScript Viewer
|
||||
@@ -72,46 +72,46 @@ G4DAWNFILEView::G4DAWNFILEView (G4DAWNFILEScene& scene,
|
||||
|
||||
}
|
||||
|
||||
//----- G4DAWNFILEView, destructor
|
||||
G4DAWNFILEView::~G4DAWNFILEView ()
|
||||
//----- G4DAWNFILEViewer, destructor
|
||||
G4DAWNFILEViewer::~G4DAWNFILEViewer ()
|
||||
{}
|
||||
|
||||
//----- G4DAWNFILEView::SetView ()
|
||||
void G4DAWNFILEView::SetView ()
|
||||
//----- G4DAWNFILEViewer::SetView ()
|
||||
void G4DAWNFILEViewer::SetView ()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEView::SetView()\n";
|
||||
G4cerr << "***** G4DAWNFILEViewer::SetView()\n";
|
||||
#endif
|
||||
// Do nothing, since DAWN is running as a different process.
|
||||
// SendViewParameters () will do this job instead.
|
||||
}
|
||||
|
||||
|
||||
//----- G4DAWNFILEView::ClearView()
|
||||
//----- G4DAWNFILEViewer::ClearView()
|
||||
void
|
||||
G4DAWNFILEView::ClearView( void )
|
||||
G4DAWNFILEViewer::ClearView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEView::ClearView () " << endl;
|
||||
G4cerr << "***** G4DAWNFILEViewer::ClearView () " << endl;
|
||||
#endif
|
||||
|
||||
//----- Begin saving data to g4.prim
|
||||
fScene.BeginSavingG4Prim();
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- Clear old data
|
||||
fScene.SendStr( FR_CLEAR_DATA );
|
||||
fSceneHandler.SendStr( FR_CLEAR_DATA );
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----- G4DAWNFILEView::DrawView ()
|
||||
void G4DAWNFILEView::DrawView ()
|
||||
//----- G4DAWNFILEViewer::DrawView ()
|
||||
void G4DAWNFILEViewer::DrawView ()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEView::DrawView () " << endl;
|
||||
G4cerr << "***** G4DAWNFILEViewer::DrawView () " << endl;
|
||||
#endif
|
||||
//----- Error recovery
|
||||
if( fScene.IsInModeling() ) {
|
||||
if( fSceneHandler.IsInModeling() ) {
|
||||
G4cerr << "WARNING from DAWNFILE driver:" << endl;
|
||||
G4cerr << " You've invoked a drawing command before " << endl;
|
||||
G4cerr << " completing your previous visualization." << endl;
|
||||
@@ -122,7 +122,7 @@ void G4DAWNFILEView::DrawView ()
|
||||
}
|
||||
|
||||
//----- Begin Saving g4.prim file
|
||||
fScene.BeginSavingG4Prim();
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- set view if necessary
|
||||
SendViewParameters();
|
||||
@@ -135,31 +135,31 @@ void G4DAWNFILEView::DrawView ()
|
||||
//----- Draw
|
||||
ProcessView () ;
|
||||
|
||||
} // G4DAWNFILEView::DrawView ()
|
||||
} // G4DAWNFILEViewer::DrawView ()
|
||||
|
||||
|
||||
|
||||
//----- G4DAWNFILEView::ShowView()
|
||||
void G4DAWNFILEView::ShowView( void )
|
||||
//----- G4DAWNFILEViewer::ShowView()
|
||||
void G4DAWNFILEViewer::ShowView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEView::ShowView () " << endl;
|
||||
G4cerr << "***** G4DAWNFILEViewer::ShowView () " << endl;
|
||||
#endif
|
||||
|
||||
if( fScene.IsInModeling() ) // if( fScene.flag_in_modeling )
|
||||
if( fSceneHandler.IsInModeling() ) // if( fSceneHandler.flag_in_modeling )
|
||||
{
|
||||
|
||||
//----- End of Data
|
||||
fScene.FREndModeling();
|
||||
fSceneHandler.FREndModeling();
|
||||
|
||||
//----- Draw all
|
||||
fScene.SendStr( FR_DRAW_ALL );
|
||||
fSceneHandler.SendStr( FR_DRAW_ALL );
|
||||
|
||||
//----- Close device
|
||||
fScene.SendStr( FR_CLOSE_DEVICE );
|
||||
fSceneHandler.SendStr( FR_CLOSE_DEVICE );
|
||||
|
||||
//----- End saving data to g4.prim
|
||||
fScene.EndSavingG4Prim() ;
|
||||
fSceneHandler.EndSavingG4Prim() ;
|
||||
|
||||
|
||||
//----- string for viewer invocation
|
||||
@@ -170,39 +170,39 @@ void G4DAWNFILEView::ShowView( void )
|
||||
|
||||
strcpy( fG4PrimViewerInvocation, fG4PrimViewer );
|
||||
strcat( fG4PrimViewerInvocation, " ");
|
||||
strcat( fG4PrimViewerInvocation, fScene.GetG4PrimFileName() );
|
||||
strcat( fG4PrimViewerInvocation, fSceneHandler.GetG4PrimFileName() );
|
||||
}
|
||||
|
||||
|
||||
//----- Invoke DAWN
|
||||
if( false == G4FRofstream::DoesFileExist( fScene.GetG4PrimFileName() ) )
|
||||
if( false == G4FRofstream::DoesFileExist( fSceneHandler.GetG4PrimFileName() ) )
|
||||
{
|
||||
G4cout << "ERROR: Failed to generate file ";
|
||||
G4cout << fScene.GetG4PrimFileName() << endl;
|
||||
G4cout << fSceneHandler.GetG4PrimFileName() << endl;
|
||||
|
||||
} else if( strcmp( GetG4PrimViewerInvocation(), "" ) )
|
||||
{
|
||||
G4cout << "File " << fScene.GetG4PrimFileName() ;
|
||||
G4cout << "File " << fSceneHandler.GetG4PrimFileName() ;
|
||||
G4cout << " is generated." << endl;
|
||||
G4cout << GetG4PrimViewerInvocation() << endl;
|
||||
system( GetG4PrimViewerInvocation() );
|
||||
|
||||
} else { // no view, i.e., only file generation
|
||||
G4cout << "File " << fScene.GetG4PrimFileName() ;
|
||||
G4cout << "File " << fSceneHandler.GetG4PrimFileName() ;
|
||||
G4cout << " is generated." << endl;
|
||||
G4cout << "No viewer is invoked." << endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // G4DAWNFILEView::ShowView()
|
||||
} // G4DAWNFILEViewer::ShowView()
|
||||
|
||||
|
||||
//----- G4DAWNFILEView::FlushView()
|
||||
void G4DAWNFILEView::FlushView( void )
|
||||
//----- G4DAWNFILEViewer::FlushView()
|
||||
void G4DAWNFILEViewer::FlushView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEView::Flush () " << endl;
|
||||
G4cerr << "***** G4DAWNFILEViewer::Flush () " << endl;
|
||||
#endif
|
||||
|
||||
ShowView();
|
||||
@@ -210,11 +210,11 @@ void G4DAWNFILEView::FlushView( void )
|
||||
|
||||
|
||||
|
||||
//----- G4DAWNFILEView::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
void G4DAWNFILEView::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
//----- G4DAWNFILEViewer::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
void G4DAWNFILEViewer::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEView::SendDrawingStyle() " << endl;
|
||||
G4cerr << "***** G4DAWNFILEViewer::SendDrawingStyle() " << endl;
|
||||
#endif
|
||||
|
||||
G4int style = fVP.GetDrawingStyle();
|
||||
@@ -239,19 +239,19 @@ void G4DAWNFILEView::SendDrawingStyleToDAWNGUI( ostream& out )
|
||||
break;
|
||||
}
|
||||
|
||||
} // G4DAWNFILEView::SendDrawingStyle()
|
||||
} // G4DAWNFILEViewer::SendDrawingStyle()
|
||||
|
||||
|
||||
|
||||
//----- G4DAWNFILEView::SendViewParameters ()
|
||||
void G4DAWNFILEView::SendViewParameters ()
|
||||
//----- G4DAWNFILEViewer::SendViewParameters ()
|
||||
void G4DAWNFILEViewer::SendViewParameters ()
|
||||
{
|
||||
// Calculates view representation based on extent of object being
|
||||
// viewed and (initial) direction of camera. (Note: it can change
|
||||
// later due to user interaction via visualization system's GUI.)
|
||||
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4DAWNFILEView::SendViewParameters()\n";
|
||||
G4cerr << "***** G4DAWNFILEViewer::SendViewParameters()\n";
|
||||
#endif
|
||||
|
||||
//----- Magic number to decide camera distance automatically
|
||||
@@ -260,12 +260,12 @@ void G4DAWNFILEView::SendViewParameters ()
|
||||
const G4double MAX_HALF_ANGLE = 0.499 * M_PI ;
|
||||
|
||||
//----- Send Bounding Box
|
||||
fScene.SendBoundingBox();
|
||||
fSceneHandler.SendBoundingBox();
|
||||
|
||||
//----- CALC camera distance
|
||||
//..... Note: Camera cannot enter inside object
|
||||
G4double camera_distance ;
|
||||
G4double radius = fScene.GetSceneData().GetExtent().GetExtentRadius();
|
||||
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
|
||||
|
||||
G4double half_view_angle = fabs ( fVP.GetFieldHalfAngle () ) ;
|
||||
if( half_view_angle > MAX_HALF_ANGLE ) {
|
||||
@@ -372,10 +372,10 @@ void G4DAWNFILEView::SendViewParameters ()
|
||||
|
||||
|
||||
//----- SET CAMERA
|
||||
fScene.SendStr( FR_SET_CAMERA );
|
||||
fSceneHandler.SendStr( FR_SET_CAMERA );
|
||||
|
||||
|
||||
} // G4DAWNFILEView::SendViewParameters ()
|
||||
} // G4DAWNFILEViewer::SendViewParameters ()
|
||||
|
||||
|
||||
#endif // G4VIS_BUILD_DAWNFILE_DRIVER
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FRClientServer.cc,v 2.1 1998/07/13 17:11:01 urbi Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FRClientServer.cc,v 1.2 1999/01/09 16:11:49 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
// Satoshi TANAKA, Wed Jul 3 14:14:29 JST 1996
|
||||
////////////////////////////////
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FRSceneFunc.icc,v 2.3 1998/07/21 09:44:57 stanaka Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FRSceneFunc.icc,v 1.3 1999/01/11 00:47:22 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ void G4FRSCENE::AddPrimitive (const G4Polyline& polyline)
|
||||
G4int nPoints = polyline.entries ();
|
||||
G4int i ;
|
||||
const G4VisAttributes* pVA =
|
||||
fpView->GetApplicableVisAttributes ( polyline.GetVisAttributes() );
|
||||
fpViewer->GetApplicableVisAttributes ( polyline.GetVisAttributes() );
|
||||
|
||||
//----- skip drawing invisible primitive
|
||||
if( pVA ){
|
||||
@@ -243,7 +243,7 @@ void G4FRSCENE::AddPrimitive ( const G4Polyhedron& polyhedron )
|
||||
InitializeFR();
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes( fpView->GetApplicableVisAttributes
|
||||
if(!SendVisAttributes( fpViewer->GetApplicableVisAttributes
|
||||
(polyhedron.GetVisAttributes() ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_RED ); // color
|
||||
}
|
||||
@@ -298,7 +298,7 @@ void G4FRSCENE::AddPrimitive ( const G4Polyhedron& polyhedron )
|
||||
void G4FRSCENE::BeginModeling ()
|
||||
{
|
||||
|
||||
G4VScene::BeginModeling ();
|
||||
G4VSceneHandler::BeginModeling ();
|
||||
|
||||
//-----
|
||||
#if defined DEBUG_FR_SCENE
|
||||
@@ -342,7 +342,7 @@ void G4FRSCENE::BeginPrimitives (const G4Transform3D& objectTransformation)
|
||||
G4cerr << "***** BeginPrimitives \n";
|
||||
#endif
|
||||
|
||||
G4VScene::BeginPrimitives (objectTransformation);
|
||||
G4VSceneHandler::BeginPrimitives (objectTransformation);
|
||||
fpObjectTransformation = &objectTransformation;
|
||||
|
||||
#if defined DEBUG_FR_SCENE
|
||||
@@ -357,7 +357,7 @@ void G4FRSCENE::EndPrimitives ()
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** EndPrimitives \n";
|
||||
#endif
|
||||
G4VScene::EndPrimitives ();
|
||||
G4VSceneHandler::EndPrimitives ();
|
||||
}
|
||||
|
||||
//----- G4FRSCENE::GetSceneCount ()
|
||||
@@ -385,7 +385,7 @@ void G4FRSCENE::AddThis( const G4Box& box )
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_GREEN ); // color
|
||||
}
|
||||
|
||||
@@ -421,7 +421,7 @@ G4FRSCENE::AddThis( const G4Tubs& tubes )
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_BLUE ); // color
|
||||
}
|
||||
|
||||
@@ -460,7 +460,7 @@ G4FRSCENE::AddThis( const G4Cons& cons )
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_CYAN ); // color
|
||||
}
|
||||
|
||||
@@ -500,7 +500,7 @@ void G4FRSCENE::AddThis ( const G4Trd& trd )
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_MAGENTA ); // color
|
||||
}
|
||||
|
||||
@@ -537,7 +537,7 @@ void G4FRSCENE::AddThis ( const G4Sphere& sphere )
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_YELLOW ); // color
|
||||
}
|
||||
|
||||
@@ -565,7 +565,7 @@ void G4FRSCENE::AddThis ( const G4Sphere& sphere )
|
||||
//...... G4Polyhedron is used for visualization.
|
||||
//...... Visualization attributes and
|
||||
//...... local coordinates are resent and overwritten.
|
||||
G4VScene::AddThis( sphere ) ;
|
||||
G4VSceneHandler::AddThis( sphere ) ;
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
// //----- sphere segment
|
||||
@@ -595,7 +595,7 @@ void G4FRSCENE::AddThis (const G4Para& para)
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_RED ); // color
|
||||
}
|
||||
|
||||
@@ -648,7 +648,7 @@ void G4FRSCENE::AddThis (const G4Trap& trap)
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_GREEN ); // color
|
||||
}
|
||||
|
||||
@@ -719,7 +719,7 @@ G4FRSCENE::AddThis( const G4Torus& torus )
|
||||
|
||||
//----- Attributes
|
||||
if(!SendVisAttributes
|
||||
( fpView->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
( fpViewer->GetApplicableVisAttributes( fpVisAttribs ) ) ) {
|
||||
SendStr( FR_COLOR_RGB_BLUE ); // color
|
||||
}
|
||||
|
||||
@@ -754,7 +754,7 @@ void G4FRSCENE::AddThis ( const G4VSolid& solid )
|
||||
|
||||
|
||||
//----- Send a primitive
|
||||
G4VScene::AddThis( solid ) ;
|
||||
G4VSceneHandler::AddThis( solid ) ;
|
||||
|
||||
} //G4FRSCENE::AddThis ( const G4VSolid& )
|
||||
|
||||
@@ -764,7 +764,7 @@ G4bool
|
||||
G4FRSCENE::SendVisAttributes ( const G4VisAttributes* pAV )
|
||||
{
|
||||
|
||||
// Have a look at G4VScene::GetDrawingStyle (const G4Visible&). (John)
|
||||
// Have a look at G4VSceneHandler::GetDrawingStyle (const G4Visible&). (John)
|
||||
|
||||
G4bool status = true ; // initialization
|
||||
const G4double ALPHA_MIN = 0.001 ; // min of alpha factor of color
|
||||
@@ -803,7 +803,7 @@ G4bool G4FRSCENE::IsVisible()
|
||||
G4bool visibility = true ;
|
||||
|
||||
const G4VisAttributes* pVisAttribs =
|
||||
fpView->GetApplicableVisAttributes( fpVisAttribs );
|
||||
fpViewer->GetApplicableVisAttributes( fpVisAttribs );
|
||||
|
||||
//-----
|
||||
if( ( getenv( FR_ENV_CULL_INVISIBLE_OBJECTS ) != NULL ) && \
|
||||
@@ -822,7 +822,7 @@ G4bool G4FRSCENE::IsVisible()
|
||||
void G4FRSCENE::SendBoundingBox( void )
|
||||
{
|
||||
//----- (1A) CALC bounding box of the bounding sphere
|
||||
const G4VisExtent& extent = GetSceneData().GetExtent();
|
||||
const G4VisExtent& extent = GetScene()->GetExtent();
|
||||
const G4Point3D& center = extent.GetExtentCenter();
|
||||
const G4double radius = extent.GetExtentRadius();
|
||||
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FukuiRenderer.cc,v 2.3 1998/11/06 13:41:46 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FukuiRenderer.cc,v 1.3 1999/01/11 00:47:23 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA
|
||||
@@ -24,9 +24,9 @@
|
||||
#define __G_ANSI_C__
|
||||
|
||||
//#include "G4VisFeaturesOfFukuiRenderer.hh"
|
||||
#include "G4VScene.hh"
|
||||
#include "G4FukuiRendererScene.hh"
|
||||
#include "G4FukuiRendererView.hh"
|
||||
#include "G4VSceneHandler.hh"
|
||||
#include "G4FukuiRendererSceneHandler.hh"
|
||||
#include "G4FukuiRendererViewer.hh"
|
||||
#include "G4FRClientServer.hh"
|
||||
#include "G4FRConst.hh"
|
||||
#include "G4FRFeatures.hh"
|
||||
@@ -69,25 +69,25 @@ G4FukuiRenderer::~G4FukuiRenderer ()
|
||||
}
|
||||
}
|
||||
|
||||
//----- G4FukuiRenderer::CreateScene ()
|
||||
G4VScene* G4FukuiRenderer::CreateScene (const G4String& name)
|
||||
//----- G4FukuiRenderer::CreateSceneHandler ()
|
||||
G4VSceneHandler* G4FukuiRenderer::CreateSceneHandler (const G4String& name)
|
||||
{
|
||||
G4VScene* p = new G4FukuiRendererScene (*this, name);
|
||||
G4VSceneHandler* p = new G4FukuiRendererSceneHandler (*this, name);
|
||||
|
||||
if(!flag_connected) { delete p ; p = NULL ; }
|
||||
|
||||
G4cout << G4FukuiRendererScene::GetSceneCount ()
|
||||
G4cout << G4FukuiRendererSceneHandler::GetSceneCount ()
|
||||
<< ' ' << fName << " scenes extanct." << endl;
|
||||
|
||||
return p;
|
||||
}
|
||||
|
||||
//----- G4FukuiRenderer::CreateView ()
|
||||
G4VView* G4FukuiRenderer::CreateView (G4VScene& scene, const G4String& name)
|
||||
//----- G4FukuiRenderer::CreateViewer ()
|
||||
G4VViewer* G4FukuiRenderer::CreateViewer (G4VSceneHandler& scene, const G4String& name)
|
||||
{
|
||||
if(!flag_connected) return NULL;
|
||||
G4VView* pView =
|
||||
new G4FukuiRendererView ((G4FukuiRendererScene&) scene, name);
|
||||
G4VViewer* pView =
|
||||
new G4FukuiRendererViewer ((G4FukuiRendererSceneHandler&) scene, name);
|
||||
return pView;
|
||||
}
|
||||
|
||||
|
||||
+14
-14
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FukuiRendererScene.cc,v 2.3 1998/11/06 13:41:47 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FukuiRendererSceneHandler.cc,v 1.1 1999/01/09 16:11:52 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 11:34:24 JST 1996
|
||||
@@ -29,8 +29,8 @@
|
||||
#include "globals.hh"
|
||||
#include "G4FRConst.hh"
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#include "G4FukuiRendererScene.hh"
|
||||
#include "G4FukuiRendererView.hh"
|
||||
#include "G4FukuiRendererSceneHandler.hh"
|
||||
#include "G4FukuiRendererViewer.hh"
|
||||
#include "G4Point3D.hh"
|
||||
#include "G4VisAttributes.hh"
|
||||
#include "G4Transform3D.hh"
|
||||
@@ -55,11 +55,11 @@ const char FR_ENV_CULL_INVISIBLE_OBJECTS [] = "G4DAWN_CULL_INVISIBLE_OBJECTS";
|
||||
///////////////////////////
|
||||
|
||||
|
||||
//----- G4FukuiRendererScene, constructor
|
||||
G4FukuiRendererScene::G4FukuiRendererScene (G4FukuiRenderer& system,
|
||||
//----- G4FukuiRendererSceneHandler, constructor
|
||||
G4FukuiRendererSceneHandler::G4FukuiRendererSceneHandler (G4FukuiRenderer& system,
|
||||
const G4String& name):
|
||||
fSystem (system) ,
|
||||
G4VScene (system, fSceneIdCount++, name) ,
|
||||
G4VSceneHandler (system, fSceneIdCount++, name) ,
|
||||
fPrimDest (system.GetPrimDest() ) ,
|
||||
flag_in_modeling (false) ,
|
||||
flag_saving_g4_prim (false) ,
|
||||
@@ -89,14 +89,14 @@ COMMAND_BUF_SIZE (G4FRClientServer::SEND_BUFMAX)
|
||||
//----- count instantiated scenes
|
||||
fSceneCount++;
|
||||
|
||||
} // G4FukuiRendererScene, constructor
|
||||
} // G4FukuiRendererSceneHandler, constructor
|
||||
|
||||
|
||||
//----- G4FukuiRendererScene, destructor
|
||||
G4FukuiRendererScene::~G4FukuiRendererScene ()
|
||||
//----- G4FukuiRendererSceneHandler, destructor
|
||||
G4FukuiRendererSceneHandler::~G4FukuiRendererSceneHandler ()
|
||||
{
|
||||
#if defined DEBUG_FR_SCENE
|
||||
G4cerr << "***** ~G4FukuiRendererScene" << endl;
|
||||
G4cerr << "***** ~G4FukuiRendererSceneHandler" << endl;
|
||||
#endif
|
||||
fSceneCount--;
|
||||
ClearStore (); // clear current scene
|
||||
@@ -108,7 +108,7 @@ G4FukuiRendererScene::~G4FukuiRendererScene ()
|
||||
// Common to DAWN and DAWNFILE drivers //
|
||||
/////////////////////////////////////////
|
||||
|
||||
#define G4FRSCENE G4FukuiRendererScene
|
||||
#define G4FRSCENE G4FukuiRendererSceneHandler
|
||||
#include "G4FRSceneFunc.icc"
|
||||
#undef G4FRSCENE
|
||||
|
||||
@@ -117,9 +117,9 @@ G4FukuiRendererScene::~G4FukuiRendererScene ()
|
||||
//////////////////////
|
||||
|
||||
//----- static variables
|
||||
G4int G4FukuiRendererScene::fSceneIdCount = 0;
|
||||
G4int G4FukuiRendererSceneHandler::fSceneIdCount = 0;
|
||||
|
||||
G4int G4FukuiRendererScene::fSceneCount = 0;
|
||||
G4int G4FukuiRendererSceneHandler::fSceneCount = 0;
|
||||
// num of existing instances
|
||||
|
||||
#endif // G4VIS_BUILD_DAWN_DRIVER
|
||||
+75
-75
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4FukuiRendererView.cc,v 2.4 1998/11/06 13:41:48 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4FukuiRendererViewer.cc,v 1.2 1999/01/11 00:47:24 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Satoshi TANAKA, Fri Jun 28 12:09:11 JST 1996
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <string.h>
|
||||
#include <assert.h>
|
||||
|
||||
#include "G4SceneData.hh"
|
||||
#include "G4Scene.hh"
|
||||
#include "G4Vector3D.hh"
|
||||
#include "G4VisExtent.hh"
|
||||
#include "G4LogicalVolume.hh"
|
||||
@@ -35,28 +35,28 @@
|
||||
|
||||
#include "G4FRConst.hh"
|
||||
#include "G4FukuiRenderer.hh"
|
||||
#include "G4FukuiRendererScene.hh"
|
||||
#include "G4FukuiRendererView.hh"
|
||||
#include "G4FukuiRendererSceneHandler.hh"
|
||||
#include "G4FukuiRendererViewer.hh"
|
||||
|
||||
|
||||
//----- constants
|
||||
const char FR_ENV_MULTI_WINDOW[] = "G4DAWN_MULTI_WINDOW" ;
|
||||
|
||||
//----- G4FukuiRendererView, constructor
|
||||
G4FukuiRendererView::G4FukuiRendererView (G4FukuiRendererScene& scene,
|
||||
//----- G4FukuiRendererViewer, constructor
|
||||
G4FukuiRendererViewer::G4FukuiRendererViewer (G4FukuiRendererSceneHandler& scene,
|
||||
const G4String& name):
|
||||
G4VView (scene, scene.IncrementViewCount (), name), fScene (scene)
|
||||
G4VViewer (scene, scene.IncrementViewCount (), name), fSceneHandler (scene)
|
||||
{}
|
||||
|
||||
//----- G4FukuiRendererView, destructor
|
||||
G4FukuiRendererView::~G4FukuiRendererView ()
|
||||
//----- G4FukuiRendererViewer, destructor
|
||||
G4FukuiRendererViewer::~G4FukuiRendererViewer ()
|
||||
{}
|
||||
|
||||
//----- G4FukuiRendererView::SetView ()
|
||||
void G4FukuiRendererView::SetView ()
|
||||
//----- G4FukuiRendererViewer::SetView ()
|
||||
void G4FukuiRendererViewer::SetView ()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::SetView()\n";
|
||||
G4cerr << "***** G4FukuiRendererViewer::SetView()\n";
|
||||
#endif
|
||||
// Do nothing, since DAWN is running as a different process.
|
||||
// SendViewParameters () will do this job instead.
|
||||
@@ -65,31 +65,31 @@ void G4FukuiRendererView::SetView ()
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::ClearView()
|
||||
//----- G4FukuiRendererViewer::ClearView()
|
||||
void
|
||||
G4FukuiRendererView::ClearView( void )
|
||||
G4FukuiRendererViewer::ClearView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::ClearView () " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::ClearView () " << endl;
|
||||
#endif
|
||||
|
||||
//----- Begin saving data to g4.prim
|
||||
fScene.BeginSavingG4Prim();
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- Clear old data
|
||||
fScene.SendStr( FR_CLEAR_DATA );
|
||||
fSceneHandler.SendStr( FR_CLEAR_DATA );
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::DrawView ()
|
||||
void G4FukuiRendererView::DrawView ()
|
||||
//----- G4FukuiRendererViewer::DrawView ()
|
||||
void G4FukuiRendererViewer::DrawView ()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::DrawView () " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::DrawView () " << endl;
|
||||
#endif
|
||||
//----- Error recovery
|
||||
if( fScene.IsInModeling() ) {
|
||||
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;
|
||||
@@ -100,7 +100,7 @@ void G4FukuiRendererView::DrawView ()
|
||||
}
|
||||
|
||||
//----- Begin Saving g4.prim file
|
||||
fScene.BeginSavingG4Prim();
|
||||
fSceneHandler.BeginSavingG4Prim();
|
||||
|
||||
//----- drawing device
|
||||
if( ( getenv( FR_ENV_MULTI_WINDOW ) != NULL ) && \
|
||||
@@ -125,105 +125,105 @@ void G4FukuiRendererView::DrawView ()
|
||||
//----- Draw
|
||||
ProcessView () ;
|
||||
|
||||
} // G4FukuiRendererView::DrawView ()
|
||||
} // G4FukuiRendererViewer::DrawView ()
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::ShowView()
|
||||
void G4FukuiRendererView::ShowView( void )
|
||||
//----- G4FukuiRendererViewer::ShowView()
|
||||
void G4FukuiRendererViewer::ShowView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::ShowView () " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::ShowView () " << endl;
|
||||
#endif
|
||||
|
||||
if( fScene.IsInModeling() ) // if( fScene.flag_in_modeling )
|
||||
if( fSceneHandler.IsInModeling() ) // if( fSceneHandler.flag_in_modeling )
|
||||
{
|
||||
|
||||
//----- End of Data
|
||||
fScene.FREndModeling();
|
||||
fSceneHandler.FREndModeling();
|
||||
|
||||
//----- Draw all
|
||||
fScene.SendStr( FR_DRAW_ALL );
|
||||
fSceneHandler.SendStr( FR_DRAW_ALL );
|
||||
|
||||
//----- Close device
|
||||
fScene.SendStr( FR_CLOSE_DEVICE );
|
||||
fSceneHandler.SendStr( FR_CLOSE_DEVICE );
|
||||
|
||||
//----- End saving data to g4.prim
|
||||
fScene.EndSavingG4Prim() ;
|
||||
fSceneHandler.EndSavingG4Prim() ;
|
||||
|
||||
//----- Wait user clicks drawing Area
|
||||
this->Wait();
|
||||
}
|
||||
|
||||
} // G4FukuiRendererView::ShowView()
|
||||
} // G4FukuiRendererViewer::ShowView()
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::FlushView()
|
||||
void G4FukuiRendererView::FlushView( void )
|
||||
//----- G4FukuiRendererViewer::FlushView()
|
||||
void G4FukuiRendererViewer::FlushView( void )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::Flush () " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::Flush () " << endl;
|
||||
#endif
|
||||
|
||||
if( fScene.IsInModeling() ) // if( fScene.flag_in_modeling )
|
||||
if( fSceneHandler.IsInModeling() ) // if( fSceneHandler.flag_in_modeling )
|
||||
{
|
||||
|
||||
//----- End of Data
|
||||
fScene.FREndModeling();
|
||||
fSceneHandler.FREndModeling();
|
||||
|
||||
//----- Draw all
|
||||
fScene.SendStr( FR_DRAW_ALL );
|
||||
fSceneHandler.SendStr( FR_DRAW_ALL );
|
||||
|
||||
//----- Close device
|
||||
fScene.SendStr( FR_CLOSE_DEVICE );
|
||||
fSceneHandler.SendStr( FR_CLOSE_DEVICE );
|
||||
|
||||
//----- End saving data to g4.prim
|
||||
fScene.EndSavingG4Prim() ;
|
||||
fSceneHandler.EndSavingG4Prim() ;
|
||||
|
||||
}
|
||||
|
||||
} // G4FukuiRendererView::FlushView()
|
||||
} // G4FukuiRendererViewer::FlushView()
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::Wait()
|
||||
//----- G4FukuiRendererViewer::Wait()
|
||||
void
|
||||
G4FukuiRendererView::Wait()
|
||||
G4FukuiRendererViewer::Wait()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::Wait () " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::Wait () " << endl;
|
||||
#endif
|
||||
fScene.SendStr ( FR_WAIT );
|
||||
fScene.GetPrimDest().WaitSendBack( FR_WAIT );
|
||||
fSceneHandler.SendStr ( FR_WAIT );
|
||||
fSceneHandler.GetPrimDest().WaitSendBack( FR_WAIT );
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::Wait () : end" << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::Wait () : end" << endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::SendDevice()
|
||||
//----- G4FukuiRendererViewer::SendDevice()
|
||||
void
|
||||
G4FukuiRendererView::SendDevice( FRDEV dev )
|
||||
G4FukuiRendererViewer::SendDevice( FRDEV dev )
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::SendDevice() " << endl;
|
||||
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 ) {
|
||||
fScene.SendStrInt ( FR_DEVICE, dev );
|
||||
fSceneHandler.SendStrInt ( FR_DEVICE, dev );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::SendDrawingStyle()
|
||||
void G4FukuiRendererView::SendDrawingStyle()
|
||||
//----- G4FukuiRendererViewer::SendDrawingStyle()
|
||||
void G4FukuiRendererViewer::SendDrawingStyle()
|
||||
{
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::SendDrawingStyle() " << endl;
|
||||
G4cerr << "***** G4FukuiRendererViewer::SendDrawingStyle() " << endl;
|
||||
#endif
|
||||
|
||||
G4int style = fVP.GetDrawingStyle();
|
||||
@@ -231,33 +231,33 @@ void G4FukuiRendererView::SendDrawingStyle()
|
||||
switch( style )
|
||||
{
|
||||
case G4ViewParameters::wireframe:
|
||||
fScene.SendStr( FR_WIREFRAME );
|
||||
fSceneHandler.SendStr( FR_WIREFRAME );
|
||||
break;
|
||||
case G4ViewParameters::hlr:
|
||||
fScene.SendStr( FR_LINES );
|
||||
fSceneHandler.SendStr( FR_LINES );
|
||||
break;
|
||||
case G4ViewParameters::hsr:
|
||||
case G4ViewParameters::hlhsr:
|
||||
fScene.SendStr( FR_SURFACE );
|
||||
fSceneHandler.SendStr( FR_SURFACE );
|
||||
break;
|
||||
default:
|
||||
fScene.SendStr( FR_WIREFRAME );
|
||||
fSceneHandler.SendStr( FR_WIREFRAME );
|
||||
break;
|
||||
}
|
||||
|
||||
} // G4FukuiRendererView::SendDrawingStyle()
|
||||
} // G4FukuiRendererViewer::SendDrawingStyle()
|
||||
|
||||
|
||||
|
||||
//----- G4FukuiRendererView::SendViewParameters ()
|
||||
void G4FukuiRendererView::SendViewParameters ()
|
||||
//----- G4FukuiRendererViewer::SendViewParameters ()
|
||||
void G4FukuiRendererViewer::SendViewParameters ()
|
||||
{
|
||||
// Calculates view representation based on extent of object being
|
||||
// viewed and (initial) direction of camera. (Note: it can change
|
||||
// later due to user interaction via visualization system's GUI.)
|
||||
|
||||
#if defined DEBUG_FR_VIEW
|
||||
G4cerr << "***** G4FukuiRendererView::SendViewParameters()\n";
|
||||
G4cerr << "***** G4FukuiRendererViewer::SendViewParameters()\n";
|
||||
#endif
|
||||
|
||||
//----- Magic number to decide camera distance automatically
|
||||
@@ -266,12 +266,12 @@ void G4FukuiRendererView::SendViewParameters ()
|
||||
const G4double MAX_HALF_ANGLE = 0.499 * M_PI ;
|
||||
|
||||
//----- Send Bounding Box
|
||||
fScene.SendBoundingBox();
|
||||
fSceneHandler.SendBoundingBox();
|
||||
|
||||
//----- (2A) CALC camera distance
|
||||
//..... Note: Camera cannot enter inside object
|
||||
G4double camera_distance ;
|
||||
G4double radius = fScene.GetSceneData().GetExtent().GetExtentRadius();
|
||||
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
|
||||
|
||||
G4double half_view_angle = fabs ( fVP.GetFieldHalfAngle () ) ;
|
||||
if( half_view_angle > MAX_HALF_ANGLE ) {
|
||||
@@ -300,7 +300,7 @@ void G4FukuiRendererView::SendViewParameters ()
|
||||
const G4double h_angle = (180.0 / M_PI) * camera_direction.phi () ;
|
||||
|
||||
//----- (2B), (3B) SEND camera position
|
||||
fScene.SendStrDouble3( FR_CAMERA_POSITION,
|
||||
fSceneHandler.SendStrDouble3( FR_CAMERA_POSITION,
|
||||
camera_distance,
|
||||
v_angle,
|
||||
h_angle );
|
||||
@@ -309,7 +309,7 @@ void G4FukuiRendererView::SendViewParameters ()
|
||||
const G4Point3D& target_point = fVP.GetCurrentTargetPoint();
|
||||
|
||||
//----- (4B) SEND target point
|
||||
fScene.SendStrDouble3( FR_TARGET_POINT,
|
||||
fSceneHandler.SendStrDouble3( FR_TARGET_POINT,
|
||||
target_point.x(),
|
||||
target_point.y(),
|
||||
target_point.z() );
|
||||
@@ -321,9 +321,9 @@ void G4FukuiRendererView::SendViewParameters ()
|
||||
if( half_view_angle < MIN_HALF_ANGLE ) {
|
||||
|
||||
const G4Point3D& std_target_point \
|
||||
= fScene.GetSceneData().GetStandardTargetPoint();
|
||||
= fSceneHandler.GetScene()->GetStandardTargetPoint();
|
||||
|
||||
fScene.SendStrDouble4( FR_ZOOM_FACTOR,
|
||||
fSceneHandler.SendStrDouble4( FR_ZOOM_FACTOR,
|
||||
zoom_factor ,
|
||||
std_target_point.x(),
|
||||
std_target_point.y(),
|
||||
@@ -337,23 +337,23 @@ void G4FukuiRendererView::SendViewParameters ()
|
||||
G4double focal_distance \
|
||||
= FR_HALF_SCREEN_SIZE / tan( half_view_angle );
|
||||
focal_distance *= zoom_factor ;
|
||||
fScene.SendStrDouble ( FR_FOCAL_DISTANCE, focal_distance );
|
||||
fSceneHandler.SendStrDouble ( FR_FOCAL_DISTANCE, focal_distance );
|
||||
}
|
||||
|
||||
//----- INVOKE GUI: not executed in the default setting
|
||||
if( fScene.GetSystem().IsGUIMode() ) {
|
||||
if( fSceneHandler.GetSystem().IsGUIMode() ) {
|
||||
//----- send GUI command
|
||||
fScene.SendStr( FR_GUI );
|
||||
fSceneHandler.SendStr( FR_GUI );
|
||||
|
||||
//----- wait the same command is sent back:
|
||||
//..... This avoids to send many data before
|
||||
//..... GUI session is over.
|
||||
fScene.GetPrimDest().WaitSendBack( FR_GUI );
|
||||
fSceneHandler.GetPrimDest().WaitSendBack( FR_GUI );
|
||||
}
|
||||
|
||||
//----- SET CAMERA
|
||||
fScene.SendStr( FR_SET_CAMERA );
|
||||
fSceneHandler.SendStr( FR_SET_CAMERA );
|
||||
|
||||
} // G4FukuiRendererView::SendViewParameters ()
|
||||
} // G4FukuiRendererViewer::SendViewParameters ()
|
||||
|
||||
#endif // G4VIS_BUILD_DAWN_DRIVER
|
||||
Reference in New Issue
Block a user