Import Geant4 6.2.0 source tree
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventor.hh,v 1.6 2001/07/11 10:08:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4OpenInventor.hh,v 1.7 2004/04/08 09:39:37 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
// Guy Barrand 26 Mar 1998.
|
||||
// OpenInventor graphics system factory.
|
||||
@@ -40,11 +40,10 @@ class G4OpenInventor: public G4VGraphicsSystem {
|
||||
public:
|
||||
G4OpenInventor(const G4String,const G4String,G4VGraphicsSystem::Functionality);
|
||||
virtual ~G4OpenInventor();
|
||||
G4VViewer* CreateViewer(G4VSceneHandler&,const G4String& name = "");
|
||||
void SetInteractorManager(G4VInteractorManager*);
|
||||
G4VInteractorManager* GetInteractorManager();
|
||||
G4VSceneHandler* CreateSceneHandler (const G4String& name);
|
||||
void InitHEPVis();
|
||||
void InitNodes();
|
||||
private:
|
||||
G4VInteractorManager* interactorManager;
|
||||
};
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorSceneHandler.hh,v 1.15 2003/10/29 10:01:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-00-patch-01 $
|
||||
// $Id: G4OpenInventorSceneHandler.hh,v 1.16 2004/04/08 09:39:38 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// J Kallenbach 27th Aug 1996
|
||||
@@ -44,7 +44,8 @@ class SoSeparator;
|
||||
// Base class for various OpenInventorScene classes.
|
||||
class G4OpenInventorSceneHandler: public G4VSceneHandler {
|
||||
|
||||
friend class G4OpenInventorViewer;
|
||||
friend class G4OpenInventorXtViewer;
|
||||
friend class G4OpenInventorWinViewer;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorSceneHandler.icc,v 1.4 2001/07/11 10:08:59 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4OpenInventorSceneHandler.icc,v 1.5 2004/04/08 09:39:38 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// J Kallenbach 27th Aug 1996
|
||||
|
||||
@@ -21,16 +21,16 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorTransform3D.hh,v 1.4 2001/07/11 10:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4OpenInventorTransform3D.hh,v 1.5 2004/04/08 09:39:38 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// jck 17 Dec 1996
|
||||
// G4OpenGLInventorTransform3D provides SoSFMatrix transformation matrix
|
||||
// from G4Transform3D.
|
||||
|
||||
#ifndef G4OpenInventorTRANSFORM3D_HH
|
||||
#define G4OpenInventorTRANSFORM3D_HH
|
||||
#ifndef G4OPENINVENTORTRANSFORM3D_HH
|
||||
#define G4OPENINVENTORTRANSFORM3D_HH
|
||||
|
||||
#ifdef G4VIS_BUILD_OI_DRIVER
|
||||
|
||||
|
||||
+16
-30
@@ -20,40 +20,26 @@
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
#ifndef G4SOWINDOW_h
|
||||
#define G4SOWINDOW_h
|
||||
//
|
||||
// $Id: G4OpenInventorWin.hh,v 1.1 2004/04/08 09:37:30 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
// OpenInventor graphics system factory.
|
||||
|
||||
#include <Inventor/Xt/SoXt.h>
|
||||
#include <HEPVis/SbBasic.h>
|
||||
#if defined (G4VIS_BUILD_OIWIN32_DRIVER) || defined (G4VIS_USE_OIWIN32)
|
||||
|
||||
class SbDict;
|
||||
#ifndef G4OPENINVENTORWIN_HH
|
||||
#define G4OPENINVENTORWIN_HH
|
||||
|
||||
class G4SoWindow {
|
||||
#include "G4OpenInventor.hh"
|
||||
|
||||
class G4OpenInventorWin: public G4OpenInventor {
|
||||
public:
|
||||
G4SoWindow(const char*,SbBool=FALSE);
|
||||
virtual ~G4SoWindow();
|
||||
Widget getWidget() const;
|
||||
void show();
|
||||
void hide();
|
||||
void setTitle(const char*);
|
||||
void setSize(const SbVec2s&);
|
||||
SbVec2s getSize();
|
||||
void setWMClose(SbBool);
|
||||
SbBool getWMClose() const;
|
||||
static void clearClass();
|
||||
protected:
|
||||
void registerWidget(Widget);
|
||||
void unregisterWidget(Widget);
|
||||
static G4SoWindow* getWindow(Widget);
|
||||
private:
|
||||
Widget fWidget;
|
||||
SbBool fWMClose;
|
||||
static SbDict* fWidgetDictionary;
|
||||
#ifdef HEPVisXt
|
||||
static void widgetDestroyedCB(Widget,XtPointer,XtPointer);
|
||||
public:
|
||||
static void closeWindow(Widget,XEvent*,char**,Cardinal*);
|
||||
#endif
|
||||
G4OpenInventorWin ();
|
||||
virtual ~G4OpenInventorWin ();
|
||||
G4VViewer* CreateViewer(G4VSceneHandler&,const G4String& name = "");
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorWin32.hh,v 1.5 2001/07/11 10:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4OpenInventorWin32.hh,v 1.6 2004/04/08 09:39:38 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
// OpenInventor graphics system factory.
|
||||
|
||||
@@ -31,12 +31,14 @@
|
||||
#ifndef G4OPENINVENTORWIN32_HH
|
||||
#define G4OPENINVENTORWIN32_HH
|
||||
|
||||
#include "G4OpenInventor.hh"
|
||||
// For backward compatibilty.
|
||||
|
||||
class G4OpenInventorWin32: public G4OpenInventor {
|
||||
#include "G4OpenInventorWin.hh"
|
||||
|
||||
class G4OpenInventorWin32: public G4OpenInventorWin {
|
||||
public:
|
||||
G4OpenInventorWin32 ();
|
||||
virtual ~G4OpenInventorWin32 ();
|
||||
G4OpenInventorWin32 () {}
|
||||
virtual ~G4OpenInventorWin32 () {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,69 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorWinViewer.hh,v 1.2 2004/04/08 10:49:10 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// Jeff Kallenbach 01 Aug 1996
|
||||
// OpenInventor viewer - opens window, hard copy, etc.
|
||||
|
||||
#ifndef G4OPENINVENTORWINVIEWER_HH
|
||||
#define G4OPENINVENTORWINVIEWER_HH
|
||||
|
||||
#ifdef G4VIS_BUILD_OI_DRIVER
|
||||
|
||||
#include "G4VViewer.hh"
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
class SoWinExaminerViewer;
|
||||
class SoSelection;
|
||||
class G4OpenInventorSceneHandler;
|
||||
class G4VInteractorManager;
|
||||
|
||||
class G4OpenInventorWinViewer: public G4VViewer {
|
||||
|
||||
public:
|
||||
G4OpenInventorWinViewer(G4OpenInventorSceneHandler& scene,
|
||||
const G4String& name = "");
|
||||
virtual ~G4OpenInventorWinViewer();
|
||||
void DrawView();
|
||||
void ShowView();
|
||||
private:
|
||||
void ClearView();
|
||||
void FinishView();
|
||||
void SetView();
|
||||
void KernelVisitDecision();
|
||||
G4bool CompareForKernelVisit(G4ViewParameters&);
|
||||
G4OpenInventorSceneHandler& fG4OpenInventorSceneHandler;
|
||||
G4ViewParameters fLastVP; // Memory for making kernel visit decisions.
|
||||
HWND fShell;
|
||||
SoWinExaminerViewer* fViewer;
|
||||
SoSelection* fSelection;
|
||||
G4VInteractorManager* fInteractorManager;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -21,8 +21,8 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorX.hh,v 1.5 2001/07/11 10:09:00 gunter Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4OpenInventorX.hh,v 1.6 2004/04/08 09:39:38 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 27th March 1996
|
||||
@@ -33,12 +33,14 @@
|
||||
#ifndef G4OPENINVENTORX_HH
|
||||
#define G4OPENINVENTORX_HH
|
||||
|
||||
#include "G4OpenInventor.hh"
|
||||
// For backward compatibilty.
|
||||
|
||||
class G4OpenInventorX: public G4OpenInventor {
|
||||
#include "G4OpenInventorXt.hh"
|
||||
|
||||
class G4OpenInventorX: public G4OpenInventorXt {
|
||||
public:
|
||||
G4OpenInventorX ();
|
||||
virtual ~G4OpenInventorX ();
|
||||
G4OpenInventorX () {}
|
||||
virtual ~G4OpenInventorX () {}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorXt.hh,v 1.1 2004/04/08 09:37:30 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// Andrew Walkden 27th March 1996
|
||||
// OpenInventor graphics system factory.
|
||||
|
||||
#if defined (G4VIS_BUILD_OIX_DRIVER) || defined (G4VIS_USE_OIX)
|
||||
|
||||
#ifndef G4OPENINVENTORXT_HH
|
||||
#define G4OPENINVENTORXT_HH
|
||||
|
||||
#include "G4OpenInventor.hh"
|
||||
|
||||
class G4OpenInventorXt: public G4OpenInventor {
|
||||
public:
|
||||
G4OpenInventorXt ();
|
||||
virtual ~G4OpenInventorXt ();
|
||||
G4VViewer* CreateViewer(G4VSceneHandler&,const G4String& name = "");
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
+18
-21
@@ -21,51 +21,48 @@
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: G4OpenInventorViewer.hh,v 1.10 2001/11/14 14:56:11 barrand Exp $
|
||||
// GEANT4 tag $Name: geant4-05-02-patch-01 $
|
||||
// $Id: G4OpenInventorXtViewer.hh,v 1.1 2004/04/08 09:37:30 gbarrand Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
//
|
||||
// Jeff Kallenbach 01 Aug 1996
|
||||
// OpenInventor viewer - opens window, hard copy, etc.
|
||||
|
||||
#ifndef G4OPENINVENTORVIEWER_HH
|
||||
#define G4OPENINVENTORVIEWER_HH
|
||||
#ifndef G4OPENINVENTORXTVIEWER_HH
|
||||
#define G4OPENINVENTORXTVIEWER_HH
|
||||
|
||||
#ifdef G4VIS_BUILD_OI_DRIVER
|
||||
|
||||
#include <Inventor/Xt/SoXt.h>
|
||||
|
||||
#include "G4VViewer.hh"
|
||||
|
||||
class SoXtComponent;
|
||||
#include <X11/Intrinsic.h>
|
||||
class SoXtExaminerViewer;
|
||||
|
||||
class SoSelection;
|
||||
class G4SoWindow;
|
||||
class G4OpenInventorSceneHandler;
|
||||
class G4VInteractorManager;
|
||||
|
||||
//
|
||||
// Base class for various OpenInventorView classes.
|
||||
//
|
||||
class G4OpenInventorViewer: public G4VViewer {
|
||||
class G4OpenInventorXtViewer: public G4VViewer {
|
||||
|
||||
public:
|
||||
G4OpenInventorViewer (G4OpenInventorSceneHandler& scene,
|
||||
const G4String& name = "");
|
||||
virtual ~G4OpenInventorViewer ();
|
||||
void DrawView ();
|
||||
void ShowView ();
|
||||
G4OpenInventorXtViewer(G4OpenInventorSceneHandler& scene,
|
||||
const G4String& name = "");
|
||||
virtual ~G4OpenInventorXtViewer();
|
||||
void DrawView();
|
||||
void ShowView();
|
||||
private:
|
||||
void ClearView ();
|
||||
void FinishView ();
|
||||
void SetView ();
|
||||
void KernelVisitDecision ();
|
||||
void ClearView();
|
||||
void FinishView();
|
||||
void SetView();
|
||||
void KernelVisitDecision();
|
||||
G4bool CompareForKernelVisit(G4ViewParameters&);
|
||||
|
||||
G4OpenInventorSceneHandler& fG4OpenInventorSceneHandler;
|
||||
G4ViewParameters fLastVP; // Memory for making kernel visit decisions.
|
||||
Widget fShell;
|
||||
G4SoWindow* fWindow;
|
||||
SoXtComponent* fViewer; // The Inventor Viewer
|
||||
SoXtExaminerViewer* fViewer;
|
||||
SoSelection* fSelection;
|
||||
G4VInteractorManager* fInteractorManager;
|
||||
};
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SbMath.h,v 1.2 2004/06/14 09:27:34 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
#ifndef HEPVis_SbMath_h
|
||||
#define HEPVis_SbMath_h
|
||||
|
||||
#include <math.h>
|
||||
#ifndef M_PI
|
||||
#define M_PI 3.1415926535897931160E0
|
||||
#define M_PI_2 1.5707963267948965580E0
|
||||
#endif
|
||||
|
||||
#define SbMinimum(a,b) ((a)<(b)?a:b)
|
||||
#define SbMaximum(a,b) ((a)>(b)?a:b)
|
||||
|
||||
#define FCOS(x) ((float)cos((double)(x)))
|
||||
#define FSIN(x) ((float)sin((double)(x)))
|
||||
#define FACOS(x) ((float)acos((double)(x)))
|
||||
#define FASIN(x) ((float)asin((double)(x)))
|
||||
#define FTAN(x) ((float)tan((double)(x)))
|
||||
#define FATAN(x) ((float)atan((double)(x)))
|
||||
#define FSQRT(x) ((float)sqrt((double)(x)))
|
||||
#define FPOW(x,y) ((float)pow((double)(x),(double)(y)))
|
||||
#define FLOG(x) ((float)log((double)(x)))
|
||||
#define FLOG10(x) ((float)log10((double)(x)))
|
||||
#define FFLOOR(x) ((float)floor((double)(x)))
|
||||
#define FFABS(x) ((float)fabs((double)(x)))
|
||||
#define FCEIL(x) ((float)ceil((double)(x)))
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,115 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SoDetectorTreeKit.h,v 1.2 2004/06/14 09:27:35 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoDetectorTreeKit */
|
||||
/* Description: Easy way of browsing through a tree of detectors */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoDetectorTreeKit_h
|
||||
#define HEPVis_SoDetectorTreeKit_h
|
||||
|
||||
#include <Inventor/nodekits/SoBaseKit.h>
|
||||
#include <Inventor/nodes/SoEventCallback.h>
|
||||
|
||||
class SoSFNode;
|
||||
class SoHandleEventAction;
|
||||
class SoSeparator;
|
||||
|
||||
#define SoDetectorTreeKit Geant4_SoDetectorTreeKit
|
||||
|
||||
|
||||
class SoDetectorTreeKit:public SoBaseKit {
|
||||
|
||||
// The following is required:
|
||||
SO_KIT_HEADER(SoDetectorTreeKit);
|
||||
////////////////////////////////////////////
|
||||
SoSFNode alternateRep;
|
||||
////////////////////////////////////////////
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(callbackList);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(pickStyle);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(appearance);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(units);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(transform);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(texture2Transform);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(childList);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(previewSeparator);
|
||||
SO_KIT_CATALOG_ENTRY_HEADER(fullSeparator);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructor, required
|
||||
SoDetectorTreeKit();
|
||||
|
||||
// This is required
|
||||
virtual SbBool affectsState() const;
|
||||
|
||||
// Class Initializer, required
|
||||
static void initClass();
|
||||
|
||||
// Turn the preview on or off
|
||||
virtual void setPreview(SbBool Flag);
|
||||
|
||||
// Return the preview state
|
||||
virtual SbBool getPreview() const;
|
||||
|
||||
// Return the preview Separator
|
||||
virtual SoSeparator *getPreviewSeparator() const;
|
||||
|
||||
// Return the full Separator
|
||||
virtual SoSeparator *getFullSeparator() const;
|
||||
|
||||
// Generate AlternateRep, required. Generating an alternate representation
|
||||
// must be done upon users request. It allows an Inventor program to read
|
||||
// back the file without requiring *this* code to be dynamically linked.
|
||||
// If the users expects that *this* code will be dynamically linked, he
|
||||
// need not invoke this method.
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
// We better be able to clear it, too!
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
// Destructor.
|
||||
virtual ~SoDetectorTreeKit();
|
||||
|
||||
private:
|
||||
|
||||
// This is needed as well
|
||||
void createInitialTree();
|
||||
|
||||
// This is the callback function that will be
|
||||
// added to the callback list
|
||||
static void expand (void *userData, SoEventCallback *eventCB);
|
||||
static void contract (void *userData, SoEventCallback *eventCB);
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,155 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SoBox.h,v 1.2 2004/06/14 09:27:36 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoBox */
|
||||
/* Description: Represents the G4Box Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoBox_h
|
||||
#define HEPVis_SoBox_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoBox - Inventor version of the G4Box Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoBox
|
||||
*
|
||||
* Description: The Inventor version of the G4Box Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* class G4Box
|
||||
*
|
||||
* A Box is a cuboid of given half lengths dx,dy,dz. The Box is
|
||||
* centred on the origin with sides parallel to the x/y/z axes.
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*/
|
||||
|
||||
#define SoBox Geant4_SoBox
|
||||
|
||||
class SoBox:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoBox);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! Half-length along X
|
||||
//
|
||||
SoSFFloat fDx;
|
||||
//
|
||||
//! Half-length along Y
|
||||
//
|
||||
SoSFFloat fDy;
|
||||
//
|
||||
//! Half-length along Z
|
||||
//
|
||||
SoSFFloat fDz;
|
||||
//
|
||||
//! Alternate rep - for use by users without HEPVis shared objects
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoBox();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoBox();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,191 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SoCons.h,v 1.2 2004/06/14 09:27:36 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoCons */
|
||||
/* Description: Represents the G4Cons Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoCons_h
|
||||
#define HEPVis_SoCons_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
//! SoCons - Inventor version of the G4Cons Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoCons
|
||||
*
|
||||
* Description: The Inventor version of the G4Cons Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* A G4Cons is, in the general case, a Phi segment of a cone, with half-length
|
||||
* fDz, inner and outer radii specified at -fDz and +fDz. The Phi segment is
|
||||
* described by a starting fSPhi angle, and the +fDPhi delta angle for the shape.
|
||||
* If the delta angle is >=2*M_PI, the shape is treated as continuous in Phi
|
||||
*
|
||||
* Member Data:
|
||||
*
|
||||
* fRmin1 inside radius at -fDz
|
||||
* fRmin2 inside radius at +fDz
|
||||
* fRmax1 outside radius at -fDz
|
||||
* fRmax2 outside radius at +fDz
|
||||
* fDz half length in z
|
||||
*
|
||||
* fSPhi starting angle of the segment in radians
|
||||
* fDPhi delta angle of the segment in radians
|
||||
*/
|
||||
|
||||
#define SoCons Geant4_SoCons
|
||||
|
||||
class SoCons:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoCons);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! Inside radius at -fDz
|
||||
//
|
||||
SoSFFloat fRmin1;
|
||||
//
|
||||
//! Inside radius at +fDz
|
||||
//
|
||||
SoSFFloat fRmin2;
|
||||
//
|
||||
//! Outside radius at -fDz
|
||||
//
|
||||
SoSFFloat fRmax1;
|
||||
//
|
||||
//! Outside radius at +fDz
|
||||
//
|
||||
SoSFFloat fRmax2;
|
||||
//
|
||||
//! Half-length along Z
|
||||
//
|
||||
SoSFFloat fDz;
|
||||
//
|
||||
//! Starting angle, in radians
|
||||
//
|
||||
SoSFFloat fSPhi;
|
||||
//
|
||||
//! Delta-angle, in radians
|
||||
//
|
||||
SoSFFloat fDPhi;
|
||||
//
|
||||
//! An Inventor option - slightly better render, worse performance
|
||||
//
|
||||
SoSFBool smoothDraw;
|
||||
//
|
||||
//! Alternate rep required - for use by users without HEPVis shared objects
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoCons();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoCons();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
//
|
||||
//! help with trigonometry. increments sines an cosines by an angle.
|
||||
//
|
||||
void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
|
||||
double oldSin=sinPhi,oldCos=cosPhi;
|
||||
sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
|
||||
cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,213 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SoTrap.h,v 1.2 2004/06/14 09:27:37 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoTrap */
|
||||
/* Description: Represents the G4Trap Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoTrap_h
|
||||
#define HEPVis_SoTrap_h
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
//adding fields
|
||||
#ifdef WIN32
|
||||
#include <SoWinEnterScope.h>
|
||||
#endif
|
||||
|
||||
|
||||
// Defining Class
|
||||
#ifdef WIN32
|
||||
#include <SoWinLeaveScope.h>
|
||||
#endif
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoTrap - Inventor version of the G4Trap Geant Geometry entity
|
||||
/*! Node: SoTrap
|
||||
*
|
||||
* Description: Inventor version of the G4Trap Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* A G4Trap is a general trapezoid: The faces perpendicular to the z planes
|
||||
* are tapezia, and their centres are not necessarily on a line parallel to
|
||||
* the z axis.
|
||||
*
|
||||
* Note that of the 11 parameters desribed below, only 9 are really
|
||||
* independent - a check for planarity is made in the calculation of the
|
||||
* equation for each plane. If the planes are not parallel, a call to
|
||||
* G4Exception is made.
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*
|
||||
*/
|
||||
|
||||
#define SoTrap Geant4_SoTrap
|
||||
|
||||
class SoTrap:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoTrap);
|
||||
|
||||
public:
|
||||
#if defined(WIN32) && defined(BUILDING_DLL)
|
||||
// When building the node as a DLL under Win32 we must explicitly
|
||||
// declare this entry point as visible outside the DLL. The macro
|
||||
// BUILDING_DLL is defined in the node's source file.
|
||||
_declspec(dllexport)
|
||||
#endif
|
||||
|
||||
//
|
||||
//! half-length along Z
|
||||
//
|
||||
SoSFFloat pDz;
|
||||
//
|
||||
//! Polar angle of the line joining the centres of the faces at -/+pDz
|
||||
//
|
||||
SoSFFloat pTheta;
|
||||
//
|
||||
//! Azimuthal angle of the line joing the centre of the face at -pDz
|
||||
//! to the centre of the face at +pDz
|
||||
//
|
||||
SoSFFloat pPhi;
|
||||
//
|
||||
//! Half-length along y of the face at -pDz
|
||||
//
|
||||
SoSFFloat pDy1;
|
||||
//
|
||||
//! Half-length along x of the side at y=-pDy1 of the face at -pDz
|
||||
//
|
||||
SoSFFloat pDx1;
|
||||
//
|
||||
//! Half-length along x of the side at y=+pDy1 of the face at -pDz
|
||||
//
|
||||
SoSFFloat pDx2;
|
||||
//
|
||||
//! Half-length along y of the face at +pDz
|
||||
//
|
||||
SoSFFloat pDy2;
|
||||
//
|
||||
//! Half-length along x of the side at y=-pDy2 of the face at +pDz
|
||||
//
|
||||
SoSFFloat pDx3;
|
||||
//
|
||||
//! Half-length along x of the side at y=+pDy2 of the face at +pDz
|
||||
//
|
||||
SoSFFloat pDx4;
|
||||
//
|
||||
//! Angle with respect to the y axis from the centre of the side at
|
||||
//! y=-pDy1 to the centre at y=+pDy1 of the face at -pDz
|
||||
//
|
||||
SoSFFloat pAlp1;
|
||||
//
|
||||
//! Angle with respect to the y axis from the centre of the side at
|
||||
//! y=-pDy2 to the centre at y=+pDy2 of the face at +pDz
|
||||
//
|
||||
SoSFFloat pAlp2;
|
||||
|
||||
//
|
||||
//! Alternate rep - required
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoTrap();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoTrap();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
};
|
||||
|
||||
#ifdef WIN32
|
||||
#include <SoWinEnterScope.h>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,169 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SoTrd.h,v 1.2 2004/06/14 09:27:37 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoTrd */
|
||||
/* Description: Represents the G4Trd Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoTrd_h
|
||||
#define HEPVis_SoTrd_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoTrd - Inventor version of the G4Trd Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoTrd
|
||||
*
|
||||
* Description: Inventor version of the G4Trd Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* A Trd is a trapezoid with the x and y dimensions varying along z
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*
|
||||
*/
|
||||
|
||||
#define SoTrd Geant4_SoTrd
|
||||
|
||||
class SoTrd:public SoShape {
|
||||
|
||||
//
|
||||
//! This is required
|
||||
//
|
||||
SO_NODE_HEADER(SoTrd);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! half-length of x, at -fDz
|
||||
//
|
||||
SoSFFloat fDx1;
|
||||
|
||||
//
|
||||
//! half-length of x, at +fDz
|
||||
//
|
||||
SoSFFloat fDx2;
|
||||
|
||||
//
|
||||
//! half-length of y, at -fDz
|
||||
//
|
||||
SoSFFloat fDy1;
|
||||
|
||||
//
|
||||
//! half-length of y, at +fDz
|
||||
//
|
||||
SoSFFloat fDy2;
|
||||
|
||||
//
|
||||
//! half-length along Z
|
||||
//
|
||||
SoSFFloat fDz;
|
||||
|
||||
//
|
||||
//! Alternate rep - required
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoTrd();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoTrd();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,180 @@
|
||||
//
|
||||
// ********************************************************************
|
||||
// * DISCLAIMER *
|
||||
// * *
|
||||
// * The following disclaimer summarizes all the specific disclaimers *
|
||||
// * of contributors to this software. The specific disclaimers,which *
|
||||
// * govern, are listed with their locations in: *
|
||||
// * http://cern.ch/geant4/license *
|
||||
// * *
|
||||
// * Neither the authors of this software system, nor their employing *
|
||||
// * institutes,nor the agencies providing financial support for this *
|
||||
// * work make any representation or warranty, express or implied, *
|
||||
// * regarding this software system or assume any liability for its *
|
||||
// * use. *
|
||||
// * *
|
||||
// * This code implementation is the intellectual property of the *
|
||||
// * GEANT4 collaboration. *
|
||||
// * By copying, distributing or modifying the Program (or any work *
|
||||
// * based on the Program) you indicate your acceptance of this *
|
||||
// * statement, and all its terms. *
|
||||
// ********************************************************************
|
||||
//
|
||||
//
|
||||
// $Id: SoTubs.h,v 1.2 2004/06/14 09:27:38 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-06-02 $
|
||||
//
|
||||
/*-----------------------------Hepvis----------------------------------------*/
|
||||
/* */
|
||||
/* Node: SoTubs */
|
||||
/* Description: Represents the G4Tubs Geant Geometry entity */
|
||||
/* Author: Joe Boudreau Nov 11 1996 */
|
||||
/* */
|
||||
/*---------------------------------------------------------------------------*/
|
||||
#ifndef HEPVis_SoTubs_h
|
||||
#define HEPVis_SoTubs_h
|
||||
|
||||
#include <Inventor/fields/SoSFFloat.h>
|
||||
#include <Inventor/fields/SoSFNode.h>
|
||||
#include <Inventor/fields/SoSFBool.h>
|
||||
#include <Inventor/nodes/SoShape.h>
|
||||
|
||||
class SoSFNode;
|
||||
|
||||
//! SoTubs - Inventor version of the G4Tubs Geant Geometry entity
|
||||
/*!
|
||||
* Node: SoTubs
|
||||
*
|
||||
* Description: The Inventor version of the G4Tubs Geant Geometry entity
|
||||
*
|
||||
* Author: Joe Boudreau Nov 11 1996
|
||||
*
|
||||
* class G4Tubs
|
||||
*
|
||||
* A tube or tube segment with curved sides parallel to
|
||||
* the z-axis. The tube has a specified half-length along
|
||||
* the z axis, about which it is centred, and a given
|
||||
* minimum and maximum radius. A minimum radius of 0
|
||||
* signifies a filled tube /cylinder. The tube segment is
|
||||
* specified by starting and delta
|
||||
* angles for phi, with 0 being the +x axis, PI/2
|
||||
* the +y axis. A delta angle of 2PI signifies a
|
||||
* complete, unsegmented tube/cylinder
|
||||
*
|
||||
* Always use Inventor Fields. This allows Inventor to detect a change to
|
||||
* the data field and take the appropriate action; e.g., redraw the scene.
|
||||
*/
|
||||
|
||||
#define SoTubs Geant4_SoTubs
|
||||
|
||||
class SoTubs:public SoShape {
|
||||
|
||||
// The following is required:
|
||||
SO_NODE_HEADER(SoTubs);
|
||||
|
||||
public:
|
||||
|
||||
//
|
||||
//! Inside radius of the tube
|
||||
//
|
||||
SoSFFloat pRMin;
|
||||
//
|
||||
//! Outside radius of the tube
|
||||
//
|
||||
SoSFFloat pRMax;
|
||||
//
|
||||
//! Half-length in Z
|
||||
//
|
||||
SoSFFloat pDz;
|
||||
//
|
||||
//! Starting angle, in radians
|
||||
//
|
||||
SoSFFloat pSPhi;
|
||||
//
|
||||
//! Delta-angle, in radians
|
||||
//
|
||||
SoSFFloat pDPhi;
|
||||
//
|
||||
//! Alternate rep - required
|
||||
//
|
||||
SoSFNode alternateRep;
|
||||
|
||||
//
|
||||
//! Constructor, required
|
||||
//
|
||||
SoTubs();
|
||||
|
||||
//
|
||||
//! Class Initializer, required
|
||||
//
|
||||
static void initClass();
|
||||
|
||||
//
|
||||
//! Generate AlternateRep, required. Generating an alternate representation
|
||||
//! must be done upon users request. It allows an Inventor program to read
|
||||
//! back the file without requiring *this* code to be dynamically linked.
|
||||
//! If the users expects that *this* code will be dynamically linked, he
|
||||
//! need not invoke this method.
|
||||
//
|
||||
virtual void generateAlternateRep();
|
||||
|
||||
//
|
||||
//! We better be able to clear it, too!
|
||||
//
|
||||
virtual void clearAlternateRep();
|
||||
|
||||
protected:
|
||||
|
||||
//
|
||||
//! compute bounding Box, required
|
||||
//
|
||||
virtual void computeBBox(SoAction *action, SbBox3f &box, SbVec3f ¢er );
|
||||
|
||||
//
|
||||
//! Generate Primitives, required
|
||||
//
|
||||
virtual void generatePrimitives(SoAction *action);
|
||||
|
||||
//
|
||||
//! GetChildList, required whenever the class has hidden children
|
||||
//
|
||||
virtual SoChildList *getChildren() const;
|
||||
|
||||
|
||||
protected:
|
||||
//
|
||||
//! Destructor, required
|
||||
//
|
||||
virtual ~SoTubs();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
//! Generate Children. Used to create the hidden children. Required whenever
|
||||
//! the node has hidden children.
|
||||
//
|
||||
void generateChildren();
|
||||
|
||||
//
|
||||
//! Used to modify hidden children when a data field is changed. Required
|
||||
//! whenever the class has hidden children.
|
||||
//
|
||||
void updateChildren();
|
||||
|
||||
//
|
||||
//! ChildList. Required whenever the class has hidden children.
|
||||
//
|
||||
SoChildList *children;
|
||||
|
||||
//
|
||||
//! help with trigonometry. increments sines an cosines by an angle.
|
||||
//
|
||||
void inc(double & sinPhi, double & cosPhi, double sinDeltaPhi, double cosDeltaPhi) const {
|
||||
double oldSin=sinPhi,oldCos=cosPhi;
|
||||
sinPhi = oldSin*cosDeltaPhi+oldCos*sinDeltaPhi;
|
||||
cosPhi = oldCos*cosDeltaPhi-oldSin*sinDeltaPhi;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user