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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
fidentis
Analyst WebApp
Commits
7f1992d1
There was an error fetching the commit references. Please try again later.
Commit
7f1992d1
authored
Sep 8, 2021
by
Daniel Schramm
Browse files
Options
Downloads
Patches
Plain Diff
Variable sizes of drawable feature points
parent
1f62d3d3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/src/main/java/cz/fidentis/analyst/scene/DrawableFeaturePoints.java
+39
-2
39 additions, 2 deletions
...java/cz/fidentis/analyst/scene/DrawableFeaturePoints.java
with
39 additions
and
2 deletions
GUI/src/main/java/cz/fidentis/analyst/scene/DrawableFeaturePoints.java
+
39
−
2
View file @
7f1992d1
...
...
@@ -14,10 +14,12 @@ import java.util.Map;
* Drawable feature points.
*
* @author Radek Oslejsek
* @author Daniel Schramm
*/
public
class
DrawableFeaturePoints
extends
Drawable
{
public
static
final
Color
DEFAULT_COLOR
=
Color
.
LIGHT_GRAY
;
public
static
final
double
DEFAULT_SIZE
=
3
f
;
private
static
final
GLU
GLU_CONTEXT
=
new
GLU
();
...
...
@@ -27,7 +29,12 @@ public class DrawableFeaturePoints extends Drawable {
/**
* feature points with color different from the default color
*/
private
Map
<
Integer
,
Color
>
specialColors
=
new
HashMap
<>();
private
final
Map
<
Integer
,
Color
>
specialColors
=
new
HashMap
<>();
/**
* feature points with size different from the default size
*/
private
final
Map
<
Integer
,
Double
>
specialSizes
=
new
HashMap
<>();
/**
* Constructor.
...
...
@@ -84,6 +91,36 @@ public class DrawableFeaturePoints extends Drawable {
this
.
specialColors
.
clear
();
}
public
Double
getSize
(
int
index
)
{
if
(
index
<
0
||
index
>=
featurePoints
.
size
())
{
return
null
;
}
if
(
specialSizes
.
containsKey
(
index
))
{
return
specialSizes
.
get
(
index
);
}
else
{
return
DEFAULT_SIZE
;
}
}
public
void
setSize
(
int
index
,
double
size
)
{
if
(
index
<
0
||
index
>=
featurePoints
.
size
())
{
return
;
}
if
(
size
==
DEFAULT_SIZE
)
{
specialSizes
.
remove
(
index
);
}
else
{
specialSizes
.
put
(
index
,
size
);
}
}
public
void
resetSizeToDefault
(
int
index
)
{
setSize
(
index
,
DEFAULT_SIZE
);
}
public
void
resetAllSizesToDefault
()
{
specialSizes
.
clear
();
}
@Override
protected
void
renderObject
(
GL2
gl
)
{
float
[]
rgba
=
{
...
...
@@ -108,7 +145,7 @@ public class DrawableFeaturePoints extends Drawable {
GLU_CONTEXT
.
gluQuadricDrawStyle
(
center
,
GLU
.
GLU_FILL
);
GLU_CONTEXT
.
gluQuadricNormals
(
center
,
GLU
.
GLU_FLAT
);
GLU_CONTEXT
.
gluQuadricOrientation
(
center
,
GLU
.
GLU_OUTSIDE
);
GLU_CONTEXT
.
gluSphere
(
center
,
3
f
,
16
,
16
);
GLU_CONTEXT
.
gluSphere
(
center
,
specialSizes
.
getOrDefault
(
i
,
DEFAULT_SIZE
)
,
16
,
16
);
GLU_CONTEXT
.
gluDeleteQuadric
(
center
);
gl
.
glPopMatrix
();
...
...
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
sign in
to comment