Import Geant4 1.0.0 source tree
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# $Id: GNUmakefile,v 1.7 1999/12/01 15:21:07 morita Exp $
|
||||
|
||||
name := G4pgeomBoolean
|
||||
G4ODBMS := true
|
||||
G4ODBMS_INSTALLATION := true
|
||||
|
||||
ifndef G4INSTALL
|
||||
G4INSTALL = ../../../../..
|
||||
endif
|
||||
|
||||
include $(G4INSTALL)/config/architecture.gmk
|
||||
|
||||
G4OODDLX_BOOT := $(G4TMPSCHEMA_BOOT)
|
||||
|
||||
CPPFLAGS += \
|
||||
-Iinclude \
|
||||
-I$(G4SCHEMA_HEADER_DIR) \
|
||||
-I$(G4TMP)/$(G4SYSTEM)/G4pgeomGlobal \
|
||||
-I$(G4BASE)/persistency/global/include \
|
||||
-I$(G4BASE)/persistency/geometry/global/include \
|
||||
-I$(G4BASE)/persistency/management/include \
|
||||
-I$(G4BASE)/global/management/include \
|
||||
-I$(G4BASE)/global/HEPGeometry/include \
|
||||
-I$(G4BASE)/geometry/management/include \
|
||||
-I$(G4BASE)/geometry/magneticfield/include \
|
||||
-I$(G4BASE)/geometry/volumes/include \
|
||||
-I$(G4BASE)/geometry/solids/Boolean/include
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
include $(G4INSTALL)/config/G4ODBMS_BUILD.gmk
|
||||
|
||||
include $(G4INSTALL)/config/common.gmk
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
# Explicit DDL dependencies:
|
||||
|
||||
#--------------------------------------------------------------------
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
// Persistent base class for solids created by boolean operations
|
||||
// between other solids
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial Creation
|
||||
|
||||
#ifndef G4PBOOLEANSOLID_DDL
|
||||
#define G4PBOOLEANSOLID_DDL
|
||||
|
||||
#include "G4PVSolid.hh"
|
||||
#include "G4PersistentSchema.hh"
|
||||
|
||||
class G4PBooleanSolid
|
||||
: public G4PVSolid
|
||||
{
|
||||
public:
|
||||
G4PBooleanSolid( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB );
|
||||
virtual ~G4PBooleanSolid();
|
||||
|
||||
virtual G4VSolid* MakeTransientBooleanSolid(
|
||||
G4VSolid* aSolidA,
|
||||
G4VSolid* aSolidB ) const = 0;
|
||||
|
||||
public: // With Description
|
||||
// If Solid is made up from a Boolean operation of two solids,
|
||||
// return the corresponding solid (for no=0 and 1)
|
||||
// If the solid is not a "Boolean", return 0
|
||||
virtual const HepRef(G4PVSolid) GetConstituentSolid(G4int no) const;
|
||||
virtual HepRef(G4PVSolid) GetConstituentSolid(G4int no);
|
||||
|
||||
protected:
|
||||
d_Ref<G4PVSolid> fPtrSolidA;
|
||||
d_Ref<G4PVSolid> fPtrSolidB;
|
||||
|
||||
private:
|
||||
G4bool createdDisplacedSolid;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
// Persistent class describing solid placements for boolean operations
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
|
||||
#ifndef G4PDisplacedSolid_DDL
|
||||
#define G4PDisplacedSolid_DDL
|
||||
|
||||
#include "G4PersistentSchema.hh"
|
||||
#include "G4PVSolid.hh"
|
||||
#include "G4PAffineTransform.hh"
|
||||
|
||||
class G4VSolid;
|
||||
|
||||
class G4PDisplacedSolid
|
||||
: public G4PVSolid
|
||||
{
|
||||
public:
|
||||
G4PDisplacedSolid ( HepRef(G4PVSolid) persCostituentSolid,
|
||||
HepRef(G4PAffineTransform) pDirectTransform );
|
||||
virtual ~G4PDisplacedSolid();
|
||||
|
||||
G4VSolid* MakeTransientObject() const;
|
||||
|
||||
G4VSolid* MakeTransientDisplacedSolid(G4VSolid* aSolid) const;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const
|
||||
{ return G4String("G4DisplacedSolid"); }
|
||||
|
||||
HepRef(G4PVSolid) GetConstituentMovedSolid();
|
||||
|
||||
protected:
|
||||
d_Ref<G4PVSolid> fPtrSolid;
|
||||
// fPtrTransform can be created by fDirectTransform.Inverse()
|
||||
d_Ref<G4PAffineTransform> fDirectTransform;
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,38 @@
|
||||
// Persistent class for description of intersection of two CSG solids
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
|
||||
#ifndef G4PINTERSECTIONSOLID_DDL
|
||||
#define G4PINTERSECTIONSOLID_DDL
|
||||
|
||||
#include "G4PersistentSchema.hh"
|
||||
#include "G4PBooleanSolid.hh"
|
||||
|
||||
class G4VSolid;
|
||||
|
||||
class G4PIntersectionSolid: public G4PBooleanSolid
|
||||
{
|
||||
public:
|
||||
G4PIntersectionSolid( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB );
|
||||
virtual ~G4PIntersectionSolid() ;
|
||||
|
||||
G4VSolid* MakeTransientObject() const;
|
||||
|
||||
G4VSolid* MakeTransientBooleanSolid(
|
||||
G4VSolid* aSolidA,
|
||||
G4VSolid* aSolidB ) const;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const
|
||||
{ return G4String("G4IntersectionSolid"); }
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// Persistent class for description of subtraction of two CSG solids: A - B
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
//
|
||||
|
||||
#ifndef G4PSUBTRACTIONSOLID_DDL
|
||||
#define G4PSUBTRACTIONSOLID_DDL
|
||||
|
||||
#include "G4PersistentSchema.hh"
|
||||
#include "G4PBooleanSolid.hh"
|
||||
|
||||
class G4VSolid;
|
||||
|
||||
class G4PSubtractionSolid
|
||||
: public G4PBooleanSolid
|
||||
{
|
||||
public:
|
||||
G4PSubtractionSolid( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB );
|
||||
virtual ~G4PSubtractionSolid() ;
|
||||
|
||||
G4VSolid* MakeTransientObject() const;
|
||||
|
||||
G4VSolid* MakeTransientBooleanSolid(
|
||||
G4VSolid* aSolidA,
|
||||
G4VSolid* aSolidB ) const;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const
|
||||
{ return G4String("G4SubtractionSolid"); }
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
// Persistent class for description of intersection of two CSG solids
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
//
|
||||
|
||||
#ifndef G4PUNIONSOLID_DDL
|
||||
#define G4PUNIONSOLID_DDL
|
||||
|
||||
#include "G4PersistentSchema.hh"
|
||||
#include "G4PBooleanSolid.hh"
|
||||
|
||||
class G4VSolid;
|
||||
|
||||
class G4PUnionSolid
|
||||
: public G4PBooleanSolid
|
||||
{
|
||||
public:
|
||||
G4PUnionSolid( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB );
|
||||
virtual ~G4PUnionSolid() ;
|
||||
|
||||
G4VSolid* MakeTransientObject() const;
|
||||
|
||||
G4VSolid* MakeTransientBooleanSolid(
|
||||
G4VSolid* aSolidA,
|
||||
G4VSolid* aSolidB ) const;
|
||||
|
||||
virtual G4GeometryType GetEntityType() const
|
||||
{ return G4String("G4UnionSolid"); }
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
// Persistent base class for solids created by boolean operations
|
||||
// between other solids
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial Creation
|
||||
|
||||
#include "G4PBooleanSolid.hh"
|
||||
|
||||
G4PBooleanSolid::G4PBooleanSolid( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB )
|
||||
: G4PVSolid(pName),
|
||||
createdDisplacedSolid(false)
|
||||
{
|
||||
fPtrSolidA = persSolidA;
|
||||
fPtrSolidB = persSolidB;
|
||||
}
|
||||
|
||||
G4PBooleanSolid::~G4PBooleanSolid()
|
||||
{;}
|
||||
|
||||
///////////////////////////////////////////////////////////////
|
||||
//
|
||||
// If Solid is made up from a Boolean operation of two solids,
|
||||
// return the corresponding solid (for no=0 and 1)
|
||||
// If the solid is not a "Boolean", return 0
|
||||
const HepRef(G4PVSolid) G4PBooleanSolid::GetConstituentSolid(G4int no) const
|
||||
{
|
||||
HepRef(G4PVSolid) subSolid;
|
||||
if( no == 0 )
|
||||
subSolid = fPtrSolidA;
|
||||
else if( no == 1 )
|
||||
subSolid = fPtrSolidB;
|
||||
else
|
||||
G4Exception("G4PBooleanSolid::GetConstituentSolid()const invalid subsolid index");
|
||||
|
||||
const HepRef(G4PVSolid) theSolid = subSolid;
|
||||
return theSolid;
|
||||
}
|
||||
|
||||
HepRef(G4PVSolid) G4PBooleanSolid::GetConstituentSolid(G4int no)
|
||||
{
|
||||
HepRef(G4PVSolid) subSolid;
|
||||
if( no == 0 )
|
||||
subSolid = fPtrSolidA;
|
||||
else if( no == 1 )
|
||||
subSolid = fPtrSolidB;
|
||||
else
|
||||
G4Exception("G4PBooleanSolid::GetConstituentSolid invalid subsolid index");
|
||||
|
||||
return subSolid;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
// Persistent class describing solid placements for boolean operations
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
|
||||
#include "G4PDisplacedSolid.hh"
|
||||
#include "G4DisplacedSolid.hh"
|
||||
#include "G4AffineTransform.hh"
|
||||
|
||||
#include "G4VSolid.hh"
|
||||
|
||||
G4PDisplacedSolid::G4PDisplacedSolid
|
||||
( HepRef(G4PVSolid) persCostituentSolid,
|
||||
HepRef(G4PAffineTransform) pDirectTransform )
|
||||
{
|
||||
fPtrSolid = persCostituentSolid;
|
||||
fDirectTransform = pDirectTransform;
|
||||
}
|
||||
|
||||
G4PDisplacedSolid::~G4PDisplacedSolid()
|
||||
{;}
|
||||
|
||||
HepRef(G4PVSolid) G4PDisplacedSolid::GetConstituentMovedSolid()
|
||||
{ return fPtrSolid; }
|
||||
|
||||
G4VSolid* G4PDisplacedSolid::MakeTransientObject() const
|
||||
{ return 0; }
|
||||
|
||||
G4VSolid* G4PDisplacedSolid::MakeTransientDisplacedSolid
|
||||
(G4VSolid* movedSolid) const
|
||||
{
|
||||
G4AffineTransform aTransform = fDirectTransform->MakeTransientObject();
|
||||
|
||||
G4VSolid* theSolid = new G4DisplacedSolid
|
||||
( GetName(), movedSolid, aTransform );
|
||||
return theSolid;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
// Persistent class for description of intersection of two CSG solids
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
|
||||
#include "G4PIntersectionSolid.hh"
|
||||
#include "G4IntersectionSolid.hh"
|
||||
|
||||
|
||||
G4PIntersectionSolid::G4PIntersectionSolid
|
||||
( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB )
|
||||
: G4PBooleanSolid(pName, persSolidA, persSolidB)
|
||||
{;}
|
||||
|
||||
G4PIntersectionSolid::~G4PIntersectionSolid()
|
||||
{;}
|
||||
|
||||
G4VSolid* G4PIntersectionSolid::MakeTransientObject() const
|
||||
{ return 0; }
|
||||
|
||||
G4VSolid* G4PIntersectionSolid::MakeTransientBooleanSolid(
|
||||
G4VSolid* aSolidA,
|
||||
G4VSolid* aSolidB ) const
|
||||
{
|
||||
return new G4IntersectionSolid( GetName(), aSolidA, aSolidB );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
// Persistent class for description of subtraction of two CSG solids: A - B
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
//
|
||||
|
||||
#include "G4PSubtractionSolid.hh"
|
||||
#include "G4SubtractionSolid.hh"
|
||||
|
||||
G4PSubtractionSolid::G4PSubtractionSolid( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB )
|
||||
: G4PBooleanSolid(pName, persSolidA, persSolidB)
|
||||
{;}
|
||||
|
||||
G4PSubtractionSolid::~G4PSubtractionSolid()
|
||||
{;}
|
||||
|
||||
G4VSolid* G4PSubtractionSolid::MakeTransientObject() const
|
||||
{ return 0; }
|
||||
|
||||
G4VSolid* G4PSubtractionSolid::MakeTransientBooleanSolid(
|
||||
G4VSolid* aSolidA,
|
||||
G4VSolid* aSolidB ) const
|
||||
{
|
||||
return new G4SubtractionSolid( GetName(), aSolidA, aSolidB );
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
// Persistent class for description of intersection of two CSG solids
|
||||
//
|
||||
// History:
|
||||
// 10.11.99 Y.Morita, Initial creation
|
||||
//
|
||||
|
||||
#include "G4PUnionSolid.hh"
|
||||
#include "G4UnionSolid.hh"
|
||||
|
||||
G4PUnionSolid::G4PUnionSolid( const G4String& pName,
|
||||
HepRef(G4PVSolid) persSolidA,
|
||||
HepRef(G4PVSolid) persSolidB )
|
||||
: G4PBooleanSolid(pName, persSolidA, persSolidB)
|
||||
{;}
|
||||
|
||||
G4PUnionSolid::~G4PUnionSolid()
|
||||
{;}
|
||||
|
||||
G4VSolid* G4PUnionSolid::MakeTransientObject() const
|
||||
{ return 0; }
|
||||
|
||||
G4VSolid* G4PUnionSolid::MakeTransientBooleanSolid(
|
||||
G4VSolid* aSolidA,
|
||||
G4VSolid* aSolidB ) const
|
||||
{
|
||||
return new G4UnionSolid( GetName(), aSolidA, aSolidB );
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user