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 a7c66558e4968275cdb722b58f99b66b4611c2a1..cd84e94f77e17fc196da981ac14da9c89750c191 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 32950a9f28944d327586d895249e904258297892..0000000000000000000000000000000000000000 --- 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 aed5348ac2887b3164e2f8b9d48220737062fa81..0d80ceb565d7d399bb9d98d1a6053b64ae14bfd7 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 e772ed44558f303382b1d4bf8048572baa8eb415..5ff773231da714bd88006c42f56b7c57b389e528 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;