Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Analyst WebApp
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fidentis
Analyst WebApp
Commits
3499640a
There was an error fetching the commit references. Please try again later.
Commit
3499640a
authored
3 years ago
by
Daniel Schramm
Browse files
Options
Downloads
Patches
Plain Diff
PrioritySphere javadoc added
parent
8fb687ef
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Comparison/src/main/java/cz/fidentis/analyst/visitors/mesh/PrioritySphere.java
+29
-0
29 additions, 0 deletions
...ava/cz/fidentis/analyst/visitors/mesh/PrioritySphere.java
with
29 additions
and
0 deletions
Comparison/src/main/java/cz/fidentis/analyst/visitors/mesh/PrioritySphere.java
+
29
−
0
View file @
3499640a
...
@@ -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
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment