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