Add compile-time insertion tracking to `Polygon`

This commit is contained in:
Hanno Braun 2023-05-04 11:16:37 +02:00
parent 8767c789b8
commit 4b6fa6aa5a
1 changed files with 3 additions and 3 deletions

View File

@ -3,7 +3,7 @@ use fj_math::Point;
use crate::{
objects::{Cycle, Face, HalfEdge, Surface, Vertex},
operations::Insert,
operations::{Insert, IsInserted, IsInsertedNo},
services::Services,
storage::Handle,
};
@ -62,9 +62,9 @@ impl BuildFace for Face {}
/// Currently code that deals with `Polygon` might assume that the polygon has
/// no holes. Unless you create a `Polygon` yourself, or modify a `Polygon`'s
/// `face` field to have interior cycles, this should not affect you.
pub struct Polygon<const D: usize> {
pub struct Polygon<const D: usize, I: IsInserted = IsInsertedNo> {
/// The face that forms the polygon
pub face: Face,
pub face: I::T<Face>,
/// The edges of the polygon
pub edges: [Handle<HalfEdge>; D],