Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
CityDoctor
CityDoctor2
Commits
f147a2b2
Commit
f147a2b2
authored
Aug 12, 2024
by
Riegel
Browse files
Converted DistanceResult to Record. Ref
#69
parent
8bb293f5
Changes
3
Show whitespace changes
Inline
Side-by-side
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/math/DistanceResult.java
View file @
f147a2b2
...
@@ -22,31 +22,7 @@ package de.hft.stuttgart.citydoctor2.math;
...
@@ -22,31 +22,7 @@ package de.hft.stuttgart.citydoctor2.math;
* Result of a distance calculation between two points
* Result of a distance calculation between two points
*
*
* @author Matthias Betz
* @author Matthias Betz
*
*/
*/
public
class
DistanceResult
{
public
record
DistanceResult
(
Vector3d
point1
,
Vector3d
point2
,
double
distance
)
{
private
final
Vector3d
point1
;
private
final
Vector3d
point2
;
private
final
double
distance
;
public
DistanceResult
(
Vector3d
point1
,
Vector3d
point2
,
double
distance
)
{
super
();
this
.
point1
=
point1
;
this
.
point2
=
point2
;
this
.
distance
=
distance
;
}
public
Vector3d
getPoint1
()
{
return
point1
;
}
public
Vector3d
getPoint2
()
{
return
point2
;
}
public
double
getDistance
()
{
return
distance
;
}
}
}
CityDoctorParent/CityDoctorModel/src/main/java/de/hft/stuttgart/citydoctor2/math/Segment3d.java
View file @
f147a2b2
...
@@ -51,7 +51,7 @@ public class Segment3d implements Serializable {
...
@@ -51,7 +51,7 @@ public class Segment3d implements Serializable {
* @return the distance
* @return the distance
*/
*/
public
double
getDistance
(
Segment3d
otherSeg
)
{
public
double
getDistance
(
Segment3d
otherSeg
)
{
return
getDistanceResult
(
otherSeg
).
getD
istance
();
return
getDistanceResult
(
otherSeg
).
d
istance
();
}
}
public
DistanceResult
getDistanceResult
(
Segment3d
other
)
{
public
DistanceResult
getDistanceResult
(
Segment3d
other
)
{
...
...
CityDoctorParent/CityDoctorValidation/src/main/java/de/hft/stuttgart/citydoctor2/checks/geometry/RingSelfIntCheck.java
View file @
f147a2b2
...
@@ -124,9 +124,9 @@ public class RingSelfIntCheck extends Check {
...
@@ -124,9 +124,9 @@ public class RingSelfIntCheck extends Check {
Segment3d
s1
=
new
Segment3d
(
e1
.
getFrom
(),
e1
.
getTo
());
Segment3d
s1
=
new
Segment3d
(
e1
.
getFrom
(),
e1
.
getTo
());
Segment3d
s2
=
new
Segment3d
(
e2
.
getFrom
(),
e2
.
getTo
());
Segment3d
s2
=
new
Segment3d
(
e2
.
getFrom
(),
e2
.
getTo
());
DistanceResult
dr
=
s1
.
getDistanceResult
(
s2
);
DistanceResult
dr
=
s1
.
getDistanceResult
(
s2
);
if
(
dr
.
getD
istance
()
<
epsilon
)
{
if
(
dr
.
d
istance
()
<
epsilon
)
{
// intersection
// intersection
CheckError
err
=
new
RingEdgeIntersectionError
(
lr
,
e1
,
e2
,
dr
.
getP
oint1
());
CheckError
err
=
new
RingEdgeIntersectionError
(
lr
,
e1
,
e2
,
dr
.
p
oint1
());
CheckResult
cr
=
new
CheckResult
(
this
,
ResultStatus
.
ERROR
,
err
);
CheckResult
cr
=
new
CheckResult
(
this
,
ResultStatus
.
ERROR
,
err
);
lr
.
addCheckResult
(
cr
);
lr
.
addCheckResult
(
cr
);
return
;
return
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment