Rework the trait exports.

`use vec::an_operation` will import a vector-applicable operation trait.
`use mat::an_operation` will import a matrix-applicable operation trait.
This commit is contained in:
Sébastien Crozet 2013-08-31 11:41:32 +02:00
parent eb4e4a6aeb
commit 1b31304a9e
4 changed files with 26 additions and 33 deletions

View File

@ -5,27 +5,22 @@ use std::num::{One, Zero};
use std::cmp::ApproxEq; use std::cmp::ApproxEq;
use std::vec::{VecIterator, VecMutIterator}; use std::vec::{VecIterator, VecMutIterator};
use vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6}; use vec::{Vec1, Vec2, Vec3, Vec4, Vec5, Vec6};
use traits::dim::Dim;
use traits::inv::Inv;
use traits::transpose::Transpose;
use traits::rlmul::{RMul, LMul};
use traits::transformation::Transform;
use traits::homogeneous::{FromHomogeneous, ToHomogeneous};
use traits::indexable::Indexable;
use traits::column::Column;
use traits::row::Row;
use traits::iterable::{Iterable, IterableMut};
use traits::outer::Outer;
use traits::scalar_op::{ScalarAdd, ScalarSub};
pub use traits::dim::*;
pub use traits::indexable::*;
pub use traits::iterable::*;
pub use traits::outer::*;
pub use traits::scalar_op::*;
pub use traits::mat_cast::*; pub use traits::mat_cast::*;
pub use traits::column::*; pub use traits::column::*;
pub use traits::row::*;
pub use traits::inv::*; pub use traits::inv::*;
pub use traits::rlmul::*; pub use traits::rlmul::*;
pub use traits::rotation::*; pub use traits::rotation::*;
pub use traits::transformation::*; pub use traits::transformation::*;
pub use traits::translation::*; pub use traits::translation::*;
pub use traits::transpose::*; pub use traits::transpose::*;
pub use traits::homogeneous::*;
mod mat_macros; mod mat_macros;

View File

@ -1,8 +1,6 @@
use std::num::{Zero, One}; use std::num::{Zero, One};
use vec::Vec3; use vec::Vec3;
use mat::{Mat1, Mat2, Mat3}; use mat::{Mat1, Mat2, Mat3, Inv, Row};
use traits::inv::Inv;
use traits::row::Row;
// some specializations: // some specializations:
impl<N: Num + Clone> impl<N: Num + Clone>

View File

@ -4,17 +4,23 @@ use std::rand::Rng;
use std::vec::{VecIterator, VecMutIterator}; use std::vec::{VecIterator, VecMutIterator};
use std::iterator::{Iterator, FromIterator}; use std::iterator::{Iterator, FromIterator};
use std::cmp::ApproxEq; use std::cmp::ApproxEq;
use traits::basis::Basis;
use traits::dim::Dim; pub use traits::translation::*;
use traits::translation::{Translation, Translate}; pub use traits::transformation::*;
use traits::transformation::Transform; pub use traits::rotation::*;
use traits::rotation::Rotate; pub use traits::homogeneous::*;
use traits::homogeneous::{FromHomogeneous, ToHomogeneous}; pub use traits::vec_cast::*;
use traits::indexable::Indexable; pub use traits::vector::*;
use traits::scalar_op::{ScalarAdd, ScalarSub}; pub use traits::basis::*;
use traits::iterable::{Iterable, IterableMut}; pub use traits::dim::*;
use traits::vec_cast::VecCast; pub use traits::basis::*;
use traits::vector::{Vec, AlgebraicVec}; pub use traits::indexable::*;
pub use traits::iterable::*;
pub use traits::sample::*;
pub use traits::scalar_op::*;
pub use traits::cross::*;
pub use traits::sample::*;
pub use traits::row::*;
mod vec_macros; mod vec_macros;

View File

@ -1,11 +1,5 @@
use std::num::{Zero, One}; use std::num::{Zero, One};
use traits::basis::Basis; use vec::{Vec1, Vec2, Vec3, Row, AlgebraicVec, VecCast, UniformSphereSample, Cross, CrossMatrix, Basis};
use traits::cross::{Cross, CrossMatrix};
use traits::sample::UniformSphereSample;
use traits::vec_cast::VecCast;
use traits::vector::{AlgebraicVec};
use traits::row::Row;
use vec::{Vec1, Vec2, Vec3};
use mat::Mat3; use mat::Mat3;
impl<N: Mul<N, N> + Sub<N, N>> Cross<Vec1<N>> for Vec2<N> { impl<N: Mul<N, N> + Sub<N, N>> Cross<Vec1<N>> for Vec2<N> {