mirror of https://github.com/hannobraun/Fornjot
Add compile-time insertion tracking to `Polygon`
This commit is contained in:
parent
8767c789b8
commit
4b6fa6aa5a
|
@ -3,7 +3,7 @@ use fj_math::Point;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
objects::{Cycle, Face, HalfEdge, Surface, Vertex},
|
objects::{Cycle, Face, HalfEdge, Surface, Vertex},
|
||||||
operations::Insert,
|
operations::{Insert, IsInserted, IsInsertedNo},
|
||||||
services::Services,
|
services::Services,
|
||||||
storage::Handle,
|
storage::Handle,
|
||||||
};
|
};
|
||||||
|
@ -62,9 +62,9 @@ impl BuildFace for Face {}
|
||||||
/// Currently code that deals with `Polygon` might assume that the polygon has
|
/// 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
|
/// no holes. Unless you create a `Polygon` yourself, or modify a `Polygon`'s
|
||||||
/// `face` field to have interior cycles, this should not affect you.
|
/// `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
|
/// The face that forms the polygon
|
||||||
pub face: Face,
|
pub face: I::T<Face>,
|
||||||
|
|
||||||
/// The edges of the polygon
|
/// The edges of the polygon
|
||||||
pub edges: [Handle<HalfEdge>; D],
|
pub edges: [Handle<HalfEdge>; D],
|
||||||
|
|
Loading…
Reference in New Issue