Problem 959

Summary: Missing initialization in G4BoundingBox3D
Product: Geant4 Reporter: farnea
Component: geometry/solidsAssignee: Gabriele Cosmo <Gabriele.Cosmo>
Status: RESOLVED FIXED    
Severity: normal CC: farnea
Priority: P2    
Version: 9.0   
Hardware: PC   
OS: Linux   

Description farnea 2007-07-16 09:27:41 CEST
the constructor

G4BoundingBox3D::G4BoundingBox3D(const G4Point3D& p1, const G4Point3D& p2)
{
  Init(p1, p2);
}

uses the method

void G4BoundingBox3D::Init(const G4Point3D& p1, const G4Point3D& p2)
{
  // L. Broglia
  // Maybe temporary
  // Create a BBox bigger than the reality

  kCarTolerance = G4GeometryTolerance::GetInstance()->GetSurfaceTolerance();

  box_min.setX( std::min(p1.x(), p2.x()) - kCarTolerance );
  box_min.setY( std::min(p1.y(), p2.y()) - kCarTolerance );
  box_min.setZ( std::min(p1.z(), p2.z()) - kCarTolerance );
  box_max.setX( std::max(p1.x(), p2.x()) + kCarTolerance );
  box_max.setY( std::max(p1.y(), p2.y()) + kCarTolerance );
  box_max.setZ( std::max(p1.z(), p2.z()) + kCarTolerance );

  // Calc half spaces
  GeantBox = (box_max - box_min)*0.5;
  MiddlePoint = (box_min + box_max)*0.5;
  distance = 0;
}

where kCarTolerance is set as explained in the release notes.
This is not done with the constructor:

G4BoundingBox3D::G4BoundingBox3D(const G4Point3D& p)
{
  Init(p);
}

using the method

void G4BoundingBox3D::Init(const G4Point3D& p)
{
  box_min= box_max= MiddlePoint= p;
  GeantBox= G4Point3D(0, 0, 0);
  distance= 0;
}

where kCarTolerance is not initialized.
Comment 1 Gabriele Cosmo 2007-07-16 13:43:13 CEST
The problem is now fixed in tag "breps-V09-00-00" and will be included
in a future patch to release 9.0. Thanks.