1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Public status vocabulary for retained exact-geometry carriers.
//!
//! Retained carriers are exact construction evidence that may or may not be
//! admissible as topology in the current kernel. The status values here keep
//! that distinction visible to callers instead of collapsing every non-native
//! case into an approximation or a boolean failure. This is the object/predicate
//! separation advocated by Yap, "Towards Exact Geometric Computation,"
//! *Computational Geometry* 7(1-2), 3-23 (1997): preserve exact objects, then
//! branch only on certified predicates and explicitly named capability
//! boundaries.
/// Topology-readiness status for a retained curve or span.
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
pub enum RetainedTopologyStatus {
/// The retained object has exact native topology in this kernel.
NativeExact,
/// The object has a certified approximation but not native exact topology.
CertifiedApproximation,
/// The object is suitable only for display/export evidence.
DisplayOrExport,
/// The object was imported through a lossy source tolerance or conversion.
ImportedLossy,
/// The exact object is retained, but this kernel has no topology model for it.
Unsupported,
/// The topology status depends on predicates that were not decided.
Unresolved,
}
impl RetainedTopologyStatus {
/// Returns true only for exact native topology.
pub const fn is_native_exact(self) -> bool {
matches!(self, Self::NativeExact)
}
/// Returns true for exact retained evidence that must not be consumed as
/// native topology by the current kernel.
pub const fn is_retained_evidence(self) -> bool {
matches!(self, Self::Unsupported | Self::Unresolved)
}
/// Returns true when the object crossed a lossy import boundary.
pub const fn is_imported_lossy(self) -> bool {
matches!(self, Self::ImportedLossy)
}
}