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( ...@@ -41,8 +41,8 @@ vtkAMRBox::vtkAMRBox(
int ihi,int jhi) int ihi,int jhi)
{ {
this->BuildAMRBox( ilo,jlo,0,ihi,jhi,0); this->BuildAMRBox( ilo,jlo,0,ihi,jhi,0);
assert( "post: Dimension expected to <= 2" && // assert( "post: Dimension expected to <= 2" &&
( (this->GetDimensionality()==2) || (this->GetDimensionality()==1) ) ); // ( (this->GetDimensionality()==2) || (this->GetDimensionality()==1) ) );
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
...@@ -1006,8 +1006,13 @@ bool vtkAMRBox::HasPoint( const double x, const double y, const double z ) ...@@ -1006,8 +1006,13 @@ bool vtkAMRBox::HasPoint( const double x, const double y, const double z )
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
bool vtkAMRBox::operator==(const vtkAMRBox &other) bool vtkAMRBox::operator==(const vtkAMRBox &other)
{ {
// TODO: fix this to check for equality of meta-data as well // TODO: fix this to check for equality of meta-data as well?
if ( this->Dimension!=other.Dimension) if ( this->Dimension != other.Dimension)
{
return false;
}
if( this->BlockLevel != other.BlockLevel )
{ {
return false; return false;
} }
......
...@@ -244,9 +244,18 @@ public: ...@@ -244,9 +244,18 @@ public:
bool IsInvalid() const; bool IsInvalid() const;
// Description: // 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); 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: // Description:
// Determine if the boxes intersect but do not compute // Determine if the boxes intersect but do not compute
// the intersection // 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