Import Geant4 0.0.0 source tree

This commit is contained in:
Gabriele Cosmo
2016-06-01 15:25:35 +02:00
parent 54d6b71f95
commit b97f8d0df7
3237 changed files with 807095 additions and 0 deletions
@@ -0,0 +1,25 @@
# $Id: GNUmakefile,v 1.1 1998/07/09 19:10:25 japost Exp $
# -------------------------------------------------------------
# GNUmakefile for STEP library. Gabriele Cosmo, 15/11/96.
# -------------------------------------------------------------
name := G4stepinterface
ifndef G4INSTALL
G4INSTALL = ../../../..
endif
include $(G4INSTALL)/config/architecture.gmk
CPPFLAGS += \
-I$(G4BASE)/geometry/solids/STEP/include \
-I$(G4BASE)/geometry/solids/BREPS/include \
-I$(G4BASE)/geometry/management/include \
-I$(G4BASE)/geometry/volumes/include \
-I$(G4BASE)/global/management/include \
-I$(G4BASE)/global/HEPRandom/include \
-I$(G4BASE)/global/HEPGeometry/include \
-I$(G4BASE)/graphics_reps/include
include $(G4INSTALL)/config/common.gmk
@@ -0,0 +1,73 @@
History file for geometry/solids/STEPinterface
revision 1.9
date: 1998/12/09 12:00:42; author: broglia; state: Exp; lines: +22 -37
December 9, 1998 : L. Broglia
- Make the possibility to read a STEP file containing
an assembly of assemblies.
G4AdvancedBrepShapeRepresentation can have 1 or more
Manifold solid, so the creator return an array of
G4BREPSolid (class G4BREPSolidVector)
G4ContextDependentShapeRepresentationCreator and
G4RepresentationRelationshipCreator create G4AdvancedBrepShapeRepresentation,
so I modified the 'return' type (now G4BREPSolidVector)
G4AssemblyCreator create an assembly of solids, so a STEP file containing
an assembly of assemblies is saved into an assembly of solids.
----------------------------
revision 1.6
November 17, 1998 : L. Broglia
- Modify G4AssemblyCreator, made of 0 or 1 Axis2Placement3D
and 1 or more ManifoldSolidBrep
November 6, 1998 L. Broglia
- Implement CreateG4Geometry in G4CircleCreator, G4CylindricalSurfaceCreator,
G4CylindricalSurfaceCreator.cc, G4SphericalSurfaceCreator.cc
----------------------------
revision 1.4
date: 1998/07/29 00:45:22; author: gcosmo; state: Exp; lines: +2 -1
Porting on DEC-cxx 6.0: for-loop usage fixed
----------------------------
revision 1.3
date: 1998/07/12 02:58:03; author: urbi; state: Exp; lines: +1 -1
branches: 1.3.6;
Renaming methods.
----------------------------
revision 1.2
date: 1998/07/10 20:55:42; author: japost; state: Exp; lines: +4 -4
Changed
::G4GeometryTable::Register
to
G4GeometryTable::Register
in order to allow it to compile on DEC-AFS.
Also deleted unneeded ";" after {} of functions. (Warnings on DEC)
----------------------------
revision 1.1
date: 1998/07/08 15:26:35; author: jsulkimo; state: Exp;
First version of STEPinterface.
Compiled on AIX & Linux
----------------------------
revision 1.3.6.1
date: 1998/08/21 14:37:27; author: allison; state: Exp; lines: +2 -1
HEAD version now temporarily in beta01-02-branch.
=============================================================================
@@ -0,0 +1,28 @@
#ifndef G4ADVANCEDBREPSHAPEREPRESENTATIONCREATOR_HH
#define G4ADVANCEDBREPSHAPEREPRESENTATIONCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4AdvancedBrepShapeRepresentationCreator: private G4GeometryCreator
{
public:
//Constructor
G4AdvancedBrepShapeRepresentationCreator();
~G4AdvancedBrepShapeRepresentationCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Advanced_Brep_Shape_Representation";};
static G4AdvancedBrepShapeRepresentationCreator GetInstance(){return csc;};
//Members
private:
static G4AdvancedBrepShapeRepresentationCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4ADVANCEDFACECREATOR_HH
#define G4ADVANCEDFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4AdvancedFaceCreator; // Forward declararation -> Simone
class G4AdvancedFaceCreator: private G4GeometryCreator
{
public:
//Constructor
G4AdvancedFaceCreator();
~G4AdvancedFaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Advanced_Face";};
static G4AdvancedFaceCreator GetInstance(){return csc;};
//Members
private:
static G4AdvancedFaceCreator csc;
};
#endif
@@ -0,0 +1,44 @@
#ifndef G4ASSEMBLYCREATOR_HH
#define G4ASSEMBLYCREATOR_HH
#include "G4GeometryTable.hh"
#include "G4StepFileReader.hh"
#include "G4NISTStepReader.hh"
#include "G4AdvancedBrepShapeRepresentationCreator.hh"
#include "G4ManifoldSolidBrepCreator.hh"
#include "G4ClosedShellCreator.hh"
#include "G4OpenShellCreator.hh"
#include "G4PointCreator.hh"
class G4AssemblyCreator: public G4GeometryCreator
{
public:
// Constructor
G4AssemblyCreator();
G4AssemblyCreator(G4String, G4String ="NIST");
// Destructor
~G4AssemblyCreator();
//Member functions
void ReadStepFile();
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Assembly";}
static G4AssemblyCreator GetInstance(){return ci;}
//Members
int index; // add by L. Broglia, memory for get STEP entity
private:
G4StepFileReader* StepReader;
G4String STEPfileName;
static G4AssemblyCreator ci;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4AXIS1PLACEMENTCREATOR_HH
#define G4AXIS1PLACEMENTCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4Axis1PlacementCreator: private G4GeometryCreator
{
public:
//Constructor
G4Axis1PlacementCreator();
~G4Axis1PlacementCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Axis1_Placement";};
static G4Axis1PlacementCreator GetInstance(){return csc;};
//Members
private:
static G4Axis1PlacementCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4AXIS2PLACEMENT2DCREATOR_HH
#define G4AXIS2PLACEMENT2DCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4Axis2Placement2dCreator: private G4GeometryCreator
{
public:
//Constructor
G4Axis2Placement2dCreator();
~G4Axis2Placement2dCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Axis2_Placement_2d";};
static G4Axis2Placement2dCreator GetInstance(){return csc;};
//Members
private:
static G4Axis2Placement2dCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4AXIS2PLACEMENT3DCREATOR_HH
#define G4AXIS2PLACEMENT3DCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4Axis2Placement3dCreator: private G4GeometryCreator
{
public:
//Constructor
G4Axis2Placement3dCreator();
~G4Axis2Placement3dCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Axis2_Placement_3d";};
static G4Axis2Placement3dCreator GetInstance(){return csc;};
//Members
private:
static G4Axis2Placement3dCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4AXIS2PLACEMENTCREATOR_HH
#define G4AXIS2PLACEMENTCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4Axis2PlacementCreator: private G4GeometryCreator
{
public:
//Constructor
G4Axis2PlacementCreator();
~G4Axis2PlacementCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Axis2_Placement";};
static G4Axis2PlacementCreator GetInstance(){return csc;};
//Members
private:
static G4Axis2PlacementCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4AXIS2PLACEMENTSCREATOR_HH
#define G4AXIS2PLACEMENTSCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4Axis2PlacementsCreator: private G4GeometryCreator
{
public:
//Constructor
G4Axis2PlacementsCreator();
~G4Axis2PlacementsCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Axis2_Placements";};
static G4Axis2PlacementsCreator GetInstance(){return csc;};
//Members
private:
static G4Axis2PlacementsCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4BSPLINECURVEWITHKNOTSCREATOR_HH
#define G4BSPLINECURVEWITHKNOTSCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4BSplineCurveWithKnotsCreator: private G4GeometryCreator
{
public:
//Constructor
G4BSplineCurveWithKnotsCreator();
~G4BSplineCurveWithKnotsCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "B_Spline_Curve_With_Knots";};
static G4BSplineCurveWithKnotsCreator GetInstance(){return csc;};
//Members
private:
static G4BSplineCurveWithKnotsCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4BSPLINESURFACECREATOR_HH
#define G4BSPLINESURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4BSplineSurfaceCreator: public G4GeometryCreator
{
public:
//Constructor
G4BSplineSurfaceCreator();
~G4BSplineSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "B_Spline_Surface";};
static G4BSplineSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4BSplineSurfaceCreator csc;
};
#endif
@@ -0,0 +1,30 @@
#ifndef G4BSPLINESURFACEWITHKNOTSCREATOR_HH
#define G4BSPLINESURFACEWITHKNOTSCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4BSplineSurfaceCreator.hh"
#include "G4ControlPoints.hh"
class G4BSplineSurfaceWithKnotsCreator: public G4BSplineSurfaceCreator
{
public:
//Constructor
G4BSplineSurfaceWithKnotsCreator();
~G4BSplineSurfaceWithKnotsCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "B_Spline_Surface_With_Knots";};
static G4BSplineSurfaceWithKnotsCreator GetInstance(){return csc;};
//Members
private:
static G4BSplineSurfaceWithKnotsCreator csc;
};
#endif
@@ -0,0 +1,30 @@
#ifndef G4BOUNDEDSURFACECREATOR_HH
#define G4BOUNDEDSURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4ControlPoints.hh"
#include "G4BSplineSurface.hh"
class G4BoundedSurfaceCreator: private G4GeometryCreator
{
public:
//Constructor
G4BoundedSurfaceCreator();
~G4BoundedSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Bounded_Surface";};
static G4BoundedSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4BoundedSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4CARTESIANPOINTCREATOR_HH
#define G4CARTESIANPOINTCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4CartesianPointCreator: private G4GeometryCreator
{
public:
//Constructor
G4CartesianPointCreator();
~G4CartesianPointCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Cartesian_Point";};
static G4CartesianPointCreator GetInstance(){return csc;};
//Members
private:
static G4CartesianPointCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4CIRCLECREATOR_HH
#define G4CIRCLECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4CircleCreator: private G4GeometryCreator
{
public:
//Constructor
G4CircleCreator();
~G4CircleCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Circle";};
static G4CircleCreator GetInstance(){return csc;};
//Members
private:
static G4CircleCreator csc;
};
#endif
@@ -0,0 +1,29 @@
#ifndef G4CLOSEDSHELLCREATOR_HH
#define G4CLOSEDSHELLCREATOR_HH
#include "G4ConnectedFaceSetCreator.hh"
#include "G4GeometryTable.hh"
#include "G4BREPSolid.hh"
class G4ClosedShellCreator: public G4ConnectedFaceSetCreator
{
public:
//Constructor
G4ClosedShellCreator();
~G4ClosedShellCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Closed_Shell";};
static G4ClosedShellCreator GetInstance(){return csc;};
//Members
private:
static G4ClosedShellCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4CONICCREATOR_HH
#define G4CONICCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ConicCreator: private G4GeometryCreator
{
public:
//Constructor
G4ConicCreator();
~G4ConicCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Conic";};
static G4ConicCreator GetInstance(){return csc;};
//Members
private:
static G4ConicCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4CONICALSURFACECREATOR_HH
#define G4CONICALSURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ConicalSurfaceCreator: private G4GeometryCreator
{
public:
//Constructor
G4ConicalSurfaceCreator();
~G4ConicalSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Conical_Surface";};
static G4ConicalSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4ConicalSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4CONNECTEDFACESETCREATOR_HH
#define G4CONNECTEDFACESETCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ConnectedFaceSetCreator: public G4GeometryCreator
{
public:
//Constructor
G4ConnectedFaceSetCreator();
~G4ConnectedFaceSetCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Connected_Face_Set";};
static G4ConnectedFaceSetCreator GetInstance(){return csc;};
//Members
private:
static G4ConnectedFaceSetCreator csc;
};
#endif
@@ -0,0 +1,27 @@
#ifndef G4CONTEXTDEPENDENTSHAPEREPRESENTATIONCREATOR_HH
#define G4CONTEXTDEPENDENTSHAPEREPRESENTATIONCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ContextDependentShapeRepresentationCreator: private G4GeometryCreator
{
public:
//Constructor
G4ContextDependentShapeRepresentationCreator();
~G4ContextDependentShapeRepresentationCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Context_Dependent_Shape_Representation";};
static G4ContextDependentShapeRepresentationCreator GetInstance(){return csc;};
//Members
private:
static G4ContextDependentShapeRepresentationCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4CURVECREATOR_HH
#define G4CURVECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4CurveCreator: private G4GeometryCreator
{
public:
//Constructor
G4CurveCreator();
~G4CurveCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Curve";};
static G4CurveCreator GetInstance(){return csc;};
//Members
private:
static G4CurveCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4CYLINDRICALSURFACECREATOR_HH
#define G4CYLINDRICALSURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4CylindricalSurfaceCreator: private G4GeometryCreator
{
public:
//Constructor
G4CylindricalSurfaceCreator();
~G4CylindricalSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Cylindrical_Surface";};
static G4CylindricalSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4CylindricalSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4DIRECTIONCREATOR_HH
#define G4DIRECTIONCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4DirectionCreator: private G4GeometryCreator
{
public:
//Constructor
G4DirectionCreator();
~G4DirectionCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Direction";};
static G4DirectionCreator GetInstance(){return csc;};
//Members
private:
static G4DirectionCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4EDGECURVECREATOR_HH
#define G4EDGECURVECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4EdgeCurveCreator: private G4GeometryCreator
{
public:
//Constructor
G4EdgeCurveCreator();
~G4EdgeCurveCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Edge_Curve";};
static G4EdgeCurveCreator GetInstance(){return csc;};
//Members
private:
static G4EdgeCurveCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4EDGELOOPCREATOR_HH
#define G4EDGELOOPCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4EdgeLoopCreator: private G4GeometryCreator
{
public:
//Constructor
G4EdgeLoopCreator();
~G4EdgeLoopCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Edge_Loop";};
static G4EdgeLoopCreator GetInstance(){return csc;};
//Members
private:
static G4EdgeLoopCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4ELLIPSECREATOR_HH
#define G4ELLIPSECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4EllipseCreator: private G4GeometryCreator
{
public:
//Constructor
G4EllipseCreator();
~G4EllipseCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Ellipse";};
static G4EllipseCreator GetInstance(){return csc;};
//Members
private:
static G4EllipseCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4FACEBOUNDCREATOR_HH
#define G4FACEBOUNDCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4FaceBoundCreator: public G4GeometryCreator
{
public:
//Constructor
G4FaceBoundCreator();
~G4FaceBoundCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Face_Bound";};
static G4FaceBoundCreator GetInstance(){return csc;};
//Members
private:
static G4FaceBoundCreator csc;
};
#endif
@@ -0,0 +1,29 @@
#ifndef G4FACEOUTERBOUNDCREATOR_HH
#define G4FACEOUTERBOUNDCREATOR_HH
#include "G4GeometryCreator.hh"
//#include "G4GeometryTable.hh"
#include "G4FaceBoundCreator.hh"
class G4FaceOuterBoundCreator: public G4FaceBoundCreator
{
public:
//Constructor
G4FaceOuterBoundCreator();
~G4FaceOuterBoundCreator();
//Member functions
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Face_Outer_Bound";};
static G4FaceOuterBoundCreator GetInstance(){return csc;};
//Members
private:
static G4FaceOuterBoundCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4FACESURFACECREATOR_HH
#define G4FACESURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4FaceSurfaceCreator: public G4GeometryCreator
{
public:
//Constructor
G4FaceSurfaceCreator();
~G4FaceSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Face_Surface";};
static G4FaceSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4FaceSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4GEOMETRICREPRESENTATIONCONTEXTCREATOR_HH
#define G4GEOMETRICREPRESENTATIONCONTEXTCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4GeometricRepresentationContextCreator: private G4GeometryCreator
{
public:
//Constructor
G4GeometricRepresentationContextCreator();
~G4GeometricRepresentationContextCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Geometric_Representation_Context";};
static G4GeometricRepresentationContextCreator GetInstance(){return csc;};
//Members
private:
static G4GeometricRepresentationContextCreator csc;
};
#endif
@@ -0,0 +1,63 @@
#ifndef G4GEOMETRYCREATOR_HH
#define G4GEOMETRYCREATOR_HH
//#include "G4OrderedTable.hh"
#include "G4STEPEntity.hh"
#include "G4NISTStepReader.hh"
#include "G4Curve.hh"
#include "G4PlacedSolid.hh"
//#include "G4Placement.hh"
#include "G4Axis2Placement3D.hh"
//typedef RWTPtrOrderedVector<G4Curve> G4CurveVector;
//typedef RWTPtrOrderedVector<G4CurveVector> G4BoundaryVector;
typedef RWTPtrOrderedVector<G4PlacedSolid> G4PlacedSolidVector;
//typedef RWTPtrOrderedVector<G4GeometryCreator> G4CreatorVector;
typedef RWTPtrOrderedVector<G4Surface> G4SurfaceVector;
typedef RWTPtrOrderedVector<G4BREPSolid> G4SolidVector;
//typedef RWTPtrOrderedVector<G4Placement> G4PlacementVector;
//#include "G4STEPEntity.hh"
//erator ==(class RWTPtrOrderedVector<G4Curve> a, class RWTPtrOrderedVector<G4Curve> b){}
#include "globals.hh"
#include "instmgr.h"
#include "STEPentity.h"
#include "STEPaggregate.h"
#include "G4Curve.hh"
//#include "G4Surface.hh"
#include "G4FPlane.hh"
#include "G4FConicalSurface.hh"
#include "G4FCylindricalSurface.hh"
#include "G4CylindricalSurface.hh"
#include "G4ToroidalSurface.hh"
#include "G4SphericalSurface.hh"
#include "G4PlacedSolid.hh"
class G4GeometryCreator
{
public:
G4GeometryCreator(){}
virtual ~G4GeometryCreator(){};
virtual void CreateG4Geometry(STEPentity&)=0;
virtual void CreateSTEPGeometry(void* =0)=0;
virtual void* GetCreatedObject(){return createdObject;}
virtual G4String Name()=0;
virtual G4bool operator==(const G4GeometryCreator&){return 0;}
virtual STEPattribute* GetNamedAttribute(G4String&,STEPentity&);
virtual STEPentity* GetNamedEntity(G4String&,STEPentity&);
G4int GetNextId(){objectId +=10 ; return objectId; }
static G4int objectId;
static InstMgr instanceManager;
void* createdObject;
};
#endif
@@ -0,0 +1,48 @@
#ifndef G4GEOMETRYTABLE_HH
#define G4GEOMETRYTABLE_HH
#include "G4GeometryCreator.hh"
//#include "G4OrderedTable.hh"
//#include "G4NISTStepReader.hh"
//typedef RWTPtrOrderedVector<G4Curve> G4CurveVector;
//typedef RWTPtrOrderedVector<G4CurveVector> G4BoundaryVector;
//typedef RWTPtrOrderedVector<G4PlacedSolid> G4PlacedSolidVector;
//typedef RWTPtrOrderedVector<G4GeometryCreator*> G4CreatorVector;
typedef RWTPtrOrderedVector<G4GeometryCreator> G4CreatorVector;
//typedef RWTPtrOrderedVector<G4Surface> G4SurfaceVector;
//typedef RWTPtrOrderedVector<G4BREPSolid> G4SolidVector;
//operator ==(class RWTPtrOrderedVector<G4Curve> a, class RWTPtrOrderedVector<G4Curve> b){}
class G4GeometryTable
{
public:
// Destructor
~G4GeometryTable();
//Member functions
static void RegisterObject(G4GeometryCreator*);
static G4bool ExistsInTable(G4String&);
static G4GeometryCreator* GetObject(G4String);
static void* CreateObject(STEPentity&);
static void* CreateSTEPObject(void*, G4String&);
static void PrintObjectNames();
static G4GeometryTable& GetInstance(){return gt;}
public:
// Constructor, singleton
G4GeometryTable();
//Members
private:
static G4CreatorVector RegisteredObjects;
static G4GeometryTable gt;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4HYPERBOLACREATOR_HH
#define G4HYPERBOLACREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4HyperbolaCreator: private G4GeometryCreator
{
public:
//Constructor
G4HyperbolaCreator();
~G4HyperbolaCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Hyperbola";};
static G4HyperbolaCreator GetInstance(){return csc;};
//Members
private:
static G4HyperbolaCreator csc;
};
#endif
@@ -0,0 +1,29 @@
#ifndef G4ITEMDEFINEDTRANSFORMATIONCREATOR_HH
#define G4ITEMDEFINEDTRANSFORMATIONCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4PlacementVector.hh"
class G4ItemDefinedTransformationCreator: private G4GeometryCreator
{
public:
//Constructor
G4ItemDefinedTransformationCreator();
~G4ItemDefinedTransformationCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Item_Defined_Transformation";};
static G4ItemDefinedTransformationCreator GetInstance(){return csc;};
//Members
private:
static G4ItemDefinedTransformationCreator csc;
};
#endif
@@ -0,0 +1,29 @@
#ifndef G4LINECREATOR_HH
#define G4LINECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4Line.hh"
class G4LineCreator: private G4GeometryCreator
{
public:
//Constructor
G4LineCreator();
~G4LineCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Line";};
static G4LineCreator GetInstance(){return csc;};
//Members
private:
static G4LineCreator csc;
};
#endif
@@ -0,0 +1,29 @@
#ifndef G4MANIFOLDSOLIDBREPCREATOR_HH
#define G4MANIFOLDSOLIDBREPCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4BREPSolid.hh"
class G4ManifoldSolidBrepCreator: private G4GeometryCreator
{
public:
//Constructor
G4ManifoldSolidBrepCreator();
~G4ManifoldSolidBrepCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Manifold_Solid_Brep";};
static G4ManifoldSolidBrepCreator GetInstance(){return csc;};
//Members
private:
static G4ManifoldSolidBrepCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4OPENSHELLCREATOR_HH
#define G4OPENSHELLCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4OpenShellCreator: private G4GeometryCreator
{
public:
//Constructor
G4OpenShellCreator();
~G4OpenShellCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Open_Shell";};
static G4OpenShellCreator GetInstance(){return csc;};
//Members
private:
static G4OpenShellCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4ORIENTEDEDGECREATOR_HH
#define G4ORIENTEDEDGECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4OrientedEdgeCreator: private G4GeometryCreator
{
public:
//Constructor
G4OrientedEdgeCreator();
~G4OrientedEdgeCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Oriented_Edge";};
static G4OrientedEdgeCreator GetInstance(){return csc;};
//Members
private:
static G4OrientedEdgeCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4PARABOLACREATOR_HH
#define G4PARABOLACREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ParabolaCreator: private G4GeometryCreator
{
public:
//Constructor
G4ParabolaCreator();
~G4ParabolaCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Parabola";};
static G4ParabolaCreator GetInstance(){return csc;};
//Members
private:
static G4ParabolaCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4PLANECREATOR_HH
#define G4PLANECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4PlaneCreator: private G4GeometryCreator
{
public:
//Constructor
G4PlaneCreator();
~G4PlaneCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Plane";};
static G4PlaneCreator GetInstance(){return csc;};
//Members
private:
static G4PlaneCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4POINTCREATOR_HH
#define G4POINTCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4PointCreator: private G4GeometryCreator
{
public:
//Constructor
G4PointCreator();
~G4PointCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Point";};
static G4PointCreator GetInstance(){return csc;};
//Members
private:
static G4PointCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4POINTONCURVECREATOR_HH
#define G4POINTONCURVECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4PointOnCurveCreator: private G4GeometryCreator
{
public:
//Constructor
G4PointOnCurveCreator();
~G4PointOnCurveCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Point_On_Curve";};
static G4PointOnCurveCreator GetInstance(){return csc;};
//Members
private:
static G4PointOnCurveCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4POINTONSURFACECREATOR_HH
#define G4POINTONSURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4PointOnSurfaceCreator: private G4GeometryCreator
{
public:
//Constructor
G4PointOnSurfaceCreator();
~G4PointOnSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Point_On_Surface";};
static G4PointOnSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4PointOnSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4POINTREPLICACREATOR_HH
#define G4POINTREPLICACREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4PointReplicaCreator: private G4GeometryCreator
{
public:
//Constructor
G4PointReplicaCreator();
~G4PointReplicaCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Point_Replica";};
static G4PointReplicaCreator GetInstance(){return csc;};
//Members
private:
static G4PointReplicaCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4PRODUCTDEFINITIONSHAPECREATOR_HH
#define G4PRODUCTDEFINITIONSHAPECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ProductDefinitionShapeCreator: private G4GeometryCreator
{
public:
//Constructor
G4ProductDefinitionShapeCreator();
~G4ProductDefinitionShapeCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Product_Definition_Shape";};
static G4ProductDefinitionShapeCreator GetInstance(){return csc;};
//Members
private:
static G4ProductDefinitionShapeCreator csc;
};
#endif
@@ -0,0 +1,29 @@
#ifndef G4RATIONALBSPLINESURFACECREATOR_HH
#define G4RATIONALBSPLINESURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4BSplineSurfaceCreator.hh"
class G4RationalBSplineSurfaceCreator: public G4BSplineSurfaceCreator
{
public:
//Constructor
G4RationalBSplineSurfaceCreator();
~G4RationalBSplineSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Rational_B_Spline_Surface";};
static G4RationalBSplineSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4RationalBSplineSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4REPRESENTATIONRELATIONSHIPCREATOR_HH
#define G4REPRESENTATIONRELATIONSHIPCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4RepresentationRelationshipCreator: private G4GeometryCreator
{
public:
//Constructor
G4RepresentationRelationshipCreator();
~G4RepresentationRelationshipCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Representation_Relationship";};
static G4RepresentationRelationshipCreator GetInstance(){return csc;};
//Members
private:
static G4int placeCount;
static G4RepresentationRelationshipCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4REPRESENTATIONRELATIONSHIPWITHTRANSFORMATIONCREATOR_HH
#define G4REPRESENTATIONRELATIONSHIPWITHTRANSFORMATIONCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4RepresentationRelationshipWithTransformationCreator: private G4GeometryCreator
{
public:
//Constructor
G4RepresentationRelationshipWithTransformationCreator();
~G4RepresentationRelationshipWithTransformationCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Representation_Relationship_With_Transformation";};
static G4RepresentationRelationshipWithTransformationCreator GetInstance(){return csc;};
//Members
private:
static G4RepresentationRelationshipWithTransformationCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4SHAPEDEFINITIONREPRESENTATIONCREATOR_HH
#define G4SHAPEDEFINITIONREPRESENTATIONCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ShapeDefinitionRepresentationCreator: private G4GeometryCreator
{
public:
//Constructor
G4ShapeDefinitionRepresentationCreator();
~G4ShapeDefinitionRepresentationCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Shape_Definition_Representation";};
static G4ShapeDefinitionRepresentationCreator GetInstance(){return csc;};
//Members
private:
static G4ShapeDefinitionRepresentationCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4SHAPEREPRESENTATIONCREATOR_HH
#define G4SHAPEREPRESENTATIONCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4PlacementVector.hh"
class G4ShapeRepresentationCreator: private G4GeometryCreator
{
public:
//Constructor
G4ShapeRepresentationCreator();
~G4ShapeRepresentationCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Shape_Representation";};
static G4ShapeRepresentationCreator GetInstance(){return csc;};
//Members
private:
static G4ShapeRepresentationCreator csc;
};
#endif
@@ -0,0 +1,29 @@
#ifndef G4SHAPEREPRESENTATIONRELATIONSHIPCREATOR_HH
#define G4SHAPEREPRESENTATIONRELATIONSHIPCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
#include "G4PlacementVector.hh"
class G4ShapeRepresentationRelationshipCreator: private G4GeometryCreator
{
public:
//Constructor
G4ShapeRepresentationRelationshipCreator();
~G4ShapeRepresentationRelationshipCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Shape_Representation_Relationship";};
static G4ShapeRepresentationRelationshipCreator GetInstance(){return csc;};
//Members
private:
static G4ShapeRepresentationRelationshipCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4SPHERICALSURFACECREATOR_HH
#define G4SPHERICALSURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4SphericalSurfaceCreator: private G4GeometryCreator
{
public:
//Constructor
G4SphericalSurfaceCreator();
~G4SphericalSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void*);
G4String Name(){return "Spherical_Surface";};
static G4SphericalSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4SphericalSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4TOROIDALSURFACECREATOR_HH
#define G4TOROIDALSURFACECREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4ToroidalSurfaceCreator: private G4GeometryCreator
{
public:
//Constructor
G4ToroidalSurfaceCreator();
~G4ToroidalSurfaceCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Toroidal_Surface";};
static G4ToroidalSurfaceCreator GetInstance(){return csc;};
//Members
private:
static G4ToroidalSurfaceCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4VECTORCREATOR_HH
#define G4VECTORCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4VectorCreator: private G4GeometryCreator
{
public:
//Constructor
G4VectorCreator();
~G4VectorCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Vector";};
static G4VectorCreator GetInstance(){return csc;};
//Members
private:
static G4VectorCreator csc;
};
#endif
@@ -0,0 +1,28 @@
#ifndef G4VERTEXPOINTCREATOR_HH
#define G4VERTEXPOINTCREATOR_HH
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
class G4VertexPointCreator: private G4GeometryCreator
{
public:
//Constructor
G4VertexPointCreator();
~G4VertexPointCreator();
//Member functions
void CreateG4Geometry(STEPentity&);
void CreateSTEPGeometry(void* G4obj);
G4String Name(){return "Vertex_Point";};
static G4VertexPointCreator GetInstance(){return csc;};
//Members
private:
static G4VertexPointCreator csc;
};
#endif
@@ -0,0 +1,368 @@
#include "G4PointCreator.hh"
#include "G4PointOnSurfaceCreator.hh"
#include "G4PointOnCurveCreator.hh"
#include "G4PointReplicaCreator.hh"
#include "G4CartesianPointCreator.hh"
#include "G4VertexPointCreator.hh"
#include "G4CurveCreator.hh"
#include "G4ConicCreator.hh"
#include "G4HyperbolaCreator.hh"
#include "G4EllipseCreator.hh"
#include "G4CircleCreator.hh"
#include "G4LineCreator.hh"
#include "G4ParabolaCreator.hh"
#include "G4BSplineCurveWithKnotsCreator.hh"
#include "G4EdgeCurveCreator.hh"
#include "G4EdgeLoopCreator.hh"
#include "G4OrientedEdgeCreator.hh"
#include "G4FaceBoundCreator.hh"
#include "G4FaceOuterBoundCreator.hh"
#include "G4VectorCreator.hh"
#include "G4DirectionCreator.hh"
#include "G4Axis1PlacementCreator.hh"
#include "G4Axis2Placement2dCreator.hh"
#include "G4Axis2Placement3dCreator.hh"
#include "G4Axis2PlacementCreator.hh"
#include "G4Axis2PlacementsCreator.hh"
#include "G4ItemDefinedTransformationCreator.hh"
#include "G4AdvancedFaceCreator.hh"
#include "G4PlaneCreator.hh"
#include "G4CylindricalSurfaceCreator.hh"
#include "G4FaceSurfaceCreator.hh"
#include "G4ToroidalSurfaceCreator.hh"
#include "G4SphericalSurfaceCreator.hh"
#include "G4ConicalSurfaceCreator.hh"
#include "G4BSplineSurfaceCreator.hh"
#include "G4BoundedSurfaceCreator.hh"
#include "G4RationalBSplineSurfaceCreator.hh"
#include "G4BSplineSurfaceWithKnotsCreator.hh"
#include "G4OpenShellCreator.hh"
#include "G4ClosedShellCreator.hh"
#include "G4AdvancedBrepShapeRepresentationCreator.hh"
#include "G4ManifoldSolidBrepCreator.hh"
#include "G4ConnectedFaceSetCreator.hh"
#include "G4RepresentationRelationshipCreator.hh"
#include "G4ContextDependentShapeRepresentationCreator.hh"
#include "G4ShapeRepresentationCreator.hh"
#include "G4ShapeRepresentationRelationshipCreator.hh"
#include "G4ShapeDefinitionRepresentationCreator.hh"
#include "G4ProductDefinitionShapeCreator.hh"
#include "G4RepresentationRelationshipWithTransformationCreator.hh"
#include "G4GeometricRepresentationContextCreator.hh"
//#include "G4RepresentationItemCreator.hh"
//#include "G4GeometricRepresentationItemCreator.hh"
//#include "G4FunctionallyDefinedTransformationCreator.hh"
//#include "G4CartesianTransformationOperatorCreator.hh"
//#include "G4CartesianTransformationOperator_3dCreator.hh"
//#include "G4VersionedActionRequestCreator.hh"
//#include "G4RepresentationCreator.hh"
//#include "G4ManifoldSurfaceShapeRepresentationCreator.hh"
//#include "G4CertificationCreator.hh"
//#include "G4ProductDefinitionRelationshipCreator.hh"
//#include "G4ProductDefinitionUsageCreator.hh"
//#include "G4AssemblyComponentUsageCreator.hh"
//#include "G4QuantifiedAssemblyComponentUsageCreator.hh"
//#include "G4SolidModelCreator.hh"
//#include "G4FacetedBrepCreator.hh"
//#include "G4ActionDirectiveCreator.hh"
//#include "G4NamedUnitCreator.hh"
//#include "G4PlaneAngleUnitCreator.hh"
//#include "G4MeasureWithUnitCreator.hh"
//#include "G4AreaMeasureWithUnitCreator.hh"
//#include "G4EffectivityCreator.hh"
//#include "G4SerialNumberedEffectivityCreator.hh"
//#include "G4SurfaceCreator.hh"
//#include "G4OffsetSurfaceCreator.hh"
//#include "G4PlacementCreator.hh"
//#include "G4ProductCategoryCreator.hh"
//#include "G4ProductRelatedProductCategoryCreator.hh"
//#include "G4AddressCreator.hh"
//#include "G4OrganizationalAddressCreator.hh"
//#include "G4UniformSurfaceCreator.hh"
//#include "G4GeometricallyBoundedSurfaceShapeRepresentationCreator.hh"
//#include "G4BoundedCurveCreator.hh"
//#include "G4BSplineCurveCreator.hh"
//#include "G4RationalBSplineCurveCreator.hh"
//#include "G4ActionRequestAssignmentCreator.hh"
//#include "G4TopologicalRepresentationItemCreator.hh"
//#include "G4LengthMeasureWithUnitCreator.hh"
//#include "G4DatedEffectivityCreator.hh"
//#include "G4NextAssemblyUsageOccurrenceCreator.hh"
//#include "G4EdgeCreator.hh"
//#include "G4PersonCreator.hh"
//#include "G4DocumentCreator.hh"
//#include "G4DocumentWithClassCreator.hh"
//#include "G4ConversionBasedUnitCreator.hh"
//#include "G4ProductDefinitionFormationCreator.hh"
//#include "G4PersonAndOrganizationAssignmentCreator.hh"
//#include "G4CcDesignPersonAndOrganizationAssignmentCreator.hh"
//#include "G4OffsetCurve_3dCreator.hh"
//#include "G4ApprovalCreator.hh"
//#include "G4CompositeCurveCreator.hh"
//#include "G4CompositeCurveOnSurfaceCreator.hh"
//#include "G4BoundaryCurveCreator.hh"
//#include "G4RepresentationContextCreator.hh"
//#include "G4ActionStatusCreator.hh"
//#include "G4ApplicationContextCreator.hh"
//#include "G4ChangeRequestCreator.hh"
//#include "G4DateAndTimeCreator.hh"
//#include "G4ApprovalDateTimeCreator.hh"
//#include "G4ApprovalRoleCreator.hh"
//#include "G4ApplicationContextElementCreator.hh"
//#include "G4ProductContextCreator.hh"
//#include "G4ElementarySurfaceCreator.hh"
//#include "G4ApplicationProtocolDefinitionCreator.hh"
//#include "G4SpecifiedHigherUsageOccurrenceCreator.hh"
//#include "G4ProductDefinitionFormationWithSpecifiedSourceCreator.hh"
//#include "G4ActionRequestSolutionCreator.hh"
//#include "G4UncertaintyMeasureWithUnitCreator.hh"
//#include "G4EdgeBasedWireframeModelCreator.hh"
//#include "G4PathCreator.hh"
//#include "G4OrientedOpenShellCreator.hh"
//#include "G4SolidAngleUnitCreator.hh"
//#include "G4CoordinatedUniversalTimeOffsetCreator.hh"
//#include "G4CurveReplicaCreator.hh"
//#include "G4QuasiUniformSurfaceCreator.hh"
//#include "G4SurfaceCurveCreator.hh"
//#include "G4ActionRequestStatusCreator.hh"
//#include "G4CompositeCurveSegmentCreator.hh"
//#include "G4ReparametrisedCompositeCurveSegmentCreator.hh"
//#include "G4PersonAndOrganizationRoleCreator.hh"
//#include "G4QuasiUniformCurveCreator.hh"
//#include "G4SweptSurfaceCreator.hh"
//#include "G4PropertyDefinitionCreator.hh"
//#include "G4GlobalUncertaintyAssignedContextCreator.hh"
//#include "G4OrganizationRelationshipCreator.hh"
//#include "G4RectangularCompositeSurfaceCreator.hh"
//#include "G4LotEffectivityCreator.hh"
//#include "G4SurfaceOfLinearExtrusionCreator.hh"
//#include "G4ShellBasedSurfaceModelCreator.hh"
//#include "G4UniformCurveCreator.hh"
//#include "G4BezierCurveCreator.hh"
//#include "G4LoopCreator.hh"
//#include "G4DateCreator.hh"
//#include "G4CalendarDateCreator.hh"
//#include "G4PromissoryUsageOccurrenceCreator.hh"
//#include "G4ApprovalAssignmentCreator.hh"
//#include "G4ConfigurationItemCreator.hh"
//#include "G4ContractAssignmentCreator.hh"
//#include "G4IntersectionCurveCreator.hh"
//#include "G4TrimmedCurveCreator.hh"
//#include "G4ProductDefinitionContextCreator.hh"
//#include "G4ActionMethodCreator.hh"
//#include "G4ProductCategoryRelationshipCreator.hh"
//#include "G4PlaneAngleMeasureWithUnitCreator.hh"
//#include "G4VertexCreator.hh"
//#include "G4RepresentationMapCreator.hh"
//#include "G4ProductDefinitionEffectivityCreator.hh"
//#include "G4ConfigurationEffectivityCreator.hh"
//#include "G4ContextDependentUnitCreator.hh"
//#include "G4AlternateProductRelationshipCreator.hh"
//#include "G4DocumentTypeCreator.hh"
//#include "G4DocumentReferenceCreator.hh"
//#include "G4MechanicalContextCreator.hh"
//#include "G4ShellBasedWireframeModelCreator.hh"
//#include "G4ContractCreator.hh"
//#include "G4DimensionalExponentsCreator.hh"
//#include "G4StartRequestCreator.hh"
//#include "G4CcDesignSpecificationReferenceCreator.hh"
//#include "G4SuppliedPartRelationshipCreator.hh"
//#include "G4OrdinalDateCreator.hh"
//#include "G4MassMeasureWithUnitCreator.hh"
//#include "G4BrepWithVoidsCreator.hh"
//#include "G4WeekOfYearAndDayDateCreator.hh"
//#include "G4ShellBasedWireframeShapeRepresentationCreator.hh"
//#include "G4FaceCreator.hh"
//#include "G4OrientedFaceCreator.hh"
//#include "G4SurfaceOfRevolutionCreator.hh"
//#include "G4ProductCreator.hh"
//#include "G4ShapeAspectRelationshipCreator.hh"
//#include "G4RectangularTrimmedSurfaceCreator.hh"
//#include "G4ActionAssignmentCreator.hh"
//#include "G4ChangeCreator.hh"
//#include "G4PropertyDefinitionRepresentationCreator.hh"
//#include "G4GeometricSetCreator.hh"
//#include "G4GeometricCurveSetCreator.hh"
//#include "G4PersonalAddressCreator.hh"
//#include "G4DocumentRelationshipCreator.hh"
//#include "G4PcurveCreator.hh"
//#include "G4OuterBoundaryCurveCreator.hh"
//#include "G4AssemblyComponentUsageSubstituteCreator.hh"
//#include "G4DegeneratePcurveCreator.hh"
//#include "G4EvaluatedDegeneratePcurveCreator.hh"
//#include "G4SolidAngleMeasureWithUnitCreator.hh"
//#include "G4ConnectedEdgeSetCreator.hh"
//#include "G4ActionCreator.hh"
//#include "G4ExecutedActionCreator.hh"
//#include "G4DirectedActionCreator.hh"
//#include "G4OrganizationalProjectCreator.hh"
//#include "G4DateTimeRoleCreator.hh"
//#include "G4CurveBoundedSurfaceCreator.hh"
//#include "G4DesignMakeFromRelationshipCreator.hh"
//#include "G4DefinitionalRepresentationCreator.hh"
//#include "G4SiUnitCreator.hh"
//#include "G4BezierSurfaceCreator.hh"
//#include "G4CertificationAssignmentCreator.hh"
//#include "G4StartWorkCreator.hh"
//#include "G4ContractTypeCreator.hh"
//#include "G4CcDesignApprovalCreator.hh"
//#include "G4EdgeBasedWireframeShapeRepresentationCreator.hh"
//#include "G4GeometricallyBoundedWireframeShapeRepresentationCreator.hh"
//#include "G4ProductConceptCreator.hh"
//#include "G4CcDesignContractCreator.hh"
//#include "G4SeamCurveCreator.hh"
//#include "G4ConfigurationDesignCreator.hh"
//#include "G4DesignContextCreator.hh"
//#include "G4ProductDefinitionCreator.hh"
//#include "G4ProductDefinitionWithAssociatedDocumentsCreator.hh"
//#include "G4OrganizationCreator.hh"
//#include "G4CcDesignCertificationCreator.hh"
//#include "G4CertificationTypeCreator.hh"
//#include "G4OrientedPathCreator.hh"
//#include "G4SecurityClassificationCreator.hh"
//#include "G4VertexLoopCreator.hh"
//#include "G4ApprovalStatusCreator.hh"
//#include "G4DateAndTimeAssignmentCreator.hh"
//#include "G4ParametricRepresentationContextCreator.hh"
//#include "G4ProductConceptContextCreator.hh"
//#include "G4CartesianTransformationOperator_2dCreator.hh"
//#include "G4SurfacePatchCreator.hh"
//#include "G4LengthUnitCreator.hh"
//#include "G4ShapeAspectCreator.hh"
//#include "G4VolumeMeasureWithUnitCreator.hh"
//#include "G4SecurityClassificationLevelCreator.hh"
//#include "G4ApprovalRelationshipCreator.hh"
//#include "G4PolylineCreator.hh"
//#include "G4ApprovalPersonOrganizationCreator.hh"
//#include "G4SurfaceReplicaCreator.hh"
//#include "G4SecurityClassificationAssignmentCreator.hh"
//#include "G4CcDesignSecurityClassificationCreator.hh"
//#include "G4FacetedBrepShapeRepresentationCreator.hh"
//#include "G4DocumentUsageConstraintCreator.hh"
//#include "G4CcDesignDateAndTimeAssignmentCreator.hh"
//#include "G4OrientedClosedShellCreator.hh"
//#include "G4PersonAndOrganizationCreator.hh"
//#include "G4LocalTimeCreator.hh"
//#include "G4MassUnitCreator.hh"
//#include "G4VertexShellCreator.hh"
//#include "G4PolyLoopCreator.hh"
//#include "G4WireShellCreator.hh"
//#include "G4AreaUnitCreator.hh"
//#include "G4MappedItemCreator.hh"
//#include "G4OffsetCurve_2dCreator.hh"
//#include "G4VolumeUnitCreator.hh"
//#include "G4GlobalUnitAssignedContextCreator.hh"
//#include "G4CharacterizedDefinitionCreator.hh"
//#include "G4CharacterizedDefinitionsCreator.hh"
//#include "G4ChangeRequestItemCreator.hh"
//#include "G4ChangeRequestItemsCreator.hh"
//#include "G4CharacterizedProductDefinitionCreator.hh"
//#include "G4CharacterizedProductDefinitionsCreator.hh"
//#include "G4ReversibleTopologyItemCreator.hh"
//#include "G4ReversibleTopologyItemsCreator.hh"
//#include "G4SpecifiedItemCreator.hh"
//#include "G4SpecifiedItemsCreator.hh"
//#include "G4MeasureValueCreator.hh"
//#include "G4MeasureValuesCreator.hh"
//#include "G4PersonOrganizationSelectCreator.hh"
//#include "G4PersonOrganizationSelectsCreator.hh"
//#include "G4PcurveOrSurfaceCreator.hh"
//#include "G4PcurveOrSurfacesCreator.hh"
//#include "G4ClassifiedItemCreator.hh"
//#include "G4ClassifiedItemsCreator.hh"
//#include "G4VectorOrDirectionCreator.hh"
//#include "G4VectorOrDirectionsCreator.hh"
//#include "G4WireframeModelCreator.hh"
//#include "G4WireframeModelsCreator.hh"
//#include "G4GeometricSetSelectCreator.hh"
//#include "G4GeometricSetSelectsCreator.hh"
//#include "G4StartRequestItemCreator.hh"
//#include "G4StartRequestItemsCreator.hh"
//#include "G4PersonOrganizationItemCreator.hh"
//#include "G4PersonOrganizationItemsCreator.hh"
//#include "G4DateTimeItemCreator.hh"
//#include "G4DateTimeItemsCreator.hh"
//#include "G4ShellCreator.hh"
//#include "G4ShellsCreator.hh"
//#include "G4TransformationCreator.hh"
//#include "G4TransformationsCreator.hh"
//#include "G4BooleanOperandCreator.hh"
//#include "G4BooleanOperandsCreator.hh"
//#include "G4CertifiedItemCreator.hh"
//#include "G4CertifiedItemsCreator.hh"
//#include "G4DateTimeSelectCreator.hh"
//#include "G4DateTimeSelectsCreator.hh"
//#include "G4CurveOnSurfaceCreator.hh"
//#include "G4CurveOnSurfacesCreator.hh"
//#include "G4TrimmingSelectCreator.hh"
//#include "G4TrimmingSelectsCreator.hh"
//#include "G4ContractedItemCreator.hh"
//#include "G4ContractedItemsCreator.hh"
//#include "G4UnitCreator.hh"
//#include "G4UnitsCreator.hh"
//#include "G4ReversibleTopologyCreator.hh"
//#include "G4ReversibleTopologysCreator.hh"
//#include "G4WorkItemCreator.hh"
//#include "G4WorkItemsCreator.hh"
//#include "G4ShapeDefinitionCreator.hh"
//#include "G4ShapeDefinitionsCreator.hh"
//#include "G4SupportedItemCreator.hh"
//#include "G4SupportedItemsCreator.hh"
//#include "G4ApprovedItemCreator.hh"
//#include "G4ApprovedItemsCreator.hh"
//#include "G4SurfaceModelCreator.hh"
//#include "G4SurfaceModelsCreator.hh"
@@ -0,0 +1,92 @@
#include "G4AdvancedBrepShapeRepresentationCreator.hh"
#include<stdio.h>
G4AdvancedBrepShapeRepresentationCreator
G4AdvancedBrepShapeRepresentationCreator::csc;
G4AdvancedBrepShapeRepresentationCreator::
G4AdvancedBrepShapeRepresentationCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4AdvancedBrepShapeRepresentationCreator::
~G4AdvancedBrepShapeRepresentationCreator(){}
void G4AdvancedBrepShapeRepresentationCreator::
CreateG4Geometry(STEPentity& Ent)
{
G4String attrName("items");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
EntityAggregate *ea = (EntityAggregate*)Attr->ptr.a;
// Get parts of this shape
G4int partCount = ea->EntryCount();
EntityNode* en = (EntityNode*)ea->GetHead();
// An Advaced_BREP_Shape_Representation is made of
// 0 or 1 G4Axis2Placement3D and
// 1 or more Manifold_Solid_BREP
G4int placement = 0, nbofsolids = 0;
G4PlacedSolidVector* placedSldV = new G4PlacedSolidVector();
G4PlacedSolid* placedSld;
G4BREPSolid* sld;
STEPentity* ent;
G4Axis2Placement3D* place;
// default place
G4Axis2Placement3D* place0 = new (G4Axis2Placement3D)( G4Vector3D(1, 0, 0),
G4Vector3D(0, 1, 0),
G4Point3D(0, 0, 0) );
for(G4int a = 0; a < partCount; a++)
{
ent = en->node;
void *tmp = G4GeometryTable::CreateObject(*ent);
if( !strcmp(ent->EntityName(), "Axis2_Placement_3d") )
{
// Get placement
place = (G4Axis2Placement3D*)tmp;
placement = 1;
}
else
if( !strcmp(ent->EntityName(), "Manifold_Solid_Brep") )
{
// Get solid
sld = (G4BREPSolid*)tmp;
nbofsolids++;
G4int id = ent->GetFileId();
sld->SetId(id);
// Create the placed solid
if(placement)
placedSld = new G4PlacedSolid(sld, place);
else
placedSld = new G4PlacedSolid(sld, place0);
placedSldV->append(placedSld);
}
en = (EntityNode*)en->NextNode();
}
// Get geometric_representation_context, but it is not used
attrName = "context_of_items";
Attr = GetNamedAttribute(attrName, Ent);
createdObject = placedSldV;
}
void G4AdvancedBrepShapeRepresentationCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,72 @@
#include "G4AdvancedFaceCreator.hh"
#include "G4CurveVector.hh"
#include "G4CompositeCurve.hh"
#include "G4Surface.hh"
G4AdvancedFaceCreator G4AdvancedFaceCreator::csc;
G4AdvancedFaceCreator::G4AdvancedFaceCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4AdvancedFaceCreator::~G4AdvancedFaceCreator(){}
void G4AdvancedFaceCreator::CreateG4Geometry(STEPentity& Ent)
{
G4Surface* srf=0;
G4int sense;
STEPentity* TmpEnt=0;
G4String attrName("bounds");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
STEPaggregate *Aggr = Attr->ptr.a;
SingleLinkNode *Node = Aggr->GetHead();
G4int boundaryCount = Aggr->EntryCount();
G4CurveVector* boundaryVec = new G4CurveVector;
void *tmp;
for(G4int a=0; a<boundaryCount;a++)
{
TmpEnt = ((EntityNode*)Node)->node;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
G4CompositeCurve* pcc= new G4CompositeCurve;
pcc->Init(*((G4CurveVector*)tmp));
boundaryVec->insert(pcc);
Node = Node->NextNode();
}
attrName = "face_geometry";
Attr = GetNamedAttribute(attrName, Ent);
TmpEnt = *Attr->ptr.c;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
srf = (G4Surface*)tmp;
Attr = Ent.NextAttribute();
// if(*Attr->ptr.b) // BINARY_TYPE
// sense = 1;
// else
// sense = 0;
// Utilize the INTEGER_TYPE attribute which is 0 or 1
sense = *Attr->ptr.i;
// L. Broglia
srf->SetSameSense(sense);
// Now, re-calculate the normal of the plane
srf->CalcNormal();
srf->SetBoundaries(boundaryVec);
createdObject= srf;
}
void G4AdvancedFaceCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,164 @@
#include "G4AssemblyCreator.hh"
#include "G4Assembly.hh"
extern void HeaderSchemaInit (Registry & reg);
G4AssemblyCreator G4AssemblyCreator::ci;
G4AssemblyCreator::G4AssemblyCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4AssemblyCreator::G4AssemblyCreator(G4String fileName, G4String readerName)
{
// Name of STEP file to read in, existance of file should be checked
//here also...
STEPfileName = fileName;
// define type of STEP file reader to use
if(readerName == "NIST")
StepReader = new G4NISTStepReader();
//else...
}
G4AssemblyCreator::~G4AssemblyCreator()
{
delete StepReader;
}
void G4AssemblyCreator::ReadStepFile()
{
StepReader->ReadSTEPFile(STEPfileName);
instanceManager = StepReader->GetInstanceManager();
}
void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
{
// Advanced_Brep_Shape_Representation are created into
// Context_Dependent_Shape_Representation and
// Shape_Definition_Representation
G4int AdvancedBrepShapes = instanceManager.EntityKeywordCount
("Advanced_Brep_Shape_Representation");
G4int ConDepShapes = instanceManager.EntityKeywordCount
("Context_Dependent_Shape_Representation");
G4int ShapeDefReps = instanceManager.EntityKeywordCount
("Shape_Definition_Representation");
G4int instanceCount = instanceManager.InstanceCount();
STEPentity* ent=0;
index = 0;
int tmpindex;
void *tmp = 0;
G4PlacedSolidVector* psv = new G4PlacedSolidVector();
G4PlacedSolid* ps = new G4PlacedSolid();
G4int a;
// L. Broglia
// Total assumption !
if(ConDepShapes>0)
{
G4cout<<"\n\n Creating the Context_Dependent_Shape_Representation"<<endl;
index = 0;
for( a=0; a< ConDepShapes; a++)
{
G4cout<<"loop "<<a+1<<" of "<<ConDepShapes<<endl;
// Be careful, tmpindex not correspond to STEPfile_id !
tmpindex =
instanceManager.GetIndex("Context_Dependent_Shape_Representation",
index );
ent = instanceManager.GetSTEPentity(tmpindex);
if(ent!= ENTITY_NULL)
{
tmp =G4GeometryTable::CreateObject(*ent);
G4PlacedSolidVector* tmpV = (G4PlacedSolidVector*)tmp;
G4int entr = tmpV->entries();
for(G4int b=0; b<entr; b++)
{
ps = tmpV->at(b);
psv->append(ps);
}
index = ent->STEPfile_id ;
G4cout<<" Context_Dependent_Shape_Representation find in index "
<<index<<endl;
}
// Set index to the true value
index = tmpindex + 1;
ent=0;
}
}
else
{
G4cout<<"\n Creating the Shape_Definition_Representation"<<endl;
for(a=0; a< ShapeDefReps ; a++)
{
G4cout<<"loop "<<a+1<<" of "<<ShapeDefReps<<endl;
// Be careful, tmpindex not correspond to STEPfile_id !
tmpindex = instanceManager.GetIndex("Shape_Definition_Representation",
index );
ent = instanceManager.GetSTEPentity(tmpindex);
if(ent!= ENTITY_NULL)
{
tmp = G4GeometryTable::CreateObject(*ent);
G4PlacedSolidVector* tmpV = (G4PlacedSolidVector*)tmp;
G4int entr = tmpV->entries();
for(G4int b=0; b<entr; b++)
{
ps = tmpV->at(b);
psv->append(ps);
}
index = ent->STEPfile_id ;
G4cout<<" Shape_Definition_Representation find in index "<<index<<endl;
}
// Set index to the true value
index = tmpindex + 1;
ent=0;
}
}
createdObject = psv;
}
void G4AssemblyCreator::CreateSTEPGeometry(void* G4obj)
{
Registry reg(&::HeaderSchemaInit);
SdaiCONFIG_CONTROL_DESIGNInit (reg);
//G4Placement* plc = (G4Placement*)G4obj;
//G4String name("Axis2Placement3d");
// G4FCylindricalSurface *fCyl = (G4FCylindricalSurface *)G4obj;
// G4String name("Cylindrical_Surface");
G4ToroidalSurface *tor = (G4ToroidalSurface *)G4obj;
G4String name("Toroidal_Surface");
{
void *tmp =G4GeometryTable::CreateSTEPObject(G4obj, name);
}
}
@@ -0,0 +1,19 @@
#include "G4Axis1PlacementCreator.hh"
G4Axis1PlacementCreator G4Axis1PlacementCreator::csc;
G4Axis1PlacementCreator::G4Axis1PlacementCreator(){
G4GeometryTable::RegisterObject(this);
}
G4Axis1PlacementCreator::~G4Axis1PlacementCreator(){}
void G4Axis1PlacementCreator::CreateG4Geometry(STEPentity& Ent)
{
}
void G4Axis1PlacementCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,17 @@
#include "G4Axis2Placement2dCreator.hh"
G4Axis2Placement2dCreator G4Axis2Placement2dCreator::csc;
G4Axis2Placement2dCreator::G4Axis2Placement2dCreator(){G4GeometryTable::RegisterObject(this);}
G4Axis2Placement2dCreator::~G4Axis2Placement2dCreator(){}
void G4Axis2Placement2dCreator::CreateG4Geometry(STEPentity& Ent)
{
}
void G4Axis2Placement2dCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,81 @@
#include "G4Axis2Placement3dCreator.hh"
G4Axis2Placement3dCreator G4Axis2Placement3dCreator::csc;
G4Axis2Placement3dCreator::G4Axis2Placement3dCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4Axis2Placement3dCreator::~G4Axis2Placement3dCreator(){}
void G4Axis2Placement3dCreator::CreateG4Geometry(STEPentity& Ent)
{
G4Axis2Placement3D place;
G4Vector3D dir;
G4Vector3D axis;
G4Point3D srfPoint;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
if(Attr->NonRefType() != ENTITY_TYPE) Attr = Ent.NextAttribute();
// Get point on surface
STEPentity* TmpEnt = *Attr->ptr.c;
void * tmp = G4GeometryTable::CreateObject(*TmpEnt);
srfPoint = *(G4Point3D*)tmp;
// Get axis
Attr = Ent.NextAttribute();
TmpEnt = *Attr->ptr.c;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
axis = *(G4Vector3D*)tmp;
// Get direction
Attr = Ent.NextAttribute();
TmpEnt = *Attr->ptr.c;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
dir = *(G4Vector3D*)tmp;
createdObject = new G4Axis2Placement3D(dir, axis, srfPoint);
}
void G4Axis2Placement3dCreator::CreateSTEPGeometry(void* G4obj)
{
G4Axis2Placement3D *plc = (G4Axis2Placement3D*)G4obj;
SdaiAxis2_placement_3d *place = new SdaiAxis2_placement_3d();
G4Vector3D axis = plc->GetAxis();
G4Vector3D dir = plc->GetRefDirection();
G4Vector3D pt = plc->GetLocation();
G4String pointName("Cartesian_Point");
G4String directionName("Direction");
// Get location
void * tmp =G4GeometryTable::CreateSTEPObject(&pt, pointName);
place->Location((SdaiCartesian_point*)tmp);
// Get axis
tmp = G4GeometryTable::CreateSTEPObject(&axis, directionName);
place->Axis((SdaiDirection*)tmp);
// Get dir
tmp = G4GeometryTable::CreateSTEPObject(&dir, directionName);
place->Ref_direction((SdaiDirection*)tmp);
// Set STEP info
place->SetFileId(GetNextId());
place->Name("");
// Write out object & subobjects
place->STEPwrite(G4cout);
createdObject = place;
}
@@ -0,0 +1,17 @@
#include "G4Axis2PlacementCreator.hh"
G4Axis2PlacementCreator G4Axis2PlacementCreator::csc;
G4Axis2PlacementCreator::G4Axis2PlacementCreator(){G4GeometryTable::RegisterObject(this);}
G4Axis2PlacementCreator::~G4Axis2PlacementCreator(){}
void G4Axis2PlacementCreator::CreateG4Geometry(STEPentity& Ent)
{
}
void G4Axis2PlacementCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,21 @@
#include "G4Axis2PlacementsCreator.hh"
G4Axis2PlacementsCreator G4Axis2PlacementsCreator::csc;
G4Axis2PlacementsCreator::G4Axis2PlacementsCreator(){
// G4cerr << " G4Axis2PlacementsCreator default constructor "
// << " calling G4GeometryTable::RegisterObject(this) " << endl;
G4GeometryTable::RegisterObject(this);
}
G4Axis2PlacementsCreator::~G4Axis2PlacementsCreator(){}
void G4Axis2PlacementsCreator::CreateG4Geometry(STEPentity& Ent)
{
}
void G4Axis2PlacementsCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,193 @@
#include "G4BSplineCurveWithKnotsCreator.hh"
#include "G4BSplineCurve.hh"
typedef RWTValVector<G4double> G4doubleVector;
G4BSplineCurveWithKnotsCreator G4BSplineCurveWithKnotsCreator::csc;
G4BSplineCurveWithKnotsCreator::G4BSplineCurveWithKnotsCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4BSplineCurveWithKnotsCreator::~G4BSplineCurveWithKnotsCreator(){}
void G4BSplineCurveWithKnotsCreator::CreateG4Geometry(STEPentity& Ent)
{
// Created by L. Broglia
G4int degree;
G4Point3DVector controlPointsList;
G4doubleVector knots;
G4doubleVector weightsData;
G4BSplineCurve* bSpline = new G4BSplineCurve();
// degree
G4String attrName("degree");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
degree = *Attr->ptr.i;
// controlPointsList
attrName = "control_points_list";
Attr = GetNamedAttribute(attrName, Ent);
// Loop to find the entities
// Fill points
// Temporary solution until the STEP toolkit has been updated:
char c = ' ';
STEPaggregate *Aggr = Attr->ptr.a;
char tmp[16];
SCLstring s;
const char *Str = Aggr->asStr(s);
G4int Count=0;
G4int nbpoint = 0;
STEPentity *Entity;
G4int stringlength = strlen(Str);
while(c != ')')
{
while(c != '#')
{
c = Str[Count];
Count++;
if(Count>stringlength)
{
G4cout << "\nString index overflow in G4ControlPoints:116";
exit(0);
}
}
c = Str[Count];
int Index=0;
while(c != ',' && c != ')')
{
tmp[Index]=c;
Index++;
Count++;
c = Str[Count];
}
tmp[Index]='\0';
//c = ' ';
Index = atoi(tmp);
MgrNode* MgrTmp = instanceManager.FindFileId(Index);
Index = instanceManager.GetIndex(MgrTmp);
Entity = instanceManager.GetSTEPentity(Index);
void *tmp =G4GeometryTable::CreateObject(*Entity);
G4Point3D* pt = (G4Point3D*) tmp;
G4Point3D Pt(pt->x(), pt->y(), pt->z());
if(controlPointsList.length() <= nbpoint+1)
controlPointsList.reshape(nbpoint+1);
controlPointsList[nbpoint] = Pt;
nbpoint++;
}
// weightsData
attrName = "knot_multiplicities";
Attr = GetNamedAttribute(attrName, Ent);
c = ' ';
Aggr = Attr->ptr.a;
Str = Aggr->asStr(s);
nbpoint = 0;
Count = 0;
while(c != ')')
{
Count++;
while(c == '(')
{
c = Str[Count];
Count++;
}
int Index=0;
c = Str[Count];
while( c != ',' && c != ')' )
{
tmp[Index]=c;
Index++;
Count++;
c = Str[Count];
}
tmp[Index]='\0';
// L. Broglia : I am not sure of the function "atoi"
G4double weight = atoi(tmp);
if (weight <= 0)
weight = 1;
if(weightsData.length() <= nbpoint+1)
weightsData.reshape(nbpoint+1);
weightsData[nbpoint] = weight;
nbpoint++;
}
// knots
attrName = "knots";
Attr = GetNamedAttribute(attrName, Ent);
c = ' ';
Aggr = Attr->ptr.a;
Str = Aggr->asStr(s);
nbpoint = 0;
Count = 0;
while(c != ')')
{
Count++;
while(c == '(')
{
c = Str[Count];
Count++;
}
int Index=0;
c = Str[Count];
while(c != ',' && c != ')')
{
tmp[Index]=c;
Index++;
Count++;
c = Str[Count];
}
tmp[Index]='\0';
// L. Broglia : I am not sure of the function "atoi"
G4double knot = atoi(tmp);
if (knot <= 0)
knot = 1;
if(knots.length() <= nbpoint+1)
knots.reshape(nbpoint+1);
knots[nbpoint] = knot;
nbpoint++;
}
bSpline->Init(degree, &controlPointsList, &knots, &weightsData);
createdObject = bSpline;
}
void G4BSplineCurveWithKnotsCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,104 @@
#include "G4BSplineSurfaceCreator.hh"
#include "G4ControlPoints.hh"
G4BSplineSurfaceCreator G4BSplineSurfaceCreator::csc;
G4BSplineSurfaceCreator::G4BSplineSurfaceCreator(){G4GeometryTable::RegisterObject(this);}
G4BSplineSurfaceCreator::~G4BSplineSurfaceCreator(){}
void G4BSplineSurfaceCreator::CreateG4Geometry(STEPentity& Ent)
{
SdaiB_spline_surface* bSpline = new SdaiB_spline_surface(&Ent);
G4int u,v;
STEPentity* ent=0;
G4String attrName("u_degree");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
u = *Attr->ptr.i;
bSpline->U_degree(*Attr->ptr.i);
attrName = "v_degree";
Attr = GetNamedAttribute(attrName, Ent);
v=*Attr->ptr.i;
bSpline->V_degree(*Attr->ptr.i);
attrName = "control_points_list";
Attr = GetNamedAttribute(attrName, Ent);
STEPaggregate *Aggr = Attr->ptr.a;
GenericAggregate* gAggr = (GenericAggregate*)Attr->ptr.a;
bSpline->Control_points_list(gAggr);
// Get control points
G4int cols,rows;
cols = v+1;
rows = u+1;
STEPentity* entity;
G4int Index;
STEPentity *Entity;
char tmp[16];
SCLstring s;
const char *Str = Aggr->asStr(s);
G4int stringlength = strlen(Str);
G4ControlPoints controlPoints(4,rows, cols);
RealAggregate rationalAggr;
RealNode* rNode =0;
for(G4int a=0;a<rows;a++)
for(G4int b=0;b<cols;b++)
{
// get points
// temp version until the NIST toolkit can handle two dimensional aggregates
// The string Str contains the STEP file id:s of the underlying point
// entities so well have to parse the string to get them out...arghhh!
char c = ' ';
int Count=0;
// Loop to find the entities
// Fill points
//Temporary solution until the STEP toolkit has been updated:
while(c != '#')
{
c = Str[Count];
Count++;
if(Count>stringlength)
{
G4cout << "\nString index overflow in G4ControlPoints:116";
exit(0);
}
}
c = Str[Count];
int Index=0;
while(c != ',' && c != ')')
{
tmp[Index]=c;
Index++;
Count++;
c = Str[Count];
}
tmp[Index]='\0';
Index = atoi(tmp);
//delete [] tmp;
//Entity = InstanceList.GetSTEPentity(Index);
MgrNode* MgrTmp = instanceManager.FindFileId(Index);
Index = instanceManager.GetIndex(MgrTmp);
Entity = instanceManager.GetSTEPentity(Index);
void *tmp =G4GeometryTable::CreateObject(*Entity);
controlPoints.put(a,b,*(G4PointRat*)tmp);
}
createdObject = bSpline;
}
void G4BSplineSurfaceCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,208 @@
#include "G4BSplineSurfaceWithKnotsCreator.hh"
G4BSplineSurfaceWithKnotsCreator G4BSplineSurfaceWithKnotsCreator::csc;
G4BSplineSurfaceWithKnotsCreator::G4BSplineSurfaceWithKnotsCreator(){G4GeometryTable::RegisterObject(this);}
G4BSplineSurfaceWithKnotsCreator::~G4BSplineSurfaceWithKnotsCreator(){}
void G4BSplineSurfaceWithKnotsCreator::CreateG4Geometry(STEPentity& Ent)
{
SdaiB_spline_surface_with_knots *bSpline = new SdaiB_spline_surface_with_knots(&Ent);
// U dir
G4String attrName("u_multiplicities");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
bSpline->U_multiplicities((IntAggregate*)Attr->ptr.a);
STEPaggregate *multAggr = Attr->ptr.a;
G4int uMultCount = multAggr->EntryCount();
attrName = "u_knots";
Attr = GetNamedAttribute(attrName, Ent);
STEPaggregate *knotAggr = Attr->ptr.a;
G4int uKnotCount = knotAggr->EntryCount();
G4int totalUKnotCount = 0;
IntNode* multiNode = (IntNode*)multAggr->GetHead();
G4int a;
for(a=0;a<uMultCount;a++)
{
totalUKnotCount += multiNode->value;
multiNode = (IntNode*)multiNode->NextNode();
}
G4KnotVector *uKnots = new G4KnotVector(totalUKnotCount);
RealNode* knotNode = (RealNode*)knotAggr->GetHead();
multiNode = (IntNode*)multAggr->GetHead();
bSpline->U_knots((RealAggregate*)knotAggr);
G4int multValue=0;
G4double knotValue=0;
G4int index=0;
for(a=0;a<uKnotCount;a++)
{
multValue = multiNode->value;
knotValue = knotNode->value;
for(G4int b=0;b<multValue;b++)
{
uKnots->PutKnot(index, knotValue);
index++;
}
knotNode = (RealNode*)knotNode->NextNode();
}
// V dir
attrName = "v_multiplicities";
Attr = GetNamedAttribute(attrName, Ent);
multAggr = Attr->ptr.a;
bSpline->V_multiplicities((IntAggregate*)Attr->ptr.a);
G4int vMultCount = multAggr->EntryCount();
attrName = "v_knots";
Attr = GetNamedAttribute(attrName, Ent);
knotAggr = Attr->ptr.a;
bSpline->V_knots((RealAggregate*)knotAggr);
G4int vKnotCount = knotAggr->EntryCount();
G4int totalVKnotCount = 0;
multiNode = (IntNode*)multAggr->GetHead();
for(a=0;a<vMultCount;a++)
{
totalVKnotCount += multiNode->value;
multiNode = (IntNode*)multiNode->NextNode();
}
G4KnotVector *vKnots = new G4KnotVector(totalVKnotCount);
knotNode = (RealNode*)knotAggr->GetHead();
multiNode = (IntNode*)multAggr->GetHead();
multValue=0;
knotValue=0;
index=0;
for(a=0;a<uKnotCount;a++)
{
multValue = multiNode->value;
knotValue = knotNode->value;
for(G4int b=0;b<multValue;b++)
{
vKnots->PutKnot(index, knotValue);
index++;
}
knotNode = (RealNode*)knotNode->NextNode();
}
// b_spline base parts
G4int u,v;
STEPentity* ent=0;
attrName = "u_degree";
Attr = GetNamedAttribute(attrName, Ent);
if(Attr)
{
u = *Attr->ptr.i;
bSpline->U_degree(*Attr->ptr.i);
}
attrName = "v_degree";
Attr = GetNamedAttribute(attrName, Ent);
if(Attr)
{
v=*Attr->ptr.i;
bSpline->V_degree(*Attr->ptr.i);
}
attrName = "control_points_list";
Attr = GetNamedAttribute(attrName, Ent);
if(Attr)
{
STEPaggregate *Aggr = Attr->ptr.a;
GenericAggregate* gAggr = (GenericAggregate*)Attr->ptr.a;
bSpline->Control_points_list(gAggr);
// Get control points
G4int cols,rows;
cols = v+1;
rows = u+1;
STEPentity* entity;
G4int Index;
STEPentity *Entity;
char tmp[16];
SCLstring s;
const char *Str = Aggr->asStr(s);
G4int stringlength = strlen(Str);
G4ControlPoints controlPoints(4,rows, cols);
RealAggregate rationalAggr;
RealNode* rNode =0;
for(G4int a=0;a<rows;a++)
for(G4int b=0;b<cols;b++)
{
// get points
// temp version until the NIST toolkit can handle two dimensional aggregates
// The string Str contains the STEP file id:s of the underlying point
// entities so well have to parse the string to get them out...arghhh!
char c = ' ';
int Count=0;
// Loop to find the entities
// Fill points
//Temporary solution until the STEP toolkit has been updated:
while(c != '#')
{
c = Str[Count];
Count++;
if(Count>stringlength)
{
G4cout << "\nString index overflow in G4ControlPoints:116";
exit(0);
}
}
c = Str[Count];
int Index=0;
while(c != ',' && c != ')')
{
tmp[Index]=c;
Index++;
Count++;
c = Str[Count];
}
tmp[Index]='\0';
Index = atoi(tmp);
//delete [] tmp;
//Entity = InstanceList.GetSTEPentity(Index);
MgrNode* MgrTmp = instanceManager.FindFileId(Index);
Index = instanceManager.GetIndex(MgrTmp);
Entity = instanceManager.GetSTEPentity(Index);
void *tmp =G4GeometryTable::CreateObject(*Entity);
controlPoints.put(a,b,*(G4PointRat*)tmp);
}
}
createdObject = bSpline;
}
void G4BSplineSurfaceWithKnotsCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,244 @@
#include "G4BoundedSurfaceCreator.hh"
G4BoundedSurfaceCreator G4BoundedSurfaceCreator::csc;
G4BoundedSurfaceCreator::G4BoundedSurfaceCreator(){G4GeometryTable::RegisterObject(this);}
G4BoundedSurfaceCreator::~G4BoundedSurfaceCreator(){}
void G4BoundedSurfaceCreator::CreateG4Geometry(STEPentity& Ent)
{
STEPcomplex* complexEnt = (STEPcomplex*)&Ent;
void* tmp=0;
STEPentity* subEnt=0;
SdaiB_spline_surface *bSpline=0;
SdaiB_spline_surface_with_knots *bSplineWithKnots=0;
SdaiRational_b_spline_surface *rationalBSpline =0;
if(complexEnt->EntityExists("B_Spline_Surface"))
{
subEnt = complexEnt->EntityPart("B_Spline_Surface");
bSpline =(SdaiB_spline_surface*)G4GeometryTable::CreateObject(*subEnt);
}
if(complexEnt->EntityExists("B_Spline_Surface_With_Knots"))
{
subEnt = complexEnt->EntityPart("B_Spline_Surface_With_Knots");
bSplineWithKnots =(SdaiB_spline_surface_with_knots*)G4GeometryTable::CreateObject(*subEnt);
}
if(complexEnt->EntityExists("Rational_B_Spline_Surface"))
{
subEnt = complexEnt->EntityPart("Rational_B_Spline_Surface");
rationalBSpline =(SdaiRational_b_spline_surface*)G4GeometryTable::CreateObject(*subEnt);
}
G4int u,v;
u=bSpline->U_degree();
v=bSpline->V_degree();
// Get control points
G4int cols,rows;
cols = v+1;
rows = u+1;
char tmpstr[16];
STEPentity* entity;
G4int Index;
STEPentity *Entity;
SCLstring s;
STEPaggregate *Aggr=bSpline->Control_points_list();
const char *Str = Aggr->asStr(s);
G4int stringlength = strlen(Str);
G4ControlPoints controlPoints(4,rows, cols);
RealAggregate rationalAggr;
RealNode* rNode =0;
G4int a;
for(a=0;a<rows;a++)
for(G4int b=0;b<cols;b++)
{
// get points
// temp version until the NIST toolkit can handle two dimensional aggregates
// The string Str contains the STEP file id:s of the underlying point
// entities so well have to parse the string to get them out...arghhh!
char c = ' ';
int Count=0;
// Loop to find the entities
// Fill points
//Temporary solution until the STEP toolkit has been updated:
while(c != '#')
{
c = Str[Count];
Count++;
if(Count>stringlength)
{
G4cout << "\nString index overflow in G4ControlPoints:116";
exit(0);
}
}
c = Str[Count];
int Index=0;
while(c != ',' && c != ')')
{
tmpstr[Index]=c;
Index++;
Count++;
c = Str[Count];
}
tmpstr[Index]='\0';
Index = atoi(tmpstr);
//delete [] tmp;
//Entity = InstanceList.GetSTEPentity(Index);
MgrNode* MgrTmp = instanceManager.FindFileId(Index);
Index = instanceManager.GetIndex(MgrTmp);
Entity = instanceManager.GetSTEPentity(Index);
void *tmp =G4GeometryTable::CreateObject(*Entity);
controlPoints.put(a,b,*(G4PointRat*)tmp);
}
// Get knot vectors
STEPaggregate *multAggr = bSplineWithKnots->U_multiplicities();
G4int uMultCount = multAggr->EntryCount();
STEPaggregate *knotAggr = bSplineWithKnots->U_knots();
G4int uKnotCount = knotAggr->EntryCount();
G4int totalUKnotCount = 0;
IntNode* multiNode = (IntNode*)multAggr->GetHead();
for(a=0;a<uMultCount;a++)
{
totalUKnotCount += multiNode->value;
multiNode = (IntNode*)multiNode->NextNode();
}
G4KnotVector *uKnots = new G4KnotVector(totalUKnotCount);
RealNode* knotNode = (RealNode*)knotAggr->GetHead();
multiNode = (IntNode*)multAggr->GetHead();
G4int multValue=0;
G4double knotValue=0;
G4int index=0;
for(a=0;a<uKnotCount;a++)
{
multValue = multiNode->value;
knotValue = knotNode->value;
for(G4int b=0;b<multValue;b++)
{
uKnots->PutKnot(index, knotValue);
index++;
}
knotNode = (RealNode*)knotNode->NextNode();
}
// V dir
multAggr = bSplineWithKnots->V_multiplicities();
G4int vMultCount = multAggr->EntryCount();
knotAggr = bSplineWithKnots->V_knots();
G4int vKnotCount = knotAggr->EntryCount();
G4int totalVKnotCount = 0;
multiNode = (IntNode*)multAggr->GetHead();
for(a=0;a<vMultCount;a++)
{
totalVKnotCount += multiNode->value;
multiNode = (IntNode*)multiNode->NextNode();
}
G4KnotVector *vKnots = new G4KnotVector(totalVKnotCount);
knotNode = (RealNode*)knotAggr->GetHead();
multiNode = (IntNode*)multAggr->GetHead();
multValue=0;
knotValue=0;
index=0;
for(a=0;a<uKnotCount;a++)
{
multValue = multiNode->value;
knotValue = knotNode->value;
for(G4int b=0;b<multValue;b++)
{
vKnots->PutKnot(index, knotValue);
index++;
}
knotNode = (RealNode*)knotNode->NextNode();
}
// copy weights data
STEPaggregate *weightAggr = rationalBSpline->Weights_data();
// Temp solution until NIST supports
// two dimensional instances.grrh
const char* Str2 = weightAggr->asStr(s);
rows = weightAggr->EntryCount();
cols = 1;
G4int counter=0;
while (Str2[counter] != ')')
{
if(Str2[counter]==',')
cols++;
counter++;
}
char c;
G4int Count=0;
G4double* ratVector = new G4double[cols*rows];
for(a=0;a<rows*cols;a++)
{
c = '(';
while(c == '(' || c==',')
{
Count++;
c = Str[Count];
}
int Index=0;
char *tmp = new char[16];
while(c != ',' && c != ')')
{
tmp[Index]=c;
Index++;
Count++;
c = Str[Count];
}
tmp[Index]='\0';
G4double Value = atof(tmp);
delete [] tmp;
ratVector[a] = Value;
}
controlPoints.SetWeights(ratVector);
// create BSpline
G4BSplineSurface* bSplineSrf = new G4BSplineSurface(
u,
v,
*uKnots,
*vKnots,
controlPoints
);
}
void G4BoundedSurfaceCreator::CreateSTEPGeometry(void * G4obj)
{
}
@@ -0,0 +1,67 @@
#include "G4CartesianPointCreator.hh"
G4CartesianPointCreator G4CartesianPointCreator::csc;
G4CartesianPointCreator::G4CartesianPointCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4CartesianPointCreator::~G4CartesianPointCreator(){}
void G4CartesianPointCreator::CreateG4Geometry(STEPentity& Ent)
{
G4double x,y,z;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
Attr = Ent.NextAttribute();
STEPaggregate& XYZAggr = *Attr->ptr.a;
SingleLinkNode* RNode = XYZAggr.GetHead();
x = ((RealNode*)RNode)->value;
RNode = RNode->NextNode();
y = ((RealNode*)RNode)->value;
RNode = RNode->NextNode();
z = ((RealNode*)RNode)->value;
// createdObject = new G4Point3d(x,y,z);
createdObject = new G4Point3D(x,y,z);
}
void G4CartesianPointCreator::CreateSTEPGeometry(void* G4obj)
{
//G4Point3d* pt = (G4Point3d*)G4obj;
G4Point3D* pt = (G4Point3D*)G4obj;
RealNode *xa,*ya,*za;
RealAggregate pointAggr;
xa = (RealNode*)pointAggr.NewNode();
// xa->value = pt->X();
xa->value = pt->x();
ya = (RealNode*)pointAggr.NewNode();
// ya->value = pt->Y();
ya->value = pt->y();
za = (RealNode*)pointAggr.NewNode();
// za->value = pt->Z();
za->value = pt->z();
pointAggr.AddNode(xa);
pointAggr.AddNode(ya);
pointAggr.AddNode(za);
SdaiCartesian_point *sPoint = new SdaiCartesian_point();
sPoint->Coordinates(&pointAggr);
sPoint->SetFileId(GetNextId());
sPoint->Name("");
sPoint->STEPwrite(G4cout);
createdObject = sPoint;
}
@@ -0,0 +1,47 @@
#include "G4CircleCreator.hh"
#include "G4CircularCurve.hh"
G4CircleCreator G4CircleCreator::csc;
G4CircleCreator::G4CircleCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4CircleCreator::~G4CircleCreator(){}
void G4CircleCreator::CreateG4Geometry(STEPentity& Ent)
{
G4Axis2Placement3D place;
G4double radius;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
while(Attr->NonRefType() == STRING_TYPE ||
Attr->NonRefType() == sdaiSTRING )
Attr = Ent.NextAttribute();
// Get the placement
SelectNode* SelectN = (SelectNode*)Attr->ptr.sh;
SdaiSelect* Select = (SdaiSelect*)SelectN;
SdaiAxis2_placement* Place = (SdaiAxis2_placement*)Select;
STEPentity* TmpEnt = Place->operator SdaiAxis2_placement_3dH();
void * tmp =G4GeometryTable::CreateObject(*TmpEnt);
place = *(G4Axis2Placement3D*)tmp;
Attr = Ent.NextAttribute();
radius = *Attr->ptr.r;
G4CircularCurve* circle = new G4CircularCurve();
circle->Init(place , radius);
createdObject = circle;
}
void G4CircleCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,76 @@
#include "G4ClosedShellCreator.hh"
G4ClosedShellCreator G4ClosedShellCreator::csc;
G4ClosedShellCreator::G4ClosedShellCreator(){G4GeometryTable::RegisterObject(this);}
G4ClosedShellCreator::~G4ClosedShellCreator(){}
void G4ClosedShellCreator::CreateG4Geometry(STEPentity& Ent)
{
G4String attrName("cfs_faces");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
STEPaggregate *Aggr = Attr->ptr.a;
SingleLinkNode *Node = Aggr->GetHead();
STEPentity* TmpEnt=0;
G4int FaceCount = Aggr->EntryCount();
G4SurfaceVector SurfaceVec;
for(G4int a=0; a<FaceCount;a++)
{
TmpEnt = ((EntityNode*)Node)->node;
void *tmp =::G4GeometryTable::CreateObject(*TmpEnt);
SurfaceVec.append((G4Surface*)tmp);
Node = Node->NextNode();
}
// create G4solid
G4Surface** srfVec = new G4Surface*[FaceCount];
for(G4int b=0;b<FaceCount;b++)
srfVec[b] = (SurfaceVec[b]);
G4BREPSolid* sld = new G4BREPSolid(" ", srfVec, FaceCount);
createdObject = sld;
// delete [] srfVec;
// delete sld;
}
void G4ClosedShellCreator::CreateSTEPGeometry(void* G4obj)
{
G4BREPSolid* bSld = (G4BREPSolid*)G4obj;
SdaiClosed_shell* sld = new SdaiClosed_shell();
G4int surfaceCount = bSld->NumberOfFaces();
EntityAggregate eAggr;
EntityNode* eNode=0;
void* tmp=0;
G4Surface* srf=0;
for(G4int a=0;a<surfaceCount;a++)
{
srf = bSld->GetSurface(a);
G4String srfType(srf->GetEntityType());
tmp = G4GeometryTable::CreateSTEPObject(srf,srfType);
eNode = new EntityNode((STEPentity*)tmp);
eAggr.AddNode(eNode);
}
sld->Cfs_faces(&eAggr);
sld->SetFileId(GetNextId());
sld->Name("");
sld->STEPwrite(G4cout);
createdObject = sld;
}
@@ -0,0 +1,26 @@
#include "G4ConicCreator.hh"
G4ConicCreator G4ConicCreator::csc;
G4ConicCreator::G4ConicCreator(){G4GeometryTable::RegisterObject(this);}
G4ConicCreator::~G4ConicCreator(){}
void G4ConicCreator::CreateG4Geometry(STEPentity& Ent)
{
// G4Placement *place;
G4String attrName("edge_start");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
// Get the placement
STEPentity* TmpEnt= *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
// place = (G4Placement*)place;
}
void G4ConicCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,66 @@
#include "G4ConicalSurfaceCreator.hh"
#include "G4ConicalSurface.hh"
G4ConicalSurfaceCreator G4ConicalSurfaceCreator::csc;
G4ConicalSurfaceCreator::G4ConicalSurfaceCreator(){G4GeometryTable::RegisterObject(this);}
G4ConicalSurfaceCreator::~G4ConicalSurfaceCreator(){}
void G4ConicalSurfaceCreator::CreateG4Geometry(STEPentity& Ent)
{
// Made by L. Broglia
STEPattribute *Attr;
G4Axis2Placement3D* place;
G4double angle;
G4String attrName("position");
Attr = GetNamedAttribute(attrName, Ent);
// Get placement
STEPentity* TmpEnt = *Attr->ptr.c; // ptr.c --> ENTITY_TYPE
void *tmp = G4GeometryTable::CreateObject(*TmpEnt);
place = (G4Axis2Placement3D*)tmp;
// Get angle
G4String attrNameA("semi_angle");
Attr = GetNamedAttribute(attrNameA, Ent);
angle = *Attr->ptr.r; // Be careful, angle is in degree
G4ConicalSurface* aG4cone =
new G4ConicalSurface( (*place).GetLocation() ,
(*place).GetAxis() ,
angle * 2*M_PI/360 );
createdObject = aG4cone;
}
void G4ConicalSurfaceCreator::CreateSTEPGeometry(void* G4obj)
{
G4FConicalSurface* fCon = (G4FConicalSurface*)G4obj;
SdaiConical_surface* srf= new SdaiConical_surface();
// Get placement
G4String placementName("Axis2Placement3d");
void * tmp =G4GeometryTable::CreateSTEPObject(&fCon, placementName);
SdaiAxis2_placement_3d *place = (SdaiAxis2_placement_3d*)tmp;
srf->Position(place);
// radius
srf->Radius(fCon->GetSmallRadius());
// semi-angle
//srf->Semi_angle(fCon->GetAngle());
// Set STEP info
srf->SetFileId(GetNextId());
srf->Name("");
// Write out object
srf->STEPwrite(G4cout);
createdObject = srf;
}
@@ -0,0 +1,17 @@
#include "G4ConnectedFaceSetCreator.hh"
G4ConnectedFaceSetCreator G4ConnectedFaceSetCreator::csc;
G4ConnectedFaceSetCreator::G4ConnectedFaceSetCreator(){G4GeometryTable::RegisterObject(this);}
G4ConnectedFaceSetCreator::~G4ConnectedFaceSetCreator(){}
void G4ConnectedFaceSetCreator::CreateG4Geometry(STEPentity& Ent)
{
}
void G4ConnectedFaceSetCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,33 @@
#include "G4ContextDependentShapeRepresentationCreator.hh"
G4ContextDependentShapeRepresentationCreator G4ContextDependentShapeRepresentationCreator::csc;
G4ContextDependentShapeRepresentationCreator::G4ContextDependentShapeRepresentationCreator(){G4GeometryTable::RegisterObject(this);}
G4ContextDependentShapeRepresentationCreator::~G4ContextDependentShapeRepresentationCreator(){}
void G4ContextDependentShapeRepresentationCreator::CreateG4Geometry(STEPentity& Ent)
{
G4String attrName("representation_relation");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
G4PlacedSolidVector* psV = (G4PlacedSolidVector*)tmp;
// L. Broglia
// For the moment, the represented_product_relation is not needed
// So don`t create it
attrName="represented_product_relation";
Attr = GetNamedAttribute(attrName, Ent);
TmpEnt = *Attr->ptr.c;
// tmp =G4GeometryTable::CreateObject(*TmpEnt);
createdObject = psV;
}
void G4ContextDependentShapeRepresentationCreator::CreateSTEPGeometry(void* obj)
{
}
@@ -0,0 +1,11 @@
#include "G4CurveCreator.hh"
G4CurveCreator G4CurveCreator::csc;
G4CurveCreator::G4CurveCreator(){G4GeometryTable::RegisterObject(this);}
G4CurveCreator::~G4CurveCreator(){}
void G4CurveCreator::CreateG4Geometry(STEPentity& Ent){}
void G4CurveCreator::CreateSTEPGeometry(void* G4obj){}
@@ -0,0 +1,66 @@
#include "G4CylindricalSurfaceCreator.hh"
#include "G4FCylindricalSurface.hh"
#include "G4CylindricalSurface.hh"
G4CylindricalSurfaceCreator G4CylindricalSurfaceCreator::csc;
G4CylindricalSurfaceCreator::G4CylindricalSurfaceCreator(){G4GeometryTable::RegisterObject(this);}
G4CylindricalSurfaceCreator::~G4CylindricalSurfaceCreator(){}
void G4CylindricalSurfaceCreator::CreateG4Geometry(STEPentity& Ent)
{
// Made by L. Broglia
STEPattribute *Attr;
G4Axis2Placement3D* place;
G4double radius;
G4String attrName("position");
Attr = GetNamedAttribute(attrName, Ent);
// Get placement
STEPentity* TmpEnt = *Attr->ptr.c; // ptr.c --> ENTITY_TYPE
void *tmp = G4GeometryTable::CreateObject(*TmpEnt);
place = (G4Axis2Placement3D*)tmp;
// Get radius
G4String attrNameR("radius");
Attr = GetNamedAttribute(attrNameR, Ent);
radius = *Attr->ptr.r;
G4CylindricalSurface* aG4cylinder =
new G4CylindricalSurface( (*place).GetLocation() ,
(*place).GetAxis() ,
radius );
createdObject = aG4cylinder;
}
void G4CylindricalSurfaceCreator::CreateSTEPGeometry(void* G4obj)
{
G4FCylindricalSurface* fCyl = (G4FCylindricalSurface*)G4obj;
SdaiCylindrical_surface* srf= new SdaiCylindrical_surface();
// Get placement
G4String placementName("Axis2Placement3d");
void * tmp =G4GeometryTable::CreateSTEPObject(&fCyl, placementName);
SdaiAxis2_placement_3d *place = (SdaiAxis2_placement_3d*)tmp;
srf->Position(place);
// radius
srf->Radius(fCyl->GetRadius());
// Set STEP info
srf->SetFileId(GetNextId());
srf->Name("");
// Write out object
srf->STEPwrite(G4cout);
createdObject = srf;
}
@@ -0,0 +1,65 @@
#include "G4DirectionCreator.hh"
G4DirectionCreator G4DirectionCreator::csc;
G4DirectionCreator::G4DirectionCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4DirectionCreator::~G4DirectionCreator(){}
void G4DirectionCreator::CreateG4Geometry(STEPentity& Ent)
{
G4double x,y,z;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
Attr = Ent.NextAttribute();
STEPaggregate& XYZAggr = *Attr->ptr.a;
SingleLinkNode* RNode = XYZAggr.GetHead();
x = ((RealNode*)RNode)->value;
RNode = RNode->NextNode();
y = ((RealNode*)RNode)->value;
RNode = RNode->NextNode();
z = ((RealNode*)RNode)->value;
createdObject = new G4ThreeVector(x,y,z);
}
void G4DirectionCreator::CreateSTEPGeometry(void* G4obj)
{
//G4ThreeVec* dir = (G4ThreeVec*)G4obj;
G4Vector3D* dir = (G4Vector3D*)G4obj;
RealNode *xa,*ya,*za;
RealAggregate dirAggr;
xa = (RealNode*)dirAggr.NewNode();
// xa->value = dir->X();
xa->value = dir->x();
ya = (RealNode*)dirAggr.NewNode();
// ya->value = dir->Y();
ya->value = dir->y();
za = (RealNode*)dirAggr.NewNode();
// za->value = dir->Z();
za->value = dir->z();
dirAggr.AddNode(xa);
dirAggr.AddNode(ya);
dirAggr.AddNode(za);
SdaiDirection *sDir = new SdaiDirection();
sDir->Direction_ratios(&dirAggr);
sDir->SetFileId(GetNextId());
sDir->Name("");
sDir->STEPwrite(G4cout);
createdObject = sDir;
}
@@ -0,0 +1,58 @@
#include "G4EdgeCurveCreator.hh"
G4EdgeCurveCreator G4EdgeCurveCreator::csc;
G4EdgeCurveCreator::G4EdgeCurveCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4EdgeCurveCreator::~G4EdgeCurveCreator(){}
void G4EdgeCurveCreator::CreateG4Geometry(STEPentity& Ent)
{
G4Point3D *pt1,*pt2;
G4Curve* crv;
G4bool sameSense;
// Get start point
G4String attrName("edge_start");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
pt1 = (G4Point3D*)tmp;
// Get end point
attrName = "edge_end";
Attr = GetNamedAttribute(attrName, Ent);
TmpEnt = *Attr->ptr.c;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
pt2 = (G4Point3D*)tmp;
// Get curve
attrName = "edge_geometry";
Attr = GetNamedAttribute(attrName, Ent);
TmpEnt = *Attr->ptr.c;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
crv = (G4Curve*)tmp;
// set the bounds
G4Point3D p1(pt1->x(), pt1->y(), pt1->z());
G4Point3D p2(pt2->x(), pt2->y(), pt1->z());
crv->SetBounds(p1, p2);
//get sense info
Attr = Ent.NextAttribute();
// sameSense = *Attr->ptr.b;
createdObject = crv;
}
void G4EdgeCurveCreator::CreateSTEPGeometry(void* G4obj){}
@@ -0,0 +1,35 @@
#include "G4EdgeLoopCreator.hh"
G4EdgeLoopCreator G4EdgeLoopCreator::csc;
G4EdgeLoopCreator::G4EdgeLoopCreator(){G4GeometryTable::RegisterObject(this);}
G4EdgeLoopCreator::~G4EdgeLoopCreator(){}
void G4EdgeLoopCreator::CreateG4Geometry(STEPentity& Ent)
{
G4String attrName("edge_list");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
STEPaggregate *Aggr = Attr->ptr.a;
SingleLinkNode *Node = Aggr->GetHead();
STEPentity* TmpEnt=0;
G4int EdgeCount = Aggr->EntryCount();
G4CurveVector* CurveVec = new G4CurveVector[EdgeCount];
for(G4int a=0; a<EdgeCount;a++)
{
TmpEnt = ((EntityNode*)Node)->node;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
CurveVec->append((G4Curve*)tmp);
Node = Node->NextNode();
}
createdObject = CurveVec;
}
void G4EdgeLoopCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,42 @@
#include "G4EllipseCreator.hh"
G4EllipseCreator G4EllipseCreator::csc;
G4EllipseCreator::G4EllipseCreator(){G4GeometryTable::RegisterObject(this);}
G4EllipseCreator::~G4EllipseCreator(){}
void G4EllipseCreator::CreateG4Geometry(STEPentity& Ent)
{
G4double semi1,semi2;
// L. Broglia
// G4Placement* place;
G4Axis2Placement3D* place;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
while(Attr->NonRefType() == STRING_TYPE ||
Attr->NonRefType() == sdaiSTRING )
Attr = Ent.NextAttribute();
// Get the placement
STEPentity* TmpEnt= *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
// L. Broglia
// place = (G4Placement*)tmp;
place = (G4Axis2Placement3D*)tmp;
// get semi axises
Attr = Ent.NextAttribute();
semi1 = *Attr->ptr.r;
Attr = Ent.NextAttribute();
semi2 = *Attr->ptr.r;
}
void G4EllipseCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,34 @@
#include "G4FaceBoundCreator.hh"
G4FaceBoundCreator G4FaceBoundCreator::csc;
G4FaceBoundCreator::G4FaceBoundCreator(){G4GeometryTable::RegisterObject(this);}
G4FaceBoundCreator::~G4FaceBoundCreator(){}
void G4FaceBoundCreator::CreateG4Geometry(STEPentity& Ent)
{
G4int orientation;
G4String attrName("bound");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
// Get curve
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
// L. Broglia
// Mistake : the created object tmp is a G4CurveVector
// G4Curve* crv = (G4Curve*)tmp;
G4CurveVector* crv = (G4CurveVector*)tmp;
Attr = Ent.NextAttribute();
//orientation = *Attr->ptr.i;
//crv->SetSameSense(orientation);
createdObject = crv;
}
void G4FaceBoundCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,12 @@
#include "G4FaceOuterBoundCreator.hh"
G4FaceOuterBoundCreator G4FaceOuterBoundCreator::csc;
G4FaceOuterBoundCreator::G4FaceOuterBoundCreator(){G4GeometryTable::RegisterObject(this);}
G4FaceOuterBoundCreator::~G4FaceOuterBoundCreator(){}
void G4FaceOuterBoundCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,32 @@
#include "G4FaceSurfaceCreator.hh"
G4FaceSurfaceCreator G4FaceSurfaceCreator::csc;
G4FaceSurfaceCreator::G4FaceSurfaceCreator(){G4GeometryTable::RegisterObject(this);}
G4FaceSurfaceCreator::~G4FaceSurfaceCreator(){}
void G4FaceSurfaceCreator::CreateG4Geometry(STEPentity& Ent)
{
G4Surface* srf=0;
G4bool sense;
G4String attrName("face_geometry");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
srf = (G4Surface*)tmp;
Attr = Ent.NextAttribute();
// sense = *Attr->ptr.b;
createdObject = srf;
}
void G4FaceSurfaceCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,37 @@
#include "G4GeometricRepresentationContextCreator.hh"
G4GeometricRepresentationContextCreator G4GeometricRepresentationContextCreator
::csc;
G4GeometricRepresentationContextCreator::
G4GeometricRepresentationContextCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4GeometricRepresentationContextCreator::
~G4GeometricRepresentationContextCreator(){}
void G4GeometricRepresentationContextCreator::CreateG4Geometry(STEPentity& Ent)
{
// Made by L. Broglia
STEPattribute *Attr;
// tmp
G4cout<<"Warning ! G4GeometricRepresentationContextCreator called ..."<<endl;
G4String attrName("coordinate_space_dimension");
Attr = GetNamedAttribute(attrName, Ent);
// Get coordinate space dimension
SdaiReal Tmpdim = *Attr->ptr.r; // ptr.r --> REAL_TYPE
// void *tmp = G4GeometryTable::CreateObject(*TmpEnt);
// place = (G4Axis2Placement3D*)tmp...;
}
void G4GeometricRepresentationContextCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,67 @@
#include "G4GeometryCreator.hh"
#include "G4GeometryTable.hh"
InstMgr G4GeometryCreator::instanceManager;
G4int G4GeometryCreator::objectId = 0;
STEPattribute* G4GeometryCreator::GetNamedAttribute(G4String& attrName, STEPentity& Ent)
{
STEPattribute* attr;
Ent.ResetAttributes();
G4int attrCount = Ent.AttributeCount();
for(G4int a=0;a<attrCount;a++)
{
attr = Ent.NextAttribute();
if(attr->Name() == attrName)
return attr;
}
G4String err = "\nCannot find attribute " + attrName + " in entity " + Ent.EntityName();
G4Exception(err);
return 0; // NULL
}
STEPentity* G4GeometryCreator::GetNamedEntity(G4String& entName, STEPentity& Ent)
{
// Ent is a complex entity
if(Ent.IsComplex())
{
Ent.ResetAttributes();
STEPcomplex *complexEnt = (STEPcomplex*)&Ent;
STEPentity* subEnt=0;
G4int entCount = complexEnt->AttributeCount();
for(G4int a=0;a<entCount;a++)
{
subEnt = complexEnt->sc;
if(subEnt->EntityName() == entName)
return subEnt;
}
}
G4String err = "\nCannot find entity " + entName + " in complex entity " + Ent.EntityName();
G4Exception(err);
return 0;
}
/*
G4int[][] G4GeometryCreator::GetIds(GenericAggregate& aggr)
{
// Gets the file IDs of entities from the string.
// hack for 2D-aggregates which do not work properly in the NIST toolkit
GenericAggrNode* gNode = (GenericAggrNode*)aggr->GetHead();
SCLstring str;
G4String aggrStr = gNode->asStr(str);
}
*/
@@ -0,0 +1,194 @@
#include "G4GeometryTable.hh"
#include "includes"
G4GeometryTable G4GeometryTable::gt;
G4CreatorVector G4GeometryTable::RegisteredObjects;
G4GeometryTable::G4GeometryTable()
{
}
G4GeometryTable::~G4GeometryTable()
{
}
G4bool G4GeometryTable::ExistsInTable(G4String& objectName)
{
G4bool existsInTable = false;
for(G4int a=0;a<RegisteredObjects.length();a++)
{
G4GeometryCreator* gcTmp = RegisteredObjects(a);
G4String rName = gcTmp->Name();
if(rName == objectName) existsInTable = true;
}
return existsInTable;
}
void G4GeometryTable::RegisterObject(G4GeometryCreator* gc)
{
G4String newName = gc->Name();
if(!ExistsInTable(newName))
RegisteredObjects.append(gc);
}
G4GeometryCreator* G4GeometryTable::GetObject(G4String objectName)
{
for(G4int a=0;a<RegisteredObjects.length();a++)
{
G4GeometryCreator* gcTmp = RegisteredObjects(a);
G4String rName = gcTmp->Name();
if(rName == objectName)
return gcTmp;
}
return (G4GeometryCreator*)0;
}
void* G4GeometryTable::CreateObject(STEPentity& Ent)
{
Ent.ResetAttributes();
G4String name = Ent.EntityName();
G4GeometryCreator* gctmp = GetObject(name);
if(gctmp)
{
gctmp->CreateG4Geometry(Ent);
void* obj = gctmp->GetCreatedObject();
if (obj == 0) {
G4cout << "G4 object of type "
<< gctmp->Name() << " not necessary" << endl;
} else {
G4cout << "Created G4 object of type " << gctmp->Name() << endl;
}
return obj;
}
else
{
G4String err = "Geometry creator for entity " + name + " not found.";
G4cout << err << endl;
// G4Exception(err);
return 0;
}
}
void* G4GeometryTable::CreateSTEPObject(void* G4obj, G4String& objName)
{
G4GeometryCreator* gctmp = GetObject(objName);
if(gctmp)
{
gctmp->CreateSTEPGeometry(G4obj);
void* obj = gctmp->GetCreatedObject();
return obj;
}
else
{
G4String err = "\nSTEP creator for entity " + objName + " not found.\n";
G4cout << err;
// G4Exception(err);
return 0;
}
}
void G4GeometryTable::PrintObjectNames()
{
G4String name;
G4GeometryCreator* gc=0;
G4int a=0;
G4int objectCount = RegisteredObjects.length();
if(!objectCount)
{
G4cout << "No registered objects in table." << endl;
return;
}
G4cout << "Objects in table:" << endl;
for(a=0;a<objectCount;a++)
{
gc = RegisteredObjects[a];
name = gc->Name();
G4cout << name << endl;
}
}
G4PointCreator a;
G4CartesianPointCreator b;
G4PointOnCurveCreator c;
G4PointOnSurfaceCreator d;
G4PointReplicaCreator e;
G4VertexPointCreator f;
G4CurveCreator c1;
G4LineCreator c2;
G4CircleCreator c3;
G4EllipseCreator c4;
G4HyperbolaCreator c5;
G4ParabolaCreator c6;
G4EdgeCurveCreator c7;
G4BSplineCurveWithKnotsCreator bsc1;
G4EdgeLoopCreator l1;
G4OrientedEdgeCreator e1;
G4FaceBoundCreator b1;
G4FaceOuterBoundCreator b2 ;
G4DirectionCreator dir;
G4VectorCreator vec;
G4Axis1PlacementCreator ax1;
G4Axis2Placement2dCreator ax2;
G4Axis2Placement3dCreator ax3;
G4Axis2PlacementCreator ax4;
G4Axis2PlacementsCreator ax5;
G4AdvancedFaceCreator s2;
G4PlaneCreator s3;
G4CylindricalSurfaceCreator s4;
G4FaceSurfaceCreator fsc1;
G4ToroidalSurfaceCreator s5;
G4SphericalSurfaceCreator s6;
G4ConicalSurfaceCreator s7;
G4BSplineSurfaceCreator s8;
G4BoundedSurfaceCreator s9;
G4RationalBSplineSurfaceCreator s10;
G4BSplineSurfaceWithKnotsCreator s11;
G4ClosedShellCreator sc1;
G4OpenShellCreator sc2;
G4AdvancedBrepShapeRepresentationCreator shape1;
G4ManifoldSolidBrepCreator ms1;
G4ConnectedFaceSetCreator cfsc1;
G4ItemDefinedTransformationCreator trans1;
G4RepresentationRelationshipCreator reprel1;
G4RepresentationRelationshipWithTransformationCreator repretrans;
G4ContextDependentShapeRepresentationCreator condep1;
G4ProductDefinitionShapeCreator pdsc;
G4ShapeRepresentationRelationshipCreator srrc;
G4ShapeRepresentationCreator srcs;
G4ShapeDefinitionRepresentationCreator sdr;
G4GeometricRepresentationContextCreator grc;
@@ -0,0 +1,45 @@
#include "G4HyperbolaCreator.hh"
G4HyperbolaCreator G4HyperbolaCreator::csc;
G4HyperbolaCreator::G4HyperbolaCreator(){G4GeometryTable::RegisterObject(this);}
G4HyperbolaCreator::~G4HyperbolaCreator(){}
void G4HyperbolaCreator::CreateG4Geometry(STEPentity& Ent)
{
G4double semi1,semi_imag;
// L. Broglia
// G4Placement* place;
G4Axis2Placement3D* place;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
while(Attr->NonRefType() == STRING_TYPE ||
Attr->NonRefType() == sdaiSTRING )
Attr = Ent.NextAttribute();
// Get the placement
STEPentity* TmpEnt= *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
// L. Broglia
// place = (G4Placement*)tmp;
place = (G4Axis2Placement3D*)tmp;
// get semi axises
Attr = Ent.NextAttribute();
semi1 = *Attr->ptr.r;
Attr = Ent.NextAttribute();
semi_imag = *Attr->ptr.r;
}
void G4HyperbolaCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,44 @@
#include "G4ItemDefinedTransformationCreator.hh"
G4ItemDefinedTransformationCreator G4ItemDefinedTransformationCreator::csc;
G4ItemDefinedTransformationCreator::G4ItemDefinedTransformationCreator(){G4GeometryTable::RegisterObject(this);}
G4ItemDefinedTransformationCreator::~G4ItemDefinedTransformationCreator(){}
void G4ItemDefinedTransformationCreator::CreateG4Geometry(STEPentity& Ent)
{
G4PlacementVector* places = new G4PlacementVector();
// L. Broglia
// G4Placement* place=0;
G4Axis2Placement3D* place=0;
G4String attrName("transform_item_1");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
// L. Broglia
// place = (G4Placement*)tmp;
place = (G4Axis2Placement3D*)tmp;
places->append(place);
attrName="transform_item_2";
Attr = GetNamedAttribute(attrName, Ent);
TmpEnt = *Attr->ptr.c;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
// L. Broglia
// place = (G4Placement*)tmp;
place = (G4Axis2Placement3D*)tmp;
places->append(place);
createdObject = places;
}
void G4ItemDefinedTransformationCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,40 @@
#include "G4LineCreator.hh"
G4LineCreator G4LineCreator::csc;
G4LineCreator::G4LineCreator(){G4GeometryTable::RegisterObject(this);}
G4LineCreator::~G4LineCreator(){}
void G4LineCreator::CreateG4Geometry(STEPentity& Ent)
{
G4ThreeVector origin;
G4ThreeVector dir;
Ent.ResetAttributes();
STEPattribute *Attr;
Attr = Ent.NextAttribute();
while (Attr->NonRefType() == STRING_TYPE)
Attr = Ent.NextAttribute();
// Get the line origin
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
origin = *(G4ThreeVector*)tmp;
// Get the line direction
Attr = Ent.NextAttribute();
TmpEnt = *Attr->ptr.c;
tmp =G4GeometryTable::CreateObject(*TmpEnt);
dir = *(G4ThreeVector*)tmp;
G4Line* line = new G4Line();
line->Init(origin, dir);
createdObject = line;
}
void G4LineCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,26 @@
#include "G4ManifoldSolidBrepCreator.hh"
G4ManifoldSolidBrepCreator G4ManifoldSolidBrepCreator::csc;
G4ManifoldSolidBrepCreator::G4ManifoldSolidBrepCreator(){G4GeometryTable::RegisterObject(this);}
G4ManifoldSolidBrepCreator::~G4ManifoldSolidBrepCreator(){}
void G4ManifoldSolidBrepCreator::CreateG4Geometry(STEPentity& Ent)
{
G4BREPSolid* sld;
G4String attrName("outer");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
// Get solid
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
sld = (G4BREPSolid*)tmp;
createdObject = sld;
}
void G4ManifoldSolidBrepCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,17 @@
#include "G4OpenShellCreator.hh"
G4OpenShellCreator G4OpenShellCreator::csc;
G4OpenShellCreator::G4OpenShellCreator(){G4GeometryTable::RegisterObject(this);}
G4OpenShellCreator::~G4OpenShellCreator(){}
void G4OpenShellCreator::CreateG4Geometry(STEPentity& Ent)
{
}
void G4OpenShellCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,34 @@
#include "G4OrientedEdgeCreator.hh"
G4OrientedEdgeCreator G4OrientedEdgeCreator::csc;
G4OrientedEdgeCreator::G4OrientedEdgeCreator(){G4GeometryTable::RegisterObject(this);}
G4OrientedEdgeCreator::~G4OrientedEdgeCreator(){}
void G4OrientedEdgeCreator::CreateG4Geometry(STEPentity& Ent)
{
G4int orientation;
G4Curve* crv;
G4String attrName("edge_element");
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
// Get curve
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
crv = (G4Curve*)tmp;
// Get orientation
Attr = Ent.NextAttribute();
orientation = *Attr->ptr.i;// INTEGER_TYPE
crv->SetSameSense(orientation);
createdObject = crv;
}
void G4OrientedEdgeCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,40 @@
#include "G4ParabolaCreator.hh"
G4ParabolaCreator G4ParabolaCreator::csc;
G4ParabolaCreator::G4ParabolaCreator(){G4GeometryTable::RegisterObject(this);}
G4ParabolaCreator::~G4ParabolaCreator(){}
void G4ParabolaCreator::CreateG4Geometry(STEPentity& Ent)
{
G4double focal_dist;
// L. Broglia
// G4Placement* place;
G4Axis2Placement3D* place;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
while(Attr->NonRefType() == STRING_TYPE ||
Attr->NonRefType() == sdaiSTRING )
Attr = Ent.NextAttribute();
// Get the placement
STEPentity* TmpEnt= *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
// L. Broglia
// place = (G4Placement*)tmp;
place = (G4Axis2Placement3D*)tmp;
// get semi axises
Attr = Ent.NextAttribute();
focal_dist = *Attr->ptr.r;
}
void G4ParabolaCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,35 @@
#include "G4PlaneCreator.hh"
G4PlaneCreator G4PlaneCreator::csc;
G4PlaneCreator::G4PlaneCreator(){G4GeometryTable::RegisterObject(this);}
G4PlaneCreator::~G4PlaneCreator(){}
void G4PlaneCreator::CreateG4Geometry(STEPentity& Ent)
{
// L. Broglia
// G4Placement* place;
G4Axis2Placement3D* place;
Ent.ResetAttributes();
STEPattribute *Attr;
Attr = Ent.NextAttribute();
while (Attr->NonRefType() == STRING_TYPE)
Attr = Ent.NextAttribute();
// Get placement
STEPentity* TmpEnt = *Attr->ptr.c;
void *tmp =G4GeometryTable::CreateObject(*TmpEnt);
place = (G4Axis2Placement3D*)tmp;
createdObject = new G4FPlane( place->GetRefDirection(),
place->GetAxis(),
place->GetLocation());
}
void G4PlaneCreator::CreateSTEPGeometry(void* G4obj)
{
}
@@ -0,0 +1,14 @@
#include "G4PointCreator.hh"
G4PointCreator G4PointCreator::csc;
G4PointCreator::G4PointCreator()
{
G4GeometryTable::RegisterObject(this);
}
G4PointCreator::~G4PointCreator(){}
void G4PointCreator::CreateG4Geometry(STEPentity& Ent){}
void G4PointCreator::CreateSTEPGeometry(void* G4obj){}
@@ -0,0 +1,37 @@
#include "G4PointOnCurveCreator.hh"
G4PointOnCurveCreator G4PointOnCurveCreator::csc;
G4PointOnCurveCreator::G4PointOnCurveCreator(){G4GeometryTable::RegisterObject(this);}
G4PointOnCurveCreator::~G4PointOnCurveCreator(){}
void G4PointOnCurveCreator::CreateG4Geometry(STEPentity& Ent)
{
G4Curve* crv=0;
G4double pval = 0;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
while(Attr->NonRefType() == STRING_TYPE ||
Attr->NonRefType() == sdaiSTRING )
Attr = Ent.NextAttribute();
// Get basis curve
STEPentity* TmpEnt= *Attr->ptr.c;
void* tmp =G4GeometryTable::CreateObject(*TmpEnt);
crv = (G4Curve*)tmp;
// Get parameter value
Attr = Ent.NextAttribute();
pval = *Attr->ptr.r;
createdObject = new G4double(pval);
}
void G4PointOnCurveCreator::CreateSTEPGeometry(void* G4obj){}
@@ -0,0 +1,39 @@
#include "G4PointOnSurfaceCreator.hh"
G4PointOnSurfaceCreator G4PointOnSurfaceCreator::csc;
G4PointOnSurfaceCreator::G4PointOnSurfaceCreator(){G4GeometryTable::RegisterObject(this);}
G4PointOnSurfaceCreator::~G4PointOnSurfaceCreator(){}
void G4PointOnSurfaceCreator::CreateG4Geometry(STEPentity& Ent)
{
G4Surface* srf=0;
G4double pval1 = 0;
G4double pval2 = 0;
Ent.ResetAttributes();
STEPattribute* Attr = Ent.NextAttribute();
while(Attr->NonRefType() == STRING_TYPE ||
Attr->NonRefType() == sdaiSTRING )
Attr = Ent.NextAttribute();
// Get basis surface
STEPentity* TmpEnt= *Attr->ptr.c;
void * tmp =G4GeometryTable::CreateObject(*TmpEnt);
srf = (G4Surface*)tmp;
// Get parameter values
Attr = Ent.NextAttribute();
pval1 = *Attr->ptr.r;
Attr = Ent.NextAttribute();
pval2 = *Attr->ptr.r;
G4double* dtmp = new G4double[2];
dtmp[0] = pval1;
dtmp[1] = pval2;
createdObject = dtmp;
}
void G4PointOnSurfaceCreator::CreateSTEPGeometry(void* G4obj){}
@@ -0,0 +1,11 @@
#include "G4PointReplicaCreator.hh"
G4PointReplicaCreator G4PointReplicaCreator::csc;
G4PointReplicaCreator::G4PointReplicaCreator(){G4GeometryTable::RegisterObject(this);}
G4PointReplicaCreator::~G4PointReplicaCreator(){}
void G4PointReplicaCreator::CreateG4Geometry(STEPentity& Ent){}
void G4PointReplicaCreator::CreateSTEPGeometry(void* G4obj){}

Some files were not shown because too many files have changed in this diff Show More