13 const std::size_t safe_resolution = std::max<std::size_t>(2, cr.
resolution);
14 std::size_t depth =
static_cast<std::size_t
>(
15 std::ceil(std::log2(
static_cast<double>(safe_resolution)))
18 depth = std::min<std::size_t>(depth, 8);
25 }
catch (
const std::exception& e) {
26 std::cout <<
"[AMS] extraction failed: " << e.what() << std::endl;
31 std::cout <<
"[AMS] extraction failed with unknown exception" << std::endl;
38 std::size_t path_id = 0;
39 for (
const auto& path : c.
paths) {
40 std::size_t point_id = 0;
42 for (
const auto& pt : path) {
@ PathPoint
A new point on a contour path is available.
@ PathFinished
A contour path has been completed.
std::function< double(double, double)> ScalarField2D
Payload passed to contour progress callbacks.
std::size_t n_points
Number of points produced so far or in total.
double level
Contour level associated with the event.
std::size_t path_id
Index of the contour path being reported.
ContourProgressEventType type
Event category.
double x
X coordinate of a reported contour point.
double y
Y coordinate of a reported contour point.
std::size_t point_id
Index of the point within the current path.
Input configuration for a two-dimensional contour extraction.
std::size_t resolution
Requested grid or sampling resolution.
std::array< double, 4 > bounds
Extraction domain as {xmin, xmax, ymin, ymax}.
double level
Target scalar-field level to extract.
Output of a contour extraction algorithm.
bool success
Whether extraction produced a valid contour.
std::set< Path > paths
Extracted contour paths.
double level
Level actually targeted by the extraction.