Import Geant4 8.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-09 14:36:02 +02:00
parent d93e1e39a9
commit 8a51e0bc40
5471 changed files with 99628 additions and 55248 deletions
+54 -1
View File
@@ -1,4 +1,4 @@
cvs log $Id: History,v 1.72 2005/05/26 10:34:55 allison Exp $
cvs log $Id: History,v 1.89 2005/11/10 21:30:13 tinslay Exp $
-------------------------------------------------------------------
=========================================================
@@ -17,6 +17,59 @@ committal in the CVS repository !
* Reverse chronological order (last date on top), please *
----------------------------------------------------------
10th November 2005 Jane Tinslay (greps-V07-01-09)
- G4VVisManager: Fix Dispatch method name to "DispatchToModel".
- G4Colour: Use public static member functions instead of public
static data members to avoid problems with dynamic libraries.
10th November 2005 John Allison
- G4VVisManager and G4VGraphicsScene: Replaced default arguments
G4Transform3D::Identity by G4Transform3D(). (This is a avoid
initialisation problems with static objects with dynamic libraries.)
9th November 2005 Gabriele Cosmo
- Implemented migration to support CLHEP-2.0.X, adding explicit namespace
to CLHEP types. Affected files: HepPolyhedron[.h.cc], BooleanProcessor.src.
24th October 2005 John Allison (greps-V07-01-08)
- Moved G4VTrajectoryDrawer to modeling (renamed G4VTrajectoryModel).
- G4VVisManager.hh: Changed DispatchToCurrentDrawer to DispatchToCurrentModel.
21st October 2005 Jane Tinslay (greps-V07-01-07)
- Add G4VTrajectoryDrawer, an abstract base class for trajectory drawers
- Add "DispatchToCurrentDrawer" method to G4VVisManager
20th October 2005 John Allison (greps-V07-01-06)
- G4Colour.cc: Added #include <sstream>.
17th October 2005 Jane Tinslay (greps-V07-01-05)
- intercoms->graphics_reps migration for G4VGraphicsScene and G4VVisManager
13th October 2005 Jane Tinslay (greps-V07-01-04)
- Additions to G4Colour
o Add static data members for common colours.
o Add G4String->G4Colour colour map.
3rd October 2005 John Allison
- G4NURBStubesector.cc: Replaced <strstream> by <sstream>.
16th September 2005 John Allison (greps-V07-01-03)
- G4AttCheck.cc: Added time to legal G4AttValues.
10th August 2005 Gabriele Cosmo (greps-V07-01-02)
- Added Polyhedron description for new G4EllipticalCone shape.
Implementation by D.Anninos (CERN).
Requires tag "geom-specific-V07-01-03" for geometry/solids/specific module.
5th July 2005 John Allison (greps-V07-01-01)
- Big clean-up:
o Removed redundant intermediate class, G4VVisPrim.
o Removed redundant virtual assignments and similar oddities.
20th Jun 2005 Gabriele Cosmo (greps-V07-01-00)
- Added Polyhedron description for new G4Ellipsoid shape.
Contribution of G.Guerrieri (INFN Genova).
26th May 2005 John Allison (greps-V07-00-07)
- Fixed bug introduced in greps-V07-00-05.
- Removed DEPRECATION of G4Visible::SetVisAttributes(const G4VisAttributes&)
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4AttCheck.hh,v 1.5 2005/05/03 17:43:00 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
#ifndef G4ATTCHECK_HH
#define G4ATTCHECK_HH
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4AttDef.hh,v 1.4 2004/11/11 16:39:53 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
#ifndef G4ATTDEF_HH
#define G4ATTDEF_HH
@@ -22,7 +22,7 @@
//
//
// $Id: G4AttDefStore.hh,v 1.6 2004/06/07 08:54:00 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
#ifndef G4ATTDEFSTORE_HH
#define G4ATTDEFSTORE_HH
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4AttValue.hh,v 1.4 2005/03/22 16:51:34 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
#ifndef G4ATTVALUE_HH
#define G4ATTVALUE_HH
+3 -10
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Circle.hh,v 1.6 2001/07/11 10:01:01 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Circle.hh,v 1.7 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 17/11/96.
@@ -43,17 +43,10 @@ class G4Circle: public G4VMarker {
public: // With description
G4Circle ();
G4Circle (const G4Point3D& pos);
G4Circle (const G4VMarker& marker);
G4Circle (const G4Point3D& pos);
virtual ~G4Circle ();
//////////////////////////////////////////////////////
// Assignment...
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
virtual G4VMarker& operator = (const G4VMarker& right);
virtual G4Circle & operator = (const G4Circle& right);
};
#endif
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Color.hh,v 1.4 2001/07/11 10:01:01 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 20th October 1996
+45 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Colour.hh,v 1.9 2003/09/18 11:03:11 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Colour.hh,v 1.11 2005/11/10 20:34:45 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 20th October 1996
@@ -58,6 +58,8 @@
// G4Colour magenta (1.0, 0.0, 1.0) ; // magenta
// G4Colour yellow (1.0, 1.0, 0.0) ; // yellow
//
// For convenience, static data members are also defined for the above colours.
//
// After instantiation of a G4Colour object, you can access to its components
// with the following access functions:
//
@@ -73,6 +75,9 @@
#include "globals.hh"
#include "G4ThreeVector.hh"
#include <iostream>
#include <map>
using std::map;
class G4Colour {
friend std::ostream& operator << (std::ostream& os, const G4Colour& c);
@@ -91,8 +96,46 @@ public: // With description
G4double GetGreen () const;
G4double GetBlue () const;
G4double GetAlpha () const; // alpha = opacity = 1. - transparency.
static const G4Colour& White();
static const G4Colour& Gray();
static const G4Colour& Grey();
static const G4Colour& Black();
static const G4Colour& Red();
static const G4Colour& Green();
static const G4Colour& Blue();
static const G4Colour& Cyan();
static const G4Colour& Magenta();
static const G4Colour& Yellow();
static void AddToMap(const G4String& key, const G4Colour& colour);
// Add user defined colour to colour map with given key. Standard
// colours are added to map by default.
static bool GetColour(const G4String& key, G4Colour& result);
// Get colour for given key. Returns false if key doesn't exist
// in colour map, leaving result unchanged. Colour map
// is not sensitive to key case.
private:
G4double red, green, blue, alpha;
static const G4Colour fWhite;
static const G4Colour fGray;
static const G4Colour fGrey;
static const G4Colour fBlack;
static const G4Colour fRed;
static const G4Colour fGreen;
static const G4Colour fBlue;
static const G4Colour fCyan;
static const G4Colour fMagenta;
static const G4Colour fYellow;
static map<G4String, G4Colour> fColourMap;
static bool fInitColourMap;
static void InitialiseColourMap();
};
inline G4double G4Colour::GetRed () const {return red;}
+4 -7
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBS.hh,v 1.8 2003/06/16 16:55:07 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBS.hh,v 1.9 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// Olivier Crumeyrolle 12 September 1996
@@ -38,7 +38,7 @@
#define __C_G4NURBS__ 1
#include "globals.hh"
#include "G4VVisPrim.hh"
#include "G4Visible.hh"
// The internal floating point type is G4Float, defined line 162
@@ -46,7 +46,7 @@
#include "G4Point3D.hh"
#include "G4Vector3D.hh"
class G4NURBS : public G4VVisPrim
class G4NURBS : public G4Visible
{
public:
// NO public constructor. A G4NURBS must be builded with a child class.
@@ -62,9 +62,6 @@ class G4NURBS : public G4VVisPrim
// destructor.
virtual ~G4NURBS();
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
// direction selector defined as a type because the user will use it
// and we want the user to be well-manered.
// However internally this typed enum is not as easy to use as it
+2 -4
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBSbox.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBSbox.hh,v 1.8 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -43,8 +43,6 @@ class G4NURBSbox : public G4NURBS
{
public:
G4NURBSbox(G4double DX, G4double DY, G4double DZ);
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
const char* Whoami() const;
};
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBScylinder.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBScylinder.hh,v 1.8 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -43,8 +43,6 @@ class G4NURBScylinder : public G4NURBS
{
public:
G4NURBScylinder(G4double R, G4double DZ);
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
const char* Whoami() const;
};
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBShexahedron.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBShexahedron.hh,v 1.8 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// Hexa hedron builder prototype
// OC 17 9 96
@@ -55,8 +55,6 @@ class G4NURBShexahedron : public G4NURBS
public:
G4NURBShexahedron(const G4ThreeVector Corners [8]);
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
const char* Whoami() const;
};
+2 -4
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBStube.hh,v 1.7 2003/04/03 15:31:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBStube.hh,v 1.8 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -43,8 +43,6 @@ class G4NURBStube : public G4NURBS
{
public:
G4NURBStube(G4double RMIN, G4double RMAX, G4double DZ);
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
const char* Whoami() const;
};
#endif
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBStubesector.hh,v 1.6 2003/04/03 15:31:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBStubesector.hh,v 1.7 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -53,8 +53,6 @@ class G4NURBStubesector : public G4NURBS
G4NURBStubesector(G4double RMIN, G4double RMAX,
G4double DZ, G4double PHI1, G4double PHI2);
virtual ~G4NURBStubesector();
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
virtual const char* Whoami() const;
protected:
@@ -22,7 +22,7 @@
//
//
// $Id: G4PlacedPolyhedron.hh,v 1.10 2003/06/16 16:55:08 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
// Class Description:
@@ -22,7 +22,7 @@
//
//
// $Id: G4Point3DList.hh,v 1.11 2003/06/16 16:55:09 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison July 1995
+26 -133
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Polyhedron.hh,v 1.12 2005/03/22 19:18:56 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Polyhedron.hh,v 1.16 2005/08/10 08:20:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
#ifndef G4POLYHEDRON_HH
#define G4POLYHEDRON_HH
@@ -65,6 +65,8 @@
// phi,dphi,the,dthe) - create G4Polyhedron for Sphere;
// G4PolyhedronTorus(rmin,rmax,rtor,
// phi,dphi) - create G4Polyhedron for Torus;
// G4PolyhedronEllipsoid(dx,dy,dz,
// zcut1,zcut2) - create G4Polyhedron for Ellipsoid;
//
// Public functions inherited from HepPolyhedron (this list might be
// incomplete):
@@ -99,27 +101,21 @@
// (NumberOfRotationSteps is also called number of sides per circle or
// line segments per circle - see
// /vis/viewer/set/lineSegmentsPerCircle.)
// 20.06.05 G.Cosmo
// - Added G4PolyhedronEllipsoid.
#include "globals.hh"
#include "HepPolyhedron.h"
#include "G4VVisPrim.hh"
#include "G4Visible.hh"
class G4Polyhedron : public HepPolyhedron, public G4VVisPrim {
class G4Polyhedron : public HepPolyhedron, public G4Visible {
public:
G4Polyhedron ();
virtual ~G4Polyhedron ();
G4Polyhedron (const G4Polyhedron& from);
G4Polyhedron (const HepPolyhedron& from);
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
G4Polyhedron& operator = (const G4Polyhedron& from);
// Use compiler defaults for copy contructor and assignment. (They
// invoke their counterparts in HepPolyhedron and G4Visible.)
virtual ~G4Polyhedron ();
G4int GetNumberOfRotationStepsAtTimeOfCreation() const {
return fNumberOfRotationStepsAtTimeOfCreation;
}
@@ -131,15 +127,6 @@ class G4PolyhedronBox: public G4Polyhedron {
public:
G4PolyhedronBox (G4double dx, G4double dy, G4double dz);
virtual ~G4PolyhedronBox ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronCone: public G4Polyhedron {
@@ -147,15 +134,6 @@ public:
G4PolyhedronCone (G4double Rmn1, G4double Rmx1,
G4double Rmn2, G4double Rmx2, G4double Dz);
virtual ~G4PolyhedronCone ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronCons: public G4Polyhedron {
@@ -164,15 +142,6 @@ public:
G4double Rmn2, G4double Rmx2, G4double Dz,
G4double Phi1, G4double Dphi);
virtual ~G4PolyhedronCons ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronPara: public G4Polyhedron {
@@ -180,15 +149,6 @@ public:
G4PolyhedronPara (G4double Dx, G4double Dy, G4double Dz,
G4double Alpha, G4double Theta, G4double Phi);
virtual ~G4PolyhedronPara ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronPcon: public G4Polyhedron {
@@ -198,15 +158,6 @@ public:
const G4double *rmin,
const G4double *rmax);
virtual ~G4PolyhedronPcon ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronPgon: public G4Polyhedron {
@@ -216,15 +167,6 @@ public:
const G4double *rmin,
const G4double *rmax);
virtual ~G4PolyhedronPgon ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronSphere: public G4Polyhedron {
@@ -233,15 +175,6 @@ public:
G4double phi, G4double dphi,
G4double the, G4double dthe);
virtual ~G4PolyhedronSphere ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronTorus: public G4Polyhedron {
@@ -249,15 +182,6 @@ public:
G4PolyhedronTorus (G4double rmin, G4double rmax, G4double rtor,
G4double phi, G4double dphi);
virtual ~G4PolyhedronTorus ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronTrap: public G4Polyhedron {
@@ -268,15 +192,6 @@ public:
G4double Dy2,
G4double Dx3, G4double Dx4, G4double Alp2);
virtual ~G4PolyhedronTrap ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronTrd1: public G4Polyhedron {
@@ -284,15 +199,6 @@ public:
G4PolyhedronTrd1 (G4double Dx1, G4double Dx2,
G4double Dy, G4double Dz);
virtual ~G4PolyhedronTrd1 ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronTrd2: public G4Polyhedron {
@@ -300,30 +206,12 @@ public:
G4PolyhedronTrd2 (G4double Dx1, G4double Dx2,
G4double Dy1, G4double Dy2, G4double Dz);
virtual ~G4PolyhedronTrd2 ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronTube: public G4Polyhedron {
public:
G4PolyhedronTube (G4double Rmin, G4double Rmax, G4double Dz);
virtual ~G4PolyhedronTube ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronTubs: public G4Polyhedron {
@@ -331,15 +219,20 @@ public:
G4PolyhedronTubs (G4double Rmin, G4double Rmax, G4double Dz,
G4double Phi1, G4double Dphi);
virtual ~G4PolyhedronTubs ();
virtual G4Visible& operator = (const G4Visible& from) {
return G4Visible::operator = (from);
}
virtual G4VVisPrim& operator = (const G4VVisPrim& from) {
return G4VVisPrim::operator = (from);
}
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class G4PolyhedronEllipsoid : public G4Polyhedron {
public:
G4PolyhedronEllipsoid(G4double dx, G4double dy, G4double dz,
G4double zcut1, G4double zcut2);
virtual ~G4PolyhedronEllipsoid ();
};
class G4PolyhedronEllipticalCone : public G4Polyhedron {
public:
G4PolyhedronEllipticalCone(G4double dx, G4double dy, G4double z,
G4double zcut1);
virtual ~G4PolyhedronEllipticalCone ();
};
#endif /* G4POLYHEDRON_HH */
+4 -8
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Polyline.hh,v 1.10 2003/06/16 16:55:10 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Polyline.hh,v 1.11 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison July 1995
@@ -37,12 +37,12 @@
#ifndef G4POLYLINE_HH
#define G4POLYLINE_HH
#include "G4VVisPrim.hh"
#include "G4Visible.hh"
#include "G4Point3DList.hh"
#include "G4Transform3D.hh"
class G4Polyline: public G4VVisPrim, public G4Point3DList {
class G4Polyline: public G4Visible, public G4Point3DList {
friend std::ostream& operator << (std::ostream& os, const G4Polyline& line);
@@ -51,11 +51,7 @@ public: // With description
typedef G4Point3DList::iterator iterator;
G4Polyline ();
G4Polyline (const G4VVisPrim& prim);
virtual ~G4Polyline ();
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
virtual G4Polyline& operator = (const G4Polyline& right);
G4Polyline& transform (const G4Transform3D&);
};
+2 -6
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Polymarker.hh,v 1.9 2004/11/11 16:41:14 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Polymarker.hh,v 1.10 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison November 1996
@@ -46,10 +46,6 @@ public: // With description
enum MarkerType {dots, circles, squares};
G4Polymarker ();
virtual ~G4Polymarker ();
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
virtual G4VMarker& operator = (const G4VMarker& right);
virtual G4Polymarker& operator = (const G4Polymarker& right);
MarkerType GetMarkerType () const;
void SetMarkerType (MarkerType type);
private:
@@ -22,7 +22,7 @@
//
//
// $Id: G4Polymarker.icc,v 1.3 2001/07/11 10:01:03 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison November 1996
+3 -8
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Scale.hh,v 1.5 2002/11/27 12:24:01 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Scale.hh,v 1.6 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 21st July 2001.
@@ -60,12 +60,7 @@ public: // With description
// Uses compiler-generated copy constructor.
virtual ~G4Scale ();
virtual G4Visible& operator = (const G4Visible& from);
virtual G4VVisPrim& operator = (const G4VVisPrim& from);
virtual G4VMarker& operator = (const G4VMarker& from);
virtual G4Scale& operator = (const G4Scale& from);
~G4Scale ();
G4double GetLength() const;
const G4String& GetAnnotation() const;
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Scale.icc,v 1.2 2001/07/24 21:41:42 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 21st July 2001.
+3 -10
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Square.hh,v 1.5 2001/07/11 10:01:03 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Square.hh,v 1.6 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 17/11/96.
@@ -45,14 +45,7 @@ public: // With description
G4Square ();
G4Square (const G4Point3D& pos);
G4Square (const G4VMarker& marker);
virtual ~G4Square ();
//////////////////////////////////////////////////////
// Assignment...
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
virtual G4VMarker& operator = (const G4VMarker& right);
virtual G4Square& operator = (const G4Square& right);
~G4Square ();
};
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Square.icc,v 1.3 2001/07/11 10:01:03 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 17/11/96.
+3 -8
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Text.hh,v 1.7 2001/07/11 10:01:03 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Text.hh,v 1.8 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 17/11/96.
@@ -76,12 +76,7 @@ public: // With description
G4Text (const G4String& text);
G4Text (const G4String& text, const G4Point3D& pos);
G4Text (const G4VMarker& marker);
virtual ~G4Text ();
virtual G4Visible& operator = (const G4Visible& from);
virtual G4VVisPrim& operator = (const G4VVisPrim& from);
virtual G4VMarker& operator = (const G4VMarker& from);
virtual G4Text& operator = (const G4Text& from);
~G4Text ();
G4String GetText () const;
Layout GetLayout () const;
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Text.icc,v 1.3 2001/07/11 10:01:03 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 17/11/96.
@@ -0,0 +1,146 @@
//
// ********************************************************************
// * 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: G4VGraphicsScene.hh,v 1.5 2005/11/10 15:39:16 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
// John Allison 19th July 1996
//
// Class Description:
// Abstract interface class for a graphics scene handler.
// It is a minimal scene handler for the GEANT4 kernel.
// See G4VSceneHandler for a fuller description. G4VSceneHandler is
// the full abstract interface to graphics systems.
#ifndef G4VGRAPHICSSCENE_HH
#define G4VGRAPHICSSCENE_HH
class G4VisAttributes;
class G4VSolid;
class G4Box;
class G4Cons;
class G4Tubs;
class G4Trd;
class G4Trap;
class G4Sphere;
class G4Ellipsoid;
class G4Para;
class G4Torus;
class G4PhysicalVolumeModel;
class G4Polycone;
class G4Polyhedra;
class G4VTrajectory;
class G4VHit;
class G4Polyline;
class G4Scale;
class G4Text;
class G4Circle;
class G4Square;
class G4Polymarker;
class G4Polyhedron;
class G4NURBS;
#include "G4Transform3D.hh"
class G4VGraphicsScene {
public: // With description
///////////////////////////////////////////////////////////////////
// Methods for adding solids to the scene handler. They
// must always be called in the triplet PreAddSolid, AddSolid and
// PostAddSolid. The transformation and visualization attributes
// must be set by the call to PreAddSolid. A possible default
// implementation is to request the solid to provide a G4Polyhedron
// or similar primitive - see, for example, G4VSceneHandler in the
// Visualization Category.
virtual void PreAddSolid (const G4Transform3D& objectTransformation,
const G4VisAttributes& visAttribs) = 0;
// objectTransformation is the transformation in the world
// coordinate system of the object about to be added, and
// visAttribs is its visualization attributes.
virtual void PostAddSolid () = 0;
virtual void AddSolid (const G4Box&) = 0;
virtual void AddSolid (const G4Cons&) = 0;
virtual void AddSolid (const G4Tubs&) = 0;
virtual void AddSolid (const G4Trd&) = 0;
virtual void AddSolid (const G4Trap&) = 0;
virtual void AddSolid (const G4Sphere&) = 0;
virtual void AddSolid (const G4Para&) = 0;
virtual void AddSolid (const G4Torus&) = 0;
virtual void AddSolid (const G4Polycone&) = 0;
virtual void AddSolid (const G4Polyhedra&) = 0;
virtual void AddSolid (const G4VSolid&) = 0; // For solids not above.
///////////////////////////////////////////////////////////////////
// Methods for adding "compound" GEANT4 objects to the scene
// handler. These methods may either (a) invoke "user code" that
// uses the "user interface", G4VVisManager (see, for example,
// G4VSceneHandler in the Visualization Category, which for
// trajectories uses G4VTrajectory::DrawTrajectory, via
// G4TrajectoriesModel in the Modeling Category) or (b) invoke
// AddPrimitives below (between calls to Begin/EndPrimitives) or (c)
// use graphics-system-specific code or (d) any combination of the
// above.
virtual void AddCompound (const G4VTrajectory&) = 0;
virtual void AddCompound (const G4VHit&) = 0;
///////////////////////////////////////////////////////////////////
// Methods for adding graphics primitives to the scene handler. A
// sequence of calls to AddPrimitive must be sandwiched between
// calls to BeginPrimitives and EndPrimitives. A sequence is any
// number of calls the have the same transformation.
virtual void BeginPrimitives
(const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
// objectTransformation is the transformation in the world
// coordinate system of the object about to be added.
virtual void EndPrimitives () = 0;
virtual void AddPrimitive (const G4Polyline&) = 0;
virtual void AddPrimitive (const G4Scale&) = 0;
virtual void AddPrimitive (const G4Text&) = 0;
virtual void AddPrimitive (const G4Circle&) = 0;
virtual void AddPrimitive (const G4Square&) = 0;
virtual void AddPrimitive (const G4Polymarker&) = 0;
virtual void AddPrimitive (const G4Polyhedron&) = 0;
virtual void AddPrimitive (const G4NURBS&) = 0;
///////////////////////////////////////////////////////////////////
// Special functions for particular models.
virtual void EstablishSpecials (G4PhysicalVolumeModel&) {}
// Used to establish any special relationships between scene and
// this particular type of model - non-pure, i.e., no requirement to
// implement. See G4PhysicalVolumeModel.hh for details.
virtual void DecommissionSpecials (G4PhysicalVolumeModel&) {}
// Used to reverse the effect of EstablishSpecials, if required.
};
#endif
+4 -11
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VMarker.hh,v 1.9 2003/06/16 16:55:12 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4VMarker.hh,v 1.10 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// G4VMarker - base class for markers - circles, squares, etc.
@@ -81,12 +81,12 @@
#define G4VMARKER_HH
#include "globals.hh"
#include "G4VVisPrim.hh"
#include "G4Visible.hh"
#include "G4Point3D.hh"
#include "G4Colour.hh"
#include "G4Color.hh"
class G4VMarker: public G4VVisPrim {
class G4VMarker: public G4Visible {
friend std::ostream& operator << (std::ostream& os, const G4VMarker& marker);
@@ -97,19 +97,12 @@ public: // With description
//////////////////////////////////////////////////////
// Constructors...
G4VMarker ();
G4VMarker (const G4VMarker& marker);
G4VMarker (const G4Point3D& pos);
//////////////////////////////////////////////////////
// Destructor...
virtual ~G4VMarker ();
//////////////////////////////////////////////////////
// Assignment...
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
virtual G4VMarker& operator = (const G4VMarker& right);
//////////////////////////////////////////////////////
// Logical...
G4bool operator != (const G4VMarker&) const;
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VMarker.icc,v 1.6 2001/07/11 10:01:04 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
@@ -0,0 +1,172 @@
//
// ********************************************************************
// * 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: G4VVisManager.hh,v 1.8 2005/11/10 21:30:13 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
// John Allison 19/Oct/1996.
//
// Class Description:
//
// G4VVisManager is an abstract interface for the GEANT4 Visualization Manager.
// The inheritance hierarchy is:
// G4VVisManager <- G4VisManager <- G4VisExecutive
//
// You may also write your own vis manager in place of G4VisExecutive.
//
// See example/novice/N02 to see how and when to instantiate
// G4VisExecutive (or your own vis manager). You should *not* access
// it directly; instead you should obtain a pointer as follows:
//
// G4VVisManager* pVVMan = G4VVisManager::GetConcreteInstance ();
//
// This ensures your code will link even if G4VisExecutive is not
// instantiated or even if not provided in a library. Please protect
// your code by testing the pointer, for example, by:
//
// if (pVVMan) pVVMan -> Draw (polyline);
//
// The Draw functions draw only "transient" objects. This is useful
// for debugging, e.g., drawing the step in your UserSteppingAction,
// since G4Steps are not kept.
//
// Note: "permanent" objects, i.e., objects which are always
// available, such as detector geometry components, or available in an
// event after tracking has finished, such as hits, digitisations and
// trajectories, can be drawn in a transient way if you wish but it is
// usually possible to draw them in a permanent way with /vis/
// commands. The advantage is that permanent objects can be redrawn,
// e.g., when you change view or viewer; transient objects get
// forgotten. Also, it is possible to write a G4VUserVisAction class
// and register it to "promote" your Draw messages to "permanent" -
// see documentation.
//
// Note that the G4Transform3D argument refers to the transformation
// of the *object*, not the transformation of the coordinate syste.
//
// Note also that where a G4VisAttributes argument is specified, it
// overrides any attributes belonging to the object itself.
#ifndef G4VVISMANAGER_HH
#define G4VVISMANAGER_HH
#include "G4Transform3D.hh"
#include "G4ThreeVector.hh" // Just a typedef Hep3Vector.
#include "G4RotationMatrix.hh" // Just a typedef HepRotation.
class G4Polyline;
class G4Text;
class G4Circle;
class G4Scale;
class G4Square;
class G4Polymarker;
class G4Polyhedron;
class G4NURBS;
class G4VSolid;
class G4VHit;
class G4VTrajectory;
class G4LogicalVolume;
class G4VPhysicalVolume;
class G4VisAttributes;
class G4VVisManager {
public: // With description
static G4VVisManager* GetConcreteInstance ();
// Returns pointer to actual visualization manager if a view is
// available for drawing, else returns null. Always check value.
public:
virtual ~G4VVisManager ();
public: // With description
///////////////////////////////////////////////////////////////////////
// Draw methods for Geant4 Visualization Primitives, useful
// for representing hits, digis, etc.
virtual void Draw (const G4Circle&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4NURBS&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Polyhedron&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Polyline&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Polymarker&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Scale&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Square&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4Text&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
///////////////////////////////////////////////////////////////////////
// Draw methods for Geant4 Objects as if they were Visualization
// Primitives. Note that the visualization attributes needed in
// some cases override any visualization attributes that are
// associated with the object itself - thus you can, for example,
// change the colour of a physical volume.
virtual void Draw (const G4VHit&) = 0;
virtual void Draw (const G4VTrajectory&, G4int i_mode = 0) = 0;
// i_mode is a parameter that can be used to control the drawing of
// the trajectory. See, e.g., G4VTrajectory::DrawTrajectory.
virtual void Draw (const G4LogicalVolume&, const G4VisAttributes&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4VPhysicalVolume&, const G4VisAttributes&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
virtual void Draw (const G4VSolid&, const G4VisAttributes&,
const G4Transform3D& objectTransformation = G4Transform3D()) = 0;
//////////////////////////////////////////////////////////////////////
// Other methods...
virtual void GeometryHasChanged () = 0;
// This is used by the run manager to notify a change of geometry.
virtual void DispatchToModel(const G4VTrajectory&, G4int i_mode = 0) = 0;
// Draw the trajectory.
protected:
static void SetConcreteInstance (G4VVisManager*);
static G4VVisManager* fpConcreteInstance; // Pointer to real G4VisManager.
};
#endif
@@ -22,7 +22,7 @@
//
//
// $Id: G4VisAttributes.hh,v 1.14 2005/03/22 16:48:18 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 23rd October 1996
@@ -22,7 +22,7 @@
//
//
// $Id: G4VisAttributes.icc,v 1.8 2005/03/22 16:48:18 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 18th November 1996
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VisExtent.hh,v 1.9 2005/02/19 22:00:11 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// A.Walkden 28/11/95
+5 -6
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Visible.hh,v 1.8 2003/06/16 16:55:17 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Visible.hh,v 1.9 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 30th October 1996
@@ -50,14 +50,10 @@ class G4Visible {
public: // With description
G4Visible ();
G4Visible (const G4Visible& visible);
G4Visible (const G4VisAttributes* pVA);
virtual ~G4Visible ();
virtual G4Visible& operator = (const G4Visible& right);
virtual G4bool operator == (const G4Visible& right) const;
const G4VisAttributes* GetVisAttributes () const;
void SetVisAttributes (const G4VisAttributes* pVA);
@@ -70,6 +66,9 @@ public: // With description
// associated G4VisAttributes object would normally also be created
// on the heap and managed in the same way.
G4bool operator != (const G4Visible& right) const;
// Simple test on non-equality of address of vis attributes.
protected:
const G4VisAttributes* fpVisAttributes;
+2 -12
View File
@@ -21,22 +21,12 @@
// ********************************************************************
//
//
// $Id: G4Visible.icc,v 1.5 2005/03/09 16:37:25 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Visible.icc,v 1.6 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 30th October 1996
inline G4Visible::G4Visible (): fpVisAttributes (0) {}
inline G4Visible::G4Visible (const G4Visible& visible):
fpVisAttributes (visible.fpVisAttributes)
{}
inline G4Visible::G4Visible (const G4VisAttributes* pVA):
fpVisAttributes (pVA)
{}
inline const G4VisAttributes* G4Visible::GetVisAttributes () const {
return fpVisAttributes;
}
+77 -94
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: HepPolyhedron.h,v 1.15 2005/03/22 16:42:52 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: HepPolyhedron.h,v 1.20 2005/11/09 07:32:38 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Class Description:
@@ -38,29 +38,31 @@
// HepPolyhedronBox (dx,dy,dz)
// - create polyhedron for Box;
// HepPolyhedronTrd1 (dx1,dx2,dy,dz)
// - create polyhedron for G3 Trd1;
// - create polyhedron for Trd1;
// HepPolyhedronTrd2 (dx1,dx2,dy1,dy2,dz)
// - create polyhedron for G3 Trd2;
// - create polyhedron for Trd2;
// HepPolyhedronTrap (dz,theta,phi, h1,bl1,tl1,alp1, h2,bl2,tl2,alp2)
// - create polyhedron for G3 Trap;
// - create polyhedron for Trap;
// HepPolyhedronPara (dx,dy,dz,alpha,theta,phi)
// - create polyhedron for G3 Para;
// - create polyhedron for Para;
// HepPolyhedronTube (rmin,rmax,dz)
// - create polyhedron for G3 Tube;
// - create polyhedron for Tube;
// HepPolyhedronTubs (rmin,rmax,dz,phi1,dphi)
// - create polyhedron for G3 Tubs;
// - create polyhedron for Tubs;
// HepPolyhedronCone (rmin1,rmax1,rmin2,rmax2,dz)
// - create polyhedron for G3 Cone;
// - create polyhedron for Cone;
// HepPolyhedronCons (rmin1,rmax1,rmin2,rmax2,dz,phi1,dphi)
// - create polyhedron for G3 Cons;
// - create polyhedron for Cons;
// HepPolyhedronPgon (phi,dphi,npdv,nz, z(*),rmin(*),rmax(*))
// - create polyhedron for G3 Pgon;
// - create polyhedron for Pgon;
// HepPolyhedronPcon (phi,dphi,nz, z(*),rmin(*),rmax(*))
// - create polyhedron for G3 Pcon;
// - create polyhedron for Pcon;
// HepPolyhedronSphere (rmin,rmax,phi,dphi,the,dthe)
// - create polyhedron for Sphere;
// HepPolyhedronTorus (rmin,rmax,rtor,phi,dphi)
// - create polyhedron for Torus;
// HepPolyhedronEllipsoid (dx,dy,dz,zcut1,zcut2)
// - create polyhedron for Ellipsoid;
// Public functions:
//
// GetNoVertices () - returns number of vertices;
@@ -156,11 +158,15 @@
// 06.03.05 J.Allison
// - added IsErrorBooleanProcess
//
// 20.06.05 G.Cosmo
// - added HepPolyhedronEllipsoid
//
#ifndef HEP_POLYHEDRON_HH
#define HEP_POLYHEDRON_HH
#include <CLHEP/Geometry/Point3D.h>
#include <CLHEP/Geometry/Normal3D.h>
#ifndef DEFAULT_NUMBER_OF_STEPS
#define DEFAULT_NUMBER_OF_STEPS 24
@@ -176,7 +182,7 @@ class G4Facet {
public:
G4Facet(int v1=0, int f1=0, int v2=0, int f2=0,
int v3=0, int f3=0, int v4=0, int f4=0)
int v3=0, int f3=0, int v4=0, int f4=0)
{ edge[0].v=v1; edge[0].f=f1; edge[1].v=v2; edge[1].f=f2;
edge[2].v=v3; edge[2].f=f3; edge[3].v=v4; edge[3].f=f4; }
};
@@ -187,7 +193,7 @@ class HepPolyhedron {
protected:
static int fNumberOfRotationSteps;
int nvert, nface;
HepPoint3D *pV;
HepGeom::Point3D<double> *pV;
G4Facet *pF;
// Re-allocate memory for HepPolyhedron
@@ -197,7 +203,7 @@ class HepPolyhedron {
int FindNeighbour(int iFace, int iNode, int iOrder) const;
// Find normal at node
HepNormal3D FindNodeNormal(int iFace, int iNode) const;
HepGeom::Normal3D<double> FindNodeNormal(int iFace, int iNode) const;
// Create HepPolyhedron for prism with quadrilateral base
void CreatePrism();
@@ -235,7 +241,7 @@ class HepPolyhedron {
virtual ~HepPolyhedron() { delete [] pV; delete [] pF; }
// Assignment
virtual HepPolyhedron & operator=(const HepPolyhedron & from);
HepPolyhedron & operator=(const HepPolyhedron & from);
// Get number of vertices
int GetNoVertices() const { return nvert; }
@@ -244,58 +250,60 @@ class HepPolyhedron {
int GetNoFacets() const { return nface; }
// Transform the polyhedron
HepPolyhedron & Transform(const HepTransform3D & t);
HepPolyhedron & Transform(const HepGeom::Transform3D & t);
// Get next vertex index of the quadrilateral
bool GetNextVertexIndex(int & index, int & edgeFlag) const;
// Get vertex by index
HepPoint3D GetVertex(int index) const;
HepGeom::Point3D<double> GetVertex(int index) const;
// Get next vertex + edge visibility of the quadrilateral
bool GetNextVertex(HepPoint3D & vertex, int & edgeFlag) const;
bool GetNextVertex(HepGeom::Point3D<double> & vertex, int & edgeFlag) const;
// Get next vertex + edge visibility + normal of the quadrilateral
bool GetNextVertex(HepPoint3D & vertex, int & edgeFlag,
HepNormal3D & normal) const;
bool GetNextVertex(HepGeom::Point3D<double> & vertex, int & edgeFlag,
HepGeom::Normal3D<double> & normal) const;
// Get indeces of the next edge with indeces of the faces
bool GetNextEdgeIndeces(int & i1, int & i2, int & edgeFlag,
int & iface1, int & iface2) const;
int & iface1, int & iface2) const;
// Get indeces of the next edge
bool GetNextEdgeIndeces(int & i1, int & i2, int & edgeFlag) const;
// Get next edge
bool GetNextEdge(HepPoint3D &p1, HepPoint3D &p2, int &edgeFlag) const;
bool GetNextEdge(HepGeom::Point3D<double> &p1,
HepGeom::Point3D<double> &p2, int &edgeFlag) const;
// Get next edge
bool GetNextEdge(HepPoint3D &p1, HepPoint3D &p2, int &edgeFlag,
int &iface1, int &iface2) const;
bool GetNextEdge(HepGeom::Point3D<double> &p1,
HepGeom::Point3D<double> &p2, int &edgeFlag,
int &iface1, int &iface2) const;
// Get face by index
void GetFacet(int iFace, int &n, int *iNodes,
int *edgeFlags = 0, int *iFaces = 0) const;
int *edgeFlags = 0, int *iFaces = 0) const;
// Get face by index
void GetFacet(int iFace, int &n, HepPoint3D *nodes,
int *edgeFlags = 0, HepNormal3D *normals = 0) const;
void GetFacet(int iFace, int &n, HepGeom::Point3D<double> *nodes,
int *edgeFlags=0, HepGeom::Normal3D<double> *normals=0) const;
// Get next face with normals at the nodes
bool GetNextFacet(int &n, HepPoint3D *nodes,
int *edgeFlags=0, HepNormal3D *normals=0) const;
bool GetNextFacet(int &n, HepGeom::Point3D<double> *nodes, int *edgeFlags=0,
HepGeom::Normal3D<double> *normals=0) const;
// Get normal of the face given by index
HepNormal3D GetNormal(int iFace) const;
HepGeom::Normal3D<double> GetNormal(int iFace) const;
// Get unit normal of the face given by index
HepNormal3D GetUnitNormal(int iFace) const;
HepGeom::Normal3D<double> GetUnitNormal(int iFace) const;
// Get normal of the next face
bool GetNextNormal(HepNormal3D &normal) const;
bool GetNextNormal(HepGeom::Normal3D<double> &normal) const;
// Get normal of unit length of the next face
bool GetNextUnitNormal(HepNormal3D &normal) const;
bool GetNextUnitNormal(HepGeom::Normal3D<double> &normal) const;
// Boolean operations
HepPolyhedron add(const HepPolyhedron &p) const;
@@ -329,7 +337,7 @@ class HepPolyhedron {
* @return status of the operation - is non-zero in case of problem
*/
int createTwistedTrap(double Dz,
const double xy1[][2], const double xy2[][2]);
const double xy1[][2], const double xy2[][2]);
/**
* Creates user defined polyhedron.
@@ -349,134 +357,98 @@ class HepPolyhedron {
* @return status of the operation - is non-zero in case of problem
*/
int createPolyhedron(int Nnodes, int Nfaces,
const double xyz[][3], const int faces[][4]);
const double xyz[][3], const int faces[][4]);
};
class HepPolyhedronTrd2 : public HepPolyhedron {
public:
HepPolyhedronTrd2(double Dx1, double Dx2,
double Dy1, double Dy2, double Dz);
double Dy1, double Dy2, double Dz);
virtual ~HepPolyhedronTrd2();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronTrd1 : public HepPolyhedronTrd2 {
public:
HepPolyhedronTrd1(double Dx1, double Dx2,
double Dy, double Dz);
double Dy, double Dz);
virtual ~HepPolyhedronTrd1();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronBox : public HepPolyhedronTrd2 {
public:
HepPolyhedronBox(double Dx, double Dy, double Dz);
virtual ~HepPolyhedronBox();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronTrap : public HepPolyhedron {
public:
HepPolyhedronTrap(double Dz, double Theta, double Phi,
double Dy1,
double Dx1, double Dx2, double Alp1,
double Dy2,
double Dx3, double Dx4, double Alp2);
double Dy1,
double Dx1, double Dx2, double Alp1,
double Dy2,
double Dx3, double Dx4, double Alp2);
virtual ~HepPolyhedronTrap();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronPara : public HepPolyhedronTrap {
public:
HepPolyhedronPara(double Dx, double Dy, double Dz,
double Alpha, double Theta, double Phi);
double Alpha, double Theta, double Phi);
virtual ~HepPolyhedronPara();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronCons : public HepPolyhedron {
public:
HepPolyhedronCons(double Rmn1, double Rmx1,
double Rmn2, double Rmx2, double Dz,
double Phi1, double Dphi);
double Rmn2, double Rmx2, double Dz,
double Phi1, double Dphi);
virtual ~HepPolyhedronCons();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronCone : public HepPolyhedronCons {
public:
HepPolyhedronCone(double Rmn1, double Rmx1,
double Rmn2, double Rmx2, double Dz);
double Rmn2, double Rmx2, double Dz);
virtual ~HepPolyhedronCone();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronTubs : public HepPolyhedronCons {
public:
HepPolyhedronTubs(double Rmin, double Rmax, double Dz,
double Phi1, double Dphi);
double Phi1, double Dphi);
virtual ~HepPolyhedronTubs();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronTube : public HepPolyhedronCons {
public:
HepPolyhedronTube (double Rmin, double Rmax, double Dz);
virtual ~HepPolyhedronTube();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronPgon : public HepPolyhedron {
public:
HepPolyhedronPgon(double phi, double dphi, int npdv, int nz,
const double *z,
const double *rmin,
const double *rmax);
const double *z,
const double *rmin,
const double *rmax);
virtual ~HepPolyhedronPgon();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronPcon : public HepPolyhedronPgon {
public:
HepPolyhedronPcon(double phi, double dphi, int nz,
const double *z,
const double *rmin,
const double *rmax);
const double *z,
const double *rmin,
const double *rmax);
virtual ~HepPolyhedronPcon();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronSphere : public HepPolyhedron {
public:
HepPolyhedronSphere(double rmin, double rmax,
double phi, double dphi,
double the, double dthe);
double phi, double dphi,
double the, double dthe);
virtual ~HepPolyhedronSphere();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronTorus : public HepPolyhedron {
@@ -484,9 +456,20 @@ public:
HepPolyhedronTorus(double rmin, double rmax, double rtor,
double phi, double dphi);
virtual ~HepPolyhedronTorus();
virtual HepPolyhedron& operator = (const HepPolyhedron& from) {
return HepPolyhedron::operator = (from);
}
};
class HepPolyhedronEllipsoid : public HepPolyhedron {
public:
HepPolyhedronEllipsoid(double dx, double dy, double dz,
double zcut1, double zcut2);
virtual ~HepPolyhedronEllipsoid();
};
class HepPolyhedronEllipticalCone : public HepPolyhedron {
public:
HepPolyhedronEllipticalCone(double dx, double dy, double z,
double zcut1);
virtual ~HepPolyhedronEllipticalCone();
};
#endif /* HEP_POLYHEDRON_HH */
+214 -214
View File
@@ -10,8 +10,10 @@
#include <CLHEP/Geometry/Plane3D.h>
using namespace HepGeom;
#define INITIAL_SIZE 200
#define CRAZY_POINT HepPoint3D(-10.e+6, -10.e+6, -10.e+6)
#define CRAZY_POINT Point3D<double>(-10.e+6, -10.e+6, -10.e+6)
#define GRANULARITY 10.e+5;
#define SWAP(A,B) w = A; A = B; B = w
@@ -69,11 +71,11 @@ class vector {
// ---------------------------------------------------- Extended node ---
class ExtNode {
public:
HepPoint3D v;
Point3D<double> v;
int s;
public:
ExtNode(HepPoint3D vertex=HepPoint3D(), int status=0)
ExtNode(Point3D<double> vertex=Point3D<double>(), int status=0)
: v(vertex), s(status) {}
~ExtNode() {}
@@ -125,7 +127,7 @@ class ExtEdge {
class ExtFace {
public:
int iedges[4]; // indices of original edges
HepPlane3D plane; // face plane
Plane3D<double> plane; // face plane
double rmin[3], rmax[3]; // bounding box
int iold; // head of the list of the original edges
int inew; // head of the list of the new edges
@@ -250,7 +252,7 @@ class BooleanProcessor {
void initiateLists();
void assemblePolyhedra();
void findABC(double x1, double y1, double x2, double y2,
double &a, double &b, double &c) const;
double &a, double &b, double &c) const;
int checkDirection(double *x, double *y) const;
int checkIntersection(int ix, int iy, int i1, int i2) const;
void mergeContours(int ix, int iy, int kext, int kint);
@@ -265,8 +267,8 @@ class BooleanProcessor {
~BooleanProcessor() {}
HepPolyhedron execute(int op,
const HepPolyhedron &a,
const HepPolyhedron &b);
const HepPolyhedron &a,
const HepPolyhedron &b);
void draw();
void draw_edge(int, int);
@@ -309,7 +311,7 @@ inline void ExtFace::invert()
}
if (inew > 0) inew = iEprev;
plane = HepPlane3D(-plane.a(), -plane.b(), -plane.c(), -plane.d());
plane = Plane3D<double>(-plane.a(), -plane.b(), -plane.c(), -plane.d());
}
void BooleanProcessor::takePolyhedron(const HepPolyhedron & p,
@@ -333,7 +335,7 @@ void BooleanProcessor::takePolyhedron(const HepPolyhedron & p,
// nodes.push_back(ExtNode(p.GetVertex(i)));
// }
HepPoint3D ppp;
Point3D<double> ppp;
for (i=1; i <= p.GetNoVertices(); i++) {
ppp = p.GetVertex(i);
ppp.setX(ppp.x()+dx);
@@ -364,7 +366,7 @@ void BooleanProcessor::takePolyhedron(const HepPolyhedron & p,
for (i=0; i<nnode; i++) {
faces.back().iedges[i] = edges.size();
edges.push_back(ExtEdge(iNodes[i], iNodes[i+1],
iface+dface, iFaces[i], iVis[i]));
iface+dface, iFaces[i], iVis[i]));
edges.back().inext = edges.size();
}
edges.back().inext = 0;
@@ -377,22 +379,22 @@ void BooleanProcessor::takePolyhedron(const HepPolyhedron & p,
}
for (i=1; i<nnode; i++) {
for (k=0; k<3; k++) {
if (faces.back().rmin[k] > nodes[iNodes[i]].v[k])
faces.back().rmin[k] = nodes[iNodes[i]].v[k];
if (faces.back().rmax[k] < nodes[iNodes[i]].v[k])
faces.back().rmax[k] = nodes[iNodes[i]].v[k];
if (faces.back().rmin[k] > nodes[iNodes[i]].v[k])
faces.back().rmin[k] = nodes[iNodes[i]].v[k];
if (faces.back().rmax[k] < nodes[iNodes[i]].v[k])
faces.back().rmax[k] = nodes[iNodes[i]].v[k];
}
}
// S E T F A C E P L A N E
HepNormal3D n = (nodes[iNodes[2]].v-nodes[iNodes[0]].v).cross
Normal3D<double> n = (nodes[iNodes[2]].v-nodes[iNodes[0]].v).cross
(nodes[iNodes[3]].v-nodes[iNodes[1]].v);
HepPoint3D p(0,0,0);
Point3D<double> p(0,0,0);
for (i=0; i<nnode; i++) { p += nodes[iNodes[i]].v; }
p *= (1./nnode);
faces.back().plane = HepPlane3D(n.unit(), p);
faces.back().plane = Plane3D<double>(n.unit(), p);
// S E T R E F E R E N C E T O T H E N E X T F A C E
@@ -473,14 +475,14 @@ void BooleanProcessor::selectOutsideFaces(int & ifaces, int & iout)
***********************************************************************/
{
int i, outflag, iface = ifaces, *prev;
HepPoint3D mmbox[8] = { HepPoint3D(rmin[0],rmin[1],rmin[2]),
HepPoint3D(rmax[0],rmin[1],rmin[2]),
HepPoint3D(rmin[0],rmax[1],rmin[2]),
HepPoint3D(rmax[0],rmax[1],rmin[2]),
HepPoint3D(rmin[0],rmin[1],rmax[2]),
HepPoint3D(rmax[0],rmin[1],rmax[2]),
HepPoint3D(rmin[0],rmax[1],rmax[2]),
HepPoint3D(rmax[0],rmax[1],rmax[2]) };
Point3D<double> mmbox[8] = { Point3D<double>(rmin[0],rmin[1],rmin[2]),
Point3D<double>(rmax[0],rmin[1],rmin[2]),
Point3D<double>(rmin[0],rmax[1],rmin[2]),
Point3D<double>(rmax[0],rmax[1],rmin[2]),
Point3D<double>(rmin[0],rmin[1],rmax[2]),
Point3D<double>(rmax[0],rmin[1],rmax[2]),
Point3D<double>(rmin[0],rmax[1],rmax[2]),
Point3D<double>(rmax[0],rmax[1],rmax[2]) };
prev = &ifaces;
while (iface > 0) {
@@ -498,9 +500,9 @@ void BooleanProcessor::selectOutsideFaces(int & ifaces, int & iout)
int npos = 0, nneg = 0;
double d;
for (i=0; i<8; i++) {
d = faces[iface].plane.distance(mmbox[i]);
if (d > +del) npos++;
if (d < -del) nneg++;
d = faces[iface].plane.distance(mmbox[i]);
if (d > +del) npos++;
if (d < -del) nneg++;
}
if (npos == 8 || nneg == 8) outflag = 1;
}
@@ -529,7 +531,7 @@ int BooleanProcessor::testFaceVsPlane(ExtEdge & edge)
***********************************************************************/
{
int iface = edge.iface1;
HepPlane3D plane = faces[edge.iface2].plane;
Plane3D<double> plane = faces[edge.iface2].plane;
int i, nnode, npos = 0, nneg = 0, nzer = 0;
double dd[5];
@@ -594,22 +596,22 @@ int BooleanProcessor::testFaceVsPlane(ExtEdge & edge)
for (i=0; i<2; i++) {
iedge = faces[iface].iedges[ii[i]];
while (iedge > 0) {
i1 = edges[iedge].i1;
i2 = edges[iedge].i2;
d1 = plane.distance(nodes[i1].v);
d2 = plane.distance(nodes[i2].v);
if (d1 > del) {
if (d2 < -del) { ii[i] = nodes.size(); break; } // +-
}else if (d1 < -del) {
if (d2 > del) { ii[i] = nodes.size(); break; } // -+
}else{
ii[i] = i1; break; // 0+ or 0-
}
iedge = edges[iedge].inext;
i1 = edges[iedge].i1;
i2 = edges[iedge].i2;
d1 = plane.distance(nodes[i1].v);
d2 = plane.distance(nodes[i2].v);
if (d1 > del) {
if (d2 < -del) { ii[i] = nodes.size(); break; } // +-
}else if (d1 < -del) {
if (d2 > del) { ii[i] = nodes.size(); break; } // -+
}else{
ii[i] = i1; break; // 0+ or 0-
}
iedge = edges[iedge].inext;
}
if (ii[i] == nodes.size()) {
dd = d2-d1; d1 = d1/dd; d2 = d2/dd;
nodes.push_back(ExtNode(d2*nodes[i1].v-d1*nodes[i2].v, iedge));
dd = d2-d1; d1 = d1/dd; d2 = d2/dd;
nodes.push_back(ExtNode(d2*nodes[i1].v-d1*nodes[i2].v, iedge));
}
}
edge.inext = 0;
@@ -729,7 +731,7 @@ void BooleanProcessor::divideEdge(int & i1, int & i2)
ie2 = faces[edges[ie1].iface2].iedges[0];
while (ie2 > 0) {
if (edges[ie2].i1 == edges[ie1].i2 &&
edges[ie2].i2 == edges[ie1].i1) break;
edges[ie2].i2 == edges[ie1].i1) break;
ie2 = edges[ie2].inext;
}
@@ -942,30 +944,30 @@ void BooleanProcessor::assembleFace(int what, int iface)
for (;;) {
i = &faces[iface].inew;
while(*i > 0) {
if (edges[*i].i1 == edges[icur].i2) break;
i = &edges[*i].inext;
if (edges[*i].i1 == edges[icur].i2) break;
i = &edges[*i].inext;
}
if (*i == 0) {
i = &faces[iface].iold;
while(*i > 0) {
if (edges[*i].i1 == edges[icur].i2) ioldflag = 1;
if (edges[*i].i1 == edges[icur].i2) break;
i = &edges[*i].inext;
}
i = &faces[iface].iold;
while(*i > 0) {
if (edges[*i].i1 == edges[icur].i2) ioldflag = 1;
if (edges[*i].i1 == edges[icur].i2) break;
i = &edges[*i].inext;
}
}
if (*i > 0) {
icur = *i;
*i = edges[icur].inext;
INSERT_EDGE_TO_THE_LIST(icur);
if (edges[icur].i2 == ifirst) { break; } else { continue; }
icur = *i;
*i = edges[icur].inext;
INSERT_EDGE_TO_THE_LIST(icur);
if (edges[icur].i2 == ifirst) { break; } else { continue; }
}else{
processor_error = 1;
std::cerr
<< "BooleanProcessor::assembleFace(" << iface << ") : "
<< "could not find next edge of the contour"
<< std::endl;
faces[iface].inew = DEFECTIVE_FACE;
return;
processor_error = 1;
std::cerr
<< "BooleanProcessor::assembleFace(" << iface << ") : "
<< "could not find next edge of the contour"
<< std::endl;
faces[iface].inew = DEFECTIVE_FACE;
return;
}
}
}
@@ -977,18 +979,18 @@ void BooleanProcessor::assembleFace(int what, int iface)
if (what == 0 && ioldflag == 0 && iedge > 0) {
for (;;) {
if (edges[iedge].inext > 0) {
if (edges[iedge].i2 == edges[edges[iedge].inext].i1) {
iedge = edges[iedge].inext;
}else{
break;
}
if (edges[iedge].i2 == edges[edges[iedge].inext].i1) {
iedge = edges[iedge].inext;
}else{
break;
}
}else{
if (edges[iedge].i2 == edges[faces[iface].iold].i1) {
edges[iedge].inext = ihead; // set new face
return;
}else{
break;
}
if (edges[iedge].i2 == edges[faces[iface].iold].i1) {
edges[iedge].inext = ihead; // set new face
return;
}else{
break;
}
}
}
}
@@ -1022,7 +1024,7 @@ void BooleanProcessor::assembleNewFaces(int what, int ihead)
checkDoubleEdges(iface);
assembleFace(what, iface);
faces[iface].inew =
(faces[iface].iold == 0) ? UNSUITABLE_FACE : NEW_FACE;
(faces[iface].iold == 0) ? UNSUITABLE_FACE : NEW_FACE;
}
iface = faces[iface].inext;
}
@@ -1153,9 +1155,9 @@ void BooleanProcessor::assemblePolyhedra()
while(iedge > 0) {
iface = edges[iedge].iface2;
if (faces[iface].inew == UNKNOWN_FACE) {
unknown_faces.remove(iface);
suitable_faces.push_back(iface);
faces[iface].inew = ORIGINAL_FACE;
unknown_faces.remove(iface);
suitable_faces.push_back(iface);
faces[iface].inew = ORIGINAL_FACE;
}
iedge = edges[iedge].inext;
}
@@ -1174,9 +1176,9 @@ void BooleanProcessor::assemblePolyhedra()
while(iedge > 0) {
iface = edges[iedge].iface2;
if (faces[iface].inew == UNKNOWN_FACE) {
unknown_faces.remove(iface);
unsuitable_faces.push_back(iface);
faces[iface].inew = UNSUITABLE_FACE;
unknown_faces.remove(iface);
unsuitable_faces.push_back(iface);
faces[iface].inew = UNSUITABLE_FACE;
}
iedge = edges[iedge].inext;
}
@@ -1187,7 +1189,7 @@ void BooleanProcessor::assemblePolyhedra()
inline void
BooleanProcessor::findABC(double x1, double y1, double x2, double y2,
double &a, double &b, double &c) const
double &a, double &b, double &c) const
/***********************************************************************
* *
* Name: BooleanProcessor::findABC Date: 07.03.00 *
@@ -1358,34 +1360,34 @@ void BooleanProcessor::mergeContours(int ix, int iy, int kext, int kint)
k[4] = edges[i1int].i2;
k[5] = edges[i2int].i2;
for (i=3; i<6; i++) {
x[i] = nodes[k[i]].v[ix];
y[i] = nodes[k[i]].v[iy];
x[i] = nodes[k[i]].v[ix];
y[i] = nodes[k[i]].v[iy];
}
// T E S T L I N E K1 - K4
// I F O K T H E N M E R G E C O N T O U R S
if (checkDirection(x, y) == 0) {
if (checkIntersection(ix, iy, k[1], k[4]) == 0) {
i = i1int;
for(;;) {
if (edges[i].inext == 0) {
edges[i].inext = internal_contours[kint];
internal_contours[kint] = 0;
break;
}else{
i = edges[i].inext;
}
}
i = edges[i1int].iface1;
edges.push_back(ExtEdge(k[1], k[4], i, -(edges.size()+1), -1));
edges.back().inext = i2int;
edges.push_back(ExtEdge(k[4], k[1], i, -(edges.size()-1), -1));
edges.back().inext = edges[i1ext].inext;
edges[i1ext].inext = edges.size()-2;
edges[i1int].inext = edges.size()-1;
return;
}
if (checkIntersection(ix, iy, k[1], k[4]) == 0) {
i = i1int;
for(;;) {
if (edges[i].inext == 0) {
edges[i].inext = internal_contours[kint];
internal_contours[kint] = 0;
break;
}else{
i = edges[i].inext;
}
}
i = edges[i1int].iface1;
edges.push_back(ExtEdge(k[1], k[4], i, -(edges.size()+1), -1));
edges.back().inext = i2int;
edges.push_back(ExtEdge(k[4], k[1], i, -(edges.size()-1), -1));
edges.back().inext = edges[i1ext].inext;
edges[i1ext].inext = edges.size()-2;
edges[i1int].inext = edges.size()-1;
return;
}
}
i1int = edges[i1int].inext;
}
@@ -1482,25 +1484,25 @@ void BooleanProcessor::triangulateContour(int ix, int iy, int ihead)
if (istart == 0) {
istart = iedge1;
if (nnode <= 3) {
iedge3 = edges[iedge2].inext;
edges[iedge1].iface1 = faces.size();
edges[iedge2].iface1 = faces.size();
edges[iedge3].iface1 = faces.size();
edges[iedge3].inext = 0;
faces.push_back(ExtFace());
faces.back().iold = iedge1;
faces.back().inew = ORIGINAL_FACE;
iedge3 = edges[iedge2].inext;
edges[iedge1].iface1 = faces.size();
edges[iedge2].iface1 = faces.size();
edges[iedge3].iface1 = faces.size();
edges[iedge3].inext = 0;
faces.push_back(ExtFace());
faces.back().iold = iedge1;
faces.back().inew = ORIGINAL_FACE;
//if (draw_flag) draw_contour(4, 2, iedge1);
break;
break;
}
}else if (istart == iedge1) {
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateContour : "
<< "could not generate a triangle (infinite loop)"
<< std::endl;
<< "BooleanProcessor::triangulateContour : "
<< "could not generate a triangle (infinite loop)"
<< std::endl;
break;
}
@@ -1579,7 +1581,7 @@ void BooleanProcessor::triangulateFace(int iface)
// F I N D M A X C O M P O N E N T O F T H E N O R M A L
// S E T IX, IY, IZ
HepNormal3D normal = faces[iface].plane.normal();
Normal3D<double> normal = faces[iface].plane.normal();
int ix, iy, iz = 0;
if (std::abs(normal[1]) > std::abs(normal[iz])) iz = 1;
if (std::abs(normal[2]) > std::abs(normal[iz])) iz = 2;
@@ -1601,34 +1603,34 @@ void BooleanProcessor::triangulateFace(int iface)
z = 0.0;
for(;;) {
if (iedge > 0) {
i1 = edges[iedge].i1;
i2 = edges[iedge].i2;
z += nodes[i1].v[ix]*nodes[i2].v[iy]-nodes[i2].v[ix]*nodes[i1].v[iy];
if (ifirst != i2) {
iedge = edges[iedge].inext;
continue;
}else{
if (z > del*del) {
external_contours.push_back(icontour);
}else if (z < -del*del) {
internal_contours.push_back(icontour);
}else{
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateFace : too small contour"
<< std::endl;
}
icontour = edges[iedge].inext;
edges[iedge].inext = 0;
break;
}
i1 = edges[iedge].i1;
i2 = edges[iedge].i2;
z += nodes[i1].v[ix]*nodes[i2].v[iy]-nodes[i2].v[ix]*nodes[i1].v[iy];
if (ifirst != i2) {
iedge = edges[iedge].inext;
continue;
}else{
if (z > del*del) {
external_contours.push_back(icontour);
}else if (z < -del*del) {
internal_contours.push_back(icontour);
}else{
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateFace : too small contour"
<< std::endl;
}
icontour = edges[iedge].inext;
edges[iedge].inext = 0;
break;
}
}else{
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateFace : broken contour"
<< std::endl;
icontour = 0;
break;
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateFace : broken contour"
<< std::endl;
icontour = 0;
break;
}
}
}
@@ -1644,9 +1646,9 @@ void BooleanProcessor::triangulateFace(int iface)
if (kext == external_contours.size()) {
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateFace : "
<< "could not merge internal contour " << kint
<< std::endl;
<< "BooleanProcessor::triangulateFace : "
<< "could not merge internal contour " << kint
<< std::endl;
}
}
@@ -1664,16 +1666,16 @@ void BooleanProcessor::triangulateFace(int iface)
iedge = faces[ifa].iold;
while (iedge > 0) {
if (edges[iedge].iface1 != ifa) {
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateFace : wrong reference to itself, "
<< "iface=" << ifa << ", iface1=" << edges[iedge].iface1
<< std::endl;
processor_error = 1;
std::cerr
<< "BooleanProcessor::triangulateFace : wrong reference to itself, "
<< "iface=" << ifa << ", iface1=" << edges[iedge].iface1
<< std::endl;
}else if (edges[iedge].iface2 > 0) {
modifyReference(edges[iedge].iface2,
edges[iedge].i1, edges[iedge].i2, ifa);
modifyReference(edges[iedge].iface2,
edges[iedge].i1, edges[iedge].i2, ifa);
}else if (edges[iedge].iface2 < 0) {
edges[iedge].iface2 = edges[-edges[iedge].iface2].iface1;
edges[iedge].iface2 = edges[-edges[iedge].iface2].iface1;
}
iedge = edges[iedge].inext;
}
@@ -1701,8 +1703,8 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
faces[i].inew = ++nface;
iedge = faces[i].iold;
while (iedge > 0) {
nodes[edges[iedge].i1].s = 1;
iedge = edges[iedge].inext;
nodes[edges[iedge].i1].s = 1;
iedge = edges[iedge].inext;
}
}else{
faces[i].inew = 0;
@@ -1734,10 +1736,10 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
iedge = faces[i].iold;
while (iedge > 0) {
if (k > 3) {
std::cerr
<< "BooleanProcessor::createPolyhedron : too many edges"
<< std::endl;
break;
std::cerr
<< "BooleanProcessor::createPolyhedron : too many edges"
<< std::endl;
break;
}
v[k] = nodes[edges[iedge].i1].s;
if (edges[iedge].ivis < 0) v[k] = -v[k];
@@ -1747,9 +1749,9 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
}
if (k < 3) {
std::cerr
<< "BooleanProcessor::createPolyhedron : "
<< "face has only " << k << " edges"
<< std::endl;
<< "BooleanProcessor::createPolyhedron : "
<< "face has only " << k << " edges"
<< std::endl;
}
polyhedron.pF[faces[i].inew] =
G4Facet(v[0],f[0], v[1],f[1], v[2],f[2], v[3],f[3]);
@@ -1758,8 +1760,8 @@ HepPolyhedron BooleanProcessor::createPolyhedron()
}
HepPolyhedron BooleanProcessor::execute(int op,
const HepPolyhedron & a,
const HepPolyhedron & b)
const HepPolyhedron & a,
const HepPolyhedron & b)
/***********************************************************************
* *
* Name: BooleanProcessor::execute Date: 10.12.99 *
@@ -1779,7 +1781,7 @@ HepPolyhedron BooleanProcessor::execute(int op,
{ 17, 31, -23},
{ 31, -23, 17},
{ -31, 23, -17}
};
};
// I N I T I A T E P R O C E S S O R
@@ -1806,13 +1808,13 @@ HepPolyhedron BooleanProcessor::execute(int op,
return b;
case OP_INTERSECTION:
std::cerr
<< "BooleanProcessor: intersection with empty polyhedron"
<< std::endl;
<< "BooleanProcessor: intersection with empty polyhedron"
<< std::endl;
return HepPolyhedron();
case OP_SUBTRACTION:
std::cerr
<< "BooleanProcessor: subtraction from empty polyhedron"
<< std::endl;
<< "BooleanProcessor: subtraction from empty polyhedron"
<< std::endl;
return HepPolyhedron();
}
}
@@ -1822,8 +1824,8 @@ HepPolyhedron BooleanProcessor::execute(int op,
return a;
case OP_INTERSECTION:
std::cerr
<< "BooleanProcessor: intersection with empty polyhedron"
<< std::endl;
<< "BooleanProcessor: intersection with empty polyhedron"
<< std::endl;
return HepPolyhedron();
case OP_SUBTRACTION:
return a;
@@ -1835,7 +1837,7 @@ HepPolyhedron BooleanProcessor::execute(int op,
del = findMinMax();
// W O R K A R O U N D T O A V O I D I E A N D E E
double ddxx = del*shift[ishift][0];
double ddyy = del*shift[ishift][1];
double ddzz = del*shift[ishift][2];
@@ -1883,8 +1885,8 @@ return a;
while (ifa1 > 0) {
ifa2 = ifaces2;
while (ifa2 > 0) {
testFaceVsFace(ifa1, ifa2);
ifa2 = faces[ifa2].inext;
testFaceVsFace(ifa1, ifa2);
ifa2 = faces[ifa2].inext;
}
ifa1 = faces[ifa1].inext;
}
@@ -1906,8 +1908,8 @@ return a;
if (unknown_faces.front() != 0) {
processor_error = 1;
std::cerr
<< "BooleanProcessor::execute : unknown faces !!!"
<< std::endl;
<< "BooleanProcessor::execute : unknown faces !!!"
<< std::endl;
}
break;
}
@@ -1971,25 +1973,25 @@ return a;
while (iedge > 0) {
cout << " iegde = " << iedge
<< " i1,i2 =" << edges[iedge].i1 << "," << edges[iedge].i2
<< " iface1,iface2 = "
<< edges[iedge].iface1 << "," << edges[iedge].iface2
<< endl;
cout << " iegde = " << iedge
<< " i1,i2 =" << edges[iedge].i1 << "," << edges[iedge].i2
<< " iface1,iface2 = "
<< edges[iedge].iface1 << "," << edges[iedge].iface2
<< endl;
i1 = edges[iedge].i1;
p1[0] = nodes[i1].v.x();
p1[1] = nodes[i1].v.y();
p1[2] = nodes[i1].v.z();
IHWTON(p1,p1);
i2 = edges[iedge].i2;
p2[0] = nodes[i2].v.x();
p2[1] = nodes[i2].v.y();
p2[2] = nodes[i2].v.z();
IHWTON(p2,p2);
i1 = edges[iedge].i1;
p1[0] = nodes[i1].v.x();
p1[1] = nodes[i1].v.y();
p1[2] = nodes[i1].v.z();
IHWTON(p1,p1);
i2 = edges[iedge].i2;
p2[0] = nodes[i2].v.x();
p2[1] = nodes[i2].v.y();
p2[2] = nodes[i2].v.z();
IHWTON(p2,p2);
// icol = (edges[iedge].ivis > 0) ? 1 : 2;
IHZLIN(icol,p1[0],p1[1],p1[2], p2[0],p2[1],p2[2]);
iedge = edges[iedge].inext;
IHZLIN(icol,p1[0],p1[1],p1[2], p2[0],p2[1],p2[2]);
iedge = edges[iedge].inext;
}
cout << "--- inew" << endl;
@@ -1999,25 +2001,25 @@ return a;
while (iedge > 0) {
cout << " iegde = " << iedge
<< " i1,i2 =" << edges[iedge].i1 << "," << edges[iedge].i2
<< " iface1,iface2 = "
<< edges[iedge].iface1 << "," << edges[iedge].iface2
<< endl;
cout << " iegde = " << iedge
<< " i1,i2 =" << edges[iedge].i1 << "," << edges[iedge].i2
<< " iface1,iface2 = "
<< edges[iedge].iface1 << "," << edges[iedge].iface2
<< endl;
i1 = edges[iedge].i1;
p1[0] = nodes[i1].v.x();
p1[1] = nodes[i1].v.y();
p1[2] = nodes[i1].v.z();
IHWTON(p1,p1);
i2 = edges[iedge].i2;
p2[0] = nodes[i2].v.x();
p2[1] = nodes[i2].v.y();
p2[2] = nodes[i2].v.z();
IHWTON(p2,p2);
i1 = edges[iedge].i1;
p1[0] = nodes[i1].v.x();
p1[1] = nodes[i1].v.y();
p1[2] = nodes[i1].v.z();
IHWTON(p1,p1);
i2 = edges[iedge].i2;
p2[0] = nodes[i2].v.x();
p2[1] = nodes[i2].v.y();
p2[2] = nodes[i2].v.z();
IHWTON(p2,p2);
// icol = (edges[iedge].ivis > 0) ? 1 : 2;
IHZLIN(icol,p1[0],p1[1],p1[2], p2[0],p2[1],p2[2]);
iedge = edges[iedge].inext;
IHZLIN(icol,p1[0],p1[1],p1[2], p2[0],p2[1],p2[2]);
iedge = edges[iedge].inext;
}
iface = faces[iface].inext;
@@ -2026,8 +2028,6 @@ return a;
cin >> II;
ixclrwi();
IHZCLE(0);
}
}
}
+4 -2
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4AttCheck.cc,v 1.6 2005/05/03 17:43:01 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4AttCheck.cc,v 1.7 2005/09/16 01:04:43 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
#include "G4AttCheck.hh"
@@ -45,11 +45,13 @@ G4AttCheck::G4AttCheck
// Legal Unit Category Types...
fUnitCategories.insert("Length");
fUnitCategories.insert("Energy");
fUnitCategories.insert("Time");
fUnitCategories.insert("Electric charge");
// Corresponding Standard Units...
fStandardUnits["Length"] = "m";
fStandardUnits["Energy"] = "MeV";
fStandardUnits["Time"] = "ns";
fStandardUnits["Electric charge"] = "e+";
// Legal Categories...
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4AttDefStore.cc,v 1.5 2004/03/31 06:50:19 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
#include "G4AttDefStore.hh"
+4 -24
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Circle.cc,v 1.4 2001/07/11 10:01:07 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Circle.cc,v 1.5 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
@@ -32,28 +32,8 @@
G4Circle::G4Circle () {}
G4Circle::G4Circle (const G4Point3D& pos):
G4VMarker (pos) {}
G4Circle::G4Circle (const G4VMarker& marker): G4VMarker (marker) {}
G4Circle::G4Circle (const G4VMarker& marker):
G4VMarker (marker) {}
G4Circle::G4Circle (const G4Point3D& pos): G4VMarker (pos) {}
G4Circle::~G4Circle () {}
G4Visible & G4Circle::operator = (const G4Visible &right) {
return G4Visible::operator = (right);
}
G4VVisPrim & G4Circle::operator = (const G4VVisPrim &right) {
return G4VVisPrim::operator = (right);
}
G4VMarker & G4Circle::operator = (const G4VMarker &right) {
return G4VMarker::operator = (right);
}
G4Circle& G4Circle::operator = (const G4Circle& right) {
if (&right == this) return *this;
G4VMarker::operator = (right);
return *this;
}
+86 -3
View File
@@ -21,14 +21,15 @@
// ********************************************************************
//
//
// $Id: G4Colour.cc,v 1.6 2003/09/18 11:03:12 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Colour.cc,v 1.9 2005/11/10 20:34:45 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 20th October 1996
#include "G4Colour.hh"
#include "G4ios.hh"
#include <sstream>
G4Colour::G4Colour (G4double r, G4double g, G4double b, G4double a):
red (r), green (g), blue (b), alpha (a)
@@ -66,3 +67,85 @@ G4bool G4Colour::operator != (const G4Colour& c) const {
return true;
return false;
}
const G4Colour G4Colour::fWhite = G4Colour(1.0, 1.0, 1.0);
const G4Colour G4Colour::fGray = G4Colour(0.5, 0.5, 0.5);
const G4Colour G4Colour::fGrey = G4Colour::fGray;
const G4Colour G4Colour::fBlack = G4Colour(0.0, 0.0, 0.0);
const G4Colour G4Colour::fRed = G4Colour(1.0, 0.0, 0.0);
const G4Colour G4Colour::fGreen = G4Colour(0.0, 1.0, 0.0);
const G4Colour G4Colour::fBlue = G4Colour(0.0, 0.0, 1.0);
const G4Colour G4Colour::fCyan = G4Colour(0.0, 1.0, 1.0);
const G4Colour G4Colour::fMagenta = G4Colour(1.0, 0.0, 1.0);
const G4Colour G4Colour::fYellow = G4Colour(1.0, 1.0, 0.0);
map<G4String, G4Colour> G4Colour::fColourMap;
bool G4Colour::fInitColourMap = false;
const G4Colour& G4Colour::White() {return fWhite;}
const G4Colour& G4Colour::Gray() {return fGray;}
const G4Colour& G4Colour::Grey() {return fGrey;}
const G4Colour& G4Colour::Black() {return fBlack;}
const G4Colour& G4Colour::Red() {return fRed;}
const G4Colour& G4Colour::Green() {return fGreen;}
const G4Colour& G4Colour::Blue() {return fBlue;}
const G4Colour& G4Colour::Cyan() {return fCyan;}
const G4Colour& G4Colour::Magenta() {return fMagenta;}
const G4Colour& G4Colour::Yellow() {return fYellow;}
void
G4Colour::AddToMap(const G4String& key, const G4Colour& colour)
{
// Convert to lower case since colour map is case insensitive
G4String myKey(key);
myKey.toLower();
map<G4String, G4Colour>::iterator iter = fColourMap.find(myKey);
if (iter == fColourMap.end()) fColourMap[myKey] = colour;
else {
std::ostringstream o;
o << "G4Colour with key "<<myKey<<" already exists ";
G4Exception
("G4Colour::AddToMap(const G4String& key, const G4Colour& colour)",
"ColourKeyExists", JustWarning, o.str().c_str());
}
}
void
G4Colour::InitialiseColourMap()
{
// Standard colours
AddToMap("white", G4Colour::fWhite);
AddToMap("gray", G4Colour::fGray);
AddToMap("grey", G4Colour::fGrey);
AddToMap("black", G4Colour::fBlack);
AddToMap("red", G4Colour::fRed);
AddToMap("green", G4Colour::fGreen);
AddToMap("blue", G4Colour::fBlue);
AddToMap("cyan", G4Colour::fCyan);
AddToMap("magenta", G4Colour::fMagenta);
AddToMap("yellow", G4Colour::fYellow);
}
bool
G4Colour::GetColour(const G4String& key, G4Colour& result)
{
if (false == fInitColourMap) {
fInitColourMap = true;
// Add standard colours to map
InitialiseColourMap();
}
G4String myKey(key);
myKey.toLower();
map<G4String, G4Colour>::iterator iter = fColourMap.find(myKey);
// Don't modify "result" if colour was not found in map
if (iter == fColourMap.end()) return false;
result = iter->second;
return true;
}
+3 -13
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBS.cc,v 1.7 2003/06/16 16:55:20 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBS.cc,v 1.8 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -41,16 +41,6 @@
// Here start the real world. Please, check your armored jacket. //
////////////////////////////////////////////////////////////////////////
G4Visible & G4NURBS::operator = (const G4Visible &right)
{
return G4Visible::operator = (right);
}
G4VVisPrim & G4NURBS::operator = (const G4VVisPrim &right)
{
return G4VVisPrim::operator = (right);
}
std::ostream & operator << (std::ostream & inout_outStream,
const G4NURBS & in_kNurb)
{
@@ -507,7 +497,7 @@ G4NURBS::G4NURBS( t_order in_Uorder, t_order in_Vorder,
}
G4NURBS::G4NURBS(const G4NURBS & in_krNurb)
: G4VVisPrim(in_krNurb)
: G4Visible(in_krNurb)
{
// we assume the in nurbs is ok
+2 -12
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBSbox.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBSbox.cc,v 1.6 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -68,16 +68,6 @@ G4NURBSbox::G4NURBSbox(G4double DX, G4double DY, G4double DZ)
CP(mpCtrlPts[i++], DX, DY,-DZ, 1 );
}
G4Visible & G4NURBSbox::operator = (const G4Visible &right)
{
return G4Visible::operator = (right);
}
G4VVisPrim & G4NURBSbox::operator = (const G4VVisPrim &right)
{
return G4VVisPrim::operator = (right);
}
const char* G4NURBSbox::Whoami() const
{
return "Box (as a folded piece)";
+2 -12
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBScylinder.cc,v 1.6 2004/12/07 08:42:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBScylinder.cc,v 1.7 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -106,16 +106,6 @@ G4NURBScylinder::G4NURBScylinder(G4double R, G4double DZ)
CP(mpCtrlPts[35] , 0, 0, -DZ, 1 );
}
G4Visible & G4NURBScylinder::operator = (const G4Visible &right)
{
return G4Visible::operator = (right);
}
G4VVisPrim & G4NURBScylinder::operator = (const G4VVisPrim &right)
{
return G4VVisPrim::operator = (right);
}
const char* G4NURBScylinder::Whoami() const
{
return "Cylinder";
+2 -12
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBShexahedron.cc,v 1.5 2003/04/03 15:31:06 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBShexahedron.cc,v 1.6 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
// hexahedron implementation
// OC 17 9 96
@@ -60,16 +60,6 @@ G4NURBShexahedron::G4NURBShexahedron(const G4ThreeVector c [8])
CP(mpCtrlPts[To1d(4,3)] , c[4].x(), c[4].y(), c[4].z(), 1 );
}
G4Visible & G4NURBShexahedron::operator = (const G4Visible &right)
{
return G4Visible::operator = (right);
}
G4VVisPrim & G4NURBShexahedron::operator = (const G4VVisPrim &right)
{
return G4VVisPrim::operator = (right);
}
const char* G4NURBShexahedron::Whoami() const
{
return "Hexahedron";
+2 -12
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBStube.cc,v 1.6 2004/12/07 08:42:25 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBStube.cc,v 1.7 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -97,16 +97,6 @@ G4NURBStube::G4NURBStube(G4double r, G4double R, G4double DZ)
CP(mpCtrlPts[44] , r, 0, DZ, 1 );
}
G4Visible & G4NURBStube::operator = (const G4Visible &right)
{
return G4Visible::operator = (right);
}
G4VVisPrim & G4NURBStube::operator = (const G4VVisPrim &right)
{
return G4VVisPrim::operator = (right);
}
const char* G4NURBStube::Whoami() const
{
return "Tube";
+7 -18
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4NURBStubesector.cc,v 1.9 2004/12/10 17:48:51 gcosmo Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4NURBStubesector.cc,v 1.11 2005/10/03 12:30:13 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// Olivier Crumeyrolle 12 September 1996
@@ -31,7 +31,7 @@
// OC 290896
#include "G4NURBStubesector.hh"
#include <strstream>
#include <sstream>
G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
G4double DZ, G4double PHI1, G4double PHI2)
@@ -179,21 +179,10 @@ G4NURBStubesector::G4NURBStubesector(G4double r, G4double R,
// to a line instead of a point
// creating the nurbs identity
mpwhoami = new char [200];
std::ostrstream tmpstr(mpwhoami, 200);
tmpstr << "Tubs" << " \tPHI1=" << PHI1 << " ; PHI2=" << PHI2 << '\0';
// could be more sophisticated, reallocating
// mpwhoami to the exact length
}
G4Visible & G4NURBStubesector::operator = (const G4Visible &right)
{
return G4Visible::operator = (right);
}
G4VVisPrim & G4NURBStubesector::operator = (const G4VVisPrim &right)
{
return G4VVisPrim::operator = (right);
std::ostringstream tmpstr;
tmpstr << "Tubs" << " \tPHI1=" << PHI1 << " ; PHI2=" << PHI2;
mpwhoami = new char [tmpstr.str().length() + 1];
mpwhoami = std::strcpy(mpwhoami, tmpstr.str().c_str());
}
const char* G4NURBStubesector::Whoami() const
@@ -22,7 +22,7 @@
//
//
// $Id: G4PlacedPolyhedron.cc,v 1.3 2001/07/11 10:01:08 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
#include "G4PlacedPolyhedron.hh"
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4Point3DList.cc,v 1.6 2003/06/16 16:55:22 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison July 1995
+16 -18
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Polyhedron.cc,v 1.14 2005/03/22 19:18:56 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Polyhedron.cc,v 1.18 2005/08/10 08:20:02 gcosmo Exp $
// GEANT4 tag $Name: geant4-08-00 $
#include "G4Polyhedron.hh"
@@ -32,13 +32,6 @@ G4Polyhedron::G4Polyhedron ():
G4Polyhedron::~G4Polyhedron () {}
G4Polyhedron::G4Polyhedron (const G4Polyhedron& from)
: HepPolyhedron(from), G4VVisPrim(from)
{
fNumberOfRotationStepsAtTimeOfCreation =
from.fNumberOfRotationStepsAtTimeOfCreation;
}
G4Polyhedron::G4Polyhedron (const HepPolyhedron& from)
: HepPolyhedron(from)
{
@@ -46,15 +39,6 @@ G4Polyhedron::G4Polyhedron (const HepPolyhedron& from)
from.fNumberOfRotationSteps;
}
G4Polyhedron& G4Polyhedron::operator = (const G4Polyhedron& from) {
if (&from == this) return *this;
HepPolyhedron::operator = (from);
G4VVisPrim::operator = (from);
fNumberOfRotationStepsAtTimeOfCreation =
from.fNumberOfRotationStepsAtTimeOfCreation;
return *this;
}
G4PolyhedronBox::G4PolyhedronBox (G4double dx, G4double dy, G4double dz):
G4Polyhedron (HepPolyhedronBox (dx, dy, dz)) {}
@@ -143,3 +127,17 @@ G4PolyhedronTubs::G4PolyhedronTubs (G4double Rmin, G4double Rmax, G4double Dz,
G4Polyhedron (HepPolyhedronTubs (Rmin, Rmax, Dz, Phi1, Dphi)) {}
G4PolyhedronTubs::~G4PolyhedronTubs () {}
G4PolyhedronEllipsoid::G4PolyhedronEllipsoid (G4double ax, G4double by,
G4double cz,
G4double zCut1, G4double zCut2):
G4Polyhedron (HepPolyhedronEllipsoid (ax, by, cz, zCut1, zCut2)) {}
G4PolyhedronEllipsoid::~G4PolyhedronEllipsoid () {}
G4PolyhedronEllipticalCone::G4PolyhedronEllipticalCone (G4double ax, G4double ay,
G4double h,
G4double zCut1):
G4Polyhedron (HepPolyhedronEllipticalCone (ax, ay, h, zCut1)) {}
G4PolyhedronEllipticalCone::~G4PolyhedronEllipticalCone () {}
+3 -21
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Polyline.cc,v 1.8 2003/06/16 16:55:23 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Polyline.cc,v 1.9 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison July 1995
@@ -31,26 +31,8 @@
G4Polyline::G4Polyline () {}
G4Polyline::G4Polyline (const G4VVisPrim& prim):
G4VVisPrim (prim)
{}
G4Polyline::~G4Polyline () {}
G4Visible & G4Polyline::operator = (const G4Visible &right) {
return G4Visible::operator = (right);
}
G4VVisPrim & G4Polyline::operator = (const G4VVisPrim &right) {
return G4VVisPrim::operator = (right);
}
G4Polyline & G4Polyline::operator = (const G4Polyline &right) {
if (&right == this) return *this;
G4VVisPrim::operator = (right);
return *this;
}
G4Polyline& G4Polyline::transform (const G4Transform3D& transformation) {
for (iterator i = begin(); i != end(); ++i) i->transform(transformation);
return *this;
@@ -58,7 +40,7 @@ G4Polyline& G4Polyline::transform (const G4Transform3D& transformation) {
std::ostream& operator << (std::ostream& os, const G4Polyline& line) {
os << "G4Polyline: ";
os << '\n' << (G4VVisPrim) line;
os << '\n' << (G4Visible) line;
os << '\n' << (G4Point3DList) line;
return os;
}
+2 -21
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Polymarker.cc,v 1.9 2004/11/11 16:41:27 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Polymarker.cc,v 1.10 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison November 1996
@@ -35,25 +35,6 @@ fMarkerType (G4Polymarker::dots)
G4Polymarker::~G4Polymarker () {}
G4Visible & G4Polymarker::operator = (const G4Visible &right) {
return G4Visible::operator = (right);
}
G4VVisPrim & G4Polymarker::operator = (const G4VVisPrim &right) {
return G4VVisPrim::operator = (right);
}
G4VMarker & G4Polymarker::operator = (const G4VMarker &right) {
return G4VMarker::operator = (right);
}
G4Polymarker & G4Polymarker::operator = (const G4Polymarker &right) {
if (&right == this) return *this;
G4VMarker::operator = (right);
fMarkerType = right.fMarkerType;
return *this;
}
std::ostream& operator << (std::ostream& os, const G4Polymarker& marker) {
os << "G4Polymarker: type: ";
switch (marker.fMarkerType) {
+2 -27
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Scale.cc,v 1.7 2005/03/22 16:49:15 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Scale.cc,v 1.8 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 21st July 2001
@@ -41,31 +41,6 @@ G4Scale::G4Scale (G4double length, const G4String& annotation,
G4Scale::~G4Scale () {}
G4Visible & G4Scale::operator = (const G4Visible &from) {
return G4Visible::operator = (from);
}
G4VVisPrim & G4Scale::operator = (const G4VVisPrim &from) {
return G4VVisPrim::operator = (from);
}
G4VMarker & G4Scale::operator = (const G4VMarker &from) {
return G4VMarker::operator = (from);
}
G4Scale & G4Scale::operator = (const G4Scale &from) {
if (&from == this) return *this;
G4VMarker::operator = (from);
fLength = from.fLength;
fAnnotation = from.fAnnotation;
fDirection = from.fDirection;
fAutoPlacing = from.fAutoPlacing;
fXmid = from.fXmid;
fYmid = from.fYmid;
fZmid = from.fZmid;
return *this;
}
const G4String G4Scale::GuidanceString
(
"An annotated line in the specified direction with tick marks at the"
+2 -20
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Square.cc,v 1.3 2001/07/11 10:01:09 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Square.cc,v 1.4 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
@@ -31,21 +31,3 @@
#include "G4VisAttributes.hh"
G4Square::~G4Square () {}
G4Visible & G4Square::operator = (const G4Visible &right) {
return G4Visible::operator = (right);
}
G4VVisPrim & G4Square::operator = (const G4VVisPrim &right) {
return G4VVisPrim::operator = (right);
}
G4VMarker & G4Square::operator = (const G4VMarker &right) {
return G4VMarker::operator = (right);
}
G4Square& G4Square::operator = (const G4Square& right) {
if (&right == this) return *this;
G4VMarker::operator = (right);
return *this;
}
+2 -24
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Text.cc,v 1.6 2001/07/11 10:01:09 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Text.cc,v 1.7 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 17/11/96.
@@ -50,25 +50,3 @@ fXOffset(0.) , fYOffset(0.)
{}
G4Text::~G4Text () {}
G4Visible & G4Text::operator = (const G4Visible &from) {
return G4Visible::operator = (from);
}
G4VVisPrim & G4Text::operator = (const G4VVisPrim &from) {
return G4VVisPrim::operator = (from);
}
G4VMarker & G4Text::operator = (const G4VMarker &from) {
return G4VMarker::operator = (from);
}
G4Text & G4Text::operator = (const G4Text &from) {
if (&from == this) return *this;
G4VMarker::operator = (from);
fText = from.fText;
fLayout = from.fLayout;
fXOffset = from.fXOffset;
fYOffset = from.fYOffset;
return *this;
}
+13 -41
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4VMarker.cc,v 1.8 2003/06/16 16:55:25 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4VMarker.cc,v 1.9 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
@@ -38,15 +38,6 @@ G4VMarker::G4VMarker ():
fInfo (G4String())
{}
G4VMarker::G4VMarker (const G4VMarker& marker):
G4VVisPrim (marker),
fPosition (marker.fPosition),
fWorldSize (marker.fWorldSize),
fScreenSize (marker.fScreenSize),
fFillStyle (marker.fFillStyle),
fInfo (marker.fInfo)
{}
G4VMarker::G4VMarker (const G4Point3D& pos):
fPosition (pos),
fWorldSize (0.),
@@ -57,23 +48,16 @@ G4VMarker::G4VMarker (const G4Point3D& pos):
G4VMarker::~G4VMarker () {}
G4Visible & G4VMarker::operator = (const G4Visible &right) {
return G4Visible::operator = (right);
}
G4VVisPrim & G4VMarker::operator = (const G4VVisPrim &right) {
return G4VVisPrim::operator = (right);
}
G4VMarker& G4VMarker::operator = (const G4VMarker& right) {
if (&right == this) return *this;
G4VVisPrim::operator = (right);
fPosition = right.fPosition;
fWorldSize = right.fWorldSize;
fScreenSize = right.fScreenSize;
fFillStyle = right.fFillStyle;
fInfo = right.fInfo;
return *this;
G4bool G4VMarker::operator != (const G4VMarker& m) const {
if (
(G4Visible::operator != (m)) ||
(fWorldSize != m.fWorldSize) ||
(fScreenSize != m.fScreenSize) ||
(fFillStyle != m.fFillStyle) ||
!(fPosition == m.fPosition)
)
return true;
return false;
}
std::ostream& operator << (std::ostream& os, const G4VMarker& marker) {
@@ -94,22 +78,10 @@ std::ostream& operator << (std::ostream& os, const G4VMarker& marker) {
default:
os << "unrecognised"; break;
}
os << "\n " << (G4VVisPrim) marker;
os << "\n " << (G4Visible) marker;
return os;
}
G4bool G4VMarker::operator != (const G4VMarker& m) const {
if (
!(G4VVisPrim::operator == (m)) ||
(fWorldSize != m.fWorldSize) ||
(fScreenSize != m.fScreenSize) ||
(fFillStyle != m.fFillStyle) ||
!(fPosition == m.fPosition)
)
return true;
return false;
}
const G4String& G4VMarker::GetInfo() const { return fInfo ;}
void G4VMarker::SetInfo( const G4String& info ){ fInfo = info ;}
@@ -21,42 +21,25 @@
// ********************************************************************
//
//
// $Id: G4VVisPrim.hh,v 1.9 2003/06/16 16:55:13 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4VVisManager.cc,v 1.3 2005/10/17 20:54:29 tinslay Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison August 1995
// Abstract interface for GEANT4 Visualization Manager.
// John Allison 19/Oct/1996.
// Class Description:
// Virtual base class for Visualization Primitives
// (or Visualization Representations, as they are sometimes called).
// Class Description - End:
#include "G4VVisManager.hh"
#ifndef G4VVISPRIM_HH
#define G4VVISPRIM_HH
G4VVisManager::~G4VVisManager () {}
#include "G4Visible.hh"
#include <iostream>
G4VVisManager* G4VVisManager::fpConcreteInstance = 0;
class G4VisAttributes;
G4VVisManager* G4VVisManager::GetConcreteInstance ()
{
return fpConcreteInstance;
}
class G4VVisPrim: public G4Visible {
friend std::ostream& operator << (std::ostream& os, const G4VVisPrim& prim);
public: // With description
G4VVisPrim ();
G4VVisPrim (const G4VVisPrim& prim);
G4VVisPrim (const G4VisAttributes* pVA);
virtual ~G4VVisPrim ();
virtual G4Visible& operator = (const G4Visible& right);
virtual G4VVisPrim& operator = (const G4VVisPrim& right);
virtual G4bool operator == (const G4Visible& right) const;
virtual G4bool operator == (const G4VVisPrim& right) const;
};
#endif
void G4VVisManager::SetConcreteInstance (G4VVisManager* m)
{
fpConcreteInstance = m;
}
-66
View File
@@ -1,66 +0,0 @@
//
// ********************************************************************
// * 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: G4VVisPrim.cc,v 1.8 2003/06/16 16:55:26 gunter Exp $
// GEANT4 tag $Name: geant4-07-01 $
//
//
// John Allison August 1995
#include "G4VVisPrim.hh"
#include "G4VisAttributes.hh"
#include "G4ios.hh"
G4VVisPrim::G4VVisPrim () {}
G4VVisPrim::G4VVisPrim (const G4VVisPrim& prim):
G4Visible (prim)
{}
G4VVisPrim::G4VVisPrim (const G4VisAttributes* pVA):
G4Visible (pVA)
{}
G4VVisPrim::~G4VVisPrim () {}
G4Visible& G4VVisPrim::operator = (const G4Visible& right) {
return G4Visible::operator = (right);
}
G4VVisPrim& G4VVisPrim::operator = (const G4VVisPrim& right) {
if (&right == this) return *this;
G4Visible::operator = (right);
return *this;
}
G4bool G4VVisPrim::operator == (const G4Visible& right) const{
return G4Visible::operator == (right);
}
G4bool G4VVisPrim::operator == (const G4VVisPrim& right) const{
return G4Visible::operator == (right);
}
std::ostream& operator << (std::ostream& os, const G4VVisPrim& prim) {
return os << (G4Visible) prim;
}
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VisAttributes.cc,v 1.10 2004/07/28 15:44:32 johna Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 23rd October 1996
+1 -1
View File
@@ -22,7 +22,7 @@
//
//
// $Id: G4VisExtent.cc,v 1.9 2005/02/19 22:00:11 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// A.Walkden 28/11/95
+12 -11
View File
@@ -21,8 +21,8 @@
// ********************************************************************
//
//
// $Id: G4Visible.cc,v 1.12 2005/05/26 10:34:55 allison Exp $
// GEANT4 tag $Name: geant4-07-01 $
// $Id: G4Visible.cc,v 1.13 2005/07/05 14:04:02 allison Exp $
// GEANT4 tag $Name: geant4-08-00 $
//
//
// John Allison 30th October 1996
@@ -32,22 +32,23 @@
#include "G4VisAttributes.hh"
#include "G4ios.hh"
G4Visible::G4Visible (): fpVisAttributes (0) {}
G4Visible::~G4Visible () {}
G4Visible& G4Visible::operator = (const G4Visible& right) {
if (&right == this) return *this;
fpVisAttributes = right.fpVisAttributes;
return *this;
}
G4bool G4Visible::operator == (const G4Visible& right) const{
return fpVisAttributes == right.fpVisAttributes;
}
G4Visible::G4Visible (const G4VisAttributes* pVA):
fpVisAttributes (pVA)
{}
void G4Visible::SetVisAttributes (const G4VisAttributes& VA) {
fpVisAttributes = new G4VisAttributes(VA);
}
G4bool G4Visible::operator != (const G4Visible& right) const {
// Simple test on non-equality of address...
return fpVisAttributes != right.fpVisAttributes;
}
std::ostream& operator << (std::ostream& os, const G4Visible& v) {
if (v.fpVisAttributes) return os << *(v.fpVisAttributes);
else return os << "No Visualization Attributes";
File diff suppressed because it is too large Load Diff