Package toxi.geom.mesh
Class VertexSelector
java.lang.Object
toxi.geom.mesh.VertexSelector
- Direct Known Subclasses:
BoxSelector
,DefaultSelector
,PlaneSelector
Abstract parent class for selecting mesh vertices and manipulating resulting
selections using set theory operations. Implementations of this class should
aim to work with all mesh types (e.g.
TriangleMesh
,
WETriangleMesh
).-
Constructor Summary
ConstructorDescriptionVertexSelector
(Mesh3D mesh) Creates a new selector assigned to the given mesh -
Method Summary
Modifier and TypeMethodDescriptionaddSelection
(VertexSelector sel2) Adds all vertices selected by the given selector to the current selection.Clears the current selection.getMesh()
Returns the associated mesh for this selector.Returns the actual collection of selected verticesCreates a new selection of all vertices NOT currently selected.selectSimilar
(Collection<? extends Vec3D> points) Selects vertices identical or closest to the ones given in the list of points.abstract VertexSelector
Selects vertices using an implementation specific method.void
Assigns a new mesh instance to this selector and clears the current selection.int
size()
Returns the current number of selected vertices.Removes all vertices selected by the given selector from the current selection.
-
Constructor Details
-
VertexSelector
Creates a new selector assigned to the given mesh- Parameters:
mesh
-
-
-
Method Details
-
addSelection
Adds all vertices selected by the given selector to the current selection. The other selector needs to be assigned to the same mesh instance.- Parameters:
sel2
- other selector- Returns:
- itself
-
clearSelection
Clears the current selection.- Returns:
- itself
-
getMesh
Returns the associated mesh for this selector.- Returns:
- itself
-
getSelection
Returns the actual collection of selected vertices- Returns:
- vertex collection
-
invertSelection
Creates a new selection of all vertices NOT currently selected.- Returns:
- itself
-
selectSimilar
Selects vertices identical or closest to the ones given in the list of points.- Parameters:
points
-- Returns:
- itself
-
selectVertices
Selects vertices using an implementation specific method. This is the only method which needs to be implemented by any selector subclass.- Returns:
- itself
-
setMesh
Assigns a new mesh instance to this selector and clears the current selection.- Parameters:
mesh
- the mesh to set
-
size
public int size()Returns the current number of selected vertices.- Returns:
- number of vertices
-
subtractSelection
Removes all vertices selected by the given selector from the current selection. The other selector needs to be assigned to the same mesh instance.- Parameters:
sel2
- other selector- Returns:
- itself
-