Import Geant4 2.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-08 15:42:07 +02:00
parent 103bda00c8
commit e7d7193284
3106 changed files with 171117 additions and 90550 deletions
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateSceneHandler.cc,v 1.3 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateViewer.cc,v 1.3 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateWin32.cc,v 1.4 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// OpenGLImmediateWin32 graphics system factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateWin32Viewer.cc,v 1.2 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Class G4OpenGLImmediateWin32Viewer : a class derived from G4OpenGLWin32Viewer and
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateX.cc,v 1.5 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLImmediateXViewer.cc,v 1.3 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLImmediateXViewer.cc,v 1.4 2000/05/22 08:16:25 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -47,10 +47,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_immediate);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLImmediateXm.cc,v 1.4 1999/12/15 14:54:07 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLImmediateXmViewer.cc,v 1.2 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLImmediateXmViewer.cc,v 1.3 2000/05/22 08:16:29 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -45,10 +45,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_immediate);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLSceneHandler.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLSceneHandler.cc,v 1.5 2000/02/21 16:03:18 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -85,8 +85,8 @@ void G4OpenGLSceneHandler::AddPrimitive (const G4Text& text) {
G4double size = GetMarkerSize (text, sizeType);
G4cerr
<< "G4OpenGLSceneHandler::AddPrimitive (const G4Text& text) not implemented yet."
<< "\n Called with text " << text.GetText ()
<< " at " << text.GetPosition ()
<< "\n Called with text \"" << text.GetText ()
<< "\" at " << text.GetPosition ()
<< ", size " << size
<< ", offsets " << text.GetXOffset () << ", " << text.GetYOffset ()
<< ", type " << sizeType
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLStoredSceneHandler.cc,v 1.6 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLStoredSceneHandler.cc,v 1.7 2000/04/12 13:09:07 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -40,7 +40,7 @@
#include "G4VisAttributes.hh"
#include "G4VPhysicalVolume.hh"
#include "G4ModelingParameters.hh"
#include "G4VModel.hh"
#include "G4OpenGLStoredSceneHandler.hh"
G4OpenGLStoredSceneHandler::G4OpenGLStoredSceneHandler (G4VGraphicsSystem& system,
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredViewer.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredWin32.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// OpenGLStoredWin32 graphics system factory.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredWin32Viewer.cc,v 1.2 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Class G4OpenGLStoredWin32Viewer : a class derived from G4OpenGLWin32Viewer and
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredX.cc,v 1.5 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLStoredXViewer.cc,v 1.3 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLStoredXViewer.cc,v 1.4 2000/05/22 08:16:36 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -46,10 +46,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_stored);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLStoredXm.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLStoredXmViewer.cc,v 1.2 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLStoredXmViewer.cc,v 1.3 2000/05/22 08:16:42 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -43,10 +43,10 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
CreateGLXContext (vi_stored);
InitializeGLView ();
CreateMainWindow ();
InitializeGLView ();
// clear the buffers and window.
ClearView ();
FinishView ();
@@ -57,7 +57,6 @@ G4VViewer (scene, scene.IncrementViewCount (), name) {
glEnable (GL_BLEND);
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glShadeModel (GL_FLAT);
}
void G4OpenGLStoredXmViewer::DrawView () {
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLTransform3D.cc,v 1.3 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 24th October 1996
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLViewer.cc,v 1.4 1999/12/15 14:54:08 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLViewer.cc,v 1.8 2000/05/22 08:09:15 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 27th March 1996
@@ -25,6 +25,7 @@
#include <assert.h>
#include <unistd.h>
#include "G4Scene.hh"
#include "G4VisExtent.hh"
#include "G4LogicalVolume.hh"
#include "G4VSolid.hh"
@@ -33,12 +34,12 @@
#include "G4Plane3D.hh"
int G4OpenGLViewer::snglBuf_RGBA[10] =
{ GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3,
GLX_BLUE_SIZE, 2, GLX_DEPTH_SIZE, 1, None };
{ GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1, GLX_DEPTH_SIZE, 1, None };
int G4OpenGLViewer::dblBuf_RGBA[11] =
{ GLX_RGBA, GLX_RED_SIZE, 3, GLX_GREEN_SIZE, 3,
GLX_BLUE_SIZE, 2, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1, None };
{ GLX_RGBA, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1,
GLX_BLUE_SIZE, 1, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 1, None };
G4OpenGLViewer::G4OpenGLViewer (G4OpenGLSceneHandler& scene):
G4VViewer (scene, -1),
@@ -95,16 +96,16 @@ void G4OpenGLViewer::SetView () {
glLightfv (GL_LIGHT0, GL_AMBIENT, ambient);
glLightfv (GL_LIGHT0, GL_DIFFUSE, diffuse);
const G4Point3D& target = fVP.GetCurrentTargetPoint ();
// Get radius of scene.
// Get radius of scene, etc.
// Note that this procedure properly takes into account zoom, dolly and pan.
const G4Point3D& targetPoint
= fSceneHandler.GetScene()->GetStandardTargetPoint()
+ fVP.GetCurrentTargetPoint ();
G4double radius = fSceneHandler.GetScene()->GetExtent().GetExtentRadius();
if(radius<=0.) radius = 1.;
const G4double cameraDistance = fVP.GetCameraDistance (radius);
const G4Point3D& pCamera =
target + cameraDistance * fVP.GetViewpointDirection().unit();
const G4Point3D cameraPosition =
targetPoint + cameraDistance * fVP.GetViewpointDirection().unit();
const GLdouble near = fVP.GetNearDistance (cameraDistance, radius);
const GLdouble far = fVP.GetFarDistance (cameraDistance, near, radius);
const GLdouble right = fVP.GetFrontHalfHeight (near, radius);
@@ -128,12 +129,13 @@ void G4OpenGLViewer::SetView () {
const G4Normal3D& upVector = fVP.GetUpVector ();
G4Point3D gltarget;
if (cameraDistance > 1.e-6 * radius) {
gltarget = target;
gltarget = targetPoint;
}
else {
gltarget = target - radius * fVP.GetViewpointDirection().unit();
gltarget = targetPoint - radius * fVP.GetViewpointDirection().unit();
}
const G4Point3D& pCamera = cameraPosition; // An alias for brevity.
gluLookAt (pCamera.x(), pCamera.y(), pCamera.z(), // Viewpoint.
gltarget.x(), gltarget.y(), gltarget.z(), // Target point.
upVector.x(), upVector.y(), upVector.z()); // Up vector.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLWin32Viewer.cc,v 1.2 1999/12/15 14:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// G4OpenGLWin32Viewer : Class to provide WindowsNT specific
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLXViewer.cc,v 1.6 1999/12/15 18:08:30 gcosmo Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLXViewer.cc,v 1.8 2000/05/22 08:07:20 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 7th February 1997
@@ -44,6 +44,9 @@
#define USE_DEFAULT_COLORMAP 1
#define USE_STANDARD_COLORMAP 0
XVisualInfo* G4OpenGLXViewer::vi_single_buffer = 0;
XVisualInfo* G4OpenGLXViewer::vi_double_buffer = 0;
extern "C"
{
static Bool WaitForNotify (Display*, XEvent* e, char* arg) {
@@ -237,16 +240,34 @@ vectored_ps (true)
// Try for a visual suitable for OpenGLImmediate..
// first try for a single buffered RGB window
if (vi_immediate =
glXChooseVisual (dpy, XDefaultScreen (dpy), snglBuf_RGBA)) {
if (!vi_single_buffer) {
vi_single_buffer =
glXChooseVisual (dpy, XDefaultScreen (dpy), snglBuf_RGBA);
}
if (!vi_single_buffer) {
G4cout <<
"G4OpenGLXViewer::G4OpenGLXViewer: unable to get a single buffer visual."
<< G4endl;
}
if (!vi_double_buffer) {
vi_double_buffer =
glXChooseVisual (dpy, XDefaultScreen (dpy), dblBuf_RGBA);
}
if (!vi_double_buffer) {
G4cout <<
"G4OpenGLXViewer::G4OpenGLXViewer: unable to get a double buffer visual."
<< G4endl;
}
if (vi_immediate = vi_single_buffer) {
attributeList = snglBuf_RGBA;
doublebuffer = false;
}
if (!vi_immediate){
// next try for a double buffered RGB, but Draw to top buffer
if (vi_immediate =
glXChooseVisual (dpy, XDefaultScreen (dpy), dblBuf_RGBA)) {
if (vi_immediate = vi_double_buffer) {
attributeList = dblBuf_RGBA;
doublebuffer = true;
}
@@ -254,7 +275,7 @@ vectored_ps (true)
// Now try for a visual suitable for OpenGLStored...
// Try for a double buffered RGB window
if (vi_stored = glXChooseVisual (dpy, XDefaultScreen (dpy), dblBuf_RGBA)) {
if (vi_stored = vi_double_buffer) {
attributeList = dblBuf_RGBA;
doublebuffer = true;
}
@@ -269,7 +290,8 @@ G4OpenGLXViewer::~G4OpenGLXViewer () {
//Close a window from here
glXDestroyContext (dpy, cx);
glXMakeCurrent (dpy, None, NULL);
XDestroyWindow (dpy, win);
if (win) XDestroyWindow (dpy, win); // ...if already deleted in
// sub-class G4OpenGLXmViewer.
XFlush (dpy);
}
}
@@ -367,7 +389,7 @@ void G4OpenGLXViewer::print3DcolorVertex(GLint size, GLint * count, GLfloat * bu
printf("\n");
}
void G4OpenGLXViewer::spewWireframeEPS (FILE* file, GLint size, GLfloat* buffer, char* cr) {
void G4OpenGLXViewer::spewWireframeEPS (FILE* file, GLint size, GLfloat* buffer, const char* cr) {
GLfloat EPS_GOURAUD_THRESHOLD=0.1;
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmBox.cc,v 1.3 1999/12/15 14:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Box container class
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmConvenienceRoutines.cc,v 1.3 1999/12/15 14:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 16th April 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmFourArrowButtons.cc,v 1.3 1999/12/15 14:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Four arrow buttons class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmFramedBox.cc,v 1.3 1999/12/15 14:54:09 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Framed box container class
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLXmMainMenubarCallbacks.cc,v 1.4 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLXmMainMenubarCallbacks.cc,v 1.6 2000/05/02 10:09:04 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 16th April 1997
@@ -24,6 +24,8 @@
#include "G4OpenGLXmViewer.hh"
#include "G4Scene.hh"
#include "G4OpenGLXmRadioButton.hh"
#include "G4OpenGLXmSliderBar.hh"
#include "G4OpenGLXmFourArrowButtons.hh"
@@ -60,7 +62,7 @@ void G4OpenGLXmViewer::actions_callback (Widget w,
char* frot_Name = new char [rot_len];
G4std::ostrstream rot_ost (frot_Name, rot_len);
rot_ost.seekp (G4std::ios::beg);
rot_ost << pView->GetScene()->GetSceneId() << '-' << pView->fViewId << G4std::ends;
rot_ost << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId << G4std::ends;
pView->fprotation_top = new G4OpenGLXmTopLevelShell (pView,
frot_Name);
@@ -145,7 +147,7 @@ void G4OpenGLXmViewer::actions_callback (Widget w,
char* fpan_Name = new char [pan_len];
G4std::ostrstream pan_ost (fpan_Name, pan_len);
pan_ost.seekp (G4std::ios::beg);
pan_ost << pView->GetScene()->GetSceneId() << '-' << pView->fViewId << G4std::ends;
pan_ost << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId << G4std::ends;
pView->fppanning_top = new G4OpenGLXmTopLevelShell (pView,
fpan_Name);
@@ -188,8 +190,8 @@ void G4OpenGLXmViewer::actions_callback (Widget w,
pan_slider_list,
True,
2,
pView->pan_sens = pView->GetScene()->GetScene()->GetExtent().GetExtentRadius() / 10.0,
pView->pan_sens_limit = pView->GetScene()->GetScene()->GetExtent().GetExtentRadius(),
pView->pan_sens = pView->GetSceneHandler()->GetScene()->GetExtent().GetExtentRadius() / 10.0,
pView->pan_sens_limit = pView->GetSceneHandler()->GetScene()->GetExtent().GetExtentRadius(),
0);
pView->fppanning_box->AddChild (pView->fppanning_slider);
@@ -225,8 +227,8 @@ void G4OpenGLXmViewer::actions_callback (Widget w,
True,
2,
pView->fVP.GetDolly(),
pView->dolly_high = pView->GetScene()->GetScene()->GetExtent().GetExtentRadius(),
pView->dolly_low = -(pView->GetScene()->GetScene()->GetExtent().GetExtentRadius()));
pView->dolly_high = pView->GetSceneHandler()->GetScene()->GetExtent().GetExtentRadius(),
pView->dolly_low = -(pView->GetSceneHandler()->GetScene()->GetExtent().GetExtentRadius()));
// pView->dolly_high,
// pView->dolly_low);
pView->fpdolly_box->AddChild (pView->fpdolly_slider);
@@ -245,7 +247,7 @@ void G4OpenGLXmViewer::actions_callback (Widget w,
char* fset_Name = new char [set_len];
G4std::ostrstream set_ost (fset_Name, set_len);
set_ost.seekp (G4std::ios::beg);
set_ost << pView->GetScene()->GetSceneId() << '-' << pView->fViewId << G4std::ends;
set_ost << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId << G4std::ends;
pView->fpsetting_top = new G4OpenGLXmTopLevelShell(pView,
fset_Name);
@@ -326,7 +328,7 @@ void G4OpenGLXmViewer::misc_callback (Widget w,
char* fmisc_Name = new char [misc_len];
G4std::ostrstream misc_ost (fmisc_Name, misc_len);
misc_ost.seekp (G4std::ios::beg);
misc_ost << pView->GetScene()->GetSceneId() << '-' << pView->fViewId << G4std::ends;
misc_ost << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId << G4std::ends;
pView->fpmiscellany_top = new G4OpenGLXmTopLevelShell (pView,
fmisc_Name);
@@ -421,7 +423,7 @@ void G4OpenGLXmViewer::misc_callback (Widget w,
char* fprint_Name = new char [print_len];
G4std::ostrstream print_ost (fprint_Name, print_len);
print_ost.seekp (G4std::ios::beg);
print_ost << pView->GetScene()->GetSceneId() << '-' << pView->fViewId << G4std::ends;
print_ost << pView->GetSceneHandler()->GetSceneHandlerId() << '-' << pView->fViewId << G4std::ends;
pView->fpprint_top = new G4OpenGLXmTopLevelShell (pView,
fprint_Name);
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLXmPanningCallbacks.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLXmPanningCallbacks.cc,v 1.4 2000/05/13 10:47:52 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 16th April 1997
@@ -20,6 +20,7 @@
#ifdef G4VIS_BUILD_OPENGLXM_DRIVER
#include "G4OpenGLXmViewer.hh"
#include "G4Scene.hh"
void G4OpenGLXmViewer::zoom_callback (Widget w,
XtPointer clientData,
@@ -119,7 +120,10 @@ void G4OpenGLXmViewer::left_right_pan_callback (XtPointer clientData,
delta = -((G4double)pView->pan_sens);
}
G4Point3D tp = pView -> fVP.GetCurrentTargetPoint ();
G4Point3D stp
= pView -> GetSceneHandler()->GetScene()->GetStandardTargetPoint();
G4Point3D tp = stp + pView -> fVP.GetCurrentTargetPoint ();
const G4Vector3D& upVector = pView->fVP.GetUpVector ();
const G4Vector3D& vpVector = pView->fVP.GetViewpointDirection ();
@@ -128,7 +132,7 @@ void G4OpenGLXmViewer::left_right_pan_callback (XtPointer clientData,
G4Vector3D unitUp = (vpVector.cross (unitRight)).unit();
tp += delta * unitRight;
pView->fVP.SetCurrentTargetPoint (tp);
pView->fVP.SetCurrentTargetPoint (tp - stp);
pView->SetView ();
pView->ClearView ();
@@ -169,14 +173,16 @@ void G4OpenGLXmViewer::up_down_pan_callback (XtPointer clientData,
delta = -((G4double)pView->pan_sens);
}
G4Point3D tp = pView->fVP.GetCurrentTargetPoint ();
G4Point3D stp
= pView -> GetSceneHandler()->GetScene()->GetStandardTargetPoint();
G4Point3D tp = stp + pView -> fVP.GetCurrentTargetPoint ();
const G4Vector3D& upVector = pView->fVP.GetUpVector ();
const G4Vector3D& vpVector = pView->fVP.GetViewpointDirection ();
G4Vector3D unitRight = (upVector.cross (vpVector)).unit();
G4Vector3D unitUp = (vpVector.cross (unitRight)).unit();
tp += delta * unitUp;
pView->fVP.SetCurrentTargetPoint (tp);
pView->fVP.SetCurrentTargetPoint (tp - stp);
pView->SetView ();
pView->ClearView ();
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmPushButton.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Push button class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmRadioButton.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Radio button class. Inherits from G4OpenGLXmVWidgetComponent
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLXmRotationCallbacks.cc,v 1.5 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLXmRotationCallbacks.cc,v 1.7 2000/05/13 10:48:03 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 16th April 1997
@@ -19,6 +19,7 @@
#include "G4OpenGLXmViewer.hh"
#include "G4Scene.hh"
#include "G4UImanager.hh"
#include "G4ios.hh"
@@ -269,7 +270,7 @@ void G4OpenGLXmViewer::reset_callback (Widget w,
XmNuserData, &pView,
NULL);
pView->fVP.SetCurrentTargetPoint(pView->fSceneHandler.GetScene()->GetStandardTargetPoint());
pView->fVP.SetCurrentTargetPoint(G4Point3D());
pView->fVP.SetZoomFactor(1.0);
pView->fVP.SetDolly(0.0);
pView->SetView ();
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmSeparator.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Separator class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmSliderBar.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Slider bar class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmStyleCallbacks.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 16th April 1997
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmTextField.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Text field class. Inherits from G4OpenGLXmVWidgetComponent
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmTopLevelShell.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Top level shell class
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetComponent.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Base class for all Motif component widgets
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetContainer.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Base class for all Motif container widgets
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetObject.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Virtual base class for all Motif widgets.
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmVWidgetShell.cc,v 1.3 1999/12/15 14:54:10 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//Base class for all Motif shell widgets
@@ -5,8 +5,8 @@
// based on the Program) you indicate your acceptance of this statement,
// and all its terms.
//
// $Id: G4OpenGLXmViewer.cc,v 1.3 1999/12/15 14:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// $Id: G4OpenGLXmViewer.cc,v 1.4 2000/05/22 08:14:00 johna Exp $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 10th February 1997
@@ -587,40 +587,17 @@ fpdolly_slider (NULL)
WinSize_x = 100;
WinSize_y = 100;
vi_immediate = 0;
vi_stored = 0;
GetXmConnection ();
if (fViewId < 0) return;
// Try for a visual suitable for OpenGLImmediate..
// first try for a single buffered RGB window
if (vi_immediate =
glXChooseVisual (dpy, XDefaultScreen (dpy), snglBuf_RGBA)) {
attributeList = snglBuf_RGBA;
doublebuffer = false;
}
if (!vi_immediate){
// next try for a double buffered RGB, but Draw to top buffer
if (vi_immediate =
glXChooseVisual (dpy, XDefaultScreen (dpy), dblBuf_RGBA)) {
attributeList = dblBuf_RGBA;
doublebuffer = true;
}
}
// Now try for a visual suitable for OpenGLStored...
// Try for a double buffered RGB window
if (vi_stored = glXChooseVisual (dpy, XDefaultScreen (dpy), dblBuf_RGBA)) {
attributeList = dblBuf_RGBA;
doublebuffer = true;
}
}
G4OpenGLXmViewer::~G4OpenGLXmViewer ()
{
XtDestroyWidget (shell);
win = 0; // ...to avoid XDestroyWindow in G4OpenGLXViewer base class
// because XtDestroyWidget has already destroyed it.
G4Xt::getInstance () ->RemoveShell (shell);
/******************************
@@ -6,7 +6,7 @@
// and all its terms.
//
// $Id: G4OpenGLXmWindowHandlingCallbacks.cc,v 1.3 1999/12/15 14:54:11 gunter Exp $
// GEANT4 tag $Name: geant4-01-01 $
// GEANT4 tag $Name: geant4-02-00 $
//
//
// Andrew Walkden 16th June 1997