Import Geant4 2.0.0 source tree
This commit is contained in:
@@ -1,5 +1,31 @@
|
||||
// This code implementation is the intellectual property of
|
||||
// the GEANT4 collaboration.
|
||||
//
|
||||
// By copying, distributing or modifying the Program (or any work
|
||||
// based on the Program) you indicate your acceptance of this statement,
|
||||
// and all its terms.
|
||||
//
|
||||
// $Id: G4AssemblyCreator.cc,v 1.5 2000/02/25 16:36:17 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4AssemblyCreator
|
||||
//
|
||||
// Authors: J.Sulkimo, P.Urban.
|
||||
// Revisions by: L.Broglia, G.Cosmo.
|
||||
//
|
||||
// History:
|
||||
// 18-Nov-1999: First step of re-engineering - G.Cosmo
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4AssemblyCreator.hh"
|
||||
#include "G4Assembly.hh"
|
||||
|
||||
#include "G4GeometryTable.hh"
|
||||
#include "G4StepFileReader.hh"
|
||||
#include "G4NISTStepReader.hh"
|
||||
#include "G4ToroidalSurface.hh"
|
||||
|
||||
extern void HeaderSchemaInit (Registry & reg);
|
||||
|
||||
G4AssemblyCreator G4AssemblyCreator::ci;
|
||||
@@ -34,8 +60,11 @@ void G4AssemblyCreator::ReadStepFile()
|
||||
instanceManager = StepReader->GetInstanceManager();
|
||||
}
|
||||
|
||||
void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
{
|
||||
void G4AssemblyCreator::CreateG4Geometry(STEPentity& sEntity)
|
||||
{
|
||||
G4cout << G4endl
|
||||
<< "Creating assembly of G4 solids ..." << G4endl;
|
||||
|
||||
// Advanced_Brep_Shape_Representation are created into
|
||||
// Context_Dependent_Shape_Representation and
|
||||
// Shape_Definition_Representation
|
||||
@@ -53,7 +82,7 @@ void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
|
||||
STEPentity* ent=0;
|
||||
index = 0;
|
||||
int tmpindex;
|
||||
int tmpindex = 0;
|
||||
|
||||
void *tmp = 0;
|
||||
G4PlacedSolidVector* psv = new G4PlacedSolidVector();
|
||||
@@ -63,46 +92,52 @@ void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
// L. Broglia
|
||||
if(ConDepShapes>0)
|
||||
{
|
||||
//#define G4_STEPINTERFACE_DEBUG 1
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"\n\n Creating the Context_Dependent_Shape_Representation"<<G4endl;
|
||||
#endif
|
||||
index = 0;
|
||||
const char* keyw = "Context_Dependent_Shape_Representation";
|
||||
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout << "\n\n Creating the " << keyw << G4endl;
|
||||
#endif
|
||||
|
||||
for( a=0; a< ConDepShapes; a++)
|
||||
{
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"loop "<<a+1<<" of "<<ConDepShapes<<G4endl;
|
||||
G4cout << "loop " << a+1 << " of " << ConDepShapes << G4endl;
|
||||
#endif
|
||||
// Be careful, tmpindex not correspond to STEPfile_id !
|
||||
tmpindex =
|
||||
instanceManager.GetIndex("Context_Dependent_Shape_Representation",
|
||||
index );
|
||||
|
||||
ent = instanceManager.GetSTEPentity(tmpindex);
|
||||
|
||||
|
||||
ent = instanceManager.GetApplication_instance(keyw, index);
|
||||
|
||||
if(ent!= ENTITY_NULL)
|
||||
{
|
||||
tmp =G4GeometryTable::CreateObject(*ent);
|
||||
|
||||
G4PlacedSolidVector* tmpV = (G4PlacedSolidVector*)tmp;
|
||||
G4int entr = tmpV->entries();
|
||||
// Be careful, tmpindex not correspond to STEPfile_id !
|
||||
tmpindex = instanceManager.GetIndex(ent);
|
||||
|
||||
for(G4int b=0; b<entr; b++)
|
||||
tmp = G4GeometryTable::CreateObject(*ent);
|
||||
if (!tmp)
|
||||
{
|
||||
ps = tmpV->at(b);
|
||||
psv->append(ps);
|
||||
G4cerr << "--- GeometryTable::CreateG4Geometry()" << G4endl;
|
||||
G4cerr << " No correspondent G4 geometry created for entity: "
|
||||
<< ent->EntityName() << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
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 ;
|
||||
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<" Context_Dependent_Shape_Representation find in index "
|
||||
<<index<<G4endl;
|
||||
G4cout << keyw << " found in index " << index << G4endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// Set index to the true value
|
||||
index = tmpindex + 1;
|
||||
ent=0;
|
||||
@@ -111,39 +146,50 @@ void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
const char* key = "Shape_Definition_Representation";
|
||||
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"\n Creating the Shape_Definition_Representation"<<G4endl;
|
||||
G4cout << "\n Creating the " << key << G4endl;
|
||||
#endif
|
||||
|
||||
for(a=0; a< ShapeDefReps ; a++)
|
||||
{
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"loop "<<a+1<<" of "<<ShapeDefReps<<G4endl;
|
||||
G4cout << "loop " << a+1 << " of " << ShapeDefReps << G4endl;
|
||||
#endif
|
||||
|
||||
// Be careful, tmpindex not correspond to STEPfile_id !
|
||||
tmpindex = instanceManager.GetIndex("Shape_Definition_Representation",
|
||||
index );
|
||||
|
||||
ent = instanceManager.GetSTEPentity(tmpindex);
|
||||
|
||||
ent = instanceManager.GetApplication_instance(key, index);
|
||||
|
||||
if(ent!= ENTITY_NULL)
|
||||
{
|
||||
// Be careful, tmpindex not correspond to STEPfile_id !
|
||||
tmpindex = instanceManager.GetIndex(ent);
|
||||
|
||||
tmp = G4GeometryTable::CreateObject(*ent);
|
||||
|
||||
G4PlacedSolidVector* tmpV = (G4PlacedSolidVector*)tmp;
|
||||
G4int entr = tmpV->entries();
|
||||
|
||||
for(G4int b=0; b<entr; b++)
|
||||
if (!tmp)
|
||||
{
|
||||
ps = tmpV->at(b);
|
||||
psv->append(ps);
|
||||
G4cerr << "--- GeometryTable::CreateG4Geometry()" << G4endl;
|
||||
G4cerr << " No correspondent G4 geometry created for entity: "
|
||||
<< ent->EntityName() << G4endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
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 ;
|
||||
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<" Shape_Definition_Representation find in index "<<index<<G4endl;
|
||||
G4cout << key << " found in index "<< index << G4endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// Set index to the true value
|
||||
@@ -171,7 +217,3 @@ void G4AssemblyCreator::CreateSTEPGeometry(void* G4obj)
|
||||
void *tmp =G4GeometryTable::CreateSTEPObject(G4obj, name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user