Skip to content
Snippets Groups Projects
Commit 3499640a authored by Daniel Schramm's avatar Daniel Schramm
Browse files

PrioritySphere javadoc added

parent 8fb687ef
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,19 @@ import java.util.Map; ...@@ -11,6 +11,19 @@ import java.util.Map;
import javax.vecmath.Point3d; import javax.vecmath.Point3d;
/** /**
* This visitor computes priorities of vertices of a mesh facet according to their absolute distance from
* the given {@link PrioritySphere#sphereCenterPosition} point.
* <ul>
* <li>The closer a vertex is to {@link PrioritySphere#sphereCenterPosition}, the higher its priority is.</li>
* <li>Vertices that are further than {@link PrioritySphere#sphereRadius} from {@link PrioritySphere#sphereCenterPosition}
* have priority equal to 0.</li>
* </ul>
* <p>
* The visitor returns all mesh facets together with priorities of all their vertices
* </p>
* <p>
* This visitor is thread-safe.
* </p>
* *
* @author Daniel Schramm * @author Daniel Schramm
*/ */
...@@ -21,6 +34,13 @@ public class PrioritySphere extends MeshVisitor { ...@@ -21,6 +34,13 @@ public class PrioritySphere extends MeshVisitor {
private final Map<MeshFacet, List<Double>> priorities = new HashMap<>(); private final Map<MeshFacet, List<Double>> priorities = new HashMap<>();
/**
* Constructor.
*
* @param sphereCenterPosition Position of the center of the sphere in which
* the priorities will be calculated
* @param sphereRadius Radius of the sphere
*/
public PrioritySphere(Point3d sphereCenterPosition, double sphereRadius) { public PrioritySphere(Point3d sphereCenterPosition, double sphereRadius) {
if (sphereCenterPosition == null) { if (sphereCenterPosition == null) {
throw new IllegalArgumentException("sphereCenterPosition"); throw new IllegalArgumentException("sphereCenterPosition");
...@@ -29,6 +49,15 @@ public class PrioritySphere extends MeshVisitor { ...@@ -29,6 +49,15 @@ public class PrioritySphere extends MeshVisitor {
this.sphereRadius = sphereRadius; this.sphereRadius = sphereRadius;
} }
/**
* Returns map of visited mesh facets together with a list of priorities of their vertices.
*
* The order of priorities corresponds to the order of vertices
* in the visited facet, i.e., the i-th priority is a priority of the i-th vertex
* of the visited facet.
*
* @return map of visited mesh facets and priorities of their vertices
*/
public Map<MeshFacet, List<Double>> getPriorities() { public Map<MeshFacet, List<Double>> getPriorities() {
return Collections.unmodifiableMap(priorities); return Collections.unmodifiableMap(priorities);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment