|
MRPTree v0.5.0.0 examples-lib3d 0.5.0.0
MR 2^P Trees (MRPTree)
|
Tessellates a MR_rect_tree object, and places the result into an MR_cell_cplx object. More...
#include <MR_rt_to_cc.hpp>
Describe point source. | |
| enum class | val_src_spc_t { FDOMAIN , FRANGE , CONSTANT } |
| Specify a source space for a data index. More... | |
| typedef std::variant< int, cc_uft_t > | iorf_t |
| Type to hold an integer or float. | |
| typedef std::tuple< val_src_spc_t, iorf_t > | val_src_t |
| Type used to hold a description of how to extract a scalar value from a tree object. | |
| typedef std::vector< val_src_t > | val_src_lst_t |
| A list of val_src_t objects. | |
Types imported from MR_rect_tree and MR_cell_cplx. | |
| typedef cc_t::node_data_idx_lst_t | cc_node_data_idx_lst_t |
| typedef cc_t::node_data_t | cc_node_data_t |
| typedef cc_t::node_idx_list_t | cc_node_idx_list_t |
| typedef cc_t::node_idx_t | cc_node_idx_t |
| typedef cc_t::cell_verts_t | cc_cell_verts_t |
| typedef cc_t::uft_t | cc_uft_t |
| typedef rt_t::diti_list_t | rt_diti_list_t |
| typedef rt_t::diti_t | rt_diti_t |
| typedef rt_t::drpt_t | rt_drpt_t |
| typedef rt_t::drpt2real_func_t | rt_drpt2real_func_t |
| typedef rt_t::rrpt_t | rt_rrpt_t |
| typedef rt_t::drpt2rrpt_func_t | rt_drpt2rrpt_func_t |
Utility Functions. | |
| static void | create_dataset_to_point_mapping (const rt_t &rtree, cc_t &ccplx, const val_src_lst_t &rt_dil) |
| Create approprate inputs for ccplx.create_dataset_to_point_mapping() from tree data. | |
| static cc_node_idx_t | add_node (cc_t &ccplx, const rt_t &rtree, rt_diti_t diti) |
| Given rt coordinates, extract point/scalar/vector data, and add point/data to cc. | |
| static cc_node_idx_t | add_node (cc_t &ccplx, rt_drpt_t dom_pnt, rt_rrpt_t rng_pnt) |
| Given rt coordinates, extract point/scalar/vector data, and add point/data to cc. | |
| static cc_node_data_t | rt_pnt_to_cc_pnt (rt_drpt_t dom_pnt, rt_rrpt_t rng_pnt) |
| Given rt_t domain & range points, produce a cc_t point data vector. | |
| static rt_drpt_t | node_data_to_drpt (const cc_node_data_t &pd) |
| Transform a MR_cell_cplx::node_data_t value into MR_rect_tree::drpt_t. | |
| static int | rt_rng_idx_to_pd_idx (int tree_range_index) |
| Convert a MR_rect_tree range index into an index for a point data array. | |
| static cc_node_idx_t | nan_edge_solver (cc_t &ccplx, const rt_t &rtree, cc_node_idx_t good_point_ccplx_index, rt_diti_t good_point_rtree_index, rt_diti_t sick_point_rtree_index, rt_drpt2rrpt_func_t func, cc_uft_t solver_epsilon=cc_t::epsilon/100) |
| Given an edge with one good point and one NaN point, find the longest segment from the good point toward the NaN point. | |
Poly data construction | |
| static int | construct_geometry_fans (cc_t &ccplx, const rt_t &rtree, rt_diti_list_t cells, int output_dimension, val_src_lst_t point_src, rt_drpt2rrpt_func_t func=nullptr) |
| Populate attached MR_cell_cplx object from data in attached MR_rect_tree object. | |
| static int | construct_geometry_fans (cc_t &ccplx, const rt_t &rtree, int output_dimension, val_src_lst_t point_src, rt_drpt2rrpt_func_t func=nullptr) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| static int | construct_geometry_points (cc_t &ccplx, const rt_t &rtree, rt_diti_list_t cells, val_src_lst_t point_src, bool output_centers, bool output_corners) |
| Populate attached MR_cell_cplx object from data in attached MR_rect_tree object. | |
| static int | construct_geometry_points (cc_t &ccplx, const rt_t &rtree, val_src_lst_t point_src, bool output_centers, bool output_corners) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| static int | construct_geometry_rects (cc_t &ccplx, const rt_t &rtree, rt_diti_list_t cells, int output_dimension, val_src_lst_t point_src, bool degenerate_fallback=true) |
| Populate a MR_cell_cplx object from data in a MR_rect_tree object. | |
| static int | construct_geometry_rects (cc_t &ccplx, const rt_t &rtree, int output_dimension, val_src_lst_t point_src, bool degenerate_fallback=true) |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
Function Adapters | |
| static cc_node_data_t | tsampf_to_cdatf (rt_drpt2rrpt_func_t func, cc_node_data_t pd) |
| Adapt a MR_rect_tree::drpt2rrpt_func_t (sample function) to a MR_cell_cplx::p2data_func_t (Point Data Transform). | |
| static cc_uft_t | tsdf_to_csdf (rt_drpt2real_func_t func, cc_node_data_t pd) |
| Adapt a MR_rect_tree::drpt2real_func_t (Domain Point SDF) to MR_cell_cplx::p2real_func_t (Point Data SDF). | |
| static cc_uft_t | tsampf_to_clcdf (int range_index, cc_uft_t level, rt_drpt2rrpt_func_t func, cc_node_data_t pd) |
| Evalate an MR_cell_cplx::p2real_func_t (Point Data SDF) function from a MR_rect_tree::drpt2rrpt_func_t (Sample Function) and level data. | |
Mathematical Tools | |
| static int | cull_cc_cells_on_domain_sdf_boundry (cc_t &ccplx, rt_drpt2real_func_t sdf_func) |
| Drop cells from a MR_cell_cplx object using an MR_rect_tree domain SDF function. | |
Tessellates a MR_rect_tree object, and places the result into an MR_cell_cplx object.
From a structural perspective this class simply a templated collection of types and static methods all designed to work with pairs of MR_rect_tree and MR_cell_cplx objects. From a functional, or pattern, perspective this class might classified as a MR_cell_cplx pseudo-constructor or proto-factory. I think of it as a bridge between MR_rect_tree and MR_cell_cplx objects. A collection of helper types that ease working with pairs of MR_rect_tree and MR_cell_cplx objects containing data derived from the same sampled function.
| rt_t | The type of supported MR_rect_tree objects |
| cc_t | The type of supported MR_cell_cplx objects |
Definition at line 58 of file MR_rt_to_cc.hpp.
| typedef cc_t::cell_verts_t mjr::MR_rt_to_cc< rt_t, cc_t >::cc_cell_verts_t |
Definition at line 70 of file MR_rt_to_cc.hpp.
| typedef cc_t::node_data_idx_lst_t mjr::MR_rt_to_cc< rt_t, cc_t >::cc_node_data_idx_lst_t |
Definition at line 66 of file MR_rt_to_cc.hpp.
| typedef cc_t::node_data_t mjr::MR_rt_to_cc< rt_t, cc_t >::cc_node_data_t |
Definition at line 67 of file MR_rt_to_cc.hpp.
| typedef cc_t::node_idx_list_t mjr::MR_rt_to_cc< rt_t, cc_t >::cc_node_idx_list_t |
Definition at line 68 of file MR_rt_to_cc.hpp.
| typedef cc_t::node_idx_t mjr::MR_rt_to_cc< rt_t, cc_t >::cc_node_idx_t |
Definition at line 69 of file MR_rt_to_cc.hpp.
| typedef cc_t::uft_t mjr::MR_rt_to_cc< rt_t, cc_t >::cc_uft_t |
Definition at line 71 of file MR_rt_to_cc.hpp.
| typedef std::variant<int, cc_uft_t> mjr::MR_rt_to_cc< rt_t, cc_t >::iorf_t |
Type to hold an integer or float.
Definition at line 91 of file MR_rt_to_cc.hpp.
| typedef rt_t::diti_list_t mjr::MR_rt_to_cc< rt_t, cc_t >::rt_diti_list_t |
Definition at line 72 of file MR_rt_to_cc.hpp.
| typedef rt_t::diti_t mjr::MR_rt_to_cc< rt_t, cc_t >::rt_diti_t |
Definition at line 73 of file MR_rt_to_cc.hpp.
| typedef rt_t::drpt2real_func_t mjr::MR_rt_to_cc< rt_t, cc_t >::rt_drpt2real_func_t |
Definition at line 75 of file MR_rt_to_cc.hpp.
| typedef rt_t::drpt2rrpt_func_t mjr::MR_rt_to_cc< rt_t, cc_t >::rt_drpt2rrpt_func_t |
Definition at line 77 of file MR_rt_to_cc.hpp.
| typedef rt_t::drpt_t mjr::MR_rt_to_cc< rt_t, cc_t >::rt_drpt_t |
Definition at line 74 of file MR_rt_to_cc.hpp.
| typedef rt_t::rrpt_t mjr::MR_rt_to_cc< rt_t, cc_t >::rt_rrpt_t |
Definition at line 76 of file MR_rt_to_cc.hpp.
| typedef std::vector<val_src_t> mjr::MR_rt_to_cc< rt_t, cc_t >::val_src_lst_t |
A list of val_src_t objects.
Definition at line 97 of file MR_rt_to_cc.hpp.
| typedef std::tuple<val_src_spc_t, iorf_t> mjr::MR_rt_to_cc< rt_t, cc_t >::val_src_t |
Type used to hold a description of how to extract a scalar value from a tree object.
Definition at line 94 of file MR_rt_to_cc.hpp.
|
strong |
Specify a source space for a data index.
| Enumerator | |
|---|---|
| FDOMAIN | Sample function domain space. |
| FRANGE | Sample function range space. |
| CONSTANT | A pseudo-source that returns a constant. |
Definition at line 85 of file MR_rt_to_cc.hpp.
|
inlinestaticprivate |
Given rt coordinates, extract point/scalar/vector data, and add point/data to cc.
| ccplx | The MR_cell_cplx to populate with geometry |
| rtree | The MR_rect_tree with source data |
| diti | The point coordinate in rtree |
Definition at line 125 of file MR_rt_to_cc.hpp.
References add_node().
Referenced by add_node(), construct_geometry_fans(), construct_geometry_points(), construct_geometry_rects(), and nan_edge_solver().
|
inlinestaticprivate |
Given rt coordinates, extract point/scalar/vector data, and add point/data to cc.
| ccplx | The MR_cell_cplx to populate with geometry |
| dom_pnt | Domain point |
| rng_pnt | Range point |
Definition at line 133 of file MR_rt_to_cc.hpp.
References rt_pnt_to_cc_pnt().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 421 of file MR_rt_to_cc.hpp.
References construct_geometry_fans().
|
inlinestatic |
Populate attached MR_cell_cplx object from data in attached MR_rect_tree object.
construct_geometry_fans(), unlike the other geometry construction methods, is capable of "healing" some broken edges – edges with one good point and one NaN point. It uses the origional sampling function to solve along the edge to produce the longest non-NaN edge possible. Then it constructs cells using the new piont(s). If func is nullptr, then no edge healing is preformed. This feature works for segments & triangles only.
| Geom | Dom Dim | Out Dim | Result | |------------+---------+---------+--------------------| | FANS | 2 | 1 | Triangle Edges | | FANS | 2 | 2 | Triangles | | FANS | 3 | 1 | Pyramid Edges | | FANS | 3 | 2 | Pyramid Faces | | FANS | 3 | 3 | Solid Pyramids |
| ccplx | The MR_cell_cplx to populate with geometry |
| rtree | The MR_rect_tree with source data |
| cells | List of cells to output from rtree |
| output_dimension | Parts of cells to output |
| point_src | Point sources |
| func | The function was used to sample the tree |
Definition at line 265 of file MR_rt_to_cc.hpp.
References add_node(), create_dataset_to_point_mapping(), and nan_edge_solver().
Referenced by construct_geometry_fans().
|
inlinestatic |
Populate attached MR_cell_cplx object from data in attached MR_rect_tree object.
Only 0D vertex cells are produced. While similar results may be obtained by setting the output_dimension to zero and calling construct_geometry_fan() or construct_geometry_rects(), this method is much faster. This method also provides the option of only outputting centers without corners.
| Geom | output_centers | output_corners | Result | output_dimension=0 equivalent | |--------+----------------+----------------+---------------+-------------------------------| | POINTS | true | true | cell vertexes | construct_geometry_fans | | POINTS | true | false | cell centers | | | POINTS | false | true | cell corners | construct_geometry_rects | | POINTS | false | false | No Points | |
| ccplx | The MR_cell_cplx to populate with geometry |
| rtree | The MR_rect_tree with source data |
| cells | List of tree cells from which to construct geometry |
| point_src | Point sources |
| output_centers | Create vertexes for cell centers |
| output_corners | Create vertexes for cell corners |
Definition at line 451 of file MR_rt_to_cc.hpp.
References add_node(), and create_dataset_to_point_mapping().
Referenced by construct_geometry_points().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 478 of file MR_rt_to_cc.hpp.
References construct_geometry_points().
|
inlinestatic |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 546 of file MR_rt_to_cc.hpp.
References construct_geometry_rects().
|
inlinestatic |
Populate a MR_cell_cplx object from data in a MR_rect_tree object.
The resulting geometric structure in the MR_cell_cplx object will consist of 'rectangular' cell types (points, segments, rectangles, & hexahedra).
| Geom | Dom Dim | Out Dim | Result | |------------+---------+---------+--------------------| | RECTANGLES | 1-3 | 0 | Cell Corner Points | | RECTANGLES | 2-3 | 1 | Cell Edges | | RECTANGLES | 2 | 2 | 2D Rectangles | | RECTANGLES | 3 | 2 | Cell Faces | | RECTANGLES | 3 | 3 | Solid Hexahedra |
| ccplx | The MR_cell_cplx to populate with geometry |
| rtree | The MR_rect_tree with source data |
| cells | List of tree cells from which to construct geometry |
| output_dimension | Parts of cells to output |
| point_src | Point sources |
| degenerate_fallback | If the rectangle is degenerate, try and make a triangle. (only works for cc_t::cell_kind_t::QUAD) |
Definition at line 507 of file MR_rt_to_cc.hpp.
References add_node(), and create_dataset_to_point_mapping().
Referenced by construct_geometry_rects().
|
inlinestaticprivate |
Create approprate inputs for ccplx.create_dataset_to_point_mapping() from tree data.
| rtree | The MR_rect_tree with source data |
| ccplx | The MR_cell_cplx to populate wiht a pont mapping |
| rt_dil | Description of data sources |
Definition at line 109 of file MR_rt_to_cc.hpp.
References CONSTANT, FDOMAIN, and FRANGE.
Referenced by construct_geometry_fans(), construct_geometry_points(), and construct_geometry_rects().
|
inlinestatic |
Drop cells from a MR_cell_cplx object using an MR_rect_tree domain SDF function.
Definition at line 601 of file MR_rt_to_cc.hpp.
References tsdf_to_csdf().
|
inlinestatic |
Given an edge with one good point and one NaN point, find the longest segment from the good point toward the NaN point.
Note we normally use this function when we detect a NaN in a geometric point (i.e. the things with a node_idx_t). This solver solves until the return of func has no NaNs. Those two criteria might not be the same thing, but it's OK.
| ccplx | The MR_cell_cplx to populate with geometry |
| rtree | The MR_rect_tree with source data |
| good_point_ccplx_index | Good point index in the ccplx object |
| good_point_rtree_index | Good point index in the rtree object |
| sick_point_rtree_index | Bad point index in the rtree object |
| func | The function to use for the solver |
| solver_epsilon | Used as a distance threshold between sick point and solved endpoint in the tree domain space. |
Definition at line 194 of file MR_rt_to_cc.hpp.
References add_node().
Referenced by construct_geometry_fans().
|
inlinestaticprivate |
Transform a MR_cell_cplx::node_data_t value into MR_rect_tree::drpt_t.
| pd | The point data to convert. |
Definition at line 157 of file MR_rt_to_cc.hpp.
Referenced by tsampf_to_cdatf(), tsampf_to_clcdf(), and tsdf_to_csdf().
|
inlinestaticprivate |
Given rt_t domain & range points, produce a cc_t point data vector.
| dom_pnt | Domain point |
| rng_pnt | Range point |
Definition at line 140 of file MR_rt_to_cc.hpp.
Referenced by add_node(), and tsampf_to_cdatf().
|
inlinestatic |
Convert a MR_rect_tree range index into an index for a point data array.
| tree_range_index | value to convert |
Definition at line 178 of file MR_rt_to_cc.hpp.
|
inlinestatic |
Adapt a MR_rect_tree::drpt2rrpt_func_t (sample function) to a MR_cell_cplx::p2data_func_t (Point Data Transform).
| func | The function to adapt |
| pd | Point data to be passed to func. |
Definition at line 564 of file MR_rt_to_cc.hpp.
References node_data_to_drpt(), and rt_pnt_to_cc_pnt().
|
inlinestatic |
Evalate an MR_cell_cplx::p2real_func_t (Point Data SDF) function from a MR_rect_tree::drpt2rrpt_func_t (Sample Function) and level data.
| range_index | Index into range of origional sample function |
| level | Level to check range element aginst |
| func | The function to adapt |
| pd | Point data to be passed to func. |
Definition at line 583 of file MR_rt_to_cc.hpp.
References node_data_to_drpt().
|
inlinestatic |
Adapt a MR_rect_tree::drpt2real_func_t (Domain Point SDF) to MR_cell_cplx::p2real_func_t (Point Data SDF).
| func | The function to adapt |
| pd | Point data to be passed to func. |
Definition at line 573 of file MR_rt_to_cc.hpp.
References node_data_to_drpt().
Referenced by cull_cc_cells_on_domain_sdf_boundry().