@@ -18,7 +18,7 @@ class Model2DTests {
1818
1919 @ Test
2020 void checkModel2DCreation_withPolygon2DArrayParam () {
21- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
21+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
2222 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
2323
2424 Polygon2D [] polygons = {
@@ -37,7 +37,7 @@ void checkModel2DCreation_withPolygon2DArrayParam() {
3737
3838 @ Test
3939 void checkModel2DCreation_withPolygon2DArrayParam_andRandomlyGeneratedShowParam () {
40- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
40+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
4141 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
4242
4343 Polygon2D [] polygons = {
@@ -58,7 +58,7 @@ void checkModel2DCreation_withPolygon2DArrayParam_andRandomlyGeneratedShowParam(
5858
5959 @ Test
6060 void checkModel2DCreation_withPolygon2DArrayParam_andRandomlyGeneratedShowParam_andRandomlyGeneratedTransformParams () {
61- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
61+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
6262 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
6363
6464 Polygon2D [] polygons = {
@@ -86,7 +86,7 @@ void checkModel2DCreation_withPolygon2DArrayParam_andRandomlyGeneratedShowParam_
8686
8787 @ Test
8888 void checkModel2DCreation_withPolygon2DArrayParam_andRandomlyGeneratedShowParam_andRandomlyGeneratedTransformParams_usingMethodChaining () {
89- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
89+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
9090 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
9191
9292 Polygon2D [] polygons = {
@@ -116,7 +116,7 @@ void checkModel2DCreation_withPolygon2DArrayParam_andRandomlyGeneratedShowParam_
116116
117117 @ Test
118118 void checkModel2DBoundsCreation_shouldMatchExpected () {
119- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
119+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
120120 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
121121
122122 Polygon2D [] polygons = {
@@ -138,7 +138,7 @@ void checkModel2DBoundsCreation_shouldMatchExpected() {
138138
139139 @ Test
140140 void checkModel2DTranslation_shouldMatchExpected () {
141- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
141+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
142142 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
143143 Pointf randomTranslation = new Pointf (Maths .random (-50f , 50f ), Maths .random (-50f , 50f ));
144144
@@ -165,7 +165,7 @@ void checkModel2DTranslation_shouldMatchExpected() {
165165
166166 @ Test
167167 void checkModel2DRotation_aroundOrigin_shouldMatchExpected () {
168- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
168+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
169169 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
170170 float randomRotation = Maths .random (-5000f , 5000f );
171171
@@ -174,15 +174,15 @@ void checkModel2DRotation_aroundOrigin_shouldMatchExpected() {
174174 Polygon2D .fromPoints (square2 )
175175 };
176176 for (Polygon2D polygon2D : expectedPolygons ) {
177- polygon2D .rotate (randomRotation , Pointf .Origin );
177+ polygon2D .rotate (randomRotation , Pointf .origin () );
178178 }
179179
180180 Polygon2D [] actualPolygons = {
181181 Polygon2D .fromPoints (square1 ),
182182 Polygon2D .fromPoints (square2 )
183183 };
184184 Model2D model2D = Model2D .fromPolygons (actualPolygons );
185- model2D .rotate (randomRotation , Pointf .Origin );
185+ model2D .rotate (randomRotation , Pointf .origin () );
186186
187187 for (Polygon2D polygon2D : expectedPolygons ) {
188188 assertEquals (polygon2D .getRotation (), model2D .getRotation (), "The rotation of the Model2D should equal to the rotation of the Polygon2Ds." );
@@ -192,7 +192,7 @@ void checkModel2DRotation_aroundOrigin_shouldMatchExpected() {
192192
193193 @ Test
194194 void checkModel2DRotation_aroundModelCenter_shouldMatchExpected () {
195- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
195+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
196196 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
197197 Pointf expectedModelCenter = Pointf .subtract (square2 [2 ], square1 [0 ]).divide (2f ).add (square1 [0 ]);
198198 float randomRotation = Maths .random (-5000f , 5000f );
@@ -220,7 +220,7 @@ void checkModel2DRotation_aroundModelCenter_shouldMatchExpected() {
220220
221221 @ Test
222222 void checkModel2DRotation_aroundRandomCenter_shouldMatchExpected () {
223- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
223+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
224224 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
225225 Pointf randomCenter = new Pointf (Maths .random (-50f , 50f ), Maths .random (-50f , 50f ));
226226 float randomRotation = Maths .random (-5000f , 5000f );
@@ -248,7 +248,7 @@ void checkModel2DRotation_aroundRandomCenter_shouldMatchExpected() {
248248
249249 @ Test
250250 void checkModel2DScaling_aroundOrigin_shouldMatchExpected () {
251- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
251+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
252252 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
253253 Pointf randomScaling = new Pointf (Maths .random (-50f , 50f ), Maths .random (-50f , 50f ));
254254
@@ -257,15 +257,15 @@ void checkModel2DScaling_aroundOrigin_shouldMatchExpected() {
257257 Polygon2D .fromPoints (square2 )
258258 };
259259 for (Polygon2D polygon2D : expectedPolygons ) {
260- polygon2D .scale (randomScaling , Pointf .Origin );
260+ polygon2D .scale (randomScaling , Pointf .origin () );
261261 }
262262
263263 Polygon2D [] actualPolygons = {
264264 Polygon2D .fromPoints (square1 ),
265265 Polygon2D .fromPoints (square2 )
266266 };
267267 Model2D model2D = Model2D .fromPolygons (actualPolygons );
268- model2D .scale (randomScaling , Pointf .Origin );
268+ model2D .scale (randomScaling , Pointf .origin () );
269269
270270 for (Polygon2D polygon2D : expectedPolygons ) {
271271 assertEquals (polygon2D .getScale (), model2D .getScale (), "The scale of the Model2D should equal to the scale of the Polygon2Ds." );
@@ -275,7 +275,7 @@ void checkModel2DScaling_aroundOrigin_shouldMatchExpected() {
275275
276276 @ Test
277277 void checkModel2DScaling_aroundModelCenter_shouldMatchExpected () {
278- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
278+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
279279 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
280280 Pointf randomScaling = new Pointf (Maths .random (-50f , 50f ), Maths .random (-50f , 50f ));
281281 Pointf expectedModelCenter = Pointf .subtract (square2 [2 ], square1 [0 ]).divide (2f ).add (square1 [0 ]);
@@ -303,7 +303,7 @@ void checkModel2DScaling_aroundModelCenter_shouldMatchExpected() {
303303
304304 @ Test
305305 void checkModel2DScaling_aroundRandomCenter_shouldMatchExpected () {
306- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
306+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
307307 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
308308 Pointf randomScaling = new Pointf (Maths .random (-50f , 50f ), Maths .random (-50f , 50f ));
309309 Pointf randomCenter = new Pointf (Maths .random (-50f , 50f ), Maths .random (-50f , 50f ));
@@ -331,7 +331,7 @@ void checkModel2DScaling_aroundRandomCenter_shouldMatchExpected() {
331331
332332 @ Test
333333 void checkModel2DScaling_usingScaleAsFloat_shouldMatchExpected () {
334- Pointf [] square1 = DrawUtil .createBox (Pointf .Origin , 50f );
334+ Pointf [] square1 = DrawUtil .createBox (Pointf .origin () , 50f );
335335 Pointf [] square2 = DrawUtil .createBox (Pointf .origin ().add (25f ), 50f );
336336 float randomScaling = Maths .random (-50f , 50f );
337337 Pointf expectedModelCenter = Pointf .subtract (square2 [2 ], square1 [0 ]).divide (2f ).add (square1 [0 ]);
0 commit comments