pub struct vtkSphericalPointIterator(/* private fields */);Expand description
Traverse a collection of points in spherical ordering.
vtkSphericalPointIterator is a state-based iterator for traversing a set of points (i.e., a neighborhood of points) in a dataset, providing a point traversal order across user-defined “axes” which span a 2D or 3D space (typically a circle or sphere). The points along each axes may be sorted in increasing radial order. To define the points, specify a dataset (i.e., its associated points, whether the points are represented implicitly or explicitly) and an associated neighborhood over which to iterate. Methods for iterating over the points are provided.
For example, consider the axes of iteration to be the four rays emanating from the center of a square and passing through the center of each of the four edges of the square. Points to be iterated over are associated (using a dot product) with each of the four axes, and then can be sorted along each axis. Then the order of iteration is then: (axis0,pt0), (axis1,pt0), (axis2,pt0), (axis3,pt0), (axis0,pt1), (axis1,pt1), (axis2,pt1), (axis3,pt1), (axis0,pt2), (axis1,pt2), (axis2,pt2), (axis3,pt2), and so on in a “spiraling” fashion until all points are visited. Thus the order of visitation is: iteration i visits all N axes in order, returning the jth point sorted along each of the N axes (i.e., i increases the fastest). Alternatively, methods exist to randomly access points, or points associated with an axes, so that custom iteration methods can be defined.
The iterator can be defined with any number of axes (defined by 3D vectors). The axes must not be coincident, and typically are equally spaced from one another. The order which the axes are defined determines the order in which the axes (and hence the points) are traversed. So for example, in a 2D sphere, four axes in the (-x,+x,-y,+y) directions would provide a “ping pong” iteration, while four axes ordered in the (+x,+y,-x,-y) directions would provide a counterclockwise rotation iteration.
The iterator provides thread-safe iteration of dataset points. It supports both random and forward iteration.
@warning The behavior of the iterator depends on the ordering of the iteration axes. It is possible to obtain a wide variety of iteration patterns depending on these axes. For example, if only one axis is defined, then a “linear” pattern is possible (i.e., visiting points in the half space defined by the vector); if two axes, then a “diagonal” iteration pattern; and so on. Note that points are sorted along the iteration axes depending on the their projection onto them (e.g., using the dot product). Because only points with positive projection are associated with an axis, it is possible that some points in the neighborhood will not be processed (i.e., if a point in the neighborhood does not positively project onto any of the axes, then it will not be iterated over). Thus if all points are to be iterated over, then the axes must form a basis which covers all points using positive projections.
@sa vtkVoronoi2D vtkVoronoi3D vtkStaticPointLocator vtkPointLocator
Implementations§
Source§impl vtkSphericalPointIterator
impl vtkSphericalPointIterator
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new vtkSphericalPointIterator wrapped inside vtkNew