Skip to content

Commit

Permalink
Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
hannobraun committed Feb 22, 2023
1 parent e271693 commit d3d7488
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 81 deletions.
17 changes: 1 addition & 16 deletions crates/fj-kernel/src/algorithms/transform/curve.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use fj_math::Transform;

use crate::{
objects::{Curve, GlobalCurve, Objects},
objects::{Curve, Objects},
services::Service,
};

Expand All @@ -21,18 +21,3 @@ impl TransformObject for Curve {
Self::new(path)
}
}

impl TransformObject for GlobalCurve {
fn transform_with_cache(
self,
_: &Transform,
_: &mut Service<Objects>,
_: &mut TransformCache,
) -> Self {
// `GlobalCurve` doesn't contain any internal geometry. If it did, that
// would just be redundant with the geometry of other objects, and this
// other geometry is already being transformed by other implementations
// of this trait.
self
}
}
5 changes: 2 additions & 3 deletions crates/fj-kernel/src/insert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
use crate::{
objects::{
Curve, Cycle, Face, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge,
Objects, Shell, Sketch, Solid, Surface, SurfaceVertex,
Curve, Cycle, Face, GlobalEdge, GlobalVertex, HalfEdge, Objects, Shell,
Sketch, Solid, Surface, SurfaceVertex,
},
services::{Service, ServiceObjectsExt},
storage::Handle,
Expand Down Expand Up @@ -37,7 +37,6 @@ impl_insert!(
Curve, curves;
Cycle, cycles;
Face, faces;
GlobalCurve, global_curves;
GlobalEdge, global_edges;
GlobalVertex, global_vertices;
HalfEdge, half_edges;
Expand Down
4 changes: 0 additions & 4 deletions crates/fj-kernel/src/objects/full/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,3 @@ impl Curve {
self.path
}
}

/// A curve, defined in global (3D) coordinates
#[derive(Clone, Copy, Debug)]
pub struct GlobalCurve;
2 changes: 1 addition & 1 deletion crates/fj-kernel/src/objects/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ mod stores;

pub use self::{
full::{
curve::{Curve, GlobalCurve},
curve::Curve,
cycle::{Cycle, HalfEdgesOfCycle},
edge::{GlobalEdge, HalfEdge, VerticesInNormalizedOrder},
face::{Face, FaceSet, Handedness},
Expand Down
5 changes: 2 additions & 3 deletions crates/fj-kernel/src/objects/object.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use std::any::Any;

use crate::{
objects::{
Curve, Cycle, Face, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge,
Objects, Shell, Sketch, Solid, Surface, SurfaceVertex,
Curve, Cycle, Face, GlobalEdge, GlobalVertex, HalfEdge, Objects, Shell,
Sketch, Solid, Surface, SurfaceVertex,
},
storage::{Handle, ObjectId},
validate::{Validate, ValidationError},
Expand Down Expand Up @@ -111,7 +111,6 @@ object!(
Curve, "curve", curves;
Cycle, "cycle", cycles;
Face, "face", faces;
GlobalCurve, "global curve", global_curves;
GlobalEdge, "global edge", global_edges;
GlobalVertex, "global vertex", global_vertices;
HalfEdge, "half-edge", half_edges;
Expand Down
7 changes: 2 additions & 5 deletions crates/fj-kernel/src/objects/stores.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use crate::{
};

use super::{
Curve, Cycle, Face, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Shell,
Sketch, Solid, Surface, SurfaceVertex,
Curve, Cycle, Face, GlobalEdge, GlobalVertex, HalfEdge, Shell, Sketch,
Solid, Surface, SurfaceVertex,
};

/// The available object stores
Expand All @@ -22,9 +22,6 @@ pub struct Objects {
/// Store for [`Face`]s
pub faces: Store<Face>,

/// Store for [`GlobalCurve`]s
pub global_curves: Store<GlobalCurve>,

/// Store for [`GlobalEdge`]s
pub global_edges: Store<GlobalEdge>,

Expand Down
2 changes: 1 addition & 1 deletion crates/fj-kernel/src/partial/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod wrapper;

pub use self::{
objects::{
curve::{MaybeSurfacePath, PartialCurve, PartialGlobalCurve},
curve::{MaybeSurfacePath, PartialCurve},
cycle::PartialCycle,
edge::{PartialGlobalEdge, PartialHalfEdge},
face::PartialFace,
Expand Down
18 changes: 1 addition & 17 deletions crates/fj-kernel/src/partial/objects/curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use fj_math::Scalar;

use crate::{
geometry::path::SurfacePath,
objects::{Curve, GlobalCurve, Objects},
objects::{Curve, Objects},
partial::{FullToPartialCache, PartialObject},
services::Service,
};
Expand Down Expand Up @@ -61,19 +61,3 @@ impl From<SurfacePath> for MaybeSurfacePath {
Self::Defined(path)
}
}

/// A partial [`GlobalCurve`]
#[derive(Clone, Debug, Default)]
pub struct PartialGlobalCurve;

impl PartialObject for PartialGlobalCurve {
type Full = GlobalCurve;

fn from_full(_: &Self::Full, _: &mut FullToPartialCache) -> Self {
Self
}

fn build(self, _: &mut Service<Objects>) -> Self::Full {
GlobalCurve
}
}
1 change: 0 additions & 1 deletion crates/fj-kernel/src/partial/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ impl_trait!(
Curve, PartialCurve;
Cycle, PartialCycle;
Face, PartialFace;
GlobalCurve, PartialGlobalCurve;
GlobalEdge, PartialGlobalEdge;
GlobalVertex, PartialGlobalVertex;
HalfEdge, PartialHalfEdge;
Expand Down
11 changes: 1 addition & 10 deletions crates/fj-kernel/src/validate/curve.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::objects::{Curve, GlobalCurve};
use crate::objects::Curve;

use super::{Validate, ValidationConfig, ValidationError};

Expand All @@ -10,12 +10,3 @@ impl Validate for Curve {
) {
}
}

impl Validate for GlobalCurve {
fn validate_with_config(
&self,
_: &ValidationConfig,
_: &mut Vec<ValidationError>,
) {
}
}
21 changes: 1 addition & 20 deletions crates/fj-kernel/src/validate/edge.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use fj_math::{Point, Scalar};

use crate::{
objects::{GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Surface},
objects::{GlobalEdge, GlobalVertex, HalfEdge, Surface},
storage::Handle,
};

Expand Down Expand Up @@ -30,25 +30,6 @@ impl Validate for GlobalEdge {
/// [`HalfEdge`] validation failed
#[derive(Clone, Debug, thiserror::Error)]
pub enum HalfEdgeValidationError {
/// [`HalfEdge`]'s [`GlobalCurve`]s do not match
#[error(
"Global form of `HalfEdge`'s `Curve` does not match `GlobalCurve` of \n\
the `HalfEdge`'s `GlobalEdge`\n\
- `GlobalCurve` from `Curve`: {global_curve_from_curve:#?}\n\
- `GlobalCurve` from `GlobalEdge`: {global_curve_from_global_form:#?}\n\
- `HalfEdge`: {half_edge:#?}",
)]
GlobalCurveMismatch {
/// The [`GlobalCurve`] from the [`HalfEdge`]'s `Curve`
global_curve_from_curve: Handle<GlobalCurve>,

/// The [`GlobalCurve`] from the [`HalfEdge`]'s global form
global_curve_from_global_form: Handle<GlobalCurve>,

/// The half-edge
half_edge: HalfEdge,
},

/// [`HalfEdge`]'s [`GlobalVertex`] objects do not match
#[error(
"Global forms of `HalfEdge` vertices do not match vertices of \n\
Expand Down

0 comments on commit d3d7488

Please sign in to comment.