Import Geant4 0.1.0 source tree
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
# $Id: GNUmakefile,v 1.1 1998/07/09 19:10:25 japost Exp $
|
||||
# $Id: GNUmakefile,v 1.1 1999/01/07 16:08:21 gunter Exp $
|
||||
# -------------------------------------------------------------
|
||||
# GNUmakefile for STEP library. Gabriele Cosmo, 15/11/96.
|
||||
# -------------------------------------------------------------
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
History file for geometry/solids/STEPinterface
|
||||
|
||||
6th February 1999 John Allison stepinterface-01-00-00 on ONE FILE ONLY...
|
||||
- Commented out some troublesome printing in G4GeometryTable.cc. Changes
|
||||
(a) in branch stepintf-geant4-00-branch (from geant4-00), (b) in branch
|
||||
stepintf-01-00-00-branch, and (c) in head of G4GeometryTable.cc.
|
||||
|
||||
revision 1.9
|
||||
date: 1998/12/09 12:00:42; author: broglia; state: Exp; lines: +22 -37
|
||||
December 9, 1998 : L. Broglia
|
||||
|
||||
@@ -61,17 +61,19 @@ void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
G4int a;
|
||||
|
||||
// L. Broglia
|
||||
// Total assumption !
|
||||
|
||||
if(ConDepShapes>0)
|
||||
{
|
||||
//#define G4_STEPINTERFACE_DEBUG 1
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"\n\n Creating the Context_Dependent_Shape_Representation"<<endl;
|
||||
#endif
|
||||
index = 0;
|
||||
|
||||
for( a=0; a< ConDepShapes; a++)
|
||||
{
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"loop "<<a+1<<" of "<<ConDepShapes<<endl;
|
||||
|
||||
#endif
|
||||
// Be careful, tmpindex not correspond to STEPfile_id !
|
||||
tmpindex =
|
||||
instanceManager.GetIndex("Context_Dependent_Shape_Representation",
|
||||
@@ -93,8 +95,12 @@ void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
}
|
||||
|
||||
index = ent->STEPfile_id ;
|
||||
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<" Context_Dependent_Shape_Representation find in index "
|
||||
<<index<<endl;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// Set index to the true value
|
||||
@@ -105,10 +111,15 @@ void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
}
|
||||
else
|
||||
{
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"\n Creating the Shape_Definition_Representation"<<endl;
|
||||
#endif
|
||||
|
||||
for(a=0; a< ShapeDefReps ; a++)
|
||||
{
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<"loop "<<a+1<<" of "<<ShapeDefReps<<endl;
|
||||
#endif
|
||||
|
||||
// Be careful, tmpindex not correspond to STEPfile_id !
|
||||
tmpindex = instanceManager.GetIndex("Shape_Definition_Representation",
|
||||
@@ -130,7 +141,9 @@ void G4AssemblyCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
}
|
||||
|
||||
index = ent->STEPfile_id ;
|
||||
G4cout<<" Shape_Definition_Representation find in index "<<index<<endl;
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
G4cout<<" Shape_Definition_Representation find in index "<<index<<endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Set index to the true value
|
||||
|
||||
@@ -17,9 +17,6 @@ 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);
|
||||
|
||||
|
||||
@@ -17,32 +17,36 @@ 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;
|
||||
}
|
||||
{
|
||||
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);
|
||||
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;
|
||||
}
|
||||
for(G4int a=0; a<RegisteredObjects.length(); a++)
|
||||
{
|
||||
G4GeometryCreator* gcTmp = RegisteredObjects(a);
|
||||
G4String rName = gcTmp->Name();
|
||||
|
||||
if(rName == objectName)
|
||||
return gcTmp;
|
||||
}
|
||||
|
||||
return (G4GeometryCreator*)0;
|
||||
}
|
||||
|
||||
@@ -54,26 +58,31 @@ void* G4GeometryTable::CreateObject(STEPentity& Ent)
|
||||
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;
|
||||
}
|
||||
{
|
||||
gctmp->CreateG4Geometry(Ent);
|
||||
void* obj = gctmp->GetCreatedObject();
|
||||
|
||||
//#define G4_STEPINTERFACE_DEBUG 1
|
||||
#ifdef G4_STEPINTERFACE_DEBUG
|
||||
if (obj == 0)
|
||||
G4cout << "G4 object of type " << gctmp->Name()
|
||||
<< " not necessary" << endl;
|
||||
else
|
||||
//G4cout << "Created G4 object of type " << gctmp->Name() << endl;
|
||||
#endif
|
||||
|
||||
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)
|
||||
{
|
||||
|
||||
|
||||
@@ -14,9 +14,6 @@ void G4ProductDefinitionShapeCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
// Made by L. Broglia
|
||||
STEPattribute *Attr;
|
||||
|
||||
// tmp
|
||||
G4cout<<"Warning ! G4ProductDefinitionShapeCreator called ..."<<endl;
|
||||
|
||||
G4String attrName("description");
|
||||
Attr = GetNamedAttribute(attrName, Ent);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user