diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index 923885fe276..ca7bec5de3d 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -512,7 +512,7 @@ public: */ template std::pair, bool> - add_node_property(const std::string& name, const T default_value = T()) { + add_property(const std::string& name, const T default_value = T()) { auto p = m_node_properties.get_or_add_property(name, default_value); return std::pair, bool>(Property_map(p.first), p.second); } @@ -528,7 +528,7 @@ public: */ template Pair_optional_adaptor> - node_property(const std::string& name) { + property(const std::string& name) { auto p = m_node_properties.template get_property_if_exists(name); if (p) return std::optional >(Property_map(*p)); @@ -553,7 +553,7 @@ public: \return true if property was a valid property of the tree. */ template - bool remove_node_property(Property_map property) { + bool remove_property(Property_map property) { return m_node_properties.remove_property(property.array()); } diff --git a/Orthtree/test/Orthtree/test_octree_custom_properties.cpp b/Orthtree/test/Orthtree/test_octree_custom_properties.cpp index 8b9a7927513..e75837a0312 100644 --- a/Orthtree/test/Orthtree/test_octree_custom_properties.cpp +++ b/Orthtree/test/Orthtree/test_octree_custom_properties.cpp @@ -26,35 +26,35 @@ int main(void) { Octree tree({points, points.point_map()}); // Testing built in node properties - typename Octree::Property_map data_prop = *tree.node_property("contents"); + typename Octree::Property_map data_prop = *tree.property("contents"); CGAL_USE(data_prop); // list of properties std::size_t num = tree.properties().size(); assert(num == 5); - auto prop2 = tree.add_node_property("test", int(0)); + auto prop2 = tree.add_property("test", int(0)); assert(prop2.second); assert(tree.properties().size() == 6); - auto prop5 = tree.add_node_property("test", int(0)); + auto prop5 = tree.add_property("test", int(0)); assert(!prop5.second); - auto a1 = tree.node_property("test"); - std::pair, bool> p1 = tree.node_property("test"); - std::optional> o1 = tree.node_property("test"); + auto a1 = tree.property("test"); + std::pair, bool> p1 = tree.property("test"); + std::optional> o1 = tree.property("test"); auto f = a1.first; auto pf1 = p1.first; auto of1 = o1.value(); auto fo1 = a1.value(); std::cout << f.size() << std::endl; - auto a2 = tree.node_property("test"); - std::pair, bool> p2 = tree.node_property("test"); - std::optional> o2 = tree.node_property("test"); + auto a2 = tree.property("test"); + std::pair, bool> p2 = tree.property("test"); + std::optional> o2 = tree.property("test"); //assert(prop3.has_value()); - auto prop4 = tree.node_property("test"); + auto prop4 = tree.property("test"); assert(!prop4.has_value()); // removal of properties @@ -63,7 +63,7 @@ int main(void) { assert(tree.properties().size() == (num - 1)); // Default value should be respected - auto node_int_property = tree.add_node_property("int", 5).first; + auto node_int_property = tree.add_property("int", 5).first; assert(node_int_property[tree.root()] == 5); // Changes to individual nodes should be respected