mirror of
https://github.com/hannobraun/Fornjot
synced 2025-05-05 02:18:28 +00:00
Simplify
This commit is contained in:
parent
8813c8324b
commit
1e8bbb9bb8
@ -19,15 +19,11 @@ impl Layer<Geometry> {
|
||||
surface: Handle<Surface>,
|
||||
geometry: LocalCurveGeom,
|
||||
) {
|
||||
let mut events = Vec::new();
|
||||
self.process_command_and_capture_events(
|
||||
DefineCurve {
|
||||
curve,
|
||||
surface,
|
||||
geometry,
|
||||
},
|
||||
&mut events,
|
||||
);
|
||||
self.process_command(DefineCurve {
|
||||
curve,
|
||||
surface,
|
||||
geometry,
|
||||
});
|
||||
}
|
||||
|
||||
/// # Define the geometry of the provided curve
|
||||
@ -43,11 +39,7 @@ impl Layer<Geometry> {
|
||||
curve: Handle<Curve>,
|
||||
geometry: CurveGeom2,
|
||||
) {
|
||||
let mut events = Vec::new();
|
||||
self.process_command_and_capture_events(
|
||||
DefineCurve2 { curve, geometry },
|
||||
&mut events,
|
||||
);
|
||||
self.process_command(DefineCurve2 { curve, geometry });
|
||||
}
|
||||
|
||||
/// # Define the geometry of the provided surface
|
||||
@ -61,11 +53,7 @@ impl Layer<Geometry> {
|
||||
surface: Handle<Surface>,
|
||||
geometry: SweptCurve,
|
||||
) {
|
||||
let mut events = Vec::new();
|
||||
self.process_command_and_capture_events(
|
||||
DefineSurface { surface, geometry },
|
||||
&mut events,
|
||||
);
|
||||
self.process_command(DefineSurface { surface, geometry });
|
||||
}
|
||||
|
||||
/// # Define the geometry of the provided surface
|
||||
@ -86,11 +74,7 @@ impl Layer<Geometry> {
|
||||
surface: Handle<Surface>,
|
||||
geometry: SurfaceGeom,
|
||||
) {
|
||||
let mut events = Vec::new();
|
||||
self.process_command_and_capture_events(
|
||||
DefineSurface2 { surface, geometry },
|
||||
&mut events,
|
||||
);
|
||||
self.process_command(DefineSurface2 { surface, geometry });
|
||||
}
|
||||
|
||||
/// Define the geometry of the provided vertex
|
||||
@ -100,15 +84,11 @@ impl Layer<Geometry> {
|
||||
curve: Handle<Curve>,
|
||||
geometry: LocalVertexGeom,
|
||||
) {
|
||||
let mut events = Vec::new();
|
||||
self.process_command_and_capture_events(
|
||||
DefineVertex {
|
||||
vertex,
|
||||
curve,
|
||||
geometry,
|
||||
},
|
||||
&mut events,
|
||||
);
|
||||
self.process_command(DefineVertex {
|
||||
vertex,
|
||||
curve,
|
||||
geometry,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,11 +13,7 @@ use super::{Command, Event, Layer};
|
||||
impl Layer<Presentation> {
|
||||
/// Set the color of a region
|
||||
pub fn set_color(&mut self, region: Handle<Region>, color: Color) {
|
||||
let mut events = Vec::new();
|
||||
self.process_command_and_capture_events(
|
||||
SetColor { region, color },
|
||||
&mut events,
|
||||
);
|
||||
self.process_command(SetColor { region, color });
|
||||
}
|
||||
|
||||
/// Mark an object as being derived from another
|
||||
@ -26,11 +22,7 @@ impl Layer<Presentation> {
|
||||
original: AnyObject<Stored>,
|
||||
derived: AnyObject<Stored>,
|
||||
) {
|
||||
let mut events = Vec::new();
|
||||
self.process_command_and_capture_events(
|
||||
DeriveObject { original, derived },
|
||||
&mut events,
|
||||
);
|
||||
self.process_command(DeriveObject { original, derived });
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -29,8 +29,7 @@ impl Layer<Topology> {
|
||||
object: event.object.into(),
|
||||
geometry,
|
||||
};
|
||||
validation
|
||||
.process_command_and_capture_events(event, &mut Vec::new());
|
||||
validation.process_command(event);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,7 @@ use super::{Command, Event, Layer};
|
||||
impl Layer<Validation> {
|
||||
/// Take all errors stored in the validation layer
|
||||
pub fn take_errors(&mut self) -> Result<(), ValidationErrors> {
|
||||
self.process_command_and_capture_events(TakeErrors, &mut Vec::new())
|
||||
self.process_command(TakeErrors)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user