Geant4-11
Functions
G4SmartVoxelHeader.cc File Reference
#include "G4SmartVoxelHeader.hh"
#include "G4ios.hh"
#include "G4LogicalVolume.hh"
#include "G4VPhysicalVolume.hh"
#include "G4VoxelLimits.hh"
#include "voxeldefs.hh"
#include "G4AffineTransform.hh"
#include "G4VSolid.hh"
#include "G4VPVParameterisation.hh"

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &os, const G4SmartVoxelHeader &h)
 

Function Documentation

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const G4SmartVoxelHeader h 
)

Definition at line 1295 of file G4SmartVoxelHeader.cc.

1296{
1297 os << "Axis = " << G4int(h.faxis) << G4endl;
1298 G4SmartVoxelProxy *collectNode=nullptr, *collectHead=nullptr;
1299 G4int collectNodeNo = 0;
1300 G4int collectHeadNo = 0;
1301 size_t i, j;
1302 G4bool haveHeaders = false;
1303
1304 for (i=0; i<h.fslices.size(); ++i)
1305 {
1306 os << "Slice #" << i << " = ";
1307 if (h.fslices[i]->IsNode())
1308 {
1309 if (h.fslices[i]!=collectNode)
1310 {
1311 os << "{";
1312 for (size_t k=0; k<h.fslices[i]->GetNode()->GetNoContained(); ++k)
1313 {
1314 os << " " << h.fslices[i]->GetNode()->GetVolume(k);
1315 }
1316 os << " }" << G4endl;
1317 collectNode = h.fslices[i];
1318 collectNodeNo = i;
1319 }
1320 else
1321 {
1322 os << "As slice #" << collectNodeNo << G4endl;
1323 }
1324 }
1325 else
1326 {
1327 haveHeaders=true;
1328 if (h.fslices[i] != collectHead)
1329 {
1330 os << "Header" << G4endl;
1331 collectHead = h.fslices[i];
1332 collectHeadNo = i;
1333 }
1334 else
1335 {
1336 os << "As slice #" << collectHeadNo << G4endl;
1337 }
1338 }
1339 }
1340
1341 if (haveHeaders)
1342 {
1343 collectHead=nullptr;
1344 for (j=0; j<h.fslices.size(); ++j)
1345 {
1346 if (h.fslices[j]->IsHeader())
1347 {
1348 os << "Header at Slice #" << j << " = ";
1349 if (h.fslices[j] != collectHead)
1350 {
1351 os << G4endl
1352 << (*(h.fslices[j]->GetHeader()));
1353 collectHead = h.fslices[j];
1354 collectHeadNo = j;
1355 }
1356 else
1357 {
1358 os << "As slice #" << collectHeadNo << G4endl;
1359 }
1360 }
1361 }
1362 }
1363 return os;
1364}
bool G4bool
Definition: G4Types.hh:86
int G4int
Definition: G4Types.hh:85
#define G4endl
Definition: G4ios.hh:57