3#include "AttributeComputerDomain.hpp"
4#include "AttributeComputerFamily.hpp"
5#include "../detail/AttributeKernelSupport.hpp"
6#include "../../trees/detail/TreeTraversalDetail.hpp"
7#include "../../trees/MorphologicalTree.hpp"
13namespace mmcfilters::attributes::computers {
40 static constexpr AttributeComputerFamily
family = AttributeComputerFamily::Area;
43 static constexpr AttributeComputerDomain
domain = AttributeComputerDomain::Topology;
61 template <std::
floating_po
int Real>
67 template <std::
floating_po
int Real>
70 ::mmcfilters::detail::traversePostOrder(
74 buffer[indexOfArea(nodeId)] = static_cast<Real>(tree.getNumProperParts(nodeId));
77 buffer[indexOfArea(parentNodeId)] += buffer[indexOfArea(childNodeId)];
88 template <std::
floating_po
int Real>
Layout object that maps scalar attributes to flat-buffer offsets.
Mutable morphological tree built directly on proper parts and dense node ids.
NodeId getRoot() const
Returns the current hierarchy root.
Computes the canonical subtree area attribute.
static constexpr std::array< Attribute, 1 > producedAttributes
Canonical list of attributes produced by this computer.
static void computeUnitRows(const UnitAttributeComputeContext< Real > &context)
Materializes AREA for one-pixel unit supports.
static constexpr AttributeComputerDomain domain
Execution domain required by the computer.
static constexpr std::string_view familyName
Family name used in dependency-plan diagnostics.
static constexpr AttributeComputerFamily family
Stable family id used by the scheduler.
static void compute(const AttributeComputeContext< Real > &context)
Computes area by summing direct proper-part counts bottom-up.
Owning result for one computed scalar attribute layout and buffer.