Commit 8517477d authored by Piotr Gawron's avatar Piotr Gawron
Browse files

never reuse point data

parent 3bd21931
Pipeline #28023 passed with stage
in 11 minutes and 6 seconds
......@@ -393,47 +393,47 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
Point thirdPoint = getPointOnSegment(segment, 0.6);
LineSegment curveSegment = new LineSegment(getSbmlModel().getLevel(), getSbmlModel().getVersion());
curveSegment.setStart(secondPoint);
curveSegment.setEnd(thirdPoint);
curveSegment.setStart(new Point(secondPoint));
curveSegment.setEnd(new Point(thirdPoint));
curve.addCurveSegment(curveSegment);
curveSegment = new LineSegment(getSbmlModel().getLevel(), getSbmlModel().getVersion());
curveSegment.setStart(thirdPoint);
curveSegment.setEnd(segment.getEnd());
curveSegment.setStart(new Point(thirdPoint));
curveSegment.setEnd(new Point(segment.getEnd()));
curve.addCurveSegment(curveSegment);
segment.setEnd(secondPoint);
segment.setEnd(new Point(secondPoint));
} else if (requiredLines == 3 && existingLines == 2) {
if (getSegmentLength(curve.getCurveSegment(0)) > getSegmentLength(curve.getCurveSegment(1))) {
CurveSegment segment = curve.getCurveSegment(0);
Point centerPoint = getCenter(segment);
LineSegment curveSegment = new LineSegment(getSbmlModel().getLevel(), getSbmlModel().getVersion());
curveSegment.setStart(centerPoint);
curveSegment.setEnd(segment.getEnd());
curveSegment.setStart(new Point(centerPoint));
curveSegment.setEnd(new Point(segment.getEnd()));
curve.addCurveSegment(1, curveSegment);
segment.setEnd(centerPoint);
segment.setEnd(new Point(centerPoint));
} else {
CurveSegment segment = curve.getCurveSegment(1);
Point centerPoint = getCenter(segment);
LineSegment curveSegment = new LineSegment(getSbmlModel().getLevel(), getSbmlModel().getVersion());
curveSegment.setStart(centerPoint);
curveSegment.setEnd(segment.getEnd());
curveSegment.setStart(new Point(centerPoint));
curveSegment.setEnd(new Point(segment.getEnd()));
curve.addCurveSegment(curveSegment);
segment.setEnd(centerPoint);
segment.setEnd(new Point(centerPoint));
}
} else if (requiredLines == 2 && existingLines == 1) {
CurveSegment segment = curve.getCurveSegment(0);
Point centerPoint = getCenter(segment);
LineSegment curveSegment = new LineSegment(getSbmlModel().getLevel(), getSbmlModel().getVersion());
curveSegment.setStart(centerPoint);
curveSegment.setEnd(segment.getEnd());
curveSegment.setStart(new Point(centerPoint));
curveSegment.setEnd(new Point(segment.getEnd()));
curve.addCurveSegment(curveSegment);
segment.setEnd(centerPoint);
segment.setEnd(new Point(centerPoint));
}
existingLines = curve.getCurveSegmentCount();
......@@ -521,7 +521,7 @@ public class SbmlReactionParser extends SbmlBioEntityParser {
start.setX(box.getPosition().getX());
start.setY(box.getPosition().getY());
start.setZ(box.getPosition().getZ());
curveSegment.setStart(start);
curveSegment.setStart(new Point(start));
curveSegment.setEnd(new Point(box.getPosition().getX() + box.getDimensions().getWidth(),
box.getPosition().getY() + box.getDimensions().getHeight()));
curve.addCurveSegment(curveSegment);
......
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