*/
//================================================================================
- DirectedBoundingBox::DirectedBoundingBox():_dim(-1)
+ DirectedBoundingBox::DirectedBoundingBox():_dim(0)
{
}
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 )
{
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
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 );
vector<double> DirectedBoundingBox::getData() const
{
vector<double> 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;
_local_cell_mesh->getNumberOfNodes(),
_local_cell_mesh_space_dim);
std::vector<double> dbbData = dbb.getData();
+ if ( dbbData.size() < bbSize ) dbbData.resize(bbSize,0);
double * minmax= &dbbData[0];
#else
int bbSize = 2*_local_cell_mesh_space_dim;
_distant_proc_ids.push_back(rank);
}
}
+#ifdef USE_DIRECTED_BB
+#else
delete [] minmax;
+#endif
}