mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-04 18:08:26 +00:00
Add Store::insert
This commit is contained in:
parent
3b0d56fb52
commit
6437cd930c
@ -3,7 +3,7 @@ mod primitives;
|
||||
mod shape;
|
||||
|
||||
pub use self::{
|
||||
operation::{HandleAny, Operation},
|
||||
operation::{Handle, HandleAny, Operation},
|
||||
primitives::{Triangle, Vertex},
|
||||
shape::Shape,
|
||||
};
|
||||
|
@ -107,7 +107,7 @@ impl<'r, NewOps, T> ShapeExtender<'r, NewOps, T> {
|
||||
NewOps: CombinRight<Handle<T>>,
|
||||
T: Operation + 'static,
|
||||
{
|
||||
let vertex = Handle::new(vertex.into());
|
||||
let vertex = self.store.insert(vertex.into());
|
||||
|
||||
self.sequence.push(OperationInSequence {
|
||||
operation: vertex.to_any(),
|
||||
|
@ -1,5 +1,7 @@
|
||||
use std::marker::PhantomData;
|
||||
|
||||
use crate::geometry::Handle;
|
||||
|
||||
pub struct Store<T> {
|
||||
_t: PhantomData<T>,
|
||||
}
|
||||
@ -8,4 +10,8 @@ impl<T> Store<T> {
|
||||
pub fn new() -> Self {
|
||||
Self { _t: PhantomData }
|
||||
}
|
||||
|
||||
pub fn insert(&mut self, op: T) -> Handle<T> {
|
||||
Handle::new(op)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user