Import Geant4 2.0.0 source tree
This commit is contained in:
@@ -1,14 +1,38 @@
|
||||
// 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: G4ClosedShellCreator.cc,v 1.3 2000/02/25 16:36:18 gcosmo Exp $
|
||||
// GEANT4 tag $Name: geant4-02-00 $
|
||||
//
|
||||
// ----------------------------------------------------------------------
|
||||
// Class G4ClosedShellCreator
|
||||
//
|
||||
// Authors: J.Sulkimo, P.Urban.
|
||||
// Revisions by: L.Broglia, G.Cosmo.
|
||||
//
|
||||
// History:
|
||||
// 18-Nov-1999: First step of re-engineering - G.Cosmo
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
#include "G4ClosedShellCreator.hh"
|
||||
#include "G4GeometryTable.hh"
|
||||
#include "G4BREPSolid.hh"
|
||||
|
||||
G4ClosedShellCreator G4ClosedShellCreator::csc;
|
||||
|
||||
G4ClosedShellCreator::G4ClosedShellCreator(){G4GeometryTable::RegisterObject(this);}
|
||||
G4ClosedShellCreator::G4ClosedShellCreator()
|
||||
{
|
||||
G4GeometryTable::RegisterObject(this);
|
||||
}
|
||||
|
||||
G4ClosedShellCreator::~G4ClosedShellCreator(){}
|
||||
G4ClosedShellCreator::~G4ClosedShellCreator() {}
|
||||
|
||||
void G4ClosedShellCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
{
|
||||
|
||||
G4String attrName("cfs_faces");
|
||||
STEPattribute *Attr = GetNamedAttribute(attrName, Ent);
|
||||
STEPaggregate *Aggr = Attr->ptr.a;
|
||||
@@ -19,26 +43,28 @@ void G4ClosedShellCreator::CreateG4Geometry(STEPentity& Ent)
|
||||
|
||||
G4SurfaceVector SurfaceVec;
|
||||
|
||||
for(G4int a=0; a<FaceCount;a++)
|
||||
for(size_t a=0; a<FaceCount;a++)
|
||||
{
|
||||
TmpEnt = ((EntityNode*)Node)->node;
|
||||
void *tmp =::G4GeometryTable::CreateObject(*TmpEnt);
|
||||
SurfaceVec.append((G4Surface*)tmp);
|
||||
void *tmp = G4GeometryTable::CreateObject(*TmpEnt);
|
||||
if (tmp) SurfaceVec.append((G4Surface*)tmp);
|
||||
Node = Node->NextNode();
|
||||
}
|
||||
|
||||
// create G4solid
|
||||
G4Surface** srfVec = new G4Surface*[FaceCount];
|
||||
|
||||
for(G4int b=0;b<FaceCount;b++)
|
||||
G4int SurfNum = SurfaceVec.entries();
|
||||
G4Surface** srfVec = new G4Surface*[SurfNum];
|
||||
if (SurfNum != FaceCount)
|
||||
G4cerr << "WARNING - G4ClosedShellCreator::CreateG4Geometry" << G4endl
|
||||
<< "\tTotal of " << SurfNum << " G4Surface components created, out of "
|
||||
<< FaceCount << " expected !" << G4endl
|
||||
<< "\tBREP Solid not correctly instantiated." << G4endl;
|
||||
for(size_t b=0;b<SurfNum;b++)
|
||||
srfVec[b] = (SurfaceVec[b]);
|
||||
|
||||
G4BREPSolid* sld = new G4BREPSolid(" ", srfVec, FaceCount);
|
||||
G4BREPSolid* sld = new G4BREPSolid(" ", srfVec, SurfNum);
|
||||
|
||||
createdObject = sld;
|
||||
|
||||
// delete [] srfVec;
|
||||
// delete sld;
|
||||
}
|
||||
|
||||
void G4ClosedShellCreator::CreateSTEPGeometry(void* G4obj)
|
||||
@@ -62,14 +88,10 @@ void G4ClosedShellCreator::CreateSTEPGeometry(void* G4obj)
|
||||
eNode = new EntityNode((STEPentity*)tmp);
|
||||
eAggr.AddNode(eNode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
sld->Cfs_faces(&eAggr);
|
||||
|
||||
|
||||
sld->cfs_faces_(&eAggr);
|
||||
sld->SetFileId(GetNextId());
|
||||
sld->Name("");
|
||||
sld->name_("");
|
||||
sld->STEPwrite(G4cout);
|
||||
|
||||
createdObject = sld;
|
||||
|
||||
Reference in New Issue
Block a user