Import Geant4 0.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 2.3 1998/07/07 17:11:11 allison Exp $
|
||||
# $Id: GNUmakefile,v 1.2 1999/04/15 15:27:56 johna Exp $
|
||||
|
||||
name := G4OPACS
|
||||
|
||||
@@ -19,6 +19,7 @@ CPPFLAGS += -I$(G4BASE)/graphics_reps/include
|
||||
CPPFLAGS += -I$(G4BASE)/geometry/management/include
|
||||
CPPFLAGS += -I$(G4BASE)/geometry/volumes/include
|
||||
CPPFLAGS += -I$(G4BASE)/interfaces/common/include
|
||||
CPPFLAGS += -I$(G4BASE)/intercoms/include
|
||||
|
||||
ifdef G4VIS_BUILD_OPACS_DRIVER
|
||||
CPPFLAGS += -I$(COROOT)/include -I$(XXROOT)/include -I$(WOROOT)/include\
|
||||
|
||||
+14
-11
@@ -5,15 +5,15 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GoScene.hh,v 2.1 1998/11/06 13:42:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4GoSceneHandler.hh,v 1.3 1999/05/25 12:04:43 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
// Wo scene - creates Wo Display lists.
|
||||
// Wo scene handler - creates Wo Display lists.
|
||||
|
||||
#ifndef G4GOSCENE_HH
|
||||
#define G4GOSCENE_HH
|
||||
#ifndef G4GOSCENEHANDLER_HH
|
||||
#define G4GOSCENEHANDLER_HH
|
||||
|
||||
#if defined(G4VIS_BUILD_OPACS_DRIVER) || defined(G4VIS_USE_OPACS)
|
||||
|
||||
@@ -23,14 +23,14 @@
|
||||
//G4
|
||||
#include "globals.hh"
|
||||
#include "G4VGraphicsSystem.hh"
|
||||
#include "G4VScene.hh"
|
||||
#include "G4VSceneHandler.hh"
|
||||
|
||||
class G4GoScene: public G4VScene {
|
||||
class G4GoSceneHandler: public G4VSceneHandler {
|
||||
|
||||
public:
|
||||
G4GoScene (G4VGraphicsSystem& system,
|
||||
G4GoSceneHandler (G4VGraphicsSystem& system,
|
||||
const G4String& name = "");
|
||||
~G4GoScene ();
|
||||
virtual ~G4GoSceneHandler ();
|
||||
void AddPrimitive (const G4Polyline&);
|
||||
void AddPrimitive (const G4Text&);
|
||||
void AddPrimitive (const G4Circle&);
|
||||
@@ -59,9 +59,12 @@ public:
|
||||
|
||||
private:
|
||||
void ClearStore ();
|
||||
void ClearTransientStore();
|
||||
void RequestPrimitives (const G4VSolid& solid);
|
||||
G4VGraphicsSystem& fSystem; // Graphics system for this scene.
|
||||
ONode fRootGoNode; // Root ONode for this scene.
|
||||
ONode fRootGoNode; // Root ONode for this scene.
|
||||
ONode fStaticRootGoNode; // For detector.
|
||||
ONode fTransientRootGoNode; // For event.
|
||||
static G4int fSceneIdCount; // static counter for Wo scenes.
|
||||
static G4int fSceneCount; // No. of extanct scenes.
|
||||
static ONode fGoNode; // Current ONode.
|
||||
@@ -70,7 +73,7 @@ private:
|
||||
char* nodeName;
|
||||
};
|
||||
|
||||
inline G4int G4GoScene::GetSceneCount () {
|
||||
inline G4int G4GoSceneHandler::GetSceneCount () {
|
||||
return fSceneCount;
|
||||
}
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Wo.hh,v 2.1 1998/11/06 13:42:01 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4Wo.hh,v 1.4 1999/05/10 15:38:48 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
@@ -25,9 +25,9 @@ class G4VInteractorManager;
|
||||
class G4Wo: public G4VGraphicsSystem {
|
||||
public:
|
||||
G4Wo ();
|
||||
~G4Wo ();
|
||||
G4VScene* CreateScene (const G4String& name = "");
|
||||
G4VView* CreateView (G4VScene&, const G4String& name = "");
|
||||
virtual ~G4Wo ();
|
||||
G4VSceneHandler* CreateSceneHandler (const G4String& name = "");
|
||||
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
|
||||
static G4VInteractorManager* GetInteractorManager ();
|
||||
};
|
||||
|
||||
|
||||
+11
-11
@@ -5,31 +5,31 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4WoView.hh,v 2.1 1998/11/06 13:42:02 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4WoViewer.hh,v 1.3 1999/05/10 15:38:49 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
// Wo view - opens window, hard copy, etc.
|
||||
// Wo viewer - opens window, hard copy, etc.
|
||||
|
||||
#ifndef G4WOVIEW_HH
|
||||
#define G4WOVIEW_HH
|
||||
#ifndef G4WOVIEWER_HH
|
||||
#define G4WOVIEWER_HH
|
||||
|
||||
#if defined(G4VIS_BUILD_OPACS_DRIVER) || defined(G4VIS_USE_OPACS)
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <OCamera.h>
|
||||
|
||||
#include "G4VView.hh"
|
||||
#include "G4VViewer.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4GoScene;
|
||||
class G4GoSceneHandler;
|
||||
|
||||
// Base class for various WoView classes.
|
||||
class G4WoView: public G4VView {
|
||||
class G4WoViewer: public G4VViewer {
|
||||
public:
|
||||
G4WoView (G4GoScene& scene, const G4String& name = "");
|
||||
~G4WoView ();
|
||||
G4WoViewer (G4GoSceneHandler& scene, const G4String& name = "");
|
||||
virtual ~G4WoViewer ();
|
||||
void DrawView ();
|
||||
void ShowView ();
|
||||
OCamera GetCamera ();
|
||||
@@ -38,7 +38,7 @@ private:
|
||||
void FinishView ();
|
||||
void SetView ();
|
||||
private:
|
||||
G4GoScene& fScene; // Graphics Scene for this view.
|
||||
G4GoSceneHandler& fSceneHandler; // Graphics Scene for this view.
|
||||
OCamera fGoCamera;
|
||||
Widget fXoCamera;
|
||||
Widget fShell;
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Xo.hh,v 2.1 1998/11/06 13:42:04 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4Xo.hh,v 1.4 1999/05/10 15:38:50 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
@@ -25,9 +25,9 @@ class G4VInteractorManager;
|
||||
class G4Xo: public G4VGraphicsSystem {
|
||||
public:
|
||||
G4Xo ();
|
||||
~G4Xo ();
|
||||
G4VScene* CreateScene (const G4String& name = "");
|
||||
G4VView* CreateView (G4VScene&, const G4String& name = "");
|
||||
virtual ~G4Xo ();
|
||||
G4VSceneHandler* CreateSceneHandler (const G4String& name = "");
|
||||
G4VViewer* CreateViewer (G4VSceneHandler&, const G4String& name = "");
|
||||
static G4VInteractorManager* GetInteractorManager ();
|
||||
};
|
||||
|
||||
|
||||
+11
-11
@@ -5,32 +5,32 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4XoView.hh,v 2.1 1998/11/06 13:42:05 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4XoViewer.hh,v 1.3 1999/05/10 15:38:51 johna Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
// Wo view - opens window, hard copy, etc.
|
||||
// Wo viewer - opens window, hard copy, etc.
|
||||
|
||||
#ifndef G4XOVIEW_HH
|
||||
#define G4XOVIEW_HH
|
||||
#ifndef G4XOVIEWER_HH
|
||||
#define G4XOVIEWER_HH
|
||||
|
||||
#if defined(G4VIS_BUILD_OPACS_DRIVER) || defined(G4VIS_USE_OPACS)
|
||||
|
||||
#include <X11/Intrinsic.h>
|
||||
#include <OCamera.h>
|
||||
|
||||
#include "G4VView.hh"
|
||||
#include "G4VViewer.hh"
|
||||
#include "globals.hh"
|
||||
|
||||
class G4Xo;
|
||||
class G4GoScene;
|
||||
class G4GoSceneHandler;
|
||||
|
||||
// Base class for various WoView classes.
|
||||
class G4XoView: public G4VView {
|
||||
class G4XoViewer: public G4VViewer {
|
||||
public:
|
||||
G4XoView (G4GoScene& scene, const G4String& name = "");
|
||||
~G4XoView ();
|
||||
G4XoViewer (G4GoSceneHandler& scene, const G4String& name = "");
|
||||
virtual ~G4XoViewer ();
|
||||
void DrawView ();
|
||||
void ShowView ();
|
||||
OCamera GetCamera ();
|
||||
@@ -39,7 +39,7 @@ private:
|
||||
void FinishView ();
|
||||
void SetView ();
|
||||
private:
|
||||
G4GoScene& fScene; // Graphics Scene for this view.
|
||||
G4GoSceneHandler& fSceneHandler; // Graphics Scene for this view.
|
||||
OCamera fGoCamera;
|
||||
Widget fXoCamera;
|
||||
Widget fShell;
|
||||
+112
-79
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4GoScene.cc,v 2.3 1998/11/06 13:42:07 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4GoSceneHandler.cc,v 1.3 1999/05/31 17:20:56 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
@@ -34,47 +34,52 @@
|
||||
#include "G4PhysicalVolumeModel.hh"
|
||||
#include "G4VPhysicalVolume.hh"
|
||||
//This
|
||||
#include "G4GoScene.hh"
|
||||
#include "G4GoSceneHandler.hh"
|
||||
|
||||
static G4Transform3D transformation;
|
||||
|
||||
G4int G4GoScene::fSceneIdCount = 0;
|
||||
G4int G4GoScene::fSceneCount = 0;
|
||||
ONode G4GoScene::fGoNode = NULL;
|
||||
OColormap G4GoScene::fOColormap = NULL;
|
||||
G4int G4GoSceneHandler::fSceneIdCount = 0;
|
||||
G4int G4GoSceneHandler::fSceneCount = 0;
|
||||
ONode G4GoSceneHandler::fGoNode = NULL;
|
||||
OColormap G4GoSceneHandler::fOColormap = NULL;
|
||||
/***************************************************************************/
|
||||
G4GoScene::G4GoScene (
|
||||
G4GoSceneHandler::G4GoSceneHandler (
|
||||
G4VGraphicsSystem& system,
|
||||
const G4String& name
|
||||
)
|
||||
/***************************************************************************/
|
||||
// Creator.
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
:
|
||||
G4VScene (system, fSceneIdCount++, name),
|
||||
fSystem (system),
|
||||
fRootGoNode (NULL),
|
||||
nodeName (NULL)
|
||||
:G4VSceneHandler (system, fSceneIdCount++, name)
|
||||
,fSystem(system)
|
||||
,fRootGoNode(NULL)
|
||||
,fStaticRootGoNode(NULL)
|
||||
,fTransientRootGoNode(NULL)
|
||||
,nodeName(NULL)
|
||||
/*.........................................................................*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::G4GoScene" << endl;
|
||||
G4cout << "G4GoSceneHandler::G4GoSceneHandler" << endl;
|
||||
#endif
|
||||
fSceneCount++;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4GoScene::~G4GoScene (
|
||||
G4GoSceneHandler::~G4GoSceneHandler (
|
||||
)
|
||||
/***************************************************************************/
|
||||
// Destructor.
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
if(ONodeIsValid(fRootGoNode)==1) ONodeDelete (fRootGoNode); //fRootGoNode could be deleted by an XoCamera popup "Erase".
|
||||
//fRootGoNode could be deleted by an XoCamera popup "Erase".
|
||||
if(ONodeIsValid(fRootGoNode)==1)
|
||||
ONodeDelete (fRootGoNode);
|
||||
fRootGoNode = NULL;
|
||||
fStaticRootGoNode = NULL;
|
||||
fTransientRootGoNode = NULL;
|
||||
fSceneCount--;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddPrimitive (
|
||||
void G4GoSceneHandler::AddPrimitive (
|
||||
const G4Polyline& line
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -82,7 +87,7 @@ void G4GoScene::AddPrimitive (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::AddPrimitive(G4Polyline&) " << line.entries () << endl;
|
||||
G4cout << "G4GoSceneHandler::AddPrimitive(G4Polyline&) " << line.entries () << endl;
|
||||
#endif
|
||||
SetColour (GetColour(line));
|
||||
int nPoints = line.entries ();
|
||||
@@ -98,7 +103,7 @@ void G4GoScene::AddPrimitive (
|
||||
OPointListDelete (points);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddPrimitive (
|
||||
void G4GoSceneHandler::AddPrimitive (
|
||||
const G4Polymarker& line
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -106,7 +111,7 @@ void G4GoScene::AddPrimitive (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::AddPrimitive(G4Polymarker&) " << line.entries () << endl;
|
||||
G4cout << "G4GoSceneHandler::AddPrimitive(G4Polymarker&) " << line.entries () << endl;
|
||||
#endif
|
||||
SetColour (GetColour(line));
|
||||
int nPoints = line.entries ();
|
||||
@@ -122,7 +127,7 @@ void G4GoScene::AddPrimitive (
|
||||
OPointListDelete (points);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddPrimitive (
|
||||
void G4GoSceneHandler::AddPrimitive (
|
||||
const G4Circle& circle
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -133,7 +138,7 @@ void G4GoScene::AddPrimitive (
|
||||
G4Point3D center = circle.GetPosition();
|
||||
G4double radius = circle.GetWorldSize();
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::AddPrimitive(G4Circle&) : center : "
|
||||
G4cout << "G4GoSceneHandler::AddPrimitive(G4Circle&) : center : "
|
||||
<< " x : " << center.x()
|
||||
<< " y : " << center.y()
|
||||
<< " z : " << center.z()
|
||||
@@ -144,7 +149,7 @@ void G4GoScene::AddPrimitive (
|
||||
GoAddMarkerToNode (fGoNode,center.x(),center.y(),center.z());
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddPrimitive (
|
||||
void G4GoSceneHandler::AddPrimitive (
|
||||
const G4Polyhedron& polyhedron
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -152,7 +157,7 @@ void G4GoScene::AddPrimitive (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::AddPrimitive(G4Polyhedron&) " << endl;
|
||||
G4cout << "G4GoSceneHandler::AddPrimitive(G4Polyhedron&) " << endl;
|
||||
#endif
|
||||
SetColour (GetColour(polyhedron));
|
||||
|
||||
@@ -160,7 +165,7 @@ void G4GoScene::AddPrimitive (
|
||||
switch (GetDrawingStyle (polyhedron)) {
|
||||
case (G4ViewParameters::hlhsr):
|
||||
case (G4ViewParameters::hsr):
|
||||
modeling = OModelingSolid;
|
||||
//not ready yet modeling = OModelingSolid;
|
||||
break;
|
||||
case (G4ViewParameters::hlr):
|
||||
case (G4ViewParameters::wireframe):
|
||||
@@ -193,7 +198,7 @@ void G4GoScene::AddPrimitive (
|
||||
} while (notLastEdge);
|
||||
if( (iPoint!=3) && (iPoint!=4) )
|
||||
{
|
||||
CWarnF ("G4GoScene::AddPrimitive G4Polyhedron : not a quad or a triangle : %d\n",iPoint);
|
||||
CWarnF ("G4GoSceneHandler::AddPrimitive G4Polyhedron : not a quad or a triangle : %d\n",iPoint);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -213,7 +218,7 @@ void G4GoScene::AddPrimitive (
|
||||
} while (notLastFace);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddPrimitive (
|
||||
void G4GoSceneHandler::AddPrimitive (
|
||||
const G4Text& text
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -222,12 +227,12 @@ void G4GoScene::AddPrimitive (
|
||||
{
|
||||
SetColour (GetTextColour(text));
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::AddPrimitive(G4Text&) " << endl;
|
||||
G4cout << "G4GoSceneHandler::AddPrimitive(G4Text&) " << endl;
|
||||
#endif
|
||||
CWarnF ("G4GoScene::AddPrimitive G4Text : not yet implemented.\n");
|
||||
CWarnF ("G4GoSceneHandler::AddPrimitive G4Text : not yet implemented.\n");
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddPrimitive (
|
||||
void G4GoSceneHandler::AddPrimitive (
|
||||
const G4Square& Square
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -236,12 +241,12 @@ void G4GoScene::AddPrimitive (
|
||||
{
|
||||
SetColour (GetColour(Square));
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::AddPrimitive(G4Square&) " << endl;
|
||||
G4cout << "G4GoSceneHandler::AddPrimitive(G4Square&) " << endl;
|
||||
#endif
|
||||
CWarnF ("G4GoScene::AddPrimitive G4Square : not yet implemented.\n");
|
||||
CWarnF ("G4GoSceneHandler::AddPrimitive G4Square : not yet implemented.\n");
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddPrimitive (
|
||||
void G4GoSceneHandler::AddPrimitive (
|
||||
const G4NURBS& nurb
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -251,100 +256,100 @@ void G4GoScene::AddPrimitive (
|
||||
{
|
||||
SetColour (GetColour(nurb));
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::AddPrimitive(G4NURBS&) " << endl;
|
||||
G4cout << "G4GoSceneHandler::AddPrimitive(G4NURBS&) " << endl;
|
||||
#endif
|
||||
CWarnF ("G4GoScene::AddPrimitive G4NURBS : not yet implemented.\n");
|
||||
CWarnF ("G4GoSceneHandler::AddPrimitive G4NURBS : not yet implemented.\n");
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Box& box
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (box);
|
||||
G4VSceneHandler::AddThis (box);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Cons& cons
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (cons);
|
||||
G4VSceneHandler::AddThis (cons);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Tubs& tubs
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (tubs);
|
||||
G4VSceneHandler::AddThis (tubs);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Trd& trd
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (trd);
|
||||
G4VSceneHandler::AddThis (trd);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Trap& trap
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (trap);
|
||||
G4VSceneHandler::AddThis (trap);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Sphere& sphere
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (sphere);
|
||||
G4VSceneHandler::AddThis (sphere);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Para& para
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (para);
|
||||
G4VSceneHandler::AddThis (para);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4Torus& torus
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (torus);
|
||||
G4VSceneHandler::AddThis (torus);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::AddThis (
|
||||
void G4GoSceneHandler::AddThis (
|
||||
const G4VSolid& solid
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::AddThis (solid);
|
||||
G4VSceneHandler::AddThis (solid);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::PreAddThis (
|
||||
void G4GoSceneHandler::PreAddThis (
|
||||
const G4Transform3D& objectTransformation,
|
||||
const G4VisAttributes& visAttribs
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4VScene::PreAddThis (objectTransformation, visAttribs);
|
||||
G4VSceneHandler::PreAddThis (objectTransformation, visAttribs);
|
||||
|
||||
CStringDelete (nodeName);
|
||||
nodeName = NULL;
|
||||
@@ -356,46 +361,56 @@ void G4GoScene::PreAddThis (
|
||||
nodeName = CStringCreateF (15+64,"PhysicalVolume/%lu",currentPhysicalVolume );
|
||||
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::PreAddThis : " << nodeName << endl;
|
||||
G4cout << "G4GoSceneHandler::PreAddThis : " << nodeName << endl;
|
||||
#endif
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::PostAddThis (
|
||||
void G4GoSceneHandler::PostAddThis (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::PostAddThis" << endl;
|
||||
G4cout << "G4GoSceneHandler::PostAddThis" << endl;
|
||||
#endif
|
||||
CStringDelete (nodeName);
|
||||
nodeName = NULL;
|
||||
G4VScene::PostAddThis();
|
||||
G4VSceneHandler::PostAddThis();
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::BeginPrimitives (
|
||||
void G4GoSceneHandler::BeginPrimitives (
|
||||
const G4Transform3D& objectTransformation
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::BeginPrimitives" << endl;
|
||||
G4cout << "G4GoSceneHandler::BeginPrimitives" << endl;
|
||||
#endif
|
||||
G4VScene::BeginPrimitives (objectTransformation);
|
||||
G4VSceneHandler::BeginPrimitives (objectTransformation);
|
||||
transformation = objectTransformation;
|
||||
fGoNode = nodeName!=NULL ? ONodeCreate (nodeName) : ONodeMake ();
|
||||
if(ONodeIsValid(fRootGoNode)==0) fRootGoNode = ONodeMake ();
|
||||
ONodeAddChild (fRootGoNode,fGoNode);
|
||||
if(ONodeIsValid(fRootGoNode)==0) {
|
||||
fRootGoNode = ONodeMake ();
|
||||
fStaticRootGoNode = ONodeMake ();
|
||||
fTransientRootGoNode = ONodeMake ();
|
||||
ONodeAddChild (fRootGoNode,fStaticRootGoNode);
|
||||
ONodeAddChild (fRootGoNode,fTransientRootGoNode);
|
||||
}
|
||||
if (fReadyForTransients) {
|
||||
ONodeAddChild (fTransientRootGoNode,fGoNode);
|
||||
} else {
|
||||
ONodeAddChild (fStaticRootGoNode,fGoNode);
|
||||
}
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::EndPrimitives (
|
||||
void G4GoSceneHandler::EndPrimitives (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::EndPrimitives" << endl;
|
||||
G4cout << "G4GoSceneHandler::EndPrimitives" << endl;
|
||||
#endif
|
||||
G4double g4angle;
|
||||
G4ThreeVector g4axis;
|
||||
@@ -410,22 +425,36 @@ void G4GoScene::EndPrimitives (
|
||||
OMatrixDelete (orot);
|
||||
OMatrixDelete (otra);
|
||||
fGoNode = NULL;
|
||||
G4VScene::EndPrimitives ();
|
||||
G4VSceneHandler::EndPrimitives ();
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::ClearStore (
|
||||
void G4GoSceneHandler::ClearStore (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::ClearStore" << endl;
|
||||
G4cout << "G4GoSceneHandler::ClearStore" << endl;
|
||||
#endif
|
||||
if(ONodeIsValid(fRootGoNode)==0) fRootGoNode = NULL;
|
||||
ONodeDestroyChildren (fRootGoNode);
|
||||
if(ONodeIsValid(fTransientRootGoNode)==0) fTransientRootGoNode = NULL;
|
||||
ONodeDestroyChildren (fTransientRootGoNode);
|
||||
if(ONodeIsValid(fStaticRootGoNode)==0) fStaticRootGoNode = NULL;
|
||||
ONodeDestroyChildren (fStaticRootGoNode);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::RequestPrimitives (
|
||||
void G4GoSceneHandler::ClearTransientStore (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoSceneHandler::ClearTransientStore" << endl;
|
||||
#endif
|
||||
if(ONodeIsValid(fTransientRootGoNode)==0) fTransientRootGoNode = NULL;
|
||||
ONodeDestroyChildren (fTransientRootGoNode);
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoSceneHandler::RequestPrimitives (
|
||||
const G4VSolid& solid
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -434,24 +463,28 @@ void G4GoScene::RequestPrimitives (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::RequestPrimitives" << endl;
|
||||
G4cout << "G4GoSceneHandler::RequestPrimitives" << endl;
|
||||
#endif
|
||||
G4VScene::RequestPrimitives (solid);
|
||||
G4VSceneHandler::RequestPrimitives (solid);
|
||||
}
|
||||
/***************************************************************************/
|
||||
ONode G4GoScene::GetRootNode (
|
||||
ONode G4GoSceneHandler::GetRootNode (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::RequestPrimitives" << endl;
|
||||
G4cout << "G4GoSceneHandler::RequestPrimitives" << endl;
|
||||
#endif
|
||||
if(ONodeIsValid(fRootGoNode)==0) fRootGoNode = NULL;
|
||||
if(ONodeIsValid(fRootGoNode)==0) {
|
||||
fRootGoNode = NULL;
|
||||
fStaticRootGoNode = NULL;
|
||||
fTransientRootGoNode = NULL;
|
||||
}
|
||||
return fRootGoNode;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4GoScene::SetColour (
|
||||
void G4GoSceneHandler::SetColour (
|
||||
const G4Colour& a_colour
|
||||
)
|
||||
/***************************************************************************/
|
||||
@@ -460,7 +493,7 @@ void G4GoScene::SetColour (
|
||||
if(fOColormap==NULL) fOColormap = OColormapGetIdentifier("ocolormap_X");
|
||||
int index = OColormapGetRGB_Index(fOColormap,a_colour.GetRed (), a_colour.GetGreen (), a_colour.GetBlue ());
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4GoScene::SetColour : red : " << a_colour.GetRed () <<
|
||||
G4cout << "G4GoSceneHandler::SetColour : red : " << a_colour.GetRed () <<
|
||||
" green : " << a_colour.GetGreen () <<
|
||||
" blue : " << a_colour.GetBlue () <<
|
||||
" index : " << index << endl;
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Wo.cc,v 2.1 1998/11/06 13:42:08 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4Wo.cc,v 1.3 1999/01/11 00:47:32 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
@@ -19,8 +19,8 @@
|
||||
#include <Wo.h>
|
||||
//G4
|
||||
#include "G4Xt.hh"
|
||||
#include "G4WoView.hh"
|
||||
#include "G4GoScene.hh"
|
||||
#include "G4WoViewer.hh"
|
||||
#include "G4GoSceneHandler.hh"
|
||||
//This
|
||||
#include "G4Wo.hh"
|
||||
|
||||
@@ -51,25 +51,25 @@ G4VInteractorManager* G4Wo::GetInteractorManager (
|
||||
return interactorManager;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4VScene* G4Wo::CreateScene (
|
||||
G4VSceneHandler* G4Wo::CreateSceneHandler (
|
||||
const G4String& name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4GoScene* pScene = new G4GoScene (*this, name);
|
||||
G4GoSceneHandler* pScene = new G4GoSceneHandler (*this, name);
|
||||
return pScene;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4VView* G4Wo::CreateView (
|
||||
G4VScene& scene,
|
||||
G4VViewer* G4Wo::CreateViewer (
|
||||
G4VSceneHandler& scene,
|
||||
const G4String& name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4GoScene* pScene = (G4GoScene*)&scene;
|
||||
G4VView* pView = new G4WoView (*pScene, name);
|
||||
G4GoSceneHandler* pScene = (G4GoSceneHandler*)&scene;
|
||||
G4VViewer* pView = new G4WoViewer (*pScene, name);
|
||||
return pView;
|
||||
}
|
||||
|
||||
|
||||
+24
-24
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4WoView.cc,v 2.8 1998/11/09 15:51:38 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4WoViewer.cc,v 1.2 1999/01/11 00:47:33 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
@@ -28,17 +28,17 @@
|
||||
//G4
|
||||
#include "G4VInteractorManager.hh"
|
||||
#include "G4Wo.hh"
|
||||
#include "G4GoScene.hh"
|
||||
#include "G4GoSceneHandler.hh"
|
||||
//This
|
||||
#include "G4WoView.hh"
|
||||
#include "G4WoViewer.hh"
|
||||
|
||||
/***************************************************************************/
|
||||
G4WoView::G4WoView (
|
||||
G4GoScene& scene,
|
||||
G4WoViewer::G4WoViewer (
|
||||
G4GoSceneHandler& scene,
|
||||
const G4String& name
|
||||
)
|
||||
:G4VView (scene, scene.IncrementViewCount(), name)
|
||||
,fScene (scene)
|
||||
:G4VViewer (scene, scene.IncrementViewCount(), name)
|
||||
,fSceneHandler (scene)
|
||||
,fGoCamera (NULL)
|
||||
,fXoCamera (NULL)
|
||||
,fShell (NULL)
|
||||
@@ -47,11 +47,11 @@ G4WoView::G4WoView (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4WoView::G4WoView" << endl;
|
||||
G4cout << "G4WoViewer::G4WoViewer" << endl;
|
||||
#endif
|
||||
|
||||
if(WoIsInitialized()==0) {
|
||||
CWarn ("G4WoView : Wo is not initialized !\n");
|
||||
CWarn ("G4WoViewer : Wo is not initialized !\n");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ G4WoView::G4WoView (
|
||||
interactorManager->SetCreatedInteractor (fXoCamera);
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4WoView::~G4WoView (
|
||||
G4WoViewer::~G4WoViewer (
|
||||
)
|
||||
/***************************************************************************/
|
||||
// Destructor.
|
||||
@@ -127,13 +127,13 @@ G4WoView::~G4WoView (
|
||||
}
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4WoView::ClearView (
|
||||
void G4WoViewer::ClearView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4WoView::SetView (
|
||||
void G4WoViewer::SetView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
// Calculates view representation based on extent of object being
|
||||
@@ -142,20 +142,20 @@ void G4WoView::SetView (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
const G4Point3D target = fVP.GetCurrentTargetPoint ();
|
||||
G4double radius = fScene.GetSceneData().GetExtent().GetExtentRadius();
|
||||
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
|
||||
if(radius<=0.) radius = 1. * m;
|
||||
const G4double cameraDistance = fVP.GetCameraDistance (radius);
|
||||
const G4Point3D& pCamera =
|
||||
target + cameraDistance * fVP.GetViewpointDirection().unit();
|
||||
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4WoView::SetView : target.x " << target.x() << " target.y " << target.y() << " target.z " << target.z() << endl;
|
||||
G4cout << "G4WoView::SetView : dir.x " << fVP.GetViewpointDirection().unit().x() <<
|
||||
G4cout << "G4WoViewer::SetView : target.x " << target.x() << " target.y " << target.y() << " target.z " << target.z() << endl;
|
||||
G4cout << "G4WoViewer::SetView : dir.x " << fVP.GetViewpointDirection().unit().x() <<
|
||||
" dir.y " << fVP.GetViewpointDirection().unit().y() <<
|
||||
" dir.z " << fVP.GetViewpointDirection().unit().z() << endl;
|
||||
G4cout << "G4WoView::SetView : cameraDistance " << cameraDistance << endl;
|
||||
G4cout << "G4WoView::SetView : pCamera.x " << pCamera.x() << " pCamera.y " << pCamera.y() << " pCamera.z " << pCamera.z() << endl;
|
||||
G4cout << "G4WoView::SetView : pCamera.x " << pCamera.x() << " pCamera.y " << pCamera.y() << " pCamera.z " << pCamera.z() << endl;
|
||||
G4cout << "G4WoViewer::SetView : cameraDistance " << cameraDistance << endl;
|
||||
G4cout << "G4WoViewer::SetView : pCamera.x " << pCamera.x() << " pCamera.y " << pCamera.y() << " pCamera.z " << pCamera.z() << endl;
|
||||
G4cout << "G4WoViewer::SetView : pCamera.x " << pCamera.x() << " pCamera.y " << pCamera.y() << " pCamera.z " << pCamera.z() << endl;
|
||||
#endif
|
||||
|
||||
OCameraSetCenter (fGoCamera,target.x() ,target.y() ,target.z());
|
||||
@@ -167,7 +167,7 @@ void G4WoView::SetView (
|
||||
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4WoView::DrawView (
|
||||
void G4WoViewer::DrawView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
@@ -176,21 +176,21 @@ void G4WoView::DrawView (
|
||||
ShowView ();
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4WoView::ShowView (
|
||||
void G4WoViewer::ShowView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
OCameraViewNode (fGoCamera,fScene.GetRootNode());
|
||||
OCameraViewNode (fGoCamera,fSceneHandler.GetRootNode());
|
||||
}
|
||||
/***************************************************************************/
|
||||
OCamera G4WoView::GetCamera (
|
||||
OCamera G4WoViewer::GetCamera (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
return fGoCamera;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4WoView::FinishView (
|
||||
void G4WoViewer::FinishView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4Xo.cc,v 2.2 1998/11/06 13:42:10 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4Xo.cc,v 1.3 1999/01/11 00:47:34 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
@@ -24,8 +24,8 @@
|
||||
#include <XWidget.h>
|
||||
//G4
|
||||
#include "G4Xt.hh"
|
||||
#include "G4XoView.hh"
|
||||
#include "G4GoScene.hh"
|
||||
#include "G4XoViewer.hh"
|
||||
#include "G4GoSceneHandler.hh"
|
||||
//This
|
||||
#include "G4Xo.hh"
|
||||
|
||||
@@ -63,25 +63,25 @@ G4VInteractorManager* G4Xo::GetInteractorManager (
|
||||
return interactorManager;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4VScene* G4Xo::CreateScene (
|
||||
G4VSceneHandler* G4Xo::CreateSceneHandler (
|
||||
const G4String& name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4GoScene* pScene = new G4GoScene (*this, name);
|
||||
G4GoSceneHandler* pScene = new G4GoSceneHandler (*this, name);
|
||||
return pScene;
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4VView* G4Xo::CreateView (
|
||||
G4VScene& scene,
|
||||
G4VViewer* G4Xo::CreateViewer (
|
||||
G4VSceneHandler& scene,
|
||||
const G4String& name
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
G4GoScene* pScene = (G4GoScene*)&scene;
|
||||
G4VView* pView = new G4XoView (*pScene, name);
|
||||
G4GoSceneHandler* pScene = (G4GoSceneHandler*)&scene;
|
||||
G4VViewer* pView = new G4XoViewer (*pScene, name);
|
||||
return pView;
|
||||
}
|
||||
|
||||
|
||||
+23
-26
@@ -5,8 +5,8 @@
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4XoView.cc,v 2.7 1998/11/06 13:42:11 allison Exp $
|
||||
// GEANT4 tag $Name: geant4-00 $
|
||||
// $Id: G4XoViewer.cc,v 1.3 1999/05/31 21:17:01 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-00-01 $
|
||||
//
|
||||
//
|
||||
// Guy Barrand 04 November 1996
|
||||
@@ -29,22 +29,22 @@
|
||||
/*Xo*/
|
||||
#include <XoCamera.h>
|
||||
//G4
|
||||
#include "G4GoScene.hh"
|
||||
#include "G4GoSceneHandler.hh"
|
||||
#include "G4Xo.hh"
|
||||
#include "G4VInteractorManager.hh"
|
||||
//This
|
||||
#include "G4XoView.hh"
|
||||
#include "G4XoViewer.hh"
|
||||
|
||||
static Bool WaitForNotify (Display*,XEvent*,char*);
|
||||
static void ActivateCallback (Widget,XtPointer,XtPointer);
|
||||
static void CollectCallback (Widget,XtPointer,XtPointer);
|
||||
/***************************************************************************/
|
||||
G4XoView::G4XoView (
|
||||
G4GoScene& scene,
|
||||
G4XoViewer::G4XoViewer (
|
||||
G4GoSceneHandler& scene,
|
||||
const G4String& name
|
||||
)
|
||||
:G4VView (scene, scene.IncrementViewCount(), name)
|
||||
,fScene (scene)
|
||||
:G4VViewer (scene, scene.IncrementViewCount(), name)
|
||||
,fSceneHandler (scene)
|
||||
,fGoCamera (NULL)
|
||||
,fXoCamera (NULL)
|
||||
,fShell (NULL)
|
||||
@@ -53,7 +53,7 @@ G4XoView::G4XoView (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4XoView::G4XoView" << endl;
|
||||
G4cout << "G4XoViewer::G4XoViewer" << endl;
|
||||
#endif
|
||||
|
||||
G4VInteractorManager* interactorManager = G4Xo::GetInteractorManager();
|
||||
@@ -109,16 +109,13 @@ G4XoView::G4XoView (
|
||||
fGoCamera = NULL;
|
||||
}
|
||||
|
||||
// g++ wants the cast !!!
|
||||
interactorManager->AddSecondaryLoopPreAction ((G4SecondaryLoopAction)XoCameraEnablePopup);
|
||||
interactorManager->AddSecondaryLoopPostAction ((G4SecondaryLoopAction)XoCameraDisablePopup);
|
||||
interactorManager->SetCreatedInteractor (fXoCamera);
|
||||
interactorManager->SetCreatedInteractor(fXoCamera);
|
||||
|
||||
CStringDelete (wname);
|
||||
CStringDelete (defName);
|
||||
}
|
||||
/***************************************************************************/
|
||||
G4XoView::~G4XoView (
|
||||
G4XoViewer::~G4XoViewer (
|
||||
)
|
||||
/***************************************************************************/
|
||||
// Destructor.
|
||||
@@ -134,13 +131,13 @@ G4XoView::~G4XoView (
|
||||
fGoCamera = NULL;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4XoView::ClearView (
|
||||
void G4XoViewer::ClearView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4XoView::SetView (
|
||||
void G4XoViewer::SetView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
// Calculates view representation based on extent of object being
|
||||
@@ -149,19 +146,19 @@ void G4XoView::SetView (
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
const G4Point3D target = fVP.GetCurrentTargetPoint ();
|
||||
G4double radius = fScene.GetSceneData().GetExtent().GetExtentRadius();
|
||||
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
|
||||
if(radius<=0.) radius = 1. * m;
|
||||
const G4double cameraDistance = fVP.GetCameraDistance (radius);
|
||||
const G4Point3D& pCamera =
|
||||
target + cameraDistance * fVP.GetViewpointDirection().unit();
|
||||
|
||||
#ifdef DEBUG
|
||||
G4cout << "G4XoView::SetView : target.x " << target.x() << " target.y " << target.y() << " target.z " << target.z() << endl;
|
||||
G4cout << "G4XoView::SetView : dir.x " << fVP.GetViewpointDirection().unit().x() <<
|
||||
G4cout << "G4XoViewer::SetView : target.x " << target.x() << " target.y " << target.y() << " target.z " << target.z() << endl;
|
||||
G4cout << "G4XoViewer::SetView : dir.x " << fVP.GetViewpointDirection().unit().x() <<
|
||||
" dir.y " << fVP.GetViewpointDirection().unit().y() <<
|
||||
" dir.z " << fVP.GetViewpointDirection().unit().z() << endl;
|
||||
G4cout << "G4XoView::SetView : cameraDistance " << cameraDistance << endl;
|
||||
G4cout << "G4XoView::SetView : pCamera.x " << pCamera.x() << " pCamera.y " << pCamera.y() << " pCamera.z " << pCamera.z() << endl;
|
||||
G4cout << "G4XoViewer::SetView : cameraDistance " << cameraDistance << endl;
|
||||
G4cout << "G4XoViewer::SetView : pCamera.x " << pCamera.x() << " pCamera.y " << pCamera.y() << " pCamera.z " << pCamera.z() << endl;
|
||||
#endif
|
||||
|
||||
OCameraSetCenter (fGoCamera,target.x() ,target.y() ,target.z());
|
||||
@@ -173,14 +170,14 @@ void G4XoView::SetView (
|
||||
|
||||
}
|
||||
/***************************************************************************/
|
||||
OCamera G4XoView::GetCamera (
|
||||
OCamera G4XoViewer::GetCamera (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
return fGoCamera;
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4XoView::DrawView (
|
||||
void G4XoViewer::DrawView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
@@ -189,18 +186,18 @@ void G4XoView::DrawView (
|
||||
FinishView ();
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4XoView::FinishView (
|
||||
void G4XoViewer::FinishView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
/*!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!*/
|
||||
{
|
||||
}
|
||||
/***************************************************************************/
|
||||
void G4XoView::ShowView (
|
||||
void G4XoViewer::ShowView (
|
||||
)
|
||||
/***************************************************************************/
|
||||
{
|
||||
OCameraViewNode (fGoCamera,fScene.GetRootNode());
|
||||
OCameraViewNode (fGoCamera,fSceneHandler.GetRootNode());
|
||||
G4Xo::GetInteractorManager() -> SecondaryLoop();
|
||||
}
|
||||
/***************************************************************************/
|
||||
Reference in New Issue
Block a user