CellFilter CellFilter::intersection(const CellFilter& other) const { if (isNull() || other.isNull()) { CellFilter rtn; return rtn; } else if (isKnownDisjointWith(other) || other.isKnownDisjointWith(*this)) { CellFilter rtn; return rtn; } else if (isKnownSubsetOf(other)) { return *this; } else if (other.isKnownSubsetOf(*this)) { return other; } else if (*this==other) { return *this; } else { CellFilter rtn = new BinaryCellFilter(*this, other, BinaryCellFilter::Intersection); other.registerSubset(rtn); this->registerSubset(rtn); return rtn; } }
CellFilter CellFilter::operator-(const CellFilter& other) const { if (other.isNull()) { return *this; } else if (isKnownDisjointWith(other) || other.isKnownDisjointWith(*this)) { return *this; } else if (isKnownSubsetOf(other)) { CellFilter rtn; return rtn; } else if (*this == other) { CellFilter rtn; return rtn; } else { CellFilter rtn = new BinaryCellFilter(*this, other, BinaryCellFilter::Difference); rtn.registerDisjoint(other); this->registerSubset(rtn); return rtn; } }