From 78782cf838bc1654e8422b3fe754401e6a8b28f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Daleng?= <142524365+MrMarHVD@users.noreply.github.com> Date: Tue, 26 Mar 2024 13:37:22 +0100 Subject: [PATCH] Fixed path/packaage issues --- .../chaosgame/game/ChaosGameDescription.java | 12 ++-- .../chaosgame/model/AffineTransform2D.java | 64 ------------------- .../game/ChaosGameDescriptionTest.java | 6 +- .../AffineTransform2DTest.java | 1 + 4 files changed, 12 insertions(+), 71 deletions(-) delete mode 100644 src/main/java/edu/ntnu/stud/chaosgame/model/AffineTransform2D.java diff --git a/src/main/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescription.java b/src/main/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescription.java index a7c6655..cd84e94 100644 --- a/src/main/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescription.java +++ b/src/main/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescription.java @@ -1,15 +1,19 @@ package edu.ntnu.stud.chaosgame.game; import edu.ntnu.stud.chaosgame.model.Vector2D; -import edu.ntnu.stud.chaosgame.model.AffineTransform2D; +import edu.ntnu.stud.chaosgame.model.transformations.Transform2D; import java.util.List; +import javax.xml.crypto.dsig.Transform; public class ChaosGameDescription { private final Vector2D minCoords; private final Vector2D maxCoords; - private final List<AffineTransform2D> transforms; + /** + * The affine transforms for this chaos game description. + */ + private final List<Transform2D> transforms; /** * Constructor for ChaosGameDescription @@ -17,7 +21,7 @@ public class ChaosGameDescription { * @param maxCoords Inputs a {@link Vector2D} vector of upper right coordinates for the chaos game. * @param transforms Inputs a list of transformations {@link AffineTransform2D} used in the chaos game. */ - public ChaosGameDescription(Vector2D minCoords, Vector2D maxCoords, List<AffineTransform2D> transforms) { + public ChaosGameDescription(Vector2D minCoords, Vector2D maxCoords, List<Transform2D> transforms) { if (minCoords == null || maxCoords == null || transforms == null){ throw new IllegalArgumentException("Coordinates and transforms must not be null."); } @@ -30,7 +34,7 @@ public class ChaosGameDescription { * Getter method for transforms * @return Returns a list of transforms in the chaos game. */ - public List<AffineTransform2D> getTransforms(){ + public List<Transform2D> getTransforms(){ return transforms; } /** diff --git a/src/main/java/edu/ntnu/stud/chaosgame/model/AffineTransform2D.java b/src/main/java/edu/ntnu/stud/chaosgame/model/AffineTransform2D.java deleted file mode 100644 index 32950a9..0000000 --- a/src/main/java/edu/ntnu/stud/chaosgame/model/AffineTransform2D.java +++ /dev/null @@ -1,64 +0,0 @@ -package edu.ntnu.stud.chaosgame.model; - -/** - * Class representing an affine transformation in 2D. - - */ -public class AffineTransform2D { - - /** - * Matrix component of the affine transformation. - */ - private Matrix2x2 matrix; - - /** - * Vector component of the affine transformation. - */ - private Vector2D vector; - - /** - * Parameterized constructor for the affine transformation. - * @param matrix matrix - * @param vector vector - */ - public AffineTransform2D(Matrix2x2 matrix, Vector2D vector) { - this.matrix = matrix; - this.vector = vector; - } - - /** - * Getter for the matrix belonging to the affine transformation. - * - * @return the matrix - */ - public Matrix2x2 getMatrix() { - return matrix; - } - - /** - * Setter for the matrix belonging to the affine transformation. - * - * @param matrix the matrix to set - */ - public void setMatrix(Matrix2x2 matrix) { - this.matrix = matrix; - } - - /** - * Getter for the vector belonging to the affine transformation. - * - * @return the vector - */ - public Vector2D getVector() { - return vector; - } - - /** - * Setter for the vector belonging to the affine transformation. - * - * @param vector the vector to set - */ - public void setVector(Vector2D vector) { - this.vector = vector; - } -} \ No newline at end of file diff --git a/src/test/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescriptionTest.java b/src/test/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescriptionTest.java index aed5348..0d80ceb 100644 --- a/src/test/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescriptionTest.java +++ b/src/test/java/edu/ntnu/stud/chaosgame/game/ChaosGameDescriptionTest.java @@ -3,9 +3,9 @@ package edu.ntnu.stud.chaosgame.game; import edu.ntnu.stud.chaosgame.model.Complex; import edu.ntnu.stud.chaosgame.model.Matrix2x2; import edu.ntnu.stud.chaosgame.model.Vector2D; -import edu.ntnu.stud.chaosgame.transformations.AffineTransform2D; -import edu.ntnu.stud.chaosgame.transformations.JuliaTransform; -import edu.ntnu.stud.chaosgame.transformations.Transform2D; +import edu.ntnu.stud.chaosgame.model.transformations.AffineTransform2D; +import edu.ntnu.stud.chaosgame.model.transformations.JuliaTransform; +import edu.ntnu.stud.chaosgame.model.transformations.Transform2D; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; diff --git a/src/test/java/edu/ntnu/stud/chaosgame/transformations/AffineTransform2DTest.java b/src/test/java/edu/ntnu/stud/chaosgame/transformations/AffineTransform2DTest.java index e772ed4..5ff7732 100644 --- a/src/test/java/edu/ntnu/stud/chaosgame/transformations/AffineTransform2DTest.java +++ b/src/test/java/edu/ntnu/stud/chaosgame/transformations/AffineTransform2DTest.java @@ -2,6 +2,7 @@ package edu.ntnu.stud.chaosgame.transformations; import edu.ntnu.stud.chaosgame.model.Matrix2x2; import edu.ntnu.stud.chaosgame.model.Vector2D; +import edu.ntnu.stud.chaosgame.model.transformations.AffineTransform2D; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Nested; -- GitLab