Skip to content

wiki: define all traits and data structure to traits requirements #1370

Description

@IvanGrigorik

Wiki should explain GeometryTraits and AccessTraits. Currently, it only explains access traits.

In addition, some of the crucial classes and functions (like BoundingVolumeHierarchy) should include what type of traits inputs should have. For example, BVH class will fail if you pass attach_indices(make_nearest(<values>, 1)), because attach_indices underlying data structure should also always have GeometryTraits. It will fail and will give a compile-time error if it does not have both AccessTraits and GeometryTraits:

Details::check_valid_access_traits(user_values);
using Values = Details::AccessValues<UserValues>;
Values values{user_values}; // NOLINT
static_assert(
Details::KokkosExt::is_accessible_from<typename Values::memory_space,
ExecutionSpace>::value,
"Values must be accessible from the execution space");
constexpr int DIM = GeometryTraits::dimension_v<BoundingVolume>;
Details::check_valid_space_filling_curve<DIM>(curve);

The good example is query(...) function, since it already have this documentation

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions