| 255 | } |
| 256 | |
| 257 | void test_circle() |
| 258 | { |
| 259 | const auto normal = geode::Vector3D{ { 1.0, 5.0, 42 } }.normalize(); |
| 260 | const geode::Point3D origin{ { -1.0, -5.0, 42 } }; |
| 261 | const geode::Plane plane{ normal, origin }; |
| 262 | const double radius{ 3 }; |
| 263 | const geode::Circle circle{ plane, radius }; |
| 264 | |
| 265 | geode::Circle circle2{ circle }; |
| 266 | geode::OpenGeodeGeometryException::test( |
| 267 | circle2.radius() == radius && circle2.plane().normal() == plane.normal() |
| 268 | && circle2.plane().origin() == plane.origin(), |
| 269 | "Wrong result for circle2" ); |
| 270 | |
| 271 | geode::Circle circle3{ std::move( circle ) }; |
| 272 | geode::OpenGeodeGeometryException::test( |
| 273 | circle3.radius() == radius && circle3.plane().normal() == plane.normal() |
| 274 | && circle3.plane().origin() == plane.origin(), |
| 275 | "Wrong result for circle3" ); |
| 276 | |
| 277 | const auto normal2 = geode::Vector3D{ { -1.0, -5.0, 42 } }.normalize(); |
| 278 | const geode::Point3D origin2{ { 1.0, 5.0, 42 } }; |
| 279 | const geode::Plane plane2{ normal2, origin2 }; |
| 280 | const double radius2{ 30 }; |
| 281 | geode::Circle circle4{ plane2, radius2 }; |
| 282 | circle4 = circle2; |
| 283 | geode::OpenGeodeGeometryException::test( |
| 284 | circle4.radius() == radius && circle4.plane().normal() == plane.normal() |
| 285 | && circle4.plane().origin() == plane.origin(), |
| 286 | "Wrong result for circle4" ); |
| 287 | |
| 288 | geode::Circle circle5{ plane2, radius2 }; |
| 289 | circle5 = std::move( circle2 ); |
| 290 | geode::OpenGeodeGeometryException::test( |
| 291 | circle5.radius() == radius && circle5.plane().normal() == plane.normal() |
| 292 | && circle5.plane().origin() == plane.origin(), |
| 293 | "Wrong result for circle5" ); |
| 294 | } |
| 295 | |
| 296 | void test() |
| 297 | { |