29 using namespace Experimental::detail::GridAxisGenerators;
31 namespace IndexedSurfacesJsonConverter {
56 template <
typename index_gr
id>
58 nlohmann::json jIndexedSurfaces;
61 nlohmann::json jCasts;
63 if constexpr (index_grid::grid_type::DIM == 1
u) {
64 jCasts.push_back(indexGrid.casts[0
u]);
67 if constexpr (index_grid::grid_type::DIM == 2
u) {
68 jCasts.push_back(indexGrid.casts[0
u]);
69 jCasts.push_back(indexGrid.casts[1
u]);
71 jIndexedSurfaces[
"casts"] = jCasts;
72 jIndexedSurfaces[
"transform"] =
75 return jIndexedSurfaces;
85 template <
typename instance_type>
86 void convert(nlohmann::json& jIndexedSurfaces,
88 [[maybe_unused]]
const instance_type& refInstance) {
90 typename instance_type::template grid_type<std::vector<std::size_t>>;
97 const auto* instance = delegate.instance();
98 auto castedDelegate =
dynamic_cast<const DelegateType*
>(instance);
99 if (castedDelegate !=
nullptr) {
101 auto indexedSurfaces = std::get<SubDelegateType>(castedDelegate->updators);
102 jIndexedSurfaces = convertImpl<SubDelegateType>(indexedSurfaces);
113 template <
typename tuple_type, std::size_t...
I>
116 const tuple_type& axesTuple,
117 std::index_sequence<I...> ) {
118 (
convert(jIndexedSurfaces, delegate, std::get<I>(axesTuple)), ...);
132 nlohmann::json jIndexedSurfaces;
134 std::make_index_sequence<
137 jIndexedSurfaces[
"type"] =
"IndexedSurfaces";
138 return jIndexedSurfaces;
147 const nlohmann::json& jSurfaceNavigation);