mirror of https://github.com/hannobraun/Fornjot
Remove redundant code
This commit is contained in:
parent
88bc99e13e
commit
fd1b7deba7
|
@ -59,11 +59,6 @@ impl PartialCurve {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`Curve`] from the partial curve
|
/// Build a full [`Curve`] from the partial curve
|
||||||
pub fn build(self, objects: &Objects) -> Result<Curve, ValidationError> {
|
pub fn build(self, objects: &Objects) -> Result<Curve, ValidationError> {
|
||||||
let path = self.path.expect("Can't build `Curve` without path");
|
let path = self.path.expect("Can't build `Curve` without path");
|
||||||
|
@ -116,11 +111,6 @@ impl From<&Curve> for PartialCurve {
|
||||||
pub struct PartialGlobalCurve;
|
pub struct PartialGlobalCurve;
|
||||||
|
|
||||||
impl PartialGlobalCurve {
|
impl PartialGlobalCurve {
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`GlobalCurve`] from the partial global curve
|
/// Build a full [`GlobalCurve`] from the partial global curve
|
||||||
pub fn build(self, _: &Objects) -> Result<GlobalCurve, ValidationError> {
|
pub fn build(self, _: &Objects) -> Result<GlobalCurve, ValidationError> {
|
||||||
Ok(GlobalCurve)
|
Ok(GlobalCurve)
|
||||||
|
|
|
@ -64,11 +64,6 @@ impl PartialCycle {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`Cycle`] from the partial cycle
|
/// Build a full [`Cycle`] from the partial cycle
|
||||||
pub fn build(
|
pub fn build(
|
||||||
mut self,
|
mut self,
|
||||||
|
|
|
@ -92,11 +92,6 @@ impl PartialHalfEdge {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`HalfEdge`] from the partial half-edge
|
/// Build a full [`HalfEdge`] from the partial half-edge
|
||||||
pub fn build(self, objects: &Objects) -> Result<HalfEdge, ValidationError> {
|
pub fn build(self, objects: &Objects) -> Result<HalfEdge, ValidationError> {
|
||||||
let curve = self.curve.into_full(objects)?;
|
let curve = self.curve.into_full(objects)?;
|
||||||
|
@ -184,11 +179,6 @@ impl PartialGlobalEdge {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`GlobalEdge`] from the partial global edge
|
/// Build a full [`GlobalEdge`] from the partial global edge
|
||||||
pub fn build(
|
pub fn build(
|
||||||
self,
|
self,
|
||||||
|
|
|
@ -70,11 +70,6 @@ impl PartialFace {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Construct a polygon from a list of points
|
/// Construct a polygon from a list of points
|
||||||
pub fn build(self, objects: &Objects) -> Result<Face, ValidationError> {
|
pub fn build(self, objects: &Objects) -> Result<Face, ValidationError> {
|
||||||
let exterior = self.exterior.into_full(objects)?;
|
let exterior = self.exterior.into_full(objects)?;
|
||||||
|
|
|
@ -25,10 +25,6 @@ macro_rules! impl_traits {
|
||||||
impl Partial for $partial {
|
impl Partial for $partial {
|
||||||
type Full = $full;
|
type Full = $full;
|
||||||
|
|
||||||
fn merge_with(self, other: Self) -> Self {
|
|
||||||
self.merge_with(other)
|
|
||||||
}
|
|
||||||
|
|
||||||
fn build(self, objects: &Objects)
|
fn build(self, objects: &Objects)
|
||||||
-> Result<
|
-> Result<
|
||||||
Self::Full,
|
Self::Full,
|
||||||
|
|
|
@ -60,11 +60,6 @@ impl PartialVertex {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`Vertex`] from the partial vertex
|
/// Build a full [`Vertex`] from the partial vertex
|
||||||
///
|
///
|
||||||
/// # Panics
|
/// # Panics
|
||||||
|
@ -173,11 +168,6 @@ impl PartialSurfaceVertex {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`SurfaceVertex`] from the partial surface vertex
|
/// Build a full [`SurfaceVertex`] from the partial surface vertex
|
||||||
pub fn build(
|
pub fn build(
|
||||||
self,
|
self,
|
||||||
|
@ -248,11 +238,6 @@ impl PartialGlobalVertex {
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Merge this partial object with another
|
|
||||||
pub fn merge_with(self, other: Self) -> Self {
|
|
||||||
<Self as MergeWith>::merge_with(self, other)
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Build a full [`GlobalVertex`] from the partial global vertex
|
/// Build a full [`GlobalVertex`] from the partial global vertex
|
||||||
pub fn build(self, _: &Objects) -> Result<GlobalVertex, ValidationError> {
|
pub fn build(self, _: &Objects) -> Result<GlobalVertex, ValidationError> {
|
||||||
let position = self
|
let position = self
|
||||||
|
|
|
@ -68,9 +68,6 @@ pub trait Partial: Default + for<'a> From<&'a Self::Full> {
|
||||||
/// The type representing the full variant of this object
|
/// The type representing the full variant of this object
|
||||||
type Full;
|
type Full;
|
||||||
|
|
||||||
/// Merge another partial object of the same type into this one
|
|
||||||
fn merge_with(self, other: Self) -> Self;
|
|
||||||
|
|
||||||
/// Build a full object from this partial one
|
/// Build a full object from this partial one
|
||||||
///
|
///
|
||||||
/// Implementations of this method will typically try to infer any missing
|
/// Implementations of this method will typically try to infer any missing
|
||||||
|
|
Loading…
Reference in New Issue