Commit 33b416bf authored by Riegel's avatar Riegel
Browse files

Merge branch 'dev_GUI' into 'dev'

Gitlab changelog and templates

See merge request !7
parents 81be0b1d 74e0b3f5
Pipeline #10100 passed with stage
in 1 minute and 8 seconds
# Title: Summary, imperative, start upper case, don't end with a period
# No more than 50 chars. #### 50 chars is here: #
# Remember blank line between title and body.
# Body: Explain *what* and *why* (not *how*). Include task ID (Jira issue).
# Wrap at 72 chars. ################################## which is here: #
# At the end: Include Co-authored-by for all contributors.
# Include at least one empty line before it. Format:
# Co-authored-by: name <user@users.noreply.github.com>
#
# How to Write a Git Commit Message:
# https://chris.beams.io/posts/git-commit/
#
# 1. Separate subject from body with a blank line
# 2. Limit the subject line to 50 characters
# 3. Capitalize the subject line
# 4. Do not end the subject line with a period
# 5. Use the imperative mood in the subject line
# 6. Wrap the body at 72 characters
# 7. Use the body to explain what and why vs. how
\ No newline at end of file
## Classification Score
Disclosed vulnerabilities are evaluated by using the [Common Vulnerability Scoring System](https://www.first.org/cvss/v4.0/user-guide).
The calculator can be found [here](https://www.first.org/cvss/calculator/4.0).
## Vulnerability Severities
**Critical:** ~"Vulnerability::Critical" Vulnerabilities with a Score >= 9, or vulnerabilities which enable remote code execution.
**High:** ~"Vulnerability::High" Vulnerabilities with a Score >= 5.
**Minor:** ~"Vulnerability::Minor" Vulnerabilities with a Score < 5, or which require physical access to the system.
\ No newline at end of file
---
# Settings for generating changelogs using the GitLab API. See
# https://docs.gitlab.com/ee/api/repositories.html#generate-changelog-data for
# more information.
categories:
added: Added
fixed: Fixed
changed: Changed
deprecated: Deprecated
removed: Removed
security: Security
performance: Performance
other: Other
template: |
{% if categories %}
{% each categories %}
### {{ title }} ({% if single_change %}1 change{% else %}{{ count }} changes{% end %})
{% each entries %}
- [{{ title }}]({{ commit.web_url }})\
{% if author.credit %} by {{ author.reference }}{% end %}\
{% if commit.trailers.MR %}\
([merge request]({{ commit.trailers.MR }}))\
{% else %}\
{% if merge_request %}\
([merge request]({{ merge_request.web_url }}))\
{% end %}\
{% end %}\
{% if commit.trailers.EE %}\
**GitLab Enterprise Edition**\
{% end %}
{% end %}
{% end %}
{% else %}
No changes.
{% end %}
## Summary
<!--Summarize the bug encountered concisely -->
## Steps to reproduce
<!--How one can reproduce the issue - this is very important-->
## What is the current bug behavior?
<!--What actually happens-->
## What is the expected correct behavior?
<!--What you should see instead-->
## Relevant logs and/or screenshots
<!--Paste any relevant logs - use code blocks (```) to format console output, logs, and code, as
it's very hard to read otherwise.-->
## Possible cause
<!--If you can, link to the line of code that might be responsible for the problem-->
/label Bug
\ No newline at end of file
## Short description
<!--Short description of what needs to be documented -->
## Content
<!--Clarify what should be contained in the documentation-->
## Location
<!--How should the documentation be made accessible-->
/label Type::Documentation
\ No newline at end of file
## Summary
<!--Give a short summary of the requested feature-->
## What is the function?
<!--Give a detailed description of how the feature should work and the required steps and actors-->
## Why is it requested?
<!--Explain why and how the described feature would be useful-->
/label Type::Feature Request
\ No newline at end of file
## Description
<!--Give the User Story -->
**As a:** <!--Role-->
**I want:** <!--Functionality X-->
**So that:** <!--Goal Y can be realized-->
## Acceptance Criteria
<!--Detail the scenarios needed to fulfill the User Story-->
**Scenario X: Title of scenario**
---
**Given** <!--An action is done-->
**When** <!--Some conditions apply-->
**Then** <!--Detailed description of expected behavior.-->
/label Type::Feature Request
\ No newline at end of file
## Summary
<!--Summarize the vulnerability -->
## Steps to reproduce
<!--How one can reproduce the issue - this is very important-->
## What is the current bug behavior?
<!--What actually happens-->
## What is the expected correct behavior?
<!--What you should see instead-->
## Relevant logs and/or screenshots
<!--Paste any relevant logs - use code blocks (```) to format console output, logs, and code, as
it's very hard to read otherwise.-->
## Possible cause
<!--If you can, link to the line of code that might be responsible for the problem-->
/label Type::Bug Vulnerability::Unclassified
/confidential
\ No newline at end of file
<!-- After merging changes to this template, update the `Default description template for merge requests` -->
<!-- found under Settings - General Merge Requests -->
## What does this MR do?
<!-- Briefly describe what this MR is about. -->
## Related issues
<!-- Link related issues below. Insert the issue link or reference.-->
## Checklist
- [ ] Commits squashed, following the message-template and containing changelog-trailers
- [ ] MR title and description are up to date, accurate, and descriptive.
- [ ] MR targeting the appropriate branch.
- [ ] Latest Merge Result pipeline is green.
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [3.15.0] (2024-09-03)
### Added (7 changes)
- Add CityDoctorAutoPro extension.
- Add CityDoctorGUI extension.
- Add CityDoctorHealer extension.
- Add CityDoctorHealerGUI extension.
- Add CityDoctorHealerGenetic extension.
- Add CityDoctorWebService extension.
- Add Documentation for extension modules.
### Fixed (1 change)
- Fix false positives for Solid self-intersections.
### Changed (1 change)
- Update Maven dependencies: Include JavaFX
### Security (1 change)
- Upgrade SnakeYAML to version 2.0
## [3.14.0] (2024-03-20)
Official Release of CityDoctor2
...@@ -211,6 +211,83 @@ public class DebugUtils { ...@@ -211,6 +211,83 @@ public class DebugUtils {
return counterArr[0]; return counterArr[0];
} }
public static void printFPSelfIntersectionTestCaseCode(PolygonPolygonIntersection... intersectionResults){
for (PolygonPolygonIntersection intersection : intersectionResults) {
printFPSelfIntersectionTestCaseCode(intersection.getPolygon1(), intersection.getPolygon2());
}
}
public static void printFPSelfIntersectionTestCaseCode(EdgePolygon polygon1, EdgePolygon polygon2) {
Locale.setDefault(Locale.US);
System.out.println("-----------------------------------------------------");
System.out.println("");
System.out.println("@Test");
System.out.println("public void testFalsePositiveCASENAME() {");
printTabbedLine("Geometry geom = new Geometry(GeometryType.SOLID, Lod.LOD1);");
System.out.println("");
printTestCasePolygonCode(polygon1, polygon2);
printTabbedLine("CDPolygonNs edgePoly1 = CDPolygonNs.of(p1, new HashMap<>());");
printTabbedLine("CDPolygonNs edgePoly2 = CDPolygonNs.of(p2, new HashMap<>());");
printTabbedLine("List<PolygonPolygonIntersection> intersectPolygons;");
printTabbedLine("intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly1, edgePoly2, 0.000001, 0.001);");
printTabbedLine("assertNotNull(intersectPolygons);");
printTabbedLine("assertTrue(intersectPolygons.isEmpty());");
System.out.println("");
printTabbedLine("intersectPolygons = IntersectPlanarPolygons.intersectPolygons(edgePoly2, edgePoly1, 0.000001, 0.001);");
printTabbedLine("assertNotNull(intersectPolygons);");
printTabbedLine("assertTrue(intersectPolygons.isEmpty());");
System.out.println("}");
}
private static void printTabbedLine(String line){
Locale.setDefault(Locale.US);
String format = "\t%s\n";
System.out.format(format, line);
}
private static void printTestCasePolygonCode(EdgePolygon polygon1, EdgePolygon polygon2) {
printTabbedLine("Polygon p1 = new ConcretePolygon();");
printTabbedLine("geom.addPolygon(p1);");
printTabbedLine("LinearRing ext = new LinearRing(LinearRingType.EXTERIOR);");
printTabbedLine("p1.setExteriorRing(ext);");
printTabbedLine("List<Vertex> vertices= new ArrayList<>();");
printTestCasePolygonVertices(polygon1);
System.out.println("");
printTabbedLine("Polygon p2 = new ConcretePolygon();");
printTabbedLine("geom.addPolygon(p2);");
printTabbedLine("ext = new LinearRing(LinearRingType.EXTERIOR);");
printTabbedLine("p2.setExteriorRing(ext);");
printTabbedLine("vertices= new ArrayList<>();");
printTestCasePolygonVertices(polygon2);
System.out.println("");
}
private static void printTestCasePolygonVertices(EdgePolygon polygon) {
List<Coordinate3d> coordList = polygon.getCoordinates();
NumberFormat nf = NumberFormat.getNumberInstance();
nf.setMaximumFractionDigits(30);
String vertexFormat = "vertices.add(new Vertex(%s,%s,%s));";
for (Coordinate3d coordinate3d : coordList) {
Point3d point = coordinate3d.getPoint();
printTabbedLine(String.format(vertexFormat,
nf.format(point.getX()), nf.format(point.getY()), nf.format(point.getZ())));
}
// close ring
Point3d point = coordList.get(0).getPoint();
printTabbedLine(String.format(vertexFormat,point.getX(),point.getY(),point.getZ()));
printTabbedLine("ext.addAllVertices(vertices);");
}
public static int printCityDoctorPolygons(Polygon... polygons) { public static int printCityDoctorPolygons(Polygon... polygons) {
Locale.setDefault(Locale.US); Locale.setDefault(Locale.US);
NumberFormat nf = NumberFormat.getNumberInstance(); NumberFormat nf = NumberFormat.getNumberInstance();
......
...@@ -154,7 +154,8 @@ public class IntersectPlanarPolygons { ...@@ -154,7 +154,8 @@ public class IntersectPlanarPolygons {
List<PolygonPolygonIntersection> intersections, double epsilon) { List<PolygonPolygonIntersection> intersections, double epsilon) {
// check if both polygons have this point in common // check if both polygons have this point in common
if (!sharingBothPolygonsThisPoint(p1, p2, point, epsilon)) { if (!sharingBothPolygonsThisPoint(p1, p2, point, epsilon)) {
PolyLine pPL = new PolyLine(new Coordinate3d(point), new Coordinate3d(point)); Coordinate3d realPointCoordinate = new Coordinate3d(point);
PolyLine pPL = new PolyLine(realPointCoordinate, realPointCoordinate);
PolygonPolygonIntersection pPPI = new PolygonPolygonIntersection(p1, p2, pPL); PolygonPolygonIntersection pPPI = new PolygonPolygonIntersection(p1, p2, pPL);
intersections.add(pPPI); intersections.add(pPPI);
} }
......
...@@ -79,7 +79,7 @@ public class PolyLine extends BaseEntity { ...@@ -79,7 +79,7 @@ public class PolyLine extends BaseEntity {
} }
public boolean isNullLine() { public boolean isNullLine() {
return isNullLine(0.00); return isNullLine(0.0000001);
} }
...@@ -88,6 +88,13 @@ public class PolyLine extends BaseEntity { ...@@ -88,6 +88,13 @@ public class PolyLine extends BaseEntity {
if (mpFirst == null || mpLast == null) { if (mpFirst == null || mpLast == null) {
return true; return true;
} }
// Check if same point object is start and end
if (mpFirst == mpLast){
Point3d start = mpFirst.getStart().getPoint();
Point3d end = mpLast.getEnd().getPoint();
// If start- and endpoint same object: -> not null line, intersection on a vertex
if(start == end) return false;
}
PolyLineSegment currentSegment = mpFirst; PolyLineSegment currentSegment = mpFirst;
double length = 0.00; double length = 0.00;
// Add length of all segments, starting from mpFirst // Add length of all segments, starting from mpFirst
...@@ -108,7 +115,7 @@ public class PolyLine extends BaseEntity { ...@@ -108,7 +115,7 @@ public class PolyLine extends BaseEntity {
length += segmentLength; length += segmentLength;
} }
// Check if total length is less than the set tolerance // Check if total length is less than the set tolerance
return length <= tolerance; return length < tolerance;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment