Skip to content

Commit

Permalink
Naming convention change
Browse files Browse the repository at this point in the history
  • Loading branch information
attcs committed Feb 17, 2024
1 parent 26fd69c commit 67a9bf6
Show file tree
Hide file tree
Showing 9 changed files with 1,457 additions and 1,392 deletions.
1 change: 1 addition & 0 deletions .clang-format-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
unittests/*
2,442 changes: 1,243 additions & 1,199 deletions octree.h

Large diffs are not rendered by default.

185 changes: 95 additions & 90 deletions octree_container.h

Large diffs are not rendered by default.

15 changes: 9 additions & 6 deletions unittests/adaptor.tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

using namespace OrthoTree;

using std::array;
using std::vector;

namespace CustomGeometryType
{
// User-defined geometrical objects
Expand Down Expand Up @@ -34,10 +37,10 @@ namespace CustomGeometryType
}
}

static constexpr Point2DCustom& box_min(BoundingBox2DCustom& box) { return box[0]; }
static constexpr Point2DCustom& box_max(BoundingBox2DCustom& box) { return box[1]; }
static constexpr Point2DCustom const& box_min_c(BoundingBox2DCustom const& box) { return box[0]; }
static constexpr Point2DCustom const& box_max_c(BoundingBox2DCustom const& box) { return box[1]; }
static constexpr Point2DCustom& box_min(BoundingBox2DCustom& Box) { return Box[0]; }
static constexpr Point2DCustom& box_max(BoundingBox2DCustom& Box) { return Box[1]; }
static constexpr Point2DCustom const& box_min_c(BoundingBox2DCustom const& Box) { return Box[0]; }
static constexpr Point2DCustom const& box_max_c(BoundingBox2DCustom const& Box) { return Box[1]; }
};

using AdaptorCustom = OrthoTree::AdaptorGeneralBase<2, Point2DCustom, BoundingBox2DCustom, AdaptorBasicsCustom, float>;
Expand Down Expand Up @@ -79,7 +82,7 @@ namespace AdaptorTest
autoc tree = QuadtreePointCustom(vector<Point2DCustom>{}, 2);
autoc& nodes = tree.GetNodes();
Assert::IsTrue(nodes.size() == 1);
Assert::IsTrue(nodes.at(1).vid.empty());
Assert::IsTrue(nodes.at(1).Entities.empty());
Assert::IsTrue(AreEqualAlmost(tree.GetBox(), BoundingBox2DCustom{}));
}

Expand All @@ -92,7 +95,7 @@ namespace AdaptorTest

autoc& nodes = tree.GetNodes();
Assert::AreEqual<size_t>(7, nodes.size());
Assert::IsTrue(nodes.at(tree.GetHash(2, 15)).vid == vector<size_t>{ 3, 4 });
Assert::IsTrue(nodes.at(tree.GetHash(2, 15)).Entities == vector<size_t>{ 3, 4 });
}

TEST_METHOD(Contains__1__True)
Expand Down
3 changes: 3 additions & 0 deletions unittests/bitset.arithmetic.tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

using namespace OrthoTree;

using std::array;
using std::vector;

namespace BitsetArithmeticTest
{
TEST_CLASS(BitsetArithmeticTest)
Expand Down
4 changes: 2 additions & 2 deletions unittests/compile_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void testCompilePoint()

autoc keySmallest = tree.FindSmallestNodeKey(keyRoot);
autoc boxAll = tree.GetBox();
autoc nDepth = tree.GetDepth(keyRoot);
autoc nDepth = tree.GetDepthID(keyRoot);
autoc nDepthMax = tree.GetDepthMax();
autoc nodeRoot = tree.GetNode(keyRoot);
autoc nodes = tree.GetNodes();
Expand Down Expand Up @@ -142,7 +142,7 @@ void testCompileBox()

autoc keySmallest = tree.FindSmallestNodeKey(keyRoot);
autoc boxAll = tree.GetBox();
autoc nDepth = tree.GetDepth(keyRoot);
autoc nDepth = tree.GetDepthID(keyRoot);
autoc nDepthMax = tree.GetDepthMax();
autoc nodeRoot = tree.GetNode(keyRoot);
autoc nodes = tree.GetNodes();
Expand Down
9 changes: 6 additions & 3 deletions unittests/example.tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

using namespace OrthoTree;

using std::array;
using std::vector;

namespace Example
{
TEST_CLASS(ExampleTests)
Expand Down Expand Up @@ -33,7 +36,7 @@ namespace Example
};

auto quadtreebox = QuadtreeBox(boxes, 3
, std::nullopt // user-provided bounding box for all
, std::nullopt // user-provided bounding Box for all
, 2 // max element in a node
);

Expand Down Expand Up @@ -96,7 +99,7 @@ namespace Example
};

auto quadtreebox = QuadtreeBoxC(boxes, 3
, std::nullopt // user-provided bounding box for all
, std::nullopt // user-provided bounding Box for all
, 2 // max element in a node
, false // parallel calculation flag
);
Expand Down Expand Up @@ -127,7 +130,7 @@ namespace Example
auto boxes = vector{ BoundingBox3D{ { 0.0, 0.0, 0.0 }, { 1.0, 1.0, 1.0 } } /* and more... */ };
// Using ctor
{
auto octreebox = OctreeBoxC(boxes, 3, std::nullopt, OctreeBox::max_element_default
auto octreebox = OctreeBoxC(boxes, 3, std::nullopt, OctreeBox::DEFAULT_MAX_ELEMENT
, true // Set std::execution::parallel_unsequenced_policy
);
}
Expand Down
Loading

0 comments on commit 67a9bf6

Please sign in to comment.