Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
TULIP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NUI
TULIP
Commits
b6a4fc3d
Commit
b6a4fc3d
authored
Sep 18, 2020
by
Nico Mack
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor bug fixes
parent
2828bd33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
TULIP/src/lu/list/itis/dkd/tui/utility/ShapeUtils.java
TULIP/src/lu/list/itis/dkd/tui/utility/ShapeUtils.java
+12
-5
No files found.
TULIP/src/lu/list/itis/dkd/tui/utility/ShapeUtils.java
View file @
b6a4fc3d
...
...
@@ -1162,7 +1162,7 @@ public class ShapeUtils {
public
static
BoundingBox
getBoundingBoxAtAngle
(
Shape
shape
,
double
angle
)
{
Point
centre
=
centroidOf
(
shape
);
AffineTransform
rotation
=
AffineTransform
.
getRotateInstance
(
-
angle
,
centre
.
getX
(),
centre
.
getY
());
AffineTransform
rotation
=
AffineTransform
.
getRotateInstance
(
angle
,
centre
.
getX
(),
centre
.
getY
());
Shape
rotated
=
rotation
.
createTransformedShape
(
shape
);
return
new
BoundingBox
(
rotated
.
getBounds2D
(),
angle
);
...
...
@@ -1180,7 +1180,7 @@ public class ShapeUtils {
public
static
List
<
Point
>
generatePointCloud
(
Shape
shape
,
int
spacing
,
int
rowOffset
,
double
angle
)
{
Point
centr
e
=
centroidOf
(
shape
);
Point
centr
oid
=
centroidOf
(
shape
);
BoundingBox
bbox
;
if
(
Double
.
isNaN
(
angle
))
{
...
...
@@ -1189,10 +1189,17 @@ public class ShapeUtils {
bbox
=
getBoundingBoxAtAngle
(
shape
,
angle
);
}
LOGGER
.
info
(
"Centroid = {}"
,
centroid
);
LOGGER
.
info
(
"BBox = {}"
,
bbox
);
double
halfMajorAxis
=
bbox
.
getBounds
().
getWidth
()
/
2
;
double
halfMinorAxis
=
bbox
.
getBounds
().
getHeight
()
/
2
;
Rectangle2D
bounds
=
bbox
.
getBounds
();
double
halfMajorAxis
=
bounds
.
getWidth
()
/
2
;
double
halfMinorAxis
=
bounds
.
getHeight
()
/
2
;
// Point bboxCentre = new Point(bounds.getCenterX(), bounds.getCenterY(), 0d,
// ScreenCoordinates.class);
// centre = rotate(centre, -bbox.getAngle());
// LOGGER.info("Centre = {}", centre);
int
numberOfPoints
=
(
int
)
(
bbox
.
getBounds
().
getWidth
()
*
bbox
.
getBounds
().
getHeight
())
/
(
spacing
*
spacing
);
...
...
@@ -1208,7 +1215,7 @@ public class ShapeUtils {
Point
candidate
=
new
Point
((
float
)
x
,
(
float
)
y
,
0
f
,
ScreenCoordinates
.
class
);
Point
rotated
=
candidate
.
clone
();
rotation
.
transform
(
candidate
,
rotated
);
rotated
=
rotated
.
add
(
centr
e
);
rotated
=
rotated
.
add
(
centr
oid
);
if
(
shape
.
contains
(
rotated
))
{
pointCloud
.
add
(
rotated
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment