diff options
| author | zverevgeny <[email protected]> | 2025-05-13 19:00:02 +0300 |
|---|---|---|
| committer | zverevgeny <[email protected]> | 2025-05-13 19:13:54 +0300 |
| commit | 92e06374736aa28637dc0e706455b65c8268a5e6 (patch) | |
| tree | 3df370c199ae25d308e542f02af20f43eab78f8a /contrib/python/contourpy/src/chunk_local.cpp | |
| parent | dc63d5794da99c2ebe3f32914d0351d9707660b0 (diff) | |
Import matplotlib
commit_hash:d59c2338025ef8fd1e1f961ed9d8d5fd52d0bd96
Diffstat (limited to 'contrib/python/contourpy/src/chunk_local.cpp')
| -rw-r--r-- | contrib/python/contourpy/src/chunk_local.cpp | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/contrib/python/contourpy/src/chunk_local.cpp b/contrib/python/contourpy/src/chunk_local.cpp new file mode 100644 index 00000000000..1c8833ab0b5 --- /dev/null +++ b/contrib/python/contourpy/src/chunk_local.cpp @@ -0,0 +1,59 @@ +#include "chunk_local.h" +#include <iostream> +#include <limits> + +namespace contourpy { + +ChunkLocal::ChunkLocal() +{ + look_up_quads.reserve(100); + clear(); +} + +void ChunkLocal::clear() +{ + chunk = -1; + istart = iend = jstart = jend = -1; + pass = -1; + + total_point_count = 0; + line_count = 0; + hole_count = 0; + + points.clear(); + line_offsets.clear(); + outer_offsets.clear(); + + look_up_quads.clear(); +} + +std::ostream &operator<<(std::ostream &os, const ChunkLocal& local) +{ + os << "ChunkLocal:" + << " chunk=" << local.chunk + << " istart=" << local.istart + << " iend=" << local.iend + << " jstart=" << local.jstart + << " jend=" << local.jend + << " total_point_count=" << local.total_point_count + << " line_count=" << local.line_count + << " hole_count=" << local.hole_count; + + if (local.line_offsets.start != nullptr) { + os << " line_offsets="; + for (count_t i = 0; i < local.line_count + 1; ++i) { + os << local.line_offsets.start[i] << " "; + } + } + + if (local.outer_offsets.start != nullptr) { + os << " outer_offsets="; + for (count_t i = 0; i < local.line_count - local.hole_count + 1; ++i) { + os << local.outer_offsets.start[i] << " "; + } + } + + return os; +} + +} // namespace contourpy |
