Commit 239b79bc authored by George Zagaris's avatar George Zagaris
Browse files

ENH: Implemented "!=" operator

Change-Id: Ib48a8d237fde19fafee96be85fd802b2f7de36a2
parent 4396a228
......@@ -41,8 +41,8 @@ vtkAMRBox::vtkAMRBox(
int ihi,int jhi)
{
this->BuildAMRBox( ilo,jlo,0,ihi,jhi,0);
assert( "post: Dimension expected to <= 2" &&
( (this->GetDimensionality()==2) || (this->GetDimensionality()==1) ) );
// assert( "post: Dimension expected to <= 2" &&
// ( (this->GetDimensionality()==2) || (this->GetDimensionality()==1) ) );
}
//-----------------------------------------------------------------------------
......@@ -1006,8 +1006,13 @@ bool vtkAMRBox::HasPoint( const double x, const double y, const double z )
//-----------------------------------------------------------------------------
bool vtkAMRBox::operator==(const vtkAMRBox &other)
{
// TODO: fix this to check for equality of meta-data as well
if ( this->Dimension!=other.Dimension)
// TODO: fix this to check for equality of meta-data as well?
if ( this->Dimension != other.Dimension)
{
return false;
}
if( this->BlockLevel != other.BlockLevel )
{
return false;
}
......
......@@ -244,9 +244,18 @@ public:
bool IsInvalid() const;
// Description:
// Test if this box has the same dimensions as another.
// Test if this box is equal with the box instance on the rhs.
// Note: Two AMR boxes are equal if: (a) they have the same dimensionality
// (b) they are at the same level and (c) they occupy the same index space.
bool operator==(const vtkAMRBox &other);
// Description:
// Test if this box is NOT equal with the box instance on the rhs.
// Note: Two AMR boxes are equal if: (a) they have the same dimensionality
// (b) they are at the same level and (c) they occupy the same index space.
bool operator!=(const vtkAMRBox &other)
{ return(!(*this == other)); }
// Description:
// Determine if the boxes intersect but do not compute
// the intersection
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment