50#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_TRANSFORMATION_3D_H
51#define LASS_GUARDIAN_OF_INCLUSION_PRIM_TRANSFORMATION_3D_H
69template <
typename T,
size_t N>
72 enum { matrixSize = N };
76 std::atomic<size_t> referenceCount;
77 std::atomic<bool> hasInverse;
79 TransformationImpl(): referenceCount(0), hasInverse(false), isTranslation(false) {}
82template <
typename U,
typename Cascade>
83class TransformationImplStorage:
public util::ObjectStorage<U, Cascade>
86 TransformationImplStorage(): util::ObjectStorage<U, Cascade>() {}
87 TransformationImplStorage(U* p): util::ObjectStorage<U, Cascade>(p) {}
88 static U* allocate() {
return allocator().allocate(); }
92 allocator().deallocate(this->pointer());
95 typedef util::AllocatorObject< U , util::AllocatorConcurrentFreeList<> > TAllocator;
96 static TAllocator& allocator()
100 static TAllocator alloc;
115 typedef typename TPoint::TVector TVector;
116 typedef typename util::CallTraits<T>::TValue TValue;
117 typedef typename util::CallTraits<T>::TParam TParam;
118 typedef typename util::CallTraits<T>::TReference TReference;
119 typedef typename util::CallTraits<T>::TConstReference TConstReference;
120 typedef num::NumTraits<T> TNumTraits;
121 typedef size_t TSize;
123 enum { dimension = TPoint::dimension };
125 template <
typename U>
struct Rebind
132 const TVector& baseZ);
133 template <
typename InputIterator>
Transformation3D(InputIterator first, InputIterator last);
141 bool isIdentity()
const;
142 bool isTranslation()
const;
144 void swap(TSelf& other);
149 static const TSelf
scaler(
const TVector& scale);
151 static const TSelf
rotation(
const TVector& axis, TParam radians);
152 static const TSelf lookAt(
const TPoint& eye,
const TPoint& target,
const TVector& sky);
156 enum { matrixSize_ = 16 };
158 typedef T TMatrix[matrixSize_];
159 typedef const T TConstMatrix[matrixSize_];
160 typedef impl::TransformationImpl<T, matrixSize_> TImpl;
161 typedef util::SharedPtr<TImpl, impl::TransformationImplStorage, util::IntrusiveCounter<TImpl, std::atomic<size_t>, &TImpl::referenceCount> > TImplPtr;
164 void computeInverse()
const;
166 static void translate(
const TConstMatrix &source, TMatrix& dest);
167 static void identity(TMatrix& dest);
168 static TImplPtr makeIdentity();
172 static TImplPtr identity_;
175template <
typename T> Transformation3D<T> concatenate(
const Transformation3D<T>& first,
const Transformation3D<T>& second);
177template <
typename T> Vector3D<T> transform(
const Vector3D<T>& subject,
const Transformation3D<T>& transformation);
178template <
typename T> Point3D<T> transform(
const Point3D<T>& subject,
const Transformation3D<T>& transformation);
179template <
typename T> Vector3D<T> normalTransform(
const Vector3D<T>& subject,
const Transformation3D<T>& transformation);
180template <
typename T> std::pair<Vector3D<T>, T> normalTransform(
const std::pair<Vector3D<T>, T>& subject,
const Transformation3D<T>& transformation);
182template<
typename T,
typename Char,
typename Traits>
183std::basic_ostream<Char, Traits>& operator<<(std::basic_ostream<Char, Traits>& stream,
const Transformation3D<T>& transformation);
193#define LASS_PRIM_HAVE_PY_EXPORT_TRAITS_TRANSFORMATION_3D
194#ifdef LASS_GUARDIAN_OF_INCLUSION_UTIL_PYOBJECT_PLUS_H
198#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_AABB_3D_H
202#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_PLANE_3D_H
206#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_RAY_3D_H
210#ifdef LASS_GUARDIAN_OF_INCLUSION_PRIM_COLOR_RGBA_H
Output stream for writing a selection of geometric primitives to XML files.
cyclic iterator over xyz indices
#define LASS_SIMD_ALIGN
if LASS_SIMD_ALIGNMENT is set, use LASS_SIMD_ALIGN to align some structures on SIMD alignment boundar...
implementation details of lass::prim
set of geometrical primitives
Library for Assembled Shared Sources.