Remove unused code

This commit is contained in:
Hanno Braun 2023-02-22 13:52:55 +01:00
parent e271693846
commit d3d7488429
11 changed files with 12 additions and 81 deletions

View File

@ -1,7 +1,7 @@
use fj_math::Transform; use fj_math::Transform;
use crate::{ use crate::{
objects::{Curve, GlobalCurve, Objects}, objects::{Curve, Objects},
services::Service, services::Service,
}; };
@ -21,18 +21,3 @@ impl TransformObject for Curve {
Self::new(path) 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
}
}

View File

@ -4,8 +4,8 @@
use crate::{ use crate::{
objects::{ objects::{
Curve, Cycle, Face, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Curve, Cycle, Face, GlobalEdge, GlobalVertex, HalfEdge, Objects, Shell,
Objects, Shell, Sketch, Solid, Surface, SurfaceVertex, Sketch, Solid, Surface, SurfaceVertex,
}, },
services::{Service, ServiceObjectsExt}, services::{Service, ServiceObjectsExt},
storage::Handle, storage::Handle,
@ -37,7 +37,6 @@ impl_insert!(
Curve, curves; Curve, curves;
Cycle, cycles; Cycle, cycles;
Face, faces; Face, faces;
GlobalCurve, global_curves;
GlobalEdge, global_edges; GlobalEdge, global_edges;
GlobalVertex, global_vertices; GlobalVertex, global_vertices;
HalfEdge, half_edges; HalfEdge, half_edges;

View File

@ -17,7 +17,3 @@ impl Curve {
self.path self.path
} }
} }
/// A curve, defined in global (3D) coordinates
#[derive(Clone, Copy, Debug)]
pub struct GlobalCurve;

View File

@ -79,7 +79,7 @@ mod stores;
pub use self::{ pub use self::{
full::{ full::{
curve::{Curve, GlobalCurve}, curve::Curve,
cycle::{Cycle, HalfEdgesOfCycle}, cycle::{Cycle, HalfEdgesOfCycle},
edge::{GlobalEdge, HalfEdge, VerticesInNormalizedOrder}, edge::{GlobalEdge, HalfEdge, VerticesInNormalizedOrder},
face::{Face, FaceSet, Handedness}, face::{Face, FaceSet, Handedness},

View File

@ -2,8 +2,8 @@ use std::any::Any;
use crate::{ use crate::{
objects::{ objects::{
Curve, Cycle, Face, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Curve, Cycle, Face, GlobalEdge, GlobalVertex, HalfEdge, Objects, Shell,
Objects, Shell, Sketch, Solid, Surface, SurfaceVertex, Sketch, Solid, Surface, SurfaceVertex,
}, },
storage::{Handle, ObjectId}, storage::{Handle, ObjectId},
validate::{Validate, ValidationError}, validate::{Validate, ValidationError},
@ -111,7 +111,6 @@ object!(
Curve, "curve", curves; Curve, "curve", curves;
Cycle, "cycle", cycles; Cycle, "cycle", cycles;
Face, "face", faces; Face, "face", faces;
GlobalCurve, "global curve", global_curves;
GlobalEdge, "global edge", global_edges; GlobalEdge, "global edge", global_edges;
GlobalVertex, "global vertex", global_vertices; GlobalVertex, "global vertex", global_vertices;
HalfEdge, "half-edge", half_edges; HalfEdge, "half-edge", half_edges;

View File

@ -6,8 +6,8 @@ use crate::{
}; };
use super::{ use super::{
Curve, Cycle, Face, GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Shell, Curve, Cycle, Face, GlobalEdge, GlobalVertex, HalfEdge, Shell, Sketch,
Sketch, Solid, Surface, SurfaceVertex, Solid, Surface, SurfaceVertex,
}; };
/// The available object stores /// The available object stores
@ -22,9 +22,6 @@ pub struct Objects {
/// Store for [`Face`]s /// Store for [`Face`]s
pub faces: Store<Face>, pub faces: Store<Face>,
/// Store for [`GlobalCurve`]s
pub global_curves: Store<GlobalCurve>,
/// Store for [`GlobalEdge`]s /// Store for [`GlobalEdge`]s
pub global_edges: Store<GlobalEdge>, pub global_edges: Store<GlobalEdge>,

View File

@ -16,7 +16,7 @@ mod wrapper;
pub use self::{ pub use self::{
objects::{ objects::{
curve::{MaybeSurfacePath, PartialCurve, PartialGlobalCurve}, curve::{MaybeSurfacePath, PartialCurve},
cycle::PartialCycle, cycle::PartialCycle,
edge::{PartialGlobalEdge, PartialHalfEdge}, edge::{PartialGlobalEdge, PartialHalfEdge},
face::PartialFace, face::PartialFace,

View File

@ -2,7 +2,7 @@ use fj_math::Scalar;
use crate::{ use crate::{
geometry::path::SurfacePath, geometry::path::SurfacePath,
objects::{Curve, GlobalCurve, Objects}, objects::{Curve, Objects},
partial::{FullToPartialCache, PartialObject}, partial::{FullToPartialCache, PartialObject},
services::Service, services::Service,
}; };
@ -61,19 +61,3 @@ impl From<SurfacePath> for MaybeSurfacePath {
Self::Defined(path) 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
}
}

View File

@ -36,7 +36,6 @@ impl_trait!(
Curve, PartialCurve; Curve, PartialCurve;
Cycle, PartialCycle; Cycle, PartialCycle;
Face, PartialFace; Face, PartialFace;
GlobalCurve, PartialGlobalCurve;
GlobalEdge, PartialGlobalEdge; GlobalEdge, PartialGlobalEdge;
GlobalVertex, PartialGlobalVertex; GlobalVertex, PartialGlobalVertex;
HalfEdge, PartialHalfEdge; HalfEdge, PartialHalfEdge;

View File

@ -1,4 +1,4 @@
use crate::objects::{Curve, GlobalCurve}; use crate::objects::Curve;
use super::{Validate, ValidationConfig, ValidationError}; use super::{Validate, ValidationConfig, ValidationError};
@ -10,12 +10,3 @@ impl Validate for Curve {
) { ) {
} }
} }
impl Validate for GlobalCurve {
fn validate_with_config(
&self,
_: &ValidationConfig,
_: &mut Vec<ValidationError>,
) {
}
}

View File

@ -1,7 +1,7 @@
use fj_math::{Point, Scalar}; use fj_math::{Point, Scalar};
use crate::{ use crate::{
objects::{GlobalCurve, GlobalEdge, GlobalVertex, HalfEdge, Surface}, objects::{GlobalEdge, GlobalVertex, HalfEdge, Surface},
storage::Handle, storage::Handle,
}; };
@ -30,25 +30,6 @@ impl Validate for GlobalEdge {
/// [`HalfEdge`] validation failed /// [`HalfEdge`] validation failed
#[derive(Clone, Debug, thiserror::Error)] #[derive(Clone, Debug, thiserror::Error)]
pub enum HalfEdgeValidationError { 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 /// [`HalfEdge`]'s [`GlobalVertex`] objects do not match
#[error( #[error(
"Global forms of `HalfEdge` vertices do not match vertices of \n\ "Global forms of `HalfEdge` vertices do not match vertices of \n\