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