50 using Point =
typename Storage::Point;
51 using Box =
typename Storage::Box;
52 using String =
typename Storage::String;
55 template <
class K,
class V>
using Hash =
typename Storage::template
Hash<K, V>;
57 template <
class K>
using Set =
typename Storage::template
Set<K>;
105 const std::function<
bool()> &
cancelled = {},
106 const std::function<void(std::uint64_t)> &
progress = {});
170 return v >= 0 && v < m_vertexTri.
size() && m_vertexTri[v] >= 0;
425 if (!m_origins.isEmpty() && v >= 0 && v < m_origins.size())
426 m_origins[v] |= origin;
517 return v >= m_superBase && v < m_superBase + 3;
529 Vector<int> star,
ring;
530 Vector<Triangle> replacement;
543 bool prepareRemoval(
int v, Removal *out)
const;
554 void commitRemoval(
int v,
const Removal &removal);
566 double orient(
int a,
int b,
int c)
const;
577 double orient(
int a,
int b,
const Point &
p)
const;
591 bool inCircle(
int a,
int b,
int c,
int d)
const;
614 int triangleWithEdge(
int a,
int b,
int *edgeIndexOut)
const;
625 void legalize(
int t,
int e);
635 void flip(
int t,
int e);
643 void setAdj(
int t,
int e,
int n);
654 void splitTriangle(
int t,
int v);
666 void splitEdge(
int t,
int e,
int v);
673 int edgeIndex(
int t,
int v)
const;
683 void trianglesAround(
int v, Vector<int> *out)
const;
691 void markConstrained(
int a,
int b);
703 bool insertConstraintImpl(
int a,
int b, std::uint64_t origin);
716 int splitSubsegment(
int a,
int b);
725 bool subsegmentEncroached(
int a,
int b)
const;
733 bool isFixedSub(
int a,
int b)
const;
743 bool exemptShortestEdge(
int u,
int v)
const;
746 Vector<std::uint32_t> m_origins;
747 Vector<double> m_terrainElevations;
748 Vector<Triangle> m_tris;
749 int m_liveTriangles = 0;
750 Vector<int> m_vertexTri;
752 int m_lastLocate = 0;
754 Hash<std::uint64_t, std::uint64_t>
756 MultiHash<std::uint64_t, std::uint64_t>
758 Hash<std::uint64_t, std::uint64_t>
760 Hash<int, std::uint64_t>
762 Set<std::uint64_t> m_fixedSub;
765 std::function<void(
int)> m_triangleChanged;
typename Storage::PointInput PointInput
Definition cdt.hpp:53
void enableProvenance()
Enable/reset optional origin bits for all currently stored vertices. Fills owned origin array with ze...
Definition cdt.hpp:414
typename Storage::template Vector< T > Vector
Definition cdt.hpp:54
int insertPoint(const Point &p)
Insert one finite point in a live triangle, splitting a triangle/edge and restoring Delaunay edges.
Definition cdt_impl.hpp:794
int liveTriangleCount() const
Count slots whose alive flag is true, including super faces if still alive.
Definition cdt_impl.hpp:381
bool isVertexActive(int v) const
Test whether an in-range vertex has a nonnegative incident-triangle hint.
Definition cdt.hpp:168
static double orientExact(const Point &a, const Point &b, const Point &c)
Return adaptive-exact orientation sign after thread-safe one-time predicate initialization.
Definition cdt_impl.hpp:137
bool smallAngleExempt(int t) const
Test the shortest edge of a triangle for equal-radius input-corner shell exemption.
Definition cdt_impl.hpp:1239
void addVertexOrigin(int v, std::uint32_t origin)
OR diagnostic provenance flags into an enabled in-range origin slot.
Definition cdt.hpp:423
typename Storage::template MultiHash< K, V > MultiHash
Definition cdt.hpp:56
typename Storage::template Set< K > Set
Definition cdt.hpp:57
typename Storage::String String
Definition cdt.hpp:52
bool build(const PointInput &points, Vector< int > *vertexOfPoint=nullptr, const std::function< bool()> &cancelled={}, const std::function< void(std::uint64_t)> &progress={})
Reset and incrementally triangulate distinct finite points inside a constructed super triangle.
Definition cdt_impl.hpp:645
int locate(const Point &p) const
Locate a finite point and require its found triangle to be alive.
Definition cdt_impl.hpp:375
int removeRegionLeftOf(int a, int b)
Delete live constraint-bounded faces topologically seeded to a directed edge's left.
Definition cdt_impl.hpp:1053
bool touchesFixed(int t) const
Test whether any triangle vertex participates in a marked fixed constrained edge.
Definition cdt_impl.hpp:1254
int inputVertexCount() const
Return the unique-input count recorded as the super-vertex base at successful build.
Definition cdt.hpp:217
void setFixedConstraint(int a, int b)
Mark every recovered subedge of a requested constraint chain unsplittable for refinement.
Definition cdt_impl.hpp:1099
const Vector< Point > & vertices() const
Borrow all stored XY positions including super, inactive and newly inserted vertices.
Definition cdt.hpp:447
bool insertConstraint(int a, int b)
Recover/mark a straight constraint, recursively splitting at exactly collinear existing vertices.
Definition cdt_impl.hpp:826
const Vector< std::uint32_t > & vertexOrigins() const
Borrow diagnostic origin storage from this triangulation.
Definition cdt.hpp:436
Origin
Definition cdt.hpp:395
@ SegmentSplit
Definition cdt.hpp:407
@ Size
Definition cdt.hpp:404
@ Domain
Definition cdt.hpp:396
@ Node
Definition cdt.hpp:400
@ Line
Definition cdt.hpp:398
@ Breakline
Definition cdt.hpp:401
@ Hole
Definition cdt.hpp:397
@ Patch
Definition cdt.hpp:399
@ Region
Definition cdt.hpp:402
@ Lattice
Definition cdt.hpp:403
@ Angle
Definition cdt.hpp:405
@ Terrain
Definition cdt.hpp:406
int removeRegionAt(const Point &p)
Mark the live constraint-bounded component containing a finite seed point dead.
Definition cdt_impl.hpp:1028
const Vector< Triangle > & triangles() const
Borrow all triangle slots with alive flags, adjacency and opposite-edge constraints.
Definition cdt.hpp:456
const Vector< double > & terrainElevations() const
Borrow the most recent refinement's cached per-vertex elevation samples.
Definition cdt.hpp:464
QualityReport refineQuality(const QualityOptions &opt)
Mutate live constrained triangulation by bounded size/angle/terrain refinement and optional coarsenin...
Definition cdt_impl.hpp:1455
typename Storage::template Hash< K, V > Hash
Definition cdt.hpp:55
void removeSuperTriangles()
Mark only live faces touching one of the three super vertices dead. Leaves the unconstrained real-poi...
Definition cdt_impl.hpp:1019
String errorMsg() const
Copy the last explicitly recorded build/constraint diagnostic.
Definition cdt.hpp:525
bool isSuperVertex(int v) const
Test whether an integer falls in the recorded three-super-vertex interval.
Definition cdt.hpp:515
bool isConstrained(int a, int b) const
Check whether a direct edge between two stored vertices is marked constrained.
Definition cdt_impl.hpp:258
bool removeVertex(int v)
Transactionally remove a free post-build interior vertex and retriangulate its local cavity.
Definition cdt_impl.hpp:1445
Vector< int > constrainedChain(int a, int b) const
Follow direct, origin-associated or collinear constrained edges from one endpoint to another.
Definition cdt_impl.hpp:268
typename Storage::Box Box
Definition cdt.hpp:51
void removeExterior()
Mark super-touching faces and every unconstrained reachable neighbor dead. Requires successfully buil...
Definition cdt_impl.hpp:993
typename Storage::Point Point
Definition cdt.hpp:50
std::ptrdiff_t size() const noexcept
Definition storage.hpp:49
DiagramType t
Definition diagramspec.cpp:23
ArrowPlacement p
Definition linesymbollayer.cpp:29
std::vector< int > start
size = pixels + 1
Definition mesh2dresultsexport.cpp:762
Definition qtcdtstorage.h:9
CoarseningOrder
Definition terrainpolicy.hpp:9
const Polygon & ring
Definition patch.cpp:164
Options for refineQuality().
Definition cdt.hpp:231
double terrainMinSpacing
Definition cdt.hpp:249
std::function< double(const Point *, const double *)> terrainErrorBound
Definition cdt.hpp:278
Set< int > protectedVertices
Additional template vertices to retain.
Definition cdt.hpp:274
double coarseningReferenceSize
Definition cdt.hpp:271
CoarseningOrder coarseningOrder
Definition cdt.hpp:268
int coarsenPasses
Maximum attempts per free vertex; 0 = off.
Definition cdt.hpp:267
std::function< double(const Point *, const double *, Point *)> terrainError
Definition cdt.hpp:243
std::function< double(double, double)> terrainElevationAt
Definition cdt.hpp:244
bool prioritizeQuality
Definition cdt.hpp:279
int maxInsertions
Definition cdt.hpp:286
int sizingRepairPasses
Definition cdt.hpp:239
double terrainTolerance
Definition cdt.hpp:245
std::function< bool()> cancelled
Definition cdt.hpp:294
std::function< void(const GenerationProgress &)> onProgress
Definition cdt.hpp:297
double normalVerticalToXY
Definition cdt.hpp:271
std::function< double(double, double)> hAt
Definition cdt.hpp:235
int maxTriangles
Definition cdt.hpp:280
double minEdge
Definition cdt.hpp:292
bool terrainFinalCheck
Definition cdt.hpp:259
double minAngleDeg
Definition cdt.hpp:284
std::function< double(const Box &)> terrainToleranceForFootprint
Positive immutable full-footprint tolerance; invalid means unknown.
Definition cdt.hpp:247
int maximumSizingRepairInsertions
Definition cdt.hpp:239
std::function< double(const Point *)> maximumAreaForTriangle
Definition cdt.hpp:236
std::function< bool(const Point &)> protectedLocation
Definition cdt.hpp:273
std::function< double(int, int)> fixedNeighbourSize
Definition cdt.hpp:238
bool terrainWorstFirst
Definition cdt.hpp:254
double maximumAdjacentRatio
Definition cdt.hpp:237
std::function< double(const Box &)> coarseningTargetSize
Prescribed size; zero means unbounded, never evolving geometry.
Definition cdt.hpp:270
int smoothingPasses
Definition cdt.hpp:266
bool coarsenSkippedTerrain
Definition cdt.hpp:314
int segmentSplits
Definition cdt.hpp:303
bool capped
Stopped at maxInsertions.
Definition cdt.hpp:309
std::uint64_t coarsenQueuePeak
Definition cdt.hpp:316
int inserted
Vertices added, segment splits included.
Definition cdt.hpp:302
int terrainInsertions
Definition cdt.hpp:306
int terrainUnresolved
Definition cdt.hpp:307
int terrainUnknown
Definition cdt.hpp:307
int sizingRepairInserted
Definition cdt.hpp:300
int coarsenAttempts
Definition cdt.hpp:312
int coarsenExactQueries
Definition cdt.hpp:313
int coarsenBoundAccepts
Definition cdt.hpp:313
int sizeInsertions
Definition cdt.hpp:306
int coarsenRejectedSize
Definition cdt.hpp:311
int coarsenRejectedEdge
Definition cdt.hpp:312
bool sizingRepairLimited
Definition cdt.hpp:301
int coarsenRejectedTerrain
Definition cdt.hpp:312
double maxTerrainError
Definition cdt.hpp:308
int coarsenRejectedAngle
Definition cdt.hpp:311
int coarsenRemoved
Definition cdt.hpp:311
bool cancelled
Definition cdt.hpp:310
int qualityInsertions
Definition cdt.hpp:306
int coarsenHeightRejects
Definition cdt.hpp:313
bool invalidPolicy
Definition cdt.hpp:317
std::uint64_t coarsenPriorityQueries
Definition cdt.hpp:316
int sizingRepairPasses
Definition cdt.hpp:300
int blockedByFixed
Bad triangles left because their point would encroach a fixed edge.
Definition cdt.hpp:304
double coarsenSeconds
Definition cdt.hpp:315
int adj[3]
Neighbour across the edge opposite v[i] (v[i+1], v[i+2]); -1 = none.
Definition cdt.hpp:60
bool alive
Definition cdt.hpp:62
int v[3]
Counter-clockwise.
Definition cdt.hpp:59
bool constrained[3]
Edge opposite v[i] is a constraint.
Definition cdt.hpp:61
Definition progress.hpp:7
double
Definition swmmpollutantpropertyadapter.cpp:68
double a
Definition terrainerrorfield.cpp:42
double b
Definition terrainerrorfield.cpp:42
double c
Definition terrainerrorfield.cpp:42
const ExportProgress * progress
Definition vectorexport.cpp:211
bool cancelled
Definition vectorexport.cpp:214