Skip to content

Commit

Permalink
Add inequality operators
Browse files Browse the repository at this point in the history
  • Loading branch information
JacksonCampolattaro committed Jul 16, 2020
1 parent 8eb54e0 commit 069b2d4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions Octree/doc/Octree/Octree.txt
Expand Up @@ -13,6 +13,10 @@ An octree is a commonly used data structure that subdivides 3d space.
The Octree package provides the Octree and Node classes.

\section Section_Octree_Example_Programs Example Programs

\subsection Section_Octree_Example_Point_Set Example for an Octree built from a Point_set_3
\subsection Section_Octree_Example_Custom_Split_Criterion Example for a Custom Split_criterion

\section Section_Octree_Software_Design Software Design

\subsection Subsection_Octree_Splitting_Rules Splitting Rules
Expand Down
6 changes: 5 additions & 1 deletion Octree/include/CGAL/Octree.h
Expand Up @@ -401,7 +401,7 @@ class Octree {
* \param rhs tree to compare with
* \return whether the trees have the same topology
*/
bool operator==(Octree<PointRange, PointMap> &rhs) const {
bool operator==(const Octree<PointRange, PointMap> &rhs) const {

// Identical trees should have the same bounding box
if (rhs.m_bbox_min != m_bbox_min || rhs.m_bbox_side != m_bbox_side)
Expand All @@ -415,6 +415,10 @@ class Octree {
return rhs.m_root == m_root;
}

bool operator!=(const Octree<PointRange, PointMap> &rhs) const {
return !operator==(rhs);
}

/// @}


Expand Down
4 changes: 4 additions & 0 deletions Octree/include/CGAL/Octree/Node.h
Expand Up @@ -265,6 +265,10 @@ class Node {
return (location() == rhs.location());
}

bool operator!=(const Node &rhs) const {
return !operator==(rhs);
}

/// @}
};
}
Expand Down
2 changes: 1 addition & 1 deletion Octree/test/Octree/test_octree_equality.cpp
Expand Up @@ -105,7 +105,7 @@ void test_different_contents_identical_criteria() {
b.refine(10, 1);

// Check if those trees are considered equal
assert(!(a == b));
assert(a != b);
}


Expand Down

0 comments on commit 069b2d4

Please sign in to comment.