moving definition of Node_index into traits

This commit is contained in:
Sven Oesau 2024-02-02 10:30:51 +01:00
parent da04410892
commit 73bf4edf44
4 changed files with 15 additions and 19 deletions

View File

@ -83,6 +83,7 @@ public:
using Sphere = typename Traits::Sphere_d; ///< Sphere type.
using Adjacency = typename Traits::Adjacency; ///< Adjacency type.
using Node_index = typename Traits::Node_index; ///< Index of a given node in the tree; the root always has index 0.
using Node_data = typename Traits::Node_data;
/// @}
@ -100,11 +101,6 @@ public:
*/
static constexpr int degree = (2 << (dimension - 1));
/*!
* \brief Index of a given node in the tree; the root always has index 0.
*/
using Node_index = std::size_t;
/*!
\brief Set of bits representing this node's relationship to its parent.
@ -155,8 +151,9 @@ private: // data members :
using Cartesian_ranges = Orthtrees::internal::Cartesian_ranges<Traits>;
using Node_property_container = Properties::Experimental::Property_container<Node_index>;
template <class T>
using Property_array = Node_property_container::Array<T>;
template <typename T>
using Property_array = typename Properties::Experimental::Property_container<Node_index>::template Array<T>;
Traits m_traits; /* the tree traits */
@ -194,11 +191,11 @@ public:
*/
explicit Orthtree(Traits traits) :
m_traits(traits),
m_node_contents(m_node_properties.add_property<Node_data>("contents")),
m_node_depths(m_node_properties.add_property<std::uint8_t>("depths", 0)),
m_node_coordinates(m_node_properties.add_property<Global_coordinates>("coordinates")),
m_node_parents(m_node_properties.add_property<std::optional<Node_index>>("parents")),
m_node_children(m_node_properties.add_property<std::optional<Node_index>>("children")) {
m_node_contents(m_node_properties.template add_property<Node_data>("contents")),
m_node_depths(m_node_properties.template add_property<std::uint8_t>("depths", 0)),
m_node_coordinates(m_node_properties.template add_property<Global_coordinates>("coordinates")),
m_node_parents(m_node_properties.template add_property<std::optional<Node_index>>("parents")),
m_node_children(m_node_properties.template add_property<std::optional<Node_index>>("children")) {
m_node_properties.emplace();

View File

@ -42,7 +42,7 @@ private:
public:
using Node_index = typename Orthtree<GeomTraits>::Node_index;
using Node_index = typename GeomTraits::Node_index;
Preorder_traversal(const Orthtree<GeomTraits>& orthtree) : m_orthtree(orthtree) {}
@ -86,7 +86,7 @@ private:
public:
using Node_index = typename Orthtree<GeomTraits>::Node_index;
using Node_index = typename GeomTraits::Node_index;
Postorder_traversal(const Orthtree<GeomTraits>& orthtree) : m_orthtree(orthtree) {}
@ -117,7 +117,7 @@ private:
public:
using Node_index = typename Orthtree<GeomTraits>::Node_index;
using Node_index = typename GeomTraits::Node_index;
Leaves_traversal(const Orthtree<GeomTraits>& orthtree) : m_orthtree(orthtree) {}
@ -158,7 +158,7 @@ private:
public:
using Node_index = typename Orthtree<GeomTraits>::Node_index;
using Node_index = typename GeomTraits::Node_index;
/*!
constructs a `depth`-level traversal.

View File

@ -49,7 +49,6 @@ struct Orthtree_traits_face_graph : public Orthtree_traits_base<
using Base = Orthtree_traits_base<
typename Kernel_traits<typename boost::property_traits<VertexPointMap>::value_type>::type, 3 >;
using Node_index = typename Base::Node_index;
using Self = Orthtree_traits_face_graph<TriangleMesh, VertexPointMap>;
using Tree = Orthtree<Self>;
@ -58,6 +57,7 @@ struct Orthtree_traits_face_graph : public Orthtree_traits_base<
using FT = typename Self::FT;
using Cartesian_const_iterator_d = typename Self::Cartesian_const_iterator_d;
using Node_index = typename Base::Node_index;
using Node_data = std::vector<typename boost::graph_traits<TriangleMesh>::face_descriptor>;
using Geom_traits = typename Kernel_traits<Point_d>::type;

View File

@ -96,9 +96,8 @@ public:
using Self = Orthtree_traits_point<GeomTraits, PointRange, PointMap, dimension>;
using Tree = Orthtree<Self>;
using Node_data_element = typename std::iterator_traits<typename PointRange::iterator>::value_type;
using Node_index = typename Base::Node_index;
using Node_data_element = typename std::iterator_traits<typename PointRange::iterator>::value_type;
Orthtree_traits_point(
PointRange& points,