EBGeometry
Compact, header-only C++ library for fast evaluation of signed distance functions
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
EBGeometry::RegionSettings Struct Reference

How the regions of an object are shown (see RegionView): which regions are visible, what a surface is colored and named by, the surfaces shown alone or seen through, and a domain's surface groups. More...

#include <EBGeometry_RegionSettings.hpp>

Collaboration diagram for EBGeometry::RegionSettings:
Collaboration graph
[legend]

Public Member Functions

bool isRegionHighlighted (const uint32_t a_region) const noexcept
 Whether a region is highlighted.
 
template<typename T >
uint32_t selectionOf (const SurfaceRef< T > &a_surface) const noexcept
 The entry of the selection a surface is selected by.
 
bool isSurfaceGroupHidden (const uint32_t a_group) const noexcept
 Whether a surface group is hidden.
 
void setSurfaceGroupHidden (const uint32_t a_group, const bool a_hidden) noexcept
 Hide a surface group, or show it again.
 
bool isSurfaceGroupSeenThrough (const uint32_t a_group) const noexcept
 Whether a surface group is seen through (m_throughGroups).
 
void setSurfaceGroupSeenThrough (const uint32_t a_group, const bool a_through) noexcept
 See through a surface group, or make it opaque again.
 
bool isVisible (const uint32_t a_region, const uint32_t a_numRegions) const noexcept
 Whether a region is shown (the background never is).
 
void setVisible (const uint32_t a_region, const bool a_visible) noexcept
 Show or hide a region.
 
void showOnly (const uint32_t a_region) noexcept
 Show one region and hide the others.
 
bool isSeenThrough (const uint32_t a_key) const noexcept
 Whether the surfaces with a key are seen through.
 
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 them, none is added).
 
bool isRegionSeenThrough (const uint32_t a_region) const noexcept
 Whether a region is seen through (m_throughRegions).
 
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).
 
void clearSeenThrough () noexcept
 Make every surface opaque: no key, no region and no surface group seen through.
 
void setColoring (const RegionColoring a_coloring) noexcept
 Color and name surfaces by another key; the keys shown alone and seen through, which meant another thing, are cleared. The regions and surface groups seen through (m_throughRegions, m_throughGroups) do not depend on the coloring and are kept.
 

Static Public Member Functions

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.
 

Public Attributes

uint64_t m_hidden = 0U
 The hidden regions, a bit each (bit k for region k); regions from 64 on are always shown.
 
RegionColoring m_coloring = RegionColoring::Region
 What a surface is colored and named by.
 
uint32_t m_only = None
 The key shown alone, or None.
 
uint32_t m_through [MaxSeenThrough] = {None, None, None, None, None, None, None, None}
 The keys seen through; None marks an unused entry.
 
uint64_t m_throughRegions = 0U
 The regions seen through, a bit each (bit k for region k; regions from 64 on never are): every surface shown as the region's, whatever the coloring, as the keys of m_through are.
 
SurfaceGroups m_surfaceGroups
 A solver's groups of surfaces (RegionColoring::SurfaceGroup colors by them): a view of selectors in a pool (a domain's, Domain::surfaceGroups(), or one built on its own), which must outlive the settings and, for a render on a device, be rebased onto that pool's mirror. Empty by default.
 
uint32_t m_highlightGroup = None
 The surface group whose surfaces are highlighted (keyed Highlighted), or None.
 
uint64_t m_highlightRegions = 0U
 The highlighted regions, a bit each (bit k for region k, the background's bit 0 included): every surface with one of them on either side is keyed Highlighted, whatever the coloring (a subdomain's boundary, say).
 
SurfaceSelector m_selected [MaxSelected] = {}
 The selected surfaces, the first m_numSelected entries (a viewer's picked parts or regions): a surface one of them matches is keyed Selected and its entry, whatever the coloring.
 
uint32_t m_numSelected = 0U
 How many entries of m_selected are used.
 
bool m_onlySelected = false
 Whether only the selected surfaces are shown, all of them, those other surfaces hid included, each side keyed apart: Selected + entry where the view enters the region seen, Selected + MaxSelected + entry where it leaves it (a surface's back, seen through an open end). A viewer renders so to outline each selected surface along its own edges: where its key changes, at its silhouette and at its rims.
 
uint64_t m_sectionRegions = 0U
 The regions whose function the section plane shows (its fill and contours, and the value under a viewer's cursor), a bit each (bit k for region k, the background's bit 0 included): a subdomain's, what a cut-cell code cuts for it (Tape::signedDistance(p, subdomains, subdomain)); 0 for the visible regions'.
 
bool m_sectionDomain = false
 Whether the section plane shows a whole domain: at each point the function of its own subdomain (its region's, m_sectionSubdomains, or the excluded regions'), negative in it and zero on its boundary, so that every subdomain's lines show at once and its zero line is every boundary and interface; the excluded regions' lines are secondary (ContourSample). Before m_sectionRegions.
 
uint8_t m_sectionSubdomains [64] = {}
 With m_sectionDomain, each region's subdomain (regions 0 to 63; later ones are excluded): below 32, or ExcludedSubdomain.
 
uint32_t m_hiddenGroups = 0U
 The hidden surface groups, a bit each (bit g for surface group g): their surfaces are not drawn, and cast no shadow.
 
uint32_t m_throughGroups = 0U
 The surface groups seen through, a bit each (bit g for surface group g): their surfaces drawn translucent and passed through, as the keys of m_through are.
 

Static Public Attributes

static constexpr uint32_t None = 0xFFFFFFFFU
 No key.
 
static constexpr uint32_t MaxSeenThrough = 8
 How many keys can be seen through at once.
 
static constexpr uint32_t Highlighted = 0xFFFFFFFDU
 The key a view of regions gives the surfaces of the highlighted surface group (m_highlightGroup), whatever the coloring, for a renderer to highlight (Render::Settings::m_highlightPrimitive).
 
static constexpr uint32_t MaxSelected = 16
 How many selectors the selection holds at most.
 
static constexpr uint32_t Selected = 0xFFFFFFC0U
 The key of the first selected surface: a surface entry i of the selection matches first (see m_selected) is keyed Selected + i, whatever the coloring, so that each is told apart (and outlined) and all are highlighted together (Render::Settings::m_highlightPrimitive = Selected, m_highlightCount = m_numSelected).
 
static constexpr uint8_t ExcludedSubdomain = 0xFFU
 An entry of m_sectionSubdomains: the region is in no subdomain (Domain::Excluded).
 

Detailed Description

How the regions of an object are shown (see RegionView): which regions are visible, what a surface is colored and named by, the surfaces shown alone or seen through, and a domain's surface groups.

A plain value, part of the render settings (Render::Settings::m_regions), so that a render, a viewer and a saved view share one description, and a kernel takes it. Keys are by the coloring: a region's number, a material's, a surface label's, a surface's, a part's, an interface's (interfaceKey()) or a group's.

Member Function Documentation

◆ interfaceKey()

static uint32_t EBGeometry::RegionSettings::interfaceKey ( const uint32_t  a_first,
const uint32_t  a_second 
)
inlinestaticnoexcept

The key of the interface between two regions, the same whichever side it is seen from.

Parameters
[in]a_firstA region.
[in]a_secondThe region on the other side.
Returns
The key.

◆ isRegionHighlighted()

bool EBGeometry::RegionSettings::isRegionHighlighted ( const uint32_t  a_region) const
inlinenoexcept

Whether a region is highlighted.

Parameters
[in]a_regionThe region (below 64; others never are).
Returns
True if it is.

◆ isRegionSeenThrough()

bool EBGeometry::RegionSettings::isRegionSeenThrough ( const uint32_t  a_region) const
inlinenoexcept

Whether a region is seen through (m_throughRegions).

Parameters
[in]a_regionThe region.
Returns
True if it is.

◆ isSeenThrough()

bool EBGeometry::RegionSettings::isSeenThrough ( const uint32_t  a_key) const
inlinenoexcept

Whether the surfaces with a key are seen through.

Parameters
[in]a_keyThe key.
Returns
True if they are.

◆ isSurfaceGroupHidden()

bool EBGeometry::RegionSettings::isSurfaceGroupHidden ( const uint32_t  a_group) const
inlinenoexcept

Whether a surface group is hidden.

Parameters
[in]a_groupThe surface group, or None (never hidden).
Returns
True if it is.

◆ isSurfaceGroupSeenThrough()

bool EBGeometry::RegionSettings::isSurfaceGroupSeenThrough ( const uint32_t  a_group) const
inlinenoexcept

Whether a surface group is seen through (m_throughGroups).

Parameters
[in]a_groupThe surface group, or None (never seen through).
Returns
True if it is.

◆ isVisible()

bool EBGeometry::RegionSettings::isVisible ( const uint32_t  a_region,
const uint32_t  a_numRegions 
) const
inlinenoexcept

Whether a region is shown (the background never is).

Parameters
[in]a_regionRegion.
[in]a_numRegionsHow many regions the object has.
Returns
True if visible.

◆ selectionOf()

template<typename T >
uint32_t EBGeometry::RegionSettings::selectionOf ( const SurfaceRef< T > &  a_surface) const
inlinenoexcept

The entry of the selection a surface is selected by.

Template Parameters
TFloating-point precision.
Parameters
[in]a_surfaceThe surface, with its sides and their materials set.
Returns
The first entry of m_selected that matches it, or None.

◆ setColoring()

void EBGeometry::RegionSettings::setColoring ( const RegionColoring  a_coloring)
inlinenoexcept

Color and name surfaces by another key; the keys shown alone and seen through, which meant another thing, are cleared. The regions and surface groups seen through (m_throughRegions, m_throughGroups) do not depend on the coloring and are kept.

Parameters
[in]a_coloringThe coloring.

◆ setRegionSeenThrough()

void EBGeometry::RegionSettings::setRegionSeenThrough ( const uint32_t  a_region,
const bool  a_through 
)
inlinenoexcept

See through a region, or make it opaque again (regions from 64 on are left as they are).

Parameters
[in]a_regionThe region.
[in]a_throughWhether to see through it.

◆ setSeenThrough()

void EBGeometry::RegionSettings::setSeenThrough ( const uint32_t  a_key,
const bool  a_through 
)
inlinenoexcept

See through the surfaces of a key, or make them opaque again (at most MaxSeenThrough keys; beyond them, none is added).

Parameters
[in]a_keyThe key.
[in]a_throughWhether to see through it.

◆ setSurfaceGroupHidden()

void EBGeometry::RegionSettings::setSurfaceGroupHidden ( const uint32_t  a_group,
const bool  a_hidden 
)
inlinenoexcept

Hide a surface group, or show it again.

Parameters
[in]a_groupThe surface group (groups from 32 on are never hidden).
[in]a_hiddenWhether to hide it.

◆ setSurfaceGroupSeenThrough()

void EBGeometry::RegionSettings::setSurfaceGroupSeenThrough ( const uint32_t  a_group,
const bool  a_through 
)
inlinenoexcept

See through a surface group, or make it opaque again.

Parameters
[in]a_groupThe surface group (groups from 32 on are never seen through).
[in]a_throughWhether to see through it.

◆ setVisible()

void EBGeometry::RegionSettings::setVisible ( const uint32_t  a_region,
const bool  a_visible 
)
inlinenoexcept

Show or hide a region.

Parameters
[in]a_regionRegion (1 to 63; others are always shown).
[in]a_visibleWhether to show it.

◆ showOnly()

void EBGeometry::RegionSettings::showOnly ( const uint32_t  a_region)
inlinenoexcept

Show one region and hide the others.

Parameters
[in]a_regionRegion.

The documentation for this struct was generated from the following file: