Loading...
Searching...
No Matches
qtnative.h
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2#pragma once
3#include "mesh/cellplanner.h"
6#include "mesh/sizefield.h"
7#include "mesh/quadblocks.h"
11#include "meshkit/blocks.hpp"
12#include "meshkit/sizefield.hpp"
14{
15// Short alias for meshkit::plan, the namespace of the standard-container types.
16namespace n = meshkit::plan;
18inline meshkit::Point2 native(QPointF p)
19{
20 return {p.x(), p.y()};
21}
22
23inline QPointF qt(meshkit::Point2 p)
24{
25 return {p.x(), p.y()};
26}
27
36inline meshkit::Box2 native(QRectF b)
37{
38 return {{b.left(), b.top()}, {b.right(), b.bottom()}};
39}
40
48inline QRectF qt(meshkit::Box2 b)
49{
50 return QRectF(QPointF(b.left(), b.top()), QPointF(b.right(), b.bottom()));
51}
52
57inline n::Text native(const QString &s)
58{
59 return s.toStdString();
60}
61
69inline QString qt(const n::Text &s)
70{
71 return QString::fromStdString(s);
72}
73
84template <class T> T native(T v)
85{
86 return v;
87}
88
98template <class T> T qt(T v)
99{
100 return v;
101}
102inline n::QuadRegion native(const QuadRegion &);
103inline QuadRegion qt(const n::QuadRegion &);
104inline n::StructuredPatch native(const StructuredPatch &);
105inline StructuredPatch qt(const n::StructuredPatch &);
106inline n::SweptPatch native(const SweptPatch &);
107inline SweptPatch qt(const n::SweptPatch &);
108inline n::BankPairPatch native(const BankPairPatch &);
109inline BankPairPatch qt(const n::BankPairPatch &);
110inline n::PatchLine native(const PatchLine &);
111inline PatchLine qt(const n::PatchLine &);
112inline n::PatchMesh native(const PatchMesh &);
113inline PatchMesh qt(const n::PatchMesh &);
114inline n::ConstraintSegment native(const ConstraintSegment &);
115inline ConstraintSegment qt(const n::ConstraintSegment &);
116inline n::SteinerPoint native(const SteinerPoint &);
117inline SteinerPoint qt(const n::SteinerPoint &);
118inline n::ConstraintSimplificationPolicy native(const ConstraintSimplificationPolicy &);
119inline ConstraintSimplificationPolicy qt(const n::ConstraintSimplificationPolicy &);
120inline n::ConstraintPolicyOverride native(const ConstraintPolicyOverride &);
121inline ConstraintPolicyOverride qt(const n::ConstraintPolicyOverride &);
122inline n::SimplificationFeature native(const SimplificationFeature &);
123inline SimplificationFeature qt(const n::SimplificationFeature &);
124inline n::SimplificationChange native(const SimplificationChange &);
125inline SimplificationChange qt(const n::SimplificationChange &);
126inline n::ConstraintSimplificationOptions native(const ConstraintSimplificationOptions &);
127inline ConstraintSimplificationOptions qt(const n::ConstraintSimplificationOptions &);
128inline n::ConstraintSimplificationResult native(const ConstraintSimplificationResult &);
129inline ConstraintSimplificationResult qt(const n::ConstraintSimplificationResult &);
130inline n::ConstraintAuditOptions native(const ConstraintAuditOptions &);
131inline ConstraintAuditOptions qt(const n::ConstraintAuditOptions &);
132inline n::ConstraintAuditExample native(const ConstraintAuditExample &);
133inline ConstraintAuditExample qt(const n::ConstraintAuditExample &);
134inline n::ConstraintAuditReport native(const ConstraintAuditReport &);
135inline ConstraintAuditReport qt(const n::ConstraintAuditReport &);
136inline n::PatchDecision native(const PatchDecision &);
137inline PatchDecision qt(const n::PatchDecision &);
138inline n::PatchAssessment native(const PatchAssessment &);
139inline PatchAssessment qt(const n::PatchAssessment &);
140inline n::PatchInterfaceConflict native(const PatchInterfaceConflict &);
141inline PatchInterfaceConflict qt(const n::PatchInterfaceConflict &);
142inline n::PatchInterfaceReport native(const PatchInterfaceReport &);
143inline PatchInterfaceReport qt(const n::PatchInterfaceReport &);
144inline n::QuadPlanningGeometry native(const QuadPlanningGeometry &);
145inline QuadPlanningGeometry qt(const n::QuadPlanningGeometry &);
146inline n::QuadPlan native(const QuadPlan &);
147inline QuadPlan qt(const n::QuadPlan &);
148inline n::QuadBlockGrid native(const QuadBlockGrid &);
149inline QuadBlockGrid qt(const n::QuadBlockGrid &);
150inline n::QuadBlockOptions native(const QuadBlockOptions &);
151inline QuadBlockOptions qt(const n::QuadBlockOptions &);
160inline n::MeshTriangle native(const MeshTriangle &v)
161{
162 n::MeshTriangle out;
163 out.v0 = v.v0;
164 out.v1 = v.v1;
165 out.v2 = v.v2;
166 out.v3 = v.v3;
167 out.tag = native(v.tag);
168 return out;
169}
170
178inline MeshTriangle qt(const n::MeshTriangle &v)
179{
180 MeshTriangle out;
181 out.v0 = v.v0;
182 out.v1 = v.v1;
183 out.v2 = v.v2;
184 out.v3 = v.v3;
185 out.tag = qt(v.tag);
186 return out;
187}
188inline n::Polygon native(const QPolygonF &);
189inline QPolygonF qt(const n::Polygon &);
201template <class T> auto native(const QVector<T> &v)
202{
203 n::Vector<decltype(native(T{}))> out;
204 out.reserve(v.size());
205 for (int i = 0; i < v.size(); ++i) {
206 const T value = v[i];
207 out.append(native(value));
208 }
209 return out;
210}
211
222template <class T> auto qt(const n::Vector<T> &v)
223{
224 QVector<decltype(qt(T{}))> out;
225 out.reserve(v.size());
226 for (int i = 0; i < v.size(); ++i) {
227 const T value = v[i];
228 out.append(qt(value));
229 }
230 return out;
231}
232
240inline n::Polygon native(const QPolygonF &v)
241{
242 n::Polygon out;
243 out.reserve(v.size());
244 for (auto p : v)
245 out.append(native(p));
246 return out;
247}
248
249inline QPolygonF qt(const n::Polygon &v)
250{
251 return QPolygonF(qt(static_cast<const n::Vector<meshkit::Point2> &>(v)));
252}
253
254inline n::QuadRegionMode native(QuadRegionMode v)
255{
256 return static_cast<n::QuadRegionMode>(v);
257}
258
259inline QuadRegionMode qt(n::QuadRegionMode v)
260{
261 return static_cast<QuadRegionMode>(v);
262}
263
264inline n::PatchDisposition native(PatchDisposition v)
265{
266 return static_cast<n::PatchDisposition>(v);
267}
268
269inline PatchDisposition qt(n::PatchDisposition v)
270{
271 return static_cast<PatchDisposition>(v);
272}
273
277inline n::ConstraintSimplificationPolicy::Mode native(ConstraintSimplificationPolicy::Mode v)
278{
279 return static_cast<n::ConstraintSimplificationPolicy::Mode>(v);
280}
281
285inline ConstraintSimplificationPolicy::Mode qt(n::ConstraintSimplificationPolicy::Mode v)
286{
287 return static_cast<ConstraintSimplificationPolicy::Mode>(v);
288}
289
293inline n::SimplificationFeature::Role native(SimplificationFeature::Role v)
294{
295 return static_cast<n::SimplificationFeature::Role>(v);
296}
297
301inline SimplificationFeature::Role qt(n::SimplificationFeature::Role v)
302{
303 return static_cast<SimplificationFeature::Role>(v);
304}
305
312inline n::QuadRegion native(const QuadRegion &v)
313{
314 n::QuadRegion out;
315 out.ring = native(v.ring);
316 out.holes = native(v.holes);
317 out.isBackground = native(v.isBackground);
318 out.mode = native(v.mode);
319 out.requireMapped = native(v.requireMapped);
320 out.automaticCandidate = native(v.automaticCandidate);
321 out.spacing = native(v.spacing);
322 out.directionalSpacing = native(v.directionalSpacing);
323 out.hAlong = native(v.hAlong);
324 out.hAcross = native(v.hAcross);
325 out.mappedAlongAngleDeg = native(v.mappedAlongAngleDeg);
326 out.aspectMax = native(v.aspectMax);
327 out.hasAlignAngle = native(v.hasAlignAngle);
328 out.alignAngleDeg = native(v.alignAngleDeg);
329 out.alignGuide = native(v.alignGuide);
330 out.corners = native(v.corners);
331 out.tag = native(v.tag);
332 return out;
333}
334
337inline QuadRegion qt(const n::QuadRegion &v)
338{
339 QuadRegion out;
340 out.ring = qt(v.ring);
341 out.holes = qt(v.holes);
342 out.isBackground = qt(v.isBackground);
343 out.mode = qt(v.mode);
344 out.requireMapped = qt(v.requireMapped);
345 out.automaticCandidate = qt(v.automaticCandidate);
346 out.spacing = qt(v.spacing);
347 out.directionalSpacing = qt(v.directionalSpacing);
348 out.hAlong = qt(v.hAlong);
349 out.hAcross = qt(v.hAcross);
350 out.mappedAlongAngleDeg = qt(v.mappedAlongAngleDeg);
351 out.aspectMax = qt(v.aspectMax);
352 out.hasAlignAngle = qt(v.hasAlignAngle);
353 out.alignAngleDeg = qt(v.alignAngleDeg);
354 out.alignGuide = qt(v.alignGuide);
355 out.corners = qt(v.corners);
356 out.tag = qt(v.tag);
357 return out;
358}
359
360inline n::StructuredPatch native(const StructuredPatch &v)
361{
362 n::StructuredPatch out;
363 out.corners = native(v.corners);
364 out.n = native(v.n);
365 out.m = native(v.m);
366 out.tag = native(v.tag);
367 return out;
368}
369
370inline StructuredPatch qt(const n::StructuredPatch &v)
371{
372 StructuredPatch out;
373 out.corners = qt(v.corners);
374 out.n = qt(v.n);
375 out.m = qt(v.m);
376 out.tag = qt(v.tag);
377 return out;
378}
379
380inline n::SweptPatch native(const SweptPatch &v)
381{
382 n::SweptPatch out;
383 out.centreline = native(v.centreline);
384 out.width = native(v.width);
385 out.across = native(v.across);
386 out.along = native(v.along);
387 out.tag = native(v.tag);
388 return out;
389}
390
391inline SweptPatch qt(const n::SweptPatch &v)
392{
393 SweptPatch out;
394 out.centreline = qt(v.centreline);
395 out.width = qt(v.width);
396 out.across = qt(v.across);
397 out.along = qt(v.along);
398 out.tag = qt(v.tag);
399 return out;
400}
401
402inline n::BankPairPatch native(const BankPairPatch &v)
403{
404 n::BankPairPatch out;
405 out.bankA = native(v.bankA);
406 out.bankB = native(v.bankB);
407 out.across = native(v.across);
408 out.along = native(v.along);
409 out.tag = native(v.tag);
410 return out;
411}
412
413inline BankPairPatch qt(const n::BankPairPatch &v)
414{
415 BankPairPatch out;
416 out.bankA = qt(v.bankA);
417 out.bankB = qt(v.bankB);
418 out.across = qt(v.across);
419 out.along = qt(v.along);
420 out.tag = qt(v.tag);
421 return out;
422}
423
424inline n::PatchLine native(const PatchLine &v)
425{
426 n::PatchLine out;
427 out.path = native(v.path);
428 out.marker = native(v.marker);
429 out.tag = native(v.tag);
430 return out;
431}
432
433inline PatchLine qt(const n::PatchLine &v)
434{
435 PatchLine out;
436 out.path = qt(v.path);
437 out.marker = qt(v.marker);
438 out.tag = qt(v.tag);
439 return out;
440}
441
448inline n::PatchMesh native(const PatchMesh &v)
449{
450 n::PatchMesh out;
451 out.xy = native(v.xy);
452 out.quads = native(v.quads);
453 out.boundarySegments = native(v.boundarySegments);
454 out.tag = native(v.tag);
455 out.lines = native(v.lines);
456 return out;
457}
458
466inline PatchMesh qt(const n::PatchMesh &v)
467{
468 PatchMesh out;
469 out.xy = qt(v.xy);
470 out.quads = qt(v.quads);
471 out.boundarySegments = qt(v.boundarySegments);
472 out.tag = qt(v.tag);
473 out.lines = qt(v.lines);
474 return out;
475}
476
477inline n::ConstraintSegment native(const ConstraintSegment &v)
478{
479 n::ConstraintSegment out;
480 out.path = native(v.path);
481 out.marker = native(v.marker);
482 out.tag = native(v.tag);
483 out.stripWidth = native(v.stripWidth);
484 return out;
485}
486
487inline ConstraintSegment qt(const n::ConstraintSegment &v)
488{
490 out.path = qt(v.path);
491 out.marker = qt(v.marker);
492 out.tag = qt(v.tag);
493 out.stripWidth = qt(v.stripWidth);
494 return out;
495}
496
497inline n::SteinerPoint native(const SteinerPoint &v)
498{
499 n::SteinerPoint out;
500 out.xy = native(v.xy);
501 out.marker = native(v.marker);
502 out.tag = native(v.tag);
503 out.z = native(v.z);
504 out.hasZ = native(v.hasZ);
505 return out;
506}
507
508inline SteinerPoint qt(const n::SteinerPoint &v)
509{
510 SteinerPoint out;
511 out.xy = qt(v.xy);
512 out.marker = qt(v.marker);
513 out.tag = qt(v.tag);
514 out.z = qt(v.z);
515 out.hasZ = qt(v.hasZ);
516 return out;
517}
518
522inline n::ConstraintSimplificationPolicy native(const ConstraintSimplificationPolicy &v)
523{
524 n::ConstraintSimplificationPolicy out;
525 out.mode = native(v.mode);
526 out.maxDeviation = native(v.maxDeviation);
527 out.maxZDeviation = native(v.maxZDeviation);
528 out.maxTurnDegrees = native(v.maxTurnDegrees);
529 out.maxAreaChangeFraction = native(v.maxAreaChangeFraction);
530 out.maxAreaChange = native(v.maxAreaChange);
531 out.minimumClearance = native(v.minimumClearance);
532 return out;
533}
534
538inline ConstraintSimplificationPolicy qt(const n::ConstraintSimplificationPolicy &v)
539{
541 out.mode = qt(v.mode);
542 out.maxDeviation = qt(v.maxDeviation);
543 out.maxZDeviation = qt(v.maxZDeviation);
544 out.maxTurnDegrees = qt(v.maxTurnDegrees);
545 out.maxAreaChangeFraction = qt(v.maxAreaChangeFraction);
546 out.maxAreaChange = qt(v.maxAreaChange);
547 out.minimumClearance = qt(v.minimumClearance);
548 return out;
549}
550
554inline n::ConstraintPolicyOverride native(const ConstraintPolicyOverride &v)
555{
556 n::ConstraintPolicyOverride out;
557 out.mode = native(v.mode);
558 out.maxDeviation = native(v.maxDeviation);
559 out.maxZDeviation = native(v.maxZDeviation);
560 out.maxTurnDegrees = native(v.maxTurnDegrees);
561 out.maxAreaChangeFraction = native(v.maxAreaChangeFraction);
562 out.minimumClearance = native(v.minimumClearance);
563 return out;
564}
565
569inline ConstraintPolicyOverride qt(const n::ConstraintPolicyOverride &v)
570{
572 out.mode = qt(v.mode);
573 out.maxDeviation = qt(v.maxDeviation);
574 out.maxZDeviation = qt(v.maxZDeviation);
575 out.maxTurnDegrees = qt(v.maxTurnDegrees);
576 out.maxAreaChangeFraction = qt(v.maxAreaChangeFraction);
577 out.minimumClearance = qt(v.minimumClearance);
578 return out;
579}
580
583inline n::SimplificationFeature native(const SimplificationFeature &v)
584{
585 n::SimplificationFeature out;
586 out.id = native(v.id);
587 out.xy = native(v.xy);
588 out.z = native(v.z);
589 out.fixed = native(v.fixed);
590 out.closed = native(v.closed);
591 out.policy = native(v.policy);
592 out.role = native(v.role);
593 out.marker = native(v.marker);
594 out.requiredInMesh = native(v.requiredInMesh);
595 out.label = native(v.label);
596 return out;
597}
598
601inline SimplificationFeature qt(const n::SimplificationFeature &v)
602{
604 out.id = qt(v.id);
605 out.xy = qt(v.xy);
606 out.z = qt(v.z);
607 out.fixed = qt(v.fixed);
608 out.closed = qt(v.closed);
609 out.policy = qt(v.policy);
610 out.role = qt(v.role);
611 out.marker = qt(v.marker);
612 out.requiredInMesh = qt(v.requiredInMesh);
613 out.label = qt(v.label);
614 return out;
615}
616
617inline n::SimplificationChange native(const SimplificationChange &v)
618{
619 n::SimplificationChange out;
620 out.id = native(v.id);
621 out.removed = native(v.removed);
622 out.rejectedShortcuts = native(v.rejectedShortcuts);
623 out.maxDeviation = native(v.maxDeviation);
624 out.maxZDeviation = native(v.maxZDeviation);
625 out.areaChange = native(v.areaChange);
626 out.budgetRetained = native(v.budgetRetained);
627 out.rolledBack = native(v.rolledBack);
628 out.sourceVertices = native(v.sourceVertices);
629 return out;
630}
631
632inline SimplificationChange qt(const n::SimplificationChange &v)
633{
635 out.id = qt(v.id);
636 out.removed = qt(v.removed);
637 out.rejectedShortcuts = qt(v.rejectedShortcuts);
638 out.maxDeviation = qt(v.maxDeviation);
639 out.maxZDeviation = qt(v.maxZDeviation);
640 out.areaChange = qt(v.areaChange);
641 out.budgetRetained = qt(v.budgetRetained);
642 out.rolledBack = qt(v.rolledBack);
643 out.sourceVertices = qt(v.sourceVertices);
644 return out;
645}
646
650inline n::ConstraintSimplificationOptions native(const ConstraintSimplificationOptions &v)
651{
652 n::ConstraintSimplificationOptions out;
653 out.protectedPoints = native(v.protectedPoints);
654 out.cancelled = native(v.cancelled);
655 out.workBudget = native(v.workBudget);
656 out.maximumWorkspaceBytes = native(v.maximumWorkspaceBytes);
657 out.canonicalizeSharedEdges = native(v.canonicalizeSharedEdges);
658 return out;
659}
660
664inline ConstraintSimplificationOptions qt(const n::ConstraintSimplificationOptions &v)
665{
667 out.protectedPoints = qt(v.protectedPoints);
668 out.cancelled = qt(v.cancelled);
669 out.workBudget = qt(v.workBudget);
670 out.maximumWorkspaceBytes = qt(v.maximumWorkspaceBytes);
671 out.canonicalizeSharedEdges = qt(v.canonicalizeSharedEdges);
672 return out;
673}
674
678inline n::ConstraintSimplificationResult native(const ConstraintSimplificationResult &v)
679{
680 n::ConstraintSimplificationResult out;
681 out.ok = native(v.ok);
682 out.cancelled = native(v.cancelled);
683 out.error = native(v.error);
684 out.features = native(v.features);
685 out.changes = native(v.changes);
686 out.sharedSegments = native(v.sharedSegments);
687 out.sharedChains = native(v.sharedChains);
688 out.workUsed = native(v.workUsed);
689 return out;
690}
691
695inline ConstraintSimplificationResult qt(const n::ConstraintSimplificationResult &v)
696{
698 out.ok = qt(v.ok);
699 out.cancelled = qt(v.cancelled);
700 out.error = qt(v.error);
701 out.features = qt(v.features);
702 out.changes = qt(v.changes);
703 out.sharedSegments = qt(v.sharedSegments);
704 out.sharedChains = qt(v.sharedChains);
705 out.workUsed = qt(v.workUsed);
706 return out;
707}
708
711inline n::ConstraintAuditOptions native(const ConstraintAuditOptions &v)
712{
713 n::ConstraintAuditOptions out;
714 out.protectedPoints = native(v.protectedPoints);
715 out.cancelled = native(v.cancelled);
716 out.workBudget = native(v.workBudget);
717 out.maximumWorkspaceBytes = native(v.maximumWorkspaceBytes);
718 out.maximumExamples = native(v.maximumExamples);
719 return out;
720}
721
724inline ConstraintAuditOptions qt(const n::ConstraintAuditOptions &v)
725{
727 out.protectedPoints = qt(v.protectedPoints);
728 out.cancelled = qt(v.cancelled);
729 out.workBudget = qt(v.workBudget);
730 out.maximumWorkspaceBytes = qt(v.maximumWorkspaceBytes);
731 out.maximumExamples = qt(v.maximumExamples);
732 return out;
733}
734
737inline n::ConstraintAuditExample native(const ConstraintAuditExample &v)
738{
739 n::ConstraintAuditExample out;
740 out.featureId = native(v.featureId);
741 out.message = native(v.message);
742 out.segment = native(v.segment);
743 return out;
744}
745
748inline ConstraintAuditExample qt(const n::ConstraintAuditExample &v)
749{
751 out.featureId = qt(v.featureId);
752 out.message = qt(v.message);
753 out.segment = qt(v.segment);
754 return out;
755}
756
759inline n::ConstraintAuditReport native(const ConstraintAuditReport &v)
760{
761 n::ConstraintAuditReport out;
762 out.ok = native(v.ok);
763 out.complete = native(v.complete);
764 out.cancelled = native(v.cancelled);
765 out.resourceLimited = native(v.resourceLimited);
766 out.error = native(v.error);
767 out.featuresChecked = native(v.featuresChecked);
768 out.segmentsChecked = native(v.segmentsChecked);
769 out.cellsChecked = native(v.cellsChecked);
770 out.violations = native(v.violations);
771 out.workUsed = native(v.workUsed);
772 out.maximumXYDeviation = native(v.maximumXYDeviation);
773 out.maximumZDeviation = native(v.maximumZDeviation);
774 out.maximumAreaChange = native(v.maximumAreaChange);
775 out.coordinateRoundoff = native(v.coordinateRoundoff);
776 out.examples = native(v.examples);
777 return out;
778}
779
782inline ConstraintAuditReport qt(const n::ConstraintAuditReport &v)
783{
785 out.ok = qt(v.ok);
786 out.complete = qt(v.complete);
787 out.cancelled = qt(v.cancelled);
788 out.resourceLimited = qt(v.resourceLimited);
789 out.error = qt(v.error);
790 out.featuresChecked = qt(v.featuresChecked);
791 out.segmentsChecked = qt(v.segmentsChecked);
792 out.cellsChecked = qt(v.cellsChecked);
793 out.violations = qt(v.violations);
794 out.workUsed = qt(v.workUsed);
795 out.maximumXYDeviation = qt(v.maximumXYDeviation);
796 out.maximumZDeviation = qt(v.maximumZDeviation);
797 out.maximumAreaChange = qt(v.maximumAreaChange);
798 out.coordinateRoundoff = qt(v.coordinateRoundoff);
799 out.examples = qt(v.examples);
800 return out;
801}
802
803inline n::PatchDecision native(const PatchDecision &v)
804{
805 n::PatchDecision out;
806 out.source = native(v.source);
807 out.reason = native(v.reason);
808 out.region = native(v.region);
809 out.required = native(v.required);
810 out.disposition = native(v.disposition);
811 out.cells = native(v.cells);
812 out.repairRounds = native(v.repairRounds);
813 return out;
814}
815
816inline PatchDecision qt(const n::PatchDecision &v)
817{
818 PatchDecision out;
819 out.source = qt(v.source);
820 out.reason = qt(v.reason);
821 out.region = qt(v.region);
822 out.required = qt(v.required);
823 out.disposition = qt(v.disposition);
824 out.cells = qt(v.cells);
825 out.repairRounds = qt(v.repairRounds);
826 return out;
827}
828
829inline n::PatchAssessment native(const PatchAssessment &v)
830{
831 n::PatchAssessment out;
832 out.ok = native(v.ok);
833 out.repairable = native(v.repairable);
834 out.cancelled = native(v.cancelled);
835 out.reason = native(v.reason);
836 return out;
837}
838
839inline PatchAssessment qt(const n::PatchAssessment &v)
840{
841 PatchAssessment out;
842 out.ok = qt(v.ok);
843 out.repairable = qt(v.repairable);
844 out.cancelled = qt(v.cancelled);
845 out.reason = qt(v.reason);
846 return out;
847}
848
851inline n::PatchInterfaceConflict native(const PatchInterfaceConflict &v)
852{
853 n::PatchInterfaceConflict out;
854 out.first = native(v.first);
855 out.second = native(v.second);
856 out.firstSize = native(v.firstSize);
857 out.secondSize = native(v.secondSize);
858 return out;
859}
860
863inline PatchInterfaceConflict qt(const n::PatchInterfaceConflict &v)
864{
866 out.first = qt(v.first);
867 out.second = qt(v.second);
868 out.firstSize = qt(v.firstSize);
869 out.secondSize = qt(v.secondSize);
870 return out;
871}
872
873inline n::PatchInterfaceReport native(const PatchInterfaceReport &v)
874{
875 n::PatchInterfaceReport out;
876 out.ok = native(v.ok);
877 out.cancelled = native(v.cancelled);
878 out.error = native(v.error);
879 out.sharedFaces = native(v.sharedFaces);
880 out.violations = native(v.violations);
881 out.largestRatio = native(v.largestRatio);
882 out.examples = native(v.examples);
883 return out;
884}
885
886inline PatchInterfaceReport qt(const n::PatchInterfaceReport &v)
887{
889 out.ok = qt(v.ok);
890 out.cancelled = qt(v.cancelled);
891 out.error = qt(v.error);
892 out.sharedFaces = qt(v.sharedFaces);
893 out.violations = qt(v.violations);
894 out.largestRatio = qt(v.largestRatio);
895 out.examples = qt(v.examples);
896 return out;
897}
898
899inline n::QuadPlanningGeometry native(const QuadPlanningGeometry &v)
900{
901 n::QuadPlanningGeometry out;
902 out.domains = native(v.domains);
903 out.holes = native(v.holes);
904 out.lines = native(v.lines);
905 out.pins = native(v.pins);
906 out.fixedPatches = native(v.fixedPatches);
907 return out;
908}
909
910inline QuadPlanningGeometry qt(const n::QuadPlanningGeometry &v)
911{
913 out.domains = qt(v.domains);
914 out.holes = qt(v.holes);
915 out.lines = qt(v.lines);
916 out.pins = qt(v.pins);
917 out.fixedPatches = qt(v.fixedPatches);
918 return out;
919}
920
921inline n::QuadPlan native(const QuadPlan &v)
922{
923 n::QuadPlan out;
924 out.ok = native(v.ok);
925 out.cancelled = native(v.cancelled);
926 out.resourceLimited = native(v.resourceLimited);
927 out.error = native(v.error);
928 out.patches = native(v.patches);
929 out.patchRegions = native(v.patchRegions);
930 out.decisions = native(v.decisions);
931 out.sharedSides = native(v.sharedSides);
932 out.workUsed = native(v.workUsed);
933 out.plannedCells = native(v.plannedCells);
934 return out;
935}
936
937inline QuadPlan qt(const n::QuadPlan &v)
938{
939 QuadPlan out;
940 out.ok = qt(v.ok);
941 out.cancelled = qt(v.cancelled);
942 out.resourceLimited = qt(v.resourceLimited);
943 out.error = qt(v.error);
944 out.patches = qt(v.patches);
945 out.patchRegions = qt(v.patchRegions);
946 out.decisions = qt(v.decisions);
947 out.sharedSides = qt(v.sharedSides);
948 out.workUsed = qt(v.workUsed);
949 out.plannedCells = qt(v.plannedCells);
950 return out;
951}
952
953inline n::QuadBlockGrid native(const QuadBlockGrid &v)
954{
955 n::QuadBlockGrid out;
956 out.origin = native(v.origin);
957 out.pitch = native(v.pitch);
958 out.cols = native(v.cols);
959 out.rows = native(v.rows);
960 out.h = native(v.h);
961 return out;
962}
963
964inline QuadBlockGrid qt(const n::QuadBlockGrid &v)
965{
966 QuadBlockGrid out;
967 out.origin = qt(v.origin);
968 out.pitch = qt(v.pitch);
969 out.cols = qt(v.cols);
970 out.rows = qt(v.rows);
971 out.h = qt(v.h);
972 return out;
973}
974
975inline n::QuadBlockOptions native(const QuadBlockOptions &v)
976{
977 n::QuadBlockOptions out;
978 out.minSpacing = native(v.minSpacing);
979 out.bandRatio = native(v.bandRatio);
980 out.minQuadsPerSide = native(v.minQuadsPerSide);
981 out.maxBlocks = native(v.maxBlocks);
982 return out;
983}
984
985inline QuadBlockOptions qt(const n::QuadBlockOptions &v)
986{
988 out.minSpacing = qt(v.minSpacing);
989 out.bandRatio = qt(v.bandRatio);
990 out.minQuadsPerSide = qt(v.minQuadsPerSide);
991 out.maxBlocks = qt(v.maxBlocks);
992 return out;
993}
994
1007inline n::MeshResult native(const MeshResult &m)
1008{
1009 n::MeshResult out;
1010 out.ok = m.ok;
1011 out.errorMsg = native(m.errorMsg);
1012 out.vertices.borrow(&m.vertices, m.vertices.size(), [](const void *p, std::size_t i) {
1013 const auto &v = (*static_cast<const QVector<MeshVertex> *>(p))[i];
1014 return n::MeshVertex{native(v.xy), v.z};
1015 });
1016 out.triangles.borrow(&m.triangles, m.triangles.size(), [](const void *p, std::size_t i) {
1017 const auto &v = (*static_cast<const QVector<MeshTriangle> *>(p))[i];
1018 n::MeshTriangle c;
1019 c.v0 = v.v0;
1020 c.v1 = v.v1;
1021 c.v2 = v.v2;
1022 c.v3 = v.v3;
1023 return c;
1024 });
1025 out.boundaryEdges.borrow(&m.boundaryEdges, m.boundaryEdges.size(),
1026 [](const void *p, std::size_t i) {
1027 const auto &v = (*static_cast<const QVector<MeshEdge> *>(p))[i];
1028 n::MeshEdge e;
1029 e.v0 = v.v0;
1030 e.v1 = v.v1;
1031 e.marker = v.marker;
1032 return e;
1033 });
1034 return out;
1035}
1036
1045inline n::SizeFieldOptions native(const SizeFieldOptions &o)
1046{
1047 n::SizeFieldOptions out;
1048 out.footprintBounds = o.footprintBounds;
1049 out.nearSize = o.nearSize;
1050 out.gradation = o.gradation;
1051 out.areaFloor = o.areaFloor;
1052 out.maxGridCells = o.maxGridCells;
1053 out.maxSize = o.maxSize;
1054 out.terrainSizeAt = o.terrainSizeAt;
1055 out.steps = native(o.steps);
1056 for (auto r : o.regions)
1057 out.regions.append({native(r.ring), r.h});
1058 for (auto r : o.terrainRegions)
1059 out.terrainRegions.append({native(r.ring), r.h});
1060 return out;
1061}
1062
1073inline n::PatchLimits native(const PatchLimits &o)
1074{
1075 n::PatchLimits out;
1076 out.minimumEdge = o.minimumEdge;
1077 out.minimumAngleDegrees = o.minimumAngleDegrees;
1078 out.maximumAspect = o.maximumAspect;
1079 out.alongSize = o.alongSize;
1080 out.acrossSize = o.acrossSize;
1081 out.alongAngleDegrees = o.alongAngleDegrees;
1082 out.terrainTolerance = o.terrainTolerance;
1083 out.cancelled = o.cancelled;
1084 out.elevationAt = o.elevationAt;
1085 if (o.maximumSize)
1086 out.maximumSize = [f = o.maximumSize](const meshkit::Box2 &b) { return f(qt(b)); };
1088 out.terrainToleranceForFootprint =
1089 [f = o.terrainToleranceForFootprint](const meshkit::Box2 &b) { return f(qt(b)); };
1090 if (o.terrainBound)
1091 out.terrainBound = [f = o.terrainBound](const meshkit::Point2 *p, const double *z) {
1092 QPointF points[3] = {qt(p[0]), qt(p[1]), qt(p[2])};
1093 return f(points, z);
1094 };
1095 return out;
1096}
1097
1107inline n::QuadPlanningOptions native(const QuadPlanningOptions &o)
1108{
1109 n::QuadPlanningOptions out;
1110 out.allowQuads = o.allowQuads;
1111 out.defaultSize = o.defaultSize;
1112 out.limits = native(o.limits);
1113 out.maximumRepairRounds = o.maximumRepairRounds;
1114 out.maximumCells = o.maximumCells;
1115 out.maximumPatchCells = o.maximumPatchCells;
1116 out.maximumWorkspaceBytes = o.maximumWorkspaceBytes;
1117 out.workBudget = o.workBudget;
1118 if (o.excluded)
1119 out.excluded = [f = o.excluded](const n::Polygon &p) { return f(qt(p)); };
1120 return out;
1121}
1122}
Automatic open-area quad blocks (workplans/MESH_REGIONAL_TRIQUAD_PLAN_2026-10-03.md,...
Axis-aligned rectangle in the XY plane, stored as an origin corner and a signed size.
Definition geometry.hpp:167
constexpr double left() const
X of the origin corner; the minimum x when width() >= 0.
Definition geometry.hpp:186
constexpr double bottom() const
top() + height(); the maximum y when height() >= 0.
Definition geometry.hpp:192
constexpr double right() const
left() + width(); the maximum x when width() >= 0.
Definition geometry.hpp:188
constexpr double top() const
Y of the origin corner; the minimum y when height() >= 0.
Definition geometry.hpp:190
Point or displacement vector in the horizontal (XY) plane.
Definition geometry.hpp:21
constexpr double y() const noexcept
Y coordinate in XY plane units.
Definition geometry.hpp:36
constexpr double x() const noexcept
X coordinate in XY plane units.
Definition geometry.hpp:34
Conversions between the Qt value types of namespace mesh and the standard types of meshkit::plan,...
meshkit::Point2 native(QPointF p)
Copy the x and y of a QPointF into a meshkit::Point2.
Definition qtnative.h:18
QPointF qt(meshkit::Point2 p)
Copy the x and y of a meshkit::Point2 into a QPointF.
Definition qtnative.h:23
QuadRegionMode
Requested (or classified) cell strategy of a QuadRegion.
Definition meshquadregion.h:45
PatchDisposition
Final outcome of one quad region in unified cell planning.
Definition cellplanner.h:19
Planning algorithms on standard containers: quad patch planning and placement, size fields,...
Automatic open-area quad blocks (workplans/MESH_REGIONAL_TRIQUAD_PLAN_2026-10-03.md,...
Graded element sizing for Delaunay refinement (MESH_MINSIZE_ENFORCEMENT_V2_AND_GRADING_PLAN_2026-09-0...
Graded element sizing for Delaunay refinement (MESH_MINSIZE_ENFORCEMENT_V2_AND_GRADING_PLAN_2026-09-0...
Two open bank polylines with independently supplied directions.
Definition meshpatch.h:68
QVector< QPointF > bankA
First bank: open polyline of >= 2 finite points with no repeated consecutive point.
Definition meshpatch.h:73
QVector< QPointF > bankB
Second bank, same rules; must not touch or cross bankA.
Definition meshpatch.h:73
int across
Quads between the banks at every station; must be >= 1.
Definition meshpatch.h:74
QString tag
Copied to the generated patch and its quads.
Definition meshpatch.h:76
double along
Target station spacing in XY units; finite >= 0 (0 = union only).
Definition meshpatch.h:75
Qt form of meshkit::plan::ConstraintAuditExample: one recorded audit violation.
Definition constraintaudit.h:33
QString featureId
Id of the offending feature, or "pin", "graph" or "mesh" for violations not tied to one feature.
Definition constraintaudit.h:41
int segment
Index of the related vertex, segment, pin or delivered edge record (meaning depends on the message); ...
Definition constraintaudit.h:44
QString message
English description of the violation.
Definition constraintaudit.h:41
Qt form of meshkit::plan::ConstraintAuditOptions: pins, cancellation and resource limits for the cons...
Definition constraintaudit.h:11
std::function< bool()> cancelled
Optional; polled before work starts and every 4096 work units.
Definition constraintaudit.h:18
QVector< QPointF > protectedPoints
XY pins that simplified shortcuts must not cross, sweep over or (with the feature's minimumClearance)...
Definition constraintaudit.h:15
quint64 workBudget
Work units allowed; 0 selects 256 per input item plus 100,000 (items: original and candidate vertices...
Definition constraintaudit.h:22
int maximumExamples
Violations kept in ConstraintAuditReport::examples, clamped to [0, 1000]; all are still counted.
Definition constraintaudit.h:28
quint64 maximumWorkspaceBytes
Estimated workspace limit in bytes (default 1 GiB); exceeding it sets resourceLimited.
Definition constraintaudit.h:25
Qt form of meshkit::plan::ConstraintAuditReport: result of auditConstraintSimplification() or auditMe...
Definition constraintaudit.h:50
double coordinateRoundoff
Largest XY matching tolerance used, 32 machine epsilons times the segment's coordinate scale; mesh au...
Definition constraintaudit.h:98
quint64 violations
Total violations found, including those beyond maximumExamples.
Definition constraintaudit.h:81
quint64 segmentsChecked
Output segments (simplification audit) or required source segments (mesh audit) examined.
Definition constraintaudit.h:80
QString error
Empty when no violation was found and the audit finished; otherwise "<id>: <message>" of the first vi...
Definition constraintaudit.h:65
bool ok
complete and no violations: the only state that certifies the input.
Definition constraintaudit.h:62
quint64 featuresChecked
Features examined (simplification audit), or required features examined (mesh audit).
Definition constraintaudit.h:80
double maximumXYDeviation
Largest XY distance found: of a removed vertex from its output shortcut (simplification audit),...
Definition constraintaudit.h:97
double maximumZDeviation
Largest Z difference found, in Z units: of a removed vertex from linear interpolation,...
Definition constraintaudit.h:97
bool cancelled
ConstraintAuditOptions::cancelled stopped the audit.
Definition constraintaudit.h:62
quint64 workUsed
Work units consumed.
Definition constraintaudit.h:81
bool complete
Not cancelled and not resource-limited.
Definition constraintaudit.h:62
double maximumAreaChange
Largest absolute ring area change in squared XY units; simplification audit only.
Definition constraintaudit.h:97
QVector< ConstraintAuditExample > examples
First violations, at most maximumExamples (clamped to [0, 1000]).
Definition constraintaudit.h:100
quint64 cellsChecked
Delivered cells visited; mesh audit only.
Definition constraintaudit.h:80
bool resourceLimited
The work budget or workspace estimate ran out.
Definition constraintaudit.h:62
Partial ConstraintSimplificationPolicy layered over a parent policy, for per-source overrides.
Definition constraintsimplifier.h:65
int mode
Mode override; validate() rejects values outside [-1, 1].
Definition constraintsimplifier.h:67
std::optional< double > maxTurnDegrees
Replaces ConstraintSimplificationPolicy::maxTurnDegrees when set (degrees).
Definition constraintsimplifier.h:79
std::optional< double > minimumClearance
Replaces ConstraintSimplificationPolicy::minimumClearance when set (XY units).
Definition constraintsimplifier.h:80
std::optional< double > maxAreaChangeFraction
Replaces ConstraintSimplificationPolicy::maxAreaChangeFraction when set; must be nonnegative here,...
Definition constraintsimplifier.h:80
std::optional< double > maxZDeviation
Replaces ConstraintSimplificationPolicy::maxZDeviation when set (Z units).
Definition constraintsimplifier.h:79
std::optional< double > maxDeviation
Replaces ConstraintSimplificationPolicy::maxDeviation when set (XY units).
Definition constraintsimplifier.h:79
A polyline that must appear as constrained edges in the mesh.
Definition meshgenerator.h:53
double stripWidth
Width of a swept quad strip along the line; 0 (default) = no strip.
Definition meshgenerator.h:64
int marker
Preserved on output edges.
Definition meshgenerator.h:55
QVector< QPointF > path
>= 2 points; consecutive pairs become constrained edges.
Definition meshgenerator.h:54
QString tag
Resolved later via the marker→tag lookup the caller maintains.
Definition meshgenerator.h:56
Collection-wide inputs and resource limits for simplifyConstraints().
Definition constraintsimplifier.h:166
std::function< bool()> cancelled
Optional cancellation poll, called synchronously at the start and about every 4096 work units; return...
Definition constraintsimplifier.h:172
quint64 maximumWorkspaceBytes
Estimated byte limit for the shared-edge canonicalization records (1 GiB by default).
Definition constraintsimplifier.h:183
QVector< QPointF > protectedPoints
Finite points in the planar frame that no shortcut may pass through or enclose between itself and the...
Definition constraintsimplifier.h:169
quint64 workBudget
Work-unit limit for the pass; 0 selects 256 per input vertex plus 100,000.
Definition constraintsimplifier.h:176
bool canonicalizeSharedEdges
Simplify segments shared exactly by several features once, as canonical chains under the strictest ow...
Definition constraintsimplifier.h:180
Per-feature limits for constraint simplification.
Definition constraintsimplifier.h:21
double maxDeviation
Largest XY distance a removed vertex may lie from the shortcut replacing it; 0 allows removing only e...
Definition constraintsimplifier.h:32
Mode mode
Simplification mode; Preserve by default.
Definition constraintsimplifier.h:29
double minimumClearance
XY distance a shortcut must keep from other original segments and protected points that do not touch ...
Definition constraintsimplifier.h:48
double maxTurnDegrees
Corner limit in degrees (0 = straight on): a vertex whose direction change exceeds it,...
Definition constraintsimplifier.h:39
double maxAreaChange
Rings only: largest |area change|; must be finite and nonnegative or exactly -1.
Definition constraintsimplifier.h:45
Mode
Whether a feature may lose vertices.
Definition constraintsimplifier.h:28
double maxAreaChangeFraction
Rings only: largest |area change| as a fraction of |original area|, in [0, 1] or exactly -1.
Definition constraintsimplifier.h:42
double maxZDeviation
Largest difference between a removed vertex's z and the height interpolated linearly along the shortc...
Definition constraintsimplifier.h:36
Output of simplifyConstraints(); features and changes are parallel to the input.
Definition constraintsimplifier.h:186
bool ok
True when the pass finished, also when exhausted limits kept the originals (see SimplificationChange:...
Definition constraintsimplifier.h:192
quint64 sharedChains
Canonical chains built from shared segments; counted only by the shared-edge path,...
Definition constraintsimplifier.h:204
quint64 sharedSegments
Distinct segments owned by more than one feature; counted only by the shared-edge path,...
Definition constraintsimplifier.h:204
bool cancelled
Cancellation was observed; ok is false and the features are the originals.
Definition constraintsimplifier.h:192
QVector< SimplificationFeature > features
Output features; the originals on failure.
Definition constraintsimplifier.h:194
QVector< SimplificationChange > changes
One outcome per input feature.
Definition constraintsimplifier.h:195
QString error
English reason when ok is false without cancellation; otherwise empty.
Definition constraintsimplifier.h:193
quint64 workUsed
Work units consumed, including shared-edge indexing.
Definition constraintsimplifier.h:204
Result of MeshGenerator::generate.
Definition meshresult.h:203
QVector< MeshVertex > vertices
Mesh vertices; cells and edges index into this array.
Definition meshresult.h:206
bool ok
True only when the producer (generator or reader) succeeded.
Definition meshresult.h:262
QString errorMsg
Failure reason when ok is false; empty on success.
Definition meshresult.h:263
A cell in the mesh — a triangle or (since the engine's mixed tri-quad meshes, workplans/TRI_QUAD_MESH...
Definition meshresult.h:64
int v2
Third corner, cyclically after v1.
Definition meshresult.h:71
int v1
Second corner, cyclically after v0.
Definition meshresult.h:71
int v3
Fourth vertex of a quadrilateral; -1 = triangle.
Definition meshresult.h:72
int v0
First corner: index into MeshResult::vertices (not range-checked here).
Definition meshresult.h:71
QString tag
Region tag, for example a subcatchment ID; empty if untagged.
Definition meshresult.h:73
Result of assessPlannedPatch().
Definition cellplanner.h:79
QString reason
English reason for the first failure; empty when ok.
Definition cellplanner.h:89
bool cancelled
PatchLimits::cancelled returned true.
Definition cellplanner.h:88
bool ok
Every cell met every limit.
Definition cellplanner.h:88
bool repairable
When ok is false: finer stations may fix the failure (angle, aspect, directional spacing,...
Definition cellplanner.h:88
Per-region planning record explaining the disposition chosen by planQuadRegions().
Definition cellplanner.h:21
QString source
Region tag, or "region:<i>" with the zero-based index when the tag is empty.
Definition cellplanner.h:27
QString reason
English explanation: the acceptance note, the refusal or priority reason, or the last repairable fail...
Definition cellplanner.h:27
int repairRounds
Station-doubling rounds the delivered patch needed; 0 otherwise.
Definition cellplanner.h:34
quint64 cells
n x m cell count at the patch's last successful assessment; 0 if none passed.
Definition cellplanner.h:33
PatchDisposition disposition
Final outcome.
Definition cellplanner.h:30
int region
Zero-based index into the planned regions; -1 when not assigned.
Definition cellplanner.h:28
bool required
QuadRegion::requireMapped or directionalSpacing was set.
Definition cellplanner.h:29
One interface face whose nominal-size ratio exceeds the limit.
Definition cellplanner.h:197
double firstSize
Nominal size of cell first (XY length).
Definition cellplanner.h:207
int second
Higher MeshResult::triangles index of the two incident cells.
Definition cellplanner.h:202
int first
Lower MeshResult::triangles index of the two incident cells.
Definition cellplanner.h:202
double secondSize
Nominal size of cell second (XY length).
Definition cellplanner.h:207
Result of auditPatchInterfaces().
Definition cellplanner.h:210
QVector< PatchInterfaceConflict > examples
Up to maximumExamples violations, sorted by cell indices.
Definition cellplanner.h:224
QString error
English reason when ok is false; empty otherwise.
Definition cellplanner.h:216
bool cancelled
Cancellation was observed; ok is false.
Definition cellplanner.h:215
quint64 violations
Shared faces whose size ratio exceeds the limit.
Definition cellplanner.h:221
bool ok
The audit completed on valid input; violations may still be present.
Definition cellplanner.h:215
quint64 sharedFaces
Interface edges with exactly two incident cells.
Definition cellplanner.h:221
double largestRatio
Largest size ratio over shared faces; 1 when none.
Definition cellplanner.h:222
Acceptance limits for one mapped patch, checked cell by cell by assessPlannedPatch().
Definition cellplanner.h:43
std::function< double(const QRectF &)> maximumSize
Optional size cap for a cell's XY bounding box, compared with sqrt(cell area); 0 means no cap,...
Definition cellplanner.h:67
double minimumAngleDegrees
Smallest allowed interior angle in degrees, in [0, 180); 0 disables.
Definition cellplanner.h:50
std::function< double(double, double)> elevationAt
Terrain elevation at (x, y), sampled at the quad corners; required by terrain checks.
Definition cellplanner.h:70
double terrainTolerance
Constant terrain error tolerance, used when terrainToleranceForFootprint is unset.
Definition cellplanner.h:61
double alongSize
Limit on the mean length of the opposite edge pair best aligned with alongAngleDegrees; 0 disables th...
Definition cellplanner.h:58
double maximumAspect
Largest allowed quad aspect ratio as computed by quadQuality(); 0 disables.
Definition cellplanner.h:50
double minimumEdge
Shortest allowed cell edge; 0 disables.
Definition cellplanner.h:50
std::function< double(const QRectF &)> terrainToleranceForFootprint
Optional tolerance for a cell's XY bounding box; replaces terrainTolerance and must return a finite p...
Definition cellplanner.h:64
double alongAngleDegrees
Undirected along axis in degrees counterclockwise from +x; must be finite.
Definition cellplanner.h:58
double acrossSize
Limit on the mean length of the other opposite edge pair; 0 disables.
Definition cellplanner.h:58
std::function< bool()> cancelled
Optional cancellation poll; planQuadRegions() also uses it as its cancellation source.
Definition cellplanner.h:76
std::function< double(const QPointF *, const double *)> terrainBound
Certified terrain error bound of the planar triangle through three XY points and heights (arrays vali...
Definition cellplanner.h:74
A polyline through a patch's vertices that must be reported as mesh edges with a marker — a conduit r...
Definition meshpatch.h:81
QVector< int > path
Local vertex indices, consecutive ones joined by quad edges.
Definition meshpatch.h:82
QString tag
Edge tag; empty = MeshGenerator resolves it from marker's constraint tag.
Definition meshpatch.h:84
int marker
Copied to each emitted MeshEdge::marker.
Definition meshpatch.h:83
A generated patch in local indices.
Definition meshpatch.h:88
QVector< MeshTriangle > quads
v3 >= 0, local indices.
Definition meshpatch.h:90
QString tag
Patch tag; MeshGenerator gives it to stitched quads whose own tag is empty.
Definition meshpatch.h:92
QVector< PatchLine > lines
Interior lines emitted as MeshResult::boundaryEdges with their marker and tag, and bounding region ta...
Definition meshpatch.h:95
QVector< QPair< int, int > > boundarySegments
Local index pairs around the patch.
Definition meshpatch.h:91
QVector< QPointF > xy
Vertex coordinates (caller XY units); local index = position.
Definition meshpatch.h:89
Local cell size on a regular grid; NaN marks unusable cells.
Definition quadblocks.h:34
int cols
Cells along +x; cell (c, r) is h[r * cols + c].
Definition quadblocks.h:41
QPointF origin
Lower-left corner of cell (0, 0).
Definition quadblocks.h:35
int rows
Cells along +y.
Definition quadblocks.h:41
QVector< float > h
Row-major, cols x rows.
Definition quadblocks.h:42
double pitch
Square cell side in planar mesh units; must be > 0 to be valid.
Definition quadblocks.h:36
Policy for placeQuadBlocks().
Definition quadblocks.h:58
int maxBlocks
Cap on regions returned; <= 0 returns none.
Definition quadblocks.h:64
double minSpacing
Blocks finer than this are not worth a patch.
Definition quadblocks.h:59
int minQuadsPerSide
Fewest quads of the block spacing per rectangle side (each side also spans >= 3 grid cells before it ...
Definition quadblocks.h:63
double bandRatio
Size bands are powers of this.
Definition quadblocks.h:60
Result of planQuadRegions().
Definition cellplanner.h:147
QVector< int > patchRegions
Zero-based region index of each entry in patches.
Definition cellplanner.h:158
bool resourceLimited
A work, workspace or cell budget stopped the plan or refused a required region.
Definition cellplanner.h:154
QVector< PatchDecision > decisions
One decision per input region, in input order.
Definition cellplanner.h:159
quint64 workUsed
Work units consumed.
Definition cellplanner.h:166
bool ok
Planning finished and every required region has a patch.
Definition cellplanner.h:154
QVector< PatchMesh > patches
Delivered patches with CCW quads, required regions first, then in region order.
Definition cellplanner.h:157
bool cancelled
Cancellation was observed; ok is false.
Definition cellplanner.h:154
quint64 plannedCells
Total quads over patches.
Definition cellplanner.h:166
quint64 sharedSides
Region sides that matched an already registered identical side path.
Definition cellplanner.h:166
QString error
English reason when ok is false; empty on success.
Definition cellplanner.h:155
Source geometry that protects against planned patches, in the regions' XY frame.
Definition cellplanner.h:132
QVector< QVector< QPointF > > lines
Protected open polylines; they may run along a patch boundary but not enter or cross it.
Definition cellplanner.h:140
QVector< PatchMesh > fixedPatches
Existing patches; their boundaries (orderedPatchBoundary()) take priority like holes.
Definition cellplanner.h:144
QVector< QPolygonF > domains
Domain rings; a patch must lie inside one (tested at its first cell's centroid) and no domain edge ma...
Definition cellplanner.h:138
QVector< QPolygonF > holes
Hole rings; they take priority over any patch.
Definition cellplanner.h:138
QVector< QPointF > pins
Protected points; one inside or on a patch must coincide with a generated vertex.
Definition cellplanner.h:142
Settings and budgets for planQuadRegions().
Definition cellplanner.h:104
quint64 maximumWorkspaceBytes
Estimated limit for the source index, stations and planned cells (2 GiB by default); not a bound on t...
Definition cellplanner.h:123
quint64 maximumPatchCells
Cell limit for a single patch.
Definition cellplanner.h:117
double defaultSize
Spacing for regions without a positive QuadRegion::spacing; finite and positive.
Definition cellplanner.h:107
std::function< bool(const QPolygonF &)> excluded
Optional veto given a candidate's ordered patch boundary; returning true refuses it.
Definition cellplanner.h:126
bool allowQuads
False refuses all regions: global triangles-only priority.
Definition cellplanner.h:105
quint64 workBudget
Work-unit limit; 0 selects 512 per maximumCells plus 100,000.
Definition cellplanner.h:123
int maximumRepairRounds
Rounds that double station counts after repairable failures; valid range [0, 3].
Definition cellplanner.h:112
quint64 maximumCells
Cell budget over all planned patches; also bounds side subdivision counts.
Definition cellplanner.h:117
PatchLimits limits
Limits for every candidate patch; a region's aspectMax, isotropic spacing and directional spacing ove...
Definition cellplanner.h:110
A polygon in which quadrilateral cells are requested, with its spacing, shape and tagging policy.
Definition meshquadregion.h:61
bool automaticCandidate
Derived candidate; no outline constraint on fallback.
Definition meshquadregion.h:79
QPolygonF ring
Closed (last == first optional), simple, any orientation.
Definition meshquadregion.h:62
double mappedAlongAngleDeg
Physical undirected along-axis, degrees from +x CCW; independent of ring start.
Definition meshquadregion.h:88
QVector< int > corners
Mapped: 4 ring vertex indices in ring order; empty = auto-pick.
Definition meshquadregion.h:98
QString tag
MeshTriangle::tag for every cell inside; empty = inherit region marker's.
Definition meshquadregion.h:99
double aspectMax
Free: opposite-side mean ratio cap; < 0 inherits global, 0 unbounded, >= 1 explicit.
Definition meshquadregion.h:90
double hAlong
Spacing for the side pair most aligned with mappedAlongAngleDeg (directional only).
Definition meshquadregion.h:85
bool directionalSpacing
Explicit Mapped spacing; failure must not fall back to isotropic cells.
Definition meshquadregion.h:81
QVector< QPointF > alignGuide
Free: optional polyline the field aligns to (streets, channels).
Definition meshquadregion.h:97
double alignAngleDeg
Free: cross-field angle, degrees from +x CCW, meaningful when hasAlignAngle.
Definition meshquadregion.h:95
bool hasAlignAngle
Free: constant cross field at alignAngleDeg (from +x, CCW).
Definition meshquadregion.h:92
QVector< QPolygonF > holes
Areas subtracted from ring (QUAD_EVERYWHERE_PLAN_2026-09-07.md §3.1): domain hole rings,...
Definition meshquadregion.h:67
double hAcross
Positive spacings in mesh CRS units, used only when directionalSpacing.
Definition meshquadregion.h:86
QuadRegionMode mode
Requested strategy (default Auto).
Definition meshquadregion.h:77
bool isBackground
True when ring IS a domain outline rather than a ring drawn inside one — the "toggle quads on for the...
Definition meshquadregion.h:74
double spacing
Target quad edge length h; 0 = derive from the size field / max area.
Definition meshquadregion.h:80
bool requireMapped
Explicit hard requirement, used by unified planning.
Definition meshquadregion.h:78
Outcome for one input feature; ConstraintSimplificationResult::changes is parallel to the input.
Definition constraintsimplifier.h:137
bool rolledBack
A simplification was reverted: the ring area limits failed or the ring area changed sign or vanished,...
Definition constraintsimplifier.h:160
qsizetype rejectedShortcuts
Candidate shortcuts refused by a deviation or topology check; each refusal keeps one more vertex and ...
Definition constraintsimplifier.h:145
double areaChange
Rings only: |output area - input area| in squared XY units.
Definition constraintsimplifier.h:152
QVector< int > sourceVertices
Output-to-input vertex indices, increasing; a repeated closing vertex maps to the last.
Definition constraintsimplifier.h:163
double maxZDeviation
Largest elevation error of a removed vertex against its accepted shortcut.
Definition constraintsimplifier.h:152
QString id
Copy of SimplificationFeature::id.
Definition constraintsimplifier.h:138
double maxDeviation
Largest XY distance of a removed vertex from its accepted shortcut.
Definition constraintsimplifier.h:152
bool budgetRetained
The work budget, the workspace limit or cancellation stopped the pass, so the original geometry was k...
Definition constraintsimplifier.h:160
qsizetype removed
Vertices removed (input minus output xy count); 0 when the feature is unchanged.
Definition constraintsimplifier.h:145
One source constraint, an open polyline or a ring, given to simplifyConstraints().
Definition constraintsimplifier.h:104
QString label
Display label; makeConstraintPreview() falls back to id when it is empty.
Definition constraintsimplifier.h:130
QVector< double > z
Elevations parallel to xy; a repeated closing vertex must repeat its elevation.
Definition constraintsimplifier.h:108
ConstraintSimplificationPolicy policy
Limits for this feature; validated before use.
Definition constraintsimplifier.h:112
bool closed
Treat the feature as a ring even without a repeated closing vertex.
Definition constraintsimplifier.h:111
Role
Meaning of the feature for the delivered-mesh audit; ignored by the simplifier.
Definition constraintsimplifier.h:126
QVector< QPointF > xy
Vertices in the common planar frame; all must be finite.
Definition constraintsimplifier.h:106
bool requiredInMesh
False makes the delivered-mesh audit skip it.
Definition constraintsimplifier.h:128
QString id
Caller identifier, copied to SimplificationChange::id and error prefixes.
Definition constraintsimplifier.h:105
enum mesh::SimplificationFeature::Role role
Feature role; Role::Line by default.
QVector< bool > fixed
Per-vertex flags parallel to xy; a flagged vertex is never removed.
Definition constraintsimplifier.h:110
int marker
Boundary marker; when nonzero, the mesh audit matches only this marker.
Definition constraintsimplifier.h:127
Policy for SizeField::build().
Definition sizefield.h:61
std::function< double(double, double)> terrainSizeAt
Terrain-error size bound in mesh units at a mesh coordinate (mesh::TerrainSizeField through the worke...
Definition sizefield.h:93
QVector< QVector< QPointF > > steps
Terrain break lines (mesh coordinates) that the generator lays mesh edges along (MESH_TRIANGLE_ENGINE...
Definition sizefield.h:116
qint64 maxGridCells
Nominal background-grid cell budget.
Definition sizefield.h:83
double maxSize
Upper clamp on the size (h_max, map units); 0 = unbounded.
Definition sizefield.h:88
double nearSize
Element size (edge length, map units) AT a feature.
Definition sizefield.h:66
double gradation
Lipschitz slope g: how fast the target size may grow per unit of distance from a feature.
Definition sizefield.h:73
double areaFloor
Refinement floor A_min (map units², from MinSizePolicy).
Definition sizefield.h:78
QVector< Region > regions
Size caps applied at grid centres inside each ring, and by bounding box in SizeField::minimumSizeInBo...
Definition sizefield.h:105
QVector< Region > terrainRegions
Finer prescribed directional scales; footprint terrain queries only.
Definition sizefield.h:106
bool footprintBounds
Build a compact min pyramid for verified sizing.
Definition sizefield.h:62
A point that must appear as a vertex in the output mesh.
Definition meshgenerator.h:68
bool hasZ
If true, z is exact — skip DTM re-sampling in post-mesh step.
Definition meshgenerator.h:73
QString tag
Convenience copy (caller can resolve via marker, but stash here too).
Definition meshgenerator.h:71
int marker
Carries a tag id; resolved via marker→tag map.
Definition meshgenerator.h:70
QPointF xy
Location in the mesh XY frame; must be finite or generate() fails.
Definition meshgenerator.h:69
double z
Pre-sampled elevation when hasZ is true (e.g. from DTM thinner).
Definition meshgenerator.h:72
Four-sided patch: corners in cyclic order (either orientation); n subdivisions along corner0→corner1 ...
Definition meshpatch.h:41
QString tag
Copied verbatim to PatchMesh::tag and to every quad's tag.
Definition meshpatch.h:48
int n
Quads along corner0→corner1; must be >= 1 (the default 0 fails validate()).
Definition meshpatch.h:47
QVector< QPointF > corners
Exactly 4, cyclic.
Definition meshpatch.h:42
int m
Quads along corner0→corner3; >= 1, and (n+1)(m+1) must fit an int index.
Definition meshpatch.h:47
Swept patch: the centreline is offset ±width/2 (mitred at interior vertices) and cut into across quad...
Definition meshpatch.h:55
double along
Target station spacing in XY units; finite >= 0 (0 = vertices).
Definition meshpatch.h:59
QString tag
Copied verbatim to PatchMesh::tag and to every quad's tag.
Definition meshpatch.h:60
double width
Full strip width in XY units; must be finite and > 0.
Definition meshpatch.h:57
int across
Quads across the strip at every station; must be >= 1.
Definition meshpatch.h:58
QVector< QPointF > centreline
>= 2 points.
Definition meshpatch.h:56