mirror of
https://github.com/hannobraun/Fornjot
synced 2025-08-22 18:16:57 +00:00
Implement TransformObject
for Handle<Curve>
This is preparation for setting curve geometry there.
This commit is contained in:
parent
3f4a92e6c9
commit
b143ffb8cf
@ -1,19 +1,24 @@
|
||||
use fj_math::Transform;
|
||||
|
||||
use crate::{topology::Curve, Core};
|
||||
use crate::{
|
||||
operations::insert::Insert, storage::Handle, topology::Curve, Core,
|
||||
};
|
||||
|
||||
use super::{TransformCache, TransformObject};
|
||||
|
||||
impl TransformObject for Curve {
|
||||
impl TransformObject for Handle<Curve> {
|
||||
fn transform_with_cache(
|
||||
&self,
|
||||
_: &Transform,
|
||||
_: &mut Core,
|
||||
_: &mut TransformCache,
|
||||
core: &mut Core,
|
||||
cache: &mut TransformCache,
|
||||
) -> Self {
|
||||
// There's nothing to actually transform here, as `Curve` holds no data.
|
||||
// We still need this implementation though, as a new `Curve` object
|
||||
// must be created to represent the new and transformed curve.
|
||||
Self::new()
|
||||
cache
|
||||
.entry(self)
|
||||
.or_insert_with(|| Curve::new().insert(core))
|
||||
.clone()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user