Arbitrarily-dimensional sparse-field spatially partitioned level set surface.
More...
#include <Surface.hpp>
|
struct | Stats |
| Store approximate statistics of the number of spatial partitions using up memory. More...
|
|
|
using | IsoGrid = Impl::Partitioned::Tracked::Numeric< Distance, D, s_num_layers > |
| A level set embedding isogrid grid, with active grid points (the narrow band) tracked. More...
|
|
using | Line = Eigen::ParametrizedLine< Distance, D > |
| D-dimensional parameterised line, for raycasting. More...
|
|
using | Plane = Eigen::Hyperplane< Distance, D > |
| D-dimensional hyperplane type (using Eigen library), for raycasting. More...
|
|
|
| Surface (const VecDi &size_, const VecDi &size_partition_=VecDi::Constant(8)) |
| Construct a level set embedding of size size. More...
|
|
const AffectedLookupGrid & | affected () const |
| Get points affected by most recent update, in the form of a lookup grid. More...
|
|
void | delta (const VecDi &pos_, Distance val_) |
| Update delta isogrid grid, tracking to tracking list if not already tracked. More...
|
|
const PosIdxList & | delta (const TupleIdx layer_idx_) const |
| Get list of spatial partitions where iso values were updated in last update. More...
|
|
bool | is_intersected (const PosIdx pos_idx_child) |
| Check if child spatial partition contains zero-layer points. More...
|
|
const IsoGrid & | isogrid () const |
| Get reference to isogrid grid. More...
|
|
VecDf | ray (const VecDf &pos_origin_, const VecDf &dir_) const |
| Cast a ray to the zero layer. More...
|
|
void | save (std::ostream &output_stream_) const |
| Save isogrid to given output stream. More...
|
|
void | seed (const VecDi &pos_centre_) |
| Create a single singularity seed point in the isogrid grid. More...
|
|
Stats | stats () const |
| Gather statistics about the current state of the surface. More...
|
|
const PosIdxList & | status_change (const TupleIdx layer_idx_) const |
| Get list of spatial partitions where layer status change occurred in last update. More...
|
|
template<typename Fn > |
void | update (Fn &&fn_) |
| Perform a full update of the narrow band. More...
|
|
template<typename Fn > |
void | update (const VecDi &pos_leaf_lower_, const VecDi &pos_leaf_upper_, Fn &&fn_) |
| Perform a bounded update of the narrow band. More...
|
|
void | update_end () |
| Update zero layer then update distance transform for affected points in each layer. More...
|
|
void | update_start () |
| Reset delta isogrid to zero and clear update lists. More...
|
|
|
static constexpr TupleIdx | layer_idx (const LayerId id_) |
| Get narrow band layer index of ID for indexing into arrays. More...
|
|
static This | load (std::istream &input_stream_) |
| Load isogrid from given input stream and construct surface. More...
|
|
|
static const VecDf | ray_miss |
| Get vector representing a raycast miss. More...
|
|
template<Dim D, LayerId L>
class Felt::Surface< D, L >
Arbitrarily-dimensional sparse-field spatially partitioned level set surface.
- Template Parameters
-
D | the number of dimensions of the surface. |
L | the number of narrow band layers surrounding the zero-layer (surface). |
◆ Felt::Surface::Stats
struct Felt::Surface::Stats |
template<Dim D, LayerId L>
struct Felt::Surface< D, L >::Stats
Store approximate statistics of the number of spatial partitions using up memory.
Class Members |
ListIdx |
active_delta_partitions |
Number of delta isogrid partitions currently active. |
ListIdx |
active_isogrid_partitions |
Number of isogrid partitions currently active. |
◆ IsoGrid
template<Dim D, LayerId L>
A level set embedding isogrid grid, with active grid points (the narrow band) tracked.
◆ Line
template<Dim D, LayerId L>
D-dimensional parameterised line, for raycasting.
◆ Plane
template<Dim D, LayerId L>
D-dimensional hyperplane type (using Eigen library), for raycasting.
◆ Surface()
template<Dim D, LayerId L>
Felt::Surface< D, L >::Surface |
( |
const VecDi & |
size_, |
|
|
const VecDi & |
size_partition_ = VecDi::Constant(8) |
|
) |
| |
|
inline |
Construct a level set embedding of size size.
All points will be marked as outside the surface (i.e. no surface).
- Parameters
-
size_ | size of the isogrid. |
size_partition_ | size of each spatial partition of the isogrid. |
◆ affected()
template<Dim D, LayerId L>
const AffectedLookupGrid& Felt::Surface< D, L >::affected |
( |
| ) |
const |
|
inline |
Get points affected by most recent update, in the form of a lookup grid.
- Returns
- the affected lookup grid.
◆ delta() [1/2]
template<Dim D, LayerId L>
Update delta isogrid grid, tracking to tracking list if not already tracked.
- Parameters
-
pos | position to update. |
val | value to set at given position. |
◆ delta() [2/2]
template<Dim D, LayerId L>
Get list of spatial partitions where iso values were updated in last update.
- Parameters
-
layer_idx_ | index of layer list to get. |
- Returns
- list of position indices.
◆ is_intersected()
template<Dim D, LayerId L>
Check if child spatial partition contains zero-layer points.
- Parameters
-
pos_idx_child | position index of child partition. |
- Returns
- true if zero-curve cuts through partition, false otherwise.
◆ isogrid()
template<Dim D, LayerId L>
Get reference to isogrid grid.
- Returns
- signed distance isogrid embedding the level set surface.
◆ layer_idx()
template<Dim D, LayerId L>
Get narrow band layer index of ID for indexing into arrays.
Internally we can of course not have negative array indices, so must convert to an index first.
- Parameters
-
- Returns
- index to use to get given layer in narrow band array.
◆ load()
template<Dim D, LayerId L>
Load isogrid from given input stream and construct surface.
- Parameters
-
input_stream_ | stream to load from. |
- Returns
- new Surface instance.
◆ ray()
template<Dim D, LayerId L>
VecDf Felt::Surface< D, L >::ray |
( |
const VecDf & |
pos_origin_, |
|
|
const VecDf & |
dir_ |
|
) |
| const |
|
inline |
Cast a ray to the zero layer.
- Parameters
-
pos_origin_ | originating point of ray |
dir_ | normal vector in direction of ray |
- Returns
- zero curve hit location or NULL_POS.
◆ save()
template<Dim D, LayerId L>
void Felt::Surface< D, L >::save |
( |
std::ostream & |
output_stream_ | ) |
const |
|
inline |
Save isogrid to given output stream.
- Parameters
-
output_stream_ | stream to save to. |
◆ seed()
template<Dim D, LayerId L>
Create a single singularity seed point in the isogrid grid.
NOTE: does not handle overwriting of points currently already on the surface/in the volume.
- Parameters
-
◆ stats()
template<Dim D, LayerId L>
Gather statistics about the current state of the surface.
- Returns
- statistics object with values for the number of active spatial partitions.
◆ status_change()
template<Dim D, LayerId L>
Get list of spatial partitions where layer status change occurred in last update.
- Parameters
-
layer_idx_ | index of layer list to get. |
- Returns
- list of position indices.
◆ update() [1/2]
template<Dim D, LayerId L>
template<typename Fn >
Perform a full update of the narrow band.
Lambda function passed will be given the position to process and a reference to the isogrid grid, and is expected to return delta isogrid to apply.
Each spatial partition is processed in parallel.
- Parameters
-
fn_ | (pos, isogrid) -> float |
◆ update() [2/2]
template<Dim D, LayerId L>
template<typename Fn >
void Felt::Surface< D, L >::update |
( |
const VecDi & |
pos_leaf_lower_, |
|
|
const VecDi & |
pos_leaf_upper_, |
|
|
Fn && |
fn_ |
|
) |
| |
|
inline |
Perform a bounded update of the narrow band.
Lambda function passed will be given the position to process and a reference to the isogrid grid, and is expected to return delta isogrid to apply.
Each spatial partition is processed in parallel.
- Parameters
-
pos_leaf_lower_ | region selection from. |
pos_leaf_upper_ | region selection to. |
fn_ | (pos, isogrid) -> float. |
◆ update_end()
template<Dim D, LayerId L>
Update zero layer then update distance transform for affected points in each layer.
◆ update_start()
template<Dim D, LayerId L>
Reset delta isogrid to zero and clear update lists.
◆ ray_miss
template<Dim D, LayerId L>
Initial value:=
VecDf::Constant(std::numeric_limits<Distance>::max())
Get vector representing a raycast miss.
The documentation for this class was generated from the following file: