|
| 1 | +/*========================================================================= |
| 2 | + * |
| 3 | + * Copyright NumFOCUS |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * https://www.apache.org/licenses/LICENSE-2.0.txt |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + * |
| 17 | + *=========================================================================*/ |
| 18 | + |
| 19 | +#include "itkVoronoiDiagram2DGenerator.h" |
| 20 | +#include "itkTestingMacros.h" |
| 21 | + |
| 22 | +int |
| 23 | +itkVoronoiDiagram2DInfiniteLoopTest(int argc, char * argv[]) |
| 24 | +{ |
| 25 | + if (argc != 0) |
| 26 | + { |
| 27 | + std::cerr << "Takes no parameters." << std::endl; |
| 28 | + std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv) << std::endl; |
| 29 | + return EXIT_FAILURE; |
| 30 | + } |
| 31 | + |
| 32 | + // From https://github.com/InsightSoftwareConsortium/ITK/issues/4386 |
| 33 | + using VoronoiDiagramType = itk::VoronoiDiagram2D<double>; |
| 34 | + using VoronoiGeneratorType = itk::VoronoiDiagram2DGenerator<double>; |
| 35 | + using PointType = VoronoiDiagramType::PointType; |
| 36 | + VoronoiGeneratorType::Pointer vg = VoronoiGeneratorType::New(); |
| 37 | + vg->SetOrigin(PointType{ { -1.61569, -1.76726 } }); |
| 38 | + vg->SetBoundary(PointType{ { 1.60174, 1.76345 } }); |
| 39 | + vg->AddOneSeed(PointType{ { -1.39649, 0.322212 } }); |
| 40 | + vg->AddOneSeed(PointType{ { -1.30128, 0.231786 } }); |
| 41 | + vg->AddOneSeed(PointType{ { -1.21509, 0.0515039 } }); |
| 42 | + vg->AddOneSeed(PointType{ { -1.22364, -0.030281 } }); |
| 43 | + vg->AddOneSeed(PointType{ { -1.22125, -0.120815 } }); |
| 44 | + vg->AddOneSeed(PointType{ { -1.25159, -0.23593 } }); |
| 45 | + vg->Update(); |
| 46 | + |
| 47 | + return EXIT_SUCCESS; |
| 48 | +} |
0 commit comments