From 8ca41c05b7bee264fd7c7b0c36a03bb1650a461a Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 12 May 2010 10:14:55 +0000 Subject: [PATCH] 0020873: [CEA] Failure with ParaMedMem * Correct work of an empty box --- src/INTERP_KERNEL/DirectedBoundingBox.cxx | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/INTERP_KERNEL/DirectedBoundingBox.cxx b/src/INTERP_KERNEL/DirectedBoundingBox.cxx index 9c275da70..72b5c5101 100644 --- a/src/INTERP_KERNEL/DirectedBoundingBox.cxx +++ b/src/INTERP_KERNEL/DirectedBoundingBox.cxx @@ -202,7 +202,7 @@ namespace INTERP_KERNEL */ //================================================================================ - DirectedBoundingBox::DirectedBoundingBox():_dim(-1) + DirectedBoundingBox::DirectedBoundingBox():_dim(0) { } @@ -594,6 +594,8 @@ namespace INTERP_KERNEL bool DirectedBoundingBox::isDisjointWith(const DirectedBoundingBox& box) const { + if ( _dim < 1 || box._dim < 1 ) return false; // empty box includes all + // boxes are disjoined if their minmaxes in local CS of either of boxes do not intersect for ( int isThisCS = 0; isThisCS < 2; ++isThisCS ) { @@ -629,6 +631,8 @@ namespace INTERP_KERNEL bool DirectedBoundingBox::isDisjointWith(const double* box) const { + if ( _dim < 1 ) return false; // empty box includes all + // boxes are disjoined if their minmaxes in local CS of either of boxes do not intersect // compare minmaxes in locals CS of this directed box @@ -673,6 +677,8 @@ namespace INTERP_KERNEL bool DirectedBoundingBox::isOut(const double* point) const { + if ( _dim < 1 ) return false; // empty box includes all + double pLoc[3]; toLocalCS( point, pLoc ); bool out = isLocalOut( pLoc ); @@ -699,8 +705,11 @@ namespace INTERP_KERNEL vector DirectedBoundingBox::getData() const { vector data(1, _dim); - data.insert( data.end(), &_axes[0], &_axes[0] + _axes.size()); - data.insert( data.end(), &_minmax[0], &_minmax[0] + _minmax.size()); + if ( _dim > 0 ) + { + data.insert( data.end(), &_axes[0], &_axes[0] + _axes.size()); + data.insert( data.end(), &_minmax[0], &_minmax[0] + _minmax.size()); + } if ( data.size() < dataSize( _dim )) data.resize( dataSize( _dim ), 0 ); return data; -- 2.39.2