use simba::scalar::{RealField, SubsetOf}; use crate::base::allocator::Allocator; use crate::base::dimension::{DimNameAdd, DimNameSum, U1}; use crate::base::{Const, DefaultAllocator, MatrixN}; use crate::geometry::{SuperTCategoryOf, TCategory, Transform}; impl SubsetOf> for Transform where N1: RealField + SubsetOf, N2: RealField, C1: TCategory, C2: SuperTCategoryOf, Const: DimNameAdd, DefaultAllocator: Allocator, U1>, DimNameSum, U1>> + Allocator, U1>, DimNameSum, U1>>, N1::Epsilon: Copy, N2::Epsilon: Copy, { #[inline] fn to_superset(&self) -> Transform { Transform::from_matrix_unchecked(self.to_homogeneous().to_superset()) } #[inline] fn is_in_subset(t: &Transform) -> bool { >::is_in_subset(t.matrix()) } #[inline] fn from_superset_unchecked(t: &Transform) -> Self { Self::from_superset_unchecked(t.matrix()) } } impl SubsetOf, U1>>> for Transform where N1: RealField + SubsetOf, N2: RealField, C: TCategory, Const: DimNameAdd, DefaultAllocator: Allocator, U1>, DimNameSum, U1>> + Allocator, U1>, DimNameSum, U1>>, N1::Epsilon: Copy, N2::Epsilon: Copy, { #[inline] fn to_superset(&self) -> MatrixN, U1>> { self.matrix().to_superset() } #[inline] fn is_in_subset(m: &MatrixN, U1>>) -> bool { C::check_homogeneous_invariants(m) } #[inline] fn from_superset_unchecked(m: &MatrixN, U1>>) -> Self { Self::from_matrix_unchecked(crate::convert_ref_unchecked(m)) } } impl From> for MatrixN, U1>> where Const: DimNameAdd, C: TCategory, DefaultAllocator: Allocator, U1>, DimNameSum, U1>>, { #[inline] fn from(t: Transform) -> Self { t.to_homogeneous() } }