#include <ADF.h>
Public Member Functions | |
| ADF () | |
| Constructs an adaptively-sampled distance field (ADF) with a recursion level of 0. | |
| ADF (boost::shared_ptr< ADF > parent, unsigned recursion_level, const Vector3 &lo_bounds, const Vector3 &hi_bounds) | |
| Constructs an octree with the specified parent, recursion level, and bounds. | |
| ADF (boost::shared_ptr< ADF > parent, unsigned recursion_level, const std::vector< Vector3ConstPtr > &vertices) | |
| Constructs an ADF with the specified parent, recursion level, and vertices. | |
| Real | calc_signed_distance (const Vector3 &point) const |
| Computes the signed distance using this ADF cell using trilinear interpolation. | |
| const std::vector< Vector3ConstPtr > & | get_vertices () const |
| void | set_distances (const std::vector< Real > &distances) |
| Sets the vector of distances for this cell. | |
| template<class ForwardIterator> | |
| void | set_distances (ForwardIterator first, ForwardIterator last) |
| Computes the signed distances for each corner of the ADF cell using a given triangle mesh. | |
| void | get_samples (std::vector< Vector3 > &samples) const |
| Gets 19 points sampled over this cell. | |
| void | reset () |
| void | simplify (Real epsilon) |
| Simplifies an ADF by coalescing cells. | |
| void | get_bounds (Vector3 &lo, Vector3 &hi) const |
| Gets the bounds for this ADF cell. | |
| void | set_bounds (const Vector3 &lo_bound, const Vector3 &hi_bound) |
| (Re)sets the bounds for this ADF cell | |
| const std::vector< Real > & | get_distances () const |
| bool | contains (const Vector3 &point) const |
| Determines whether the given point is within this ADF's bounding box. | |
| unsigned | count_cells () const |
| Counts the number of cells within this ADF. | |
| bool | generate_iso_sample (Vector3 &sample, Real epsilon) const |
| Determines a sample on the iso-surface of the ADF. | |
| void | get_all_leaf_nodes (std::list< boost::shared_ptr< ADF > > &leafs) const |
| Gets all leaf nodes in the sub-tree rooted at this cell. | |
| void | get_all_cells (std::list< boost::shared_ptr< ADF > > &cells) const |
| Gets all cells in the sub-tree rooted at this cell. | |
| void | determine_normal (const Vector3 &point, Vector3 &normal) const |
| Determines the normal to the surface at a point. | |
| bool | intersect_seg_iso_surface (const std::pair< Vector3, Vector3 > &seg, Vector3 &isect) const |
| Intersects a line segment with the iso-surface within this ADF. | |
| void | set_parent (boost::shared_ptr< ADF > parent) |
| Sets the parent of this octree. | |
| boost::shared_ptr< ADF > | get_parent () const |
| Gets the parent of this octree. | |
| bool | is_leaf () const |
| Determines whether this ADF node is a leaf. | |
| unsigned | get_recursion_level () const |
| Gets the current level of recursion of this ADF. | |
| void | set_recursion_level (unsigned level) |
| Sets the current level of recursion of this ADF. | |
| void | subdivide () |
| Subdivides this ADF cell into eight cells. | |
|
const std::vector< boost::shared_ptr< ADF > > & | get_children () const |
| Gets the set of children of this ADF cell. | |
Static Public Member Functions | |
| static boost::shared_ptr< ADF > | build_ADF_iso_inside_focus (const std::vector< TriangleConstPtr > &mesh, unsigned max_recursion, Real epsilon) |
| Builds an ADF from a triangle mesh. | |
| static boost::shared_ptr< ADF > | intersect (boost::shared_ptr< ADF > adf1, boost::shared_ptr< ADF > adf2, Real epsilon, unsigned recursion_limit) |
| Intersects two ADFs and returns the new ADF. | |
| ADF::ADF | ( | ) |
| ADF::ADF | ( | boost::shared_ptr< ADF > | parent, | |
| unsigned | recursion_level, | |||
| const Vector3 & | lo_bounds, | |||
| const Vector3 & | hi_bounds | |||
| ) |
Constructs an octree with the specified parent, recursion level, and bounds.
The bounds of the ADF are set to -/+ infinity and the distances are set to positive infinity.
| ADF::ADF | ( | boost::shared_ptr< ADF > | parent, | |
| unsigned | recursion_level, | |||
| const std::vector< Vector3ConstPtr > & | vertices | |||
| ) |
Constructs an ADF with the specified parent, recursion level, and vertices.
The vertices are expected to be in the following order: 6---7 /| /| 3---5 | | 2-|-4 |/ |/ 0---1
| void ADF::set_distances | ( | const std::vector< Real > & | distances | ) |
Sets the vector of distances for this cell.
| distances | a 8-dimension vector of distances corresponding to each vertex of the cell. The distances must correspond to the following: |
where '0' and '7' correspond to the bounds of this cell.
| void Physsim::ADF::set_distances | ( | ForwardIterator | first, | |
| ForwardIterator | last | |||
| ) |
Computes the signed distances for each corner of the ADF cell using a given triangle mesh.
| first | an iterator to the first of a set of TriangleConstPtr / TrianglePtr elements | |
| last | an iterator to the last of a set of TriangleConstPtr / TrianglePtr elements |
| void ADF::get_samples | ( | std::vector< Vector3 > & | samples | ) | const |
Gets 19 points sampled over this cell.
The 19 points are: the center of the cell, the center of each face (6), and the center of each edge (12).
| boost::shared_ptr< ADF > ADF::build_ADF_iso_inside_focus | ( | const std::vector< TriangleConstPtr > & | mesh, | |
| unsigned | max_recursion, | |||
| Real | epsilon | |||
| ) | [static] |
Builds an ADF from a triangle mesh.
This method builds an adaptively-sampled distance field, concentrating on accurately representing the iso-surface and the inside of the shape.
| mesh | the triangle mesh | |
| max_recursion | the maximum recursion level within the ADF octree | |
| epsilon | the tolerance below which subdivision stops |
| boost::shared_ptr< ADF > ADF::intersect | ( | boost::shared_ptr< ADF > | adf1, | |
| boost::shared_ptr< ADF > | adf2, | |||
| Real | epsilon, | |||
| unsigned | recursion_limit | |||
| ) | [static] |
Intersects two ADFs and returns the new ADF.
| adf1 | the first ADF | |
| adf2 | the second ADF | |
| epsilon | the tolerance to the true distance below which further recursion is terminated | |
| recursion_limit | the maximum number of levels of the ADF octree |
| void ADF::get_all_leaf_nodes | ( | std::list< boost::shared_ptr< ADF > > & | leafs | ) | const |
Gets all leaf nodes in the sub-tree rooted at this cell.
cells are not inserted into the list in any order
| void ADF::get_all_cells | ( | std::list< boost::shared_ptr< ADF > > & | cells | ) | const |
Gets all cells in the sub-tree rooted at this cell.
the list is ordered as a pre-order
Determines the normal to the surface at a point.
| bool ADF::intersect_seg_iso_surface | ( | const std::pair< Vector3, Vector3 > & | seg, | |
| Vector3 & | isect | |||
| ) | const |
Intersects a line segment with the iso-surface within this ADF.
1.5.1