|
| | MeshGenerator ()=default |
| |
| void | setDomain (const QPolygonF &outerBoundary) |
| | Replace the domain with a single closed boundary polygon.
|
| |
| void | setDomains (const QVector< QPolygonF > &outerBoundaries) |
| | Replace the domain with multiple disjoint closed polygons. Each polygon becomes its own boundary ring; Triangle meshes the interior of every ring and leaves the gaps unmeshed. Useful when the meshing region is a multi-catchment area or a layer containing several non-overlapping polygons.
|
| |
| void | addDomain (const QPolygonF &outerBoundary) |
| | Append one more closed boundary polygon to the current domain set. Equivalent to building up via setDomains.
|
| |
| void | addConstraintSegment (const ConstraintSegment &seg) |
| |
| void | addSteinerPoint (const SteinerPoint &pt) |
| |
| void | reserveSteinerPoints (qsizetype additional) |
| | Pre-reserve capacity for additional upcoming addSteinerPoint calls. Avoids the transient ~2x peak of geometric growth when bulk- adding terrain points; callers should cap the request.
|
| |
| void | addHole (const QPointF &interiorPointInsideHole) |
| |
| void | addRegion (const RegionMarker ®ion) |
| |
| void | addPatch (const PatchMesh &patch) |
| | Stitch a structured quad patch (mesh/meshpatch.h) into the domain. Its boundary segments become PSLG constraints, its interior a hole (seed = the first quad's centroid), and after Triangle runs its quads are appended after every triangle with vertices merged by coordinate against the Triangle output (GenerationOptions::patchSnapEps). Patch vertices receive whatever elevation fill the caller applies to MeshResult::vertices afterwards — same path as Triangle's own.
|
| |
| void | addQuadRegion (const QuadRegion ®ion) |
| | Register a PSLG quad region (mesh/meshquadregion.h). Resolved in generate(): the ring becomes a constraint loop; Mapped / Submapped regions are meshed directly (as an internal patch); Free regions get a cross-field aligned lattice of Steiner points, no Triangle refinement inside (the -u hook returns "unconstrained" there), template + gap pairing, cleanup and smoothing after Triangle. Marker-0 Steiner points (terrain / aux) inside a Free ring are dropped; marker != 0 points (junctions) are kept and pin the lattice. User RegionMarkers inside a quad ring are dropped (their tag is inherited when the region's tag is empty). Regions failing validation are skipped with a report line.
|
| |
| const QVector< QuadRegionReport > & | quadRegionReports () const |
| | One report per addQuadRegion() call, filled by generate().
|
| |
| void | setOptions (const GenerationOptions &opts) |
| |
| void | setRefineHook (const RefineHook &hook) |
| | Install cancellation / progress / graded-sizing callbacks.
|
| |
| MeshResult | generate () const |
| | Run Triangle. Returns a result with ok=false + errorMsg on failure.
|
| |
| QString | tagForVertexMarker (int marker) const |
| | Translate an output point's marker back to a tag string. Used by clients that don't want to maintain their own map. The generator builds this from SteinerPoint::marker→tag during generate().
|
| |
| QString | tagForEdgeMarker (int marker) const |
| | Translate an output edge's marker back to a tag string.
|
| |
Generate a 2D triangular mesh.
Usage:
MeshGenerator g;
g.setDomain(boundaryPolygon);
g.addSteinerPoint({junctionXY, 1, "J1"}); // marker = 1
g.addConstraintSegment({conduitPath, 100, "C5"}); // marker = 100
g.setOptions({.maxArea = 50.0, .minAngle = 28.0});
const MeshResult r = g.generate();
| void mesh::MeshGenerator::setRefineHook |
( |
const RefineHook & |
hook | ) |
|
Install cancellation / progress / graded-sizing callbacks.
Passing a hook with any member set makes generate() add Triangle's -u switch, which routes refinement decisions through the hook. A hook whose members are all empty changes nothing. See trirefinehook.h.
When hook.targetAreaAt is set it supersedes GenerationOptions::maxArea and the global -a<area> switch is omitted.
If the hook reports cancellation, generate() returns ok=false with errorMsg set rather than a partially refined mesh.