11#ifndef EBGEOMETRY_REGIONSETTINGS_HPP
12#define EBGEOMETRY_REGIONSETTINGS_HPP
70 static constexpr uint32_t
None = 0xFFFFFFFFU;
176 template <
typename T>
244 const uint32_t bit = 1U << a_group;
278 const uint32_t bit = 1U << a_group;
291 static inline uint32_t
294 return ((a_first < a_second ? a_first : a_second) << 16U) | (a_first < a_second ? a_second : a_first);
305 isVisible(
const uint32_t a_region,
const uint32_t a_numRegions)
const noexcept
307 return a_region > 0U && a_region < a_numRegions && (a_region >= 64U || ((
m_hidden >> a_region) & 1U) == 0U);
317 setVisible(
const uint32_t a_region,
const bool a_visible)
noexcept
319 if (a_region > 0U && a_region < 64U) {
320 const uint64_t bit = uint64_t(1) << a_region;
405 if (a_region < 64U) {
406 const uint64_t bit = uint64_t(1) << a_region;
446static_assert(std::is_trivially_copyable_v<RegionSettings>,
447 "RegionSettings must be a plain value, for a kernel to take it");
GPU portability layer: host/device decoration macros and backend detection.
#define EBGEOMETRY_HOST_DEVICE
Mark a function as callable from both host and device code (no-op on host compilers).
Definition EBGeometry_GPU.hpp:80
SurfaceSelector and SurfaceGroups: which surfaces a downstream code groups under one meaning.
A domain's surface groups, read on the host or a device: each group a set of surfaces,...
Definition EBGeometry_SurfaceGroups.hpp:296
Namespace containing all of EBGeometry's functionality.
Definition EBGeometry_Affine.hpp:26
RegionColoring
What a view of regions names a surface by, the key a renderer colors by (Render::ColorBy::Primitive).
Definition EBGeometry_RegionSettings.hpp:28
@ SurfaceGroup
The surface group the surface is in (RegionSettings::m_surfaceGroups), or none.
@ Interface
The pair of regions on its two sides there (see RegionSettings::interfaceKey()).
@ Part
The surface's part: a box's face, a mesh's face.
@ Surface
The surface itself (SurfaceRef::m_surface): each shape, each member of a collection.
@ SurfaceLabel
The surface's label (SurfaceLabel()).
@ Material
That region's material.
@ Region
The region the surface belongs to, as seen.
A section plane's field at a point (RegionView::contourSample()): its value, negative inside,...
Definition EBGeometry_RegionSettings.hpp:46
T m_value
The field's value.
Definition EBGeometry_RegionSettings.hpp:50
bool m_secondary
Whether the lines there are secondary.
Definition EBGeometry_RegionSettings.hpp:55
How the regions of an object are shown (see RegionView): which regions are visible,...
Definition EBGeometry_RegionSettings.hpp:66
bool isSeenThrough(const uint32_t a_key) const noexcept
Whether the surfaces with a key are seen through.
Definition EBGeometry_RegionSettings.hpp:346
bool isRegionSeenThrough(const uint32_t a_region) const noexcept
Whether a region is seen through (m_throughRegions).
Definition EBGeometry_RegionSettings.hpp:391
uint32_t m_only
The key shown alone, or None.
Definition EBGeometry_RegionSettings.hpp:96
uint32_t m_through[MaxSeenThrough]
The keys seen through; None marks an unused entry.
Definition EBGeometry_RegionSettings.hpp:101
bool m_onlySelected
Whether only the selected surfaces are shown, all of them, those other surfaces hid included,...
Definition EBGeometry_RegionSettings.hpp:168
void setSurfaceGroupSeenThrough(const uint32_t a_group, const bool a_through) noexcept
See through a surface group, or make it opaque again.
Definition EBGeometry_RegionSettings.hpp:275
void showOnly(const uint32_t a_region) noexcept
Show one region and hide the others.
Definition EBGeometry_RegionSettings.hpp:332
RegionColoring m_coloring
What a surface is colored and named by.
Definition EBGeometry_RegionSettings.hpp:91
uint32_t m_numSelected
How many entries of m_selected are used.
Definition EBGeometry_RegionSettings.hpp:160
uint32_t m_highlightGroup
The surface group whose surfaces are highlighted (keyed Highlighted), or None.
Definition EBGeometry_RegionSettings.hpp:119
void setRegionSeenThrough(const uint32_t a_region, const bool a_through) noexcept
See through a region, or make it opaque again (regions from 64 on are left as they are).
Definition EBGeometry_RegionSettings.hpp:403
uint8_t m_sectionSubdomains[64]
With m_sectionDomain, each region's subdomain (regions 0 to 63; later ones are excluded): below 32,...
Definition EBGeometry_RegionSettings.hpp:214
uint32_t m_hiddenGroups
The hidden surface groups, a bit each (bit g for surface group g): their surfaces are not drawn,...
Definition EBGeometry_RegionSettings.hpp:220
bool isSurfaceGroupHidden(const uint32_t a_group) const noexcept
Whether a surface group is hidden.
Definition EBGeometry_RegionSettings.hpp:229
static constexpr uint8_t ExcludedSubdomain
An entry of m_sectionSubdomains: the region is in no subdomain (Domain::Excluded).
Definition EBGeometry_RegionSettings.hpp:200
void clearSeenThrough() noexcept
Make every surface opaque: no key, no region and no surface group seen through.
Definition EBGeometry_RegionSettings.hpp:417
SurfaceGroups m_surfaceGroups
A solver's groups of surfaces (RegionColoring::SurfaceGroup colors by them): a view of selectors in a...
Definition EBGeometry_RegionSettings.hpp:114
void setSurfaceGroupHidden(const uint32_t a_group, const bool a_hidden) noexcept
Hide a surface group, or show it again.
Definition EBGeometry_RegionSettings.hpp:241
bool isSurfaceGroupSeenThrough(const uint32_t a_group) const noexcept
Whether a surface group is seen through (m_throughGroups).
Definition EBGeometry_RegionSettings.hpp:263
static constexpr uint32_t Selected
The key of the first selected surface: a surface entry i of the selection matches first (see m_select...
Definition EBGeometry_RegionSettings.hpp:149
static constexpr uint32_t Highlighted
The key a view of regions gives the surfaces of the highlighted surface group (m_highlightGroup),...
Definition EBGeometry_RegionSettings.hpp:81
void setSeenThrough(const uint32_t a_key, const bool a_through) noexcept
See through the surfaces of a key, or make them opaque again (at most MaxSeenThrough keys; beyond the...
Definition EBGeometry_RegionSettings.hpp:365
uint64_t m_hidden
The hidden regions, a bit each (bit k for region k); regions from 64 on are always shown.
Definition EBGeometry_RegionSettings.hpp:86
bool isVisible(const uint32_t a_region, const uint32_t a_numRegions) const noexcept
Whether a region is shown (the background never is).
Definition EBGeometry_RegionSettings.hpp:305
uint64_t m_throughRegions
The regions seen through, a bit each (bit k for region k; regions from 64 on never are): every surfac...
Definition EBGeometry_RegionSettings.hpp:107
static constexpr uint32_t None
No key.
Definition EBGeometry_RegionSettings.hpp:70
static constexpr uint32_t MaxSeenThrough
How many keys can be seen through at once.
Definition EBGeometry_RegionSettings.hpp:75
void setVisible(const uint32_t a_region, const bool a_visible) noexcept
Show or hide a region.
Definition EBGeometry_RegionSettings.hpp:317
bool isRegionHighlighted(const uint32_t a_region) const noexcept
Whether a region is highlighted.
Definition EBGeometry_RegionSettings.hpp:134
uint64_t m_highlightRegions
The highlighted regions, a bit each (bit k for region k, the background's bit 0 included): every surf...
Definition EBGeometry_RegionSettings.hpp:125
bool m_sectionDomain
Whether the section plane shows a whole domain: at each point the function of its own subdomain (its ...
Definition EBGeometry_RegionSettings.hpp:208
static uint32_t interfaceKey(const uint32_t a_first, const uint32_t a_second) noexcept
The key of the interface between two regions, the same whichever side it is seen from.
Definition EBGeometry_RegionSettings.hpp:292
uint32_t selectionOf(const SurfaceRef< T > &a_surface) const noexcept
The entry of the selection a surface is selected by.
Definition EBGeometry_RegionSettings.hpp:179
static constexpr uint32_t MaxSelected
How many selectors the selection holds at most.
Definition EBGeometry_RegionSettings.hpp:142
uint32_t m_throughGroups
The surface groups seen through, a bit each (bit g for surface group g): their surfaces drawn translu...
Definition EBGeometry_RegionSettings.hpp:254
SurfaceSelector m_selected[MaxSelected]
The selected surfaces, the first m_numSelected entries (a viewer's picked parts or regions): a surfac...
Definition EBGeometry_RegionSettings.hpp:155
void setColoring(const RegionColoring a_coloring) noexcept
Color and name surfaces by another key; the keys shown alone and seen through, which meant another th...
Definition EBGeometry_RegionSettings.hpp:435
uint64_t m_sectionRegions
The regions whose function the section plane shows (its fill and contours, and the value under a view...
Definition EBGeometry_RegionSettings.hpp:195
The surface that decides a shape's value at a point, as closestSurface() reports it.
Definition EBGeometry_SurfaceRef.hpp:39
Conditions on a point of a surface, all of which must hold; an unset one (Any) matches anything.
Definition EBGeometry_SurfaceGroups.hpp:40