use alga::general::{Real, SubsetOf}; use base::allocator::Allocator; use base::dimension::{DimName, DimNameAdd, DimNameSum, U1}; use base::{DefaultAllocator, MatrixN}; use geometry::{SuperTCategoryOf, TCategory, Transform}; impl SubsetOf> for Transform where N1: Real + SubsetOf, N2: Real, C1: TCategory, C2: SuperTCategoryOf, D: DimNameAdd, DefaultAllocator: Allocator, DimNameSum> + Allocator, DimNameSum>, 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] unsafe fn from_superset_unchecked(t: &Transform) -> Self { Self::from_superset_unchecked(t.matrix()) } } impl SubsetOf>> for Transform where N1: Real + SubsetOf, N2: Real, C: TCategory, D: DimNameAdd, DefaultAllocator: Allocator, DimNameSum> + Allocator, DimNameSum>, N1::Epsilon: Copy, N2::Epsilon: Copy, { #[inline] fn to_superset(&self) -> MatrixN> { self.matrix().to_superset() } #[inline] fn is_in_subset(m: &MatrixN>) -> bool { C::check_homogeneous_invariants(m) } #[inline] unsafe fn from_superset_unchecked(m: &MatrixN>) -> Self { Self::from_matrix_unchecked(::convert_ref_unchecked(m)) } } impl From> for MatrixN> where D: DimNameAdd, C: TCategory, DefaultAllocator: Allocator, DimNameSum>, { #[inline] fn from(t: Transform) -> Self { t.to_homogeneous() } }