6#include "Math/Vector2D.h"
7#include "Math/Vector.h"
30
32
236template<
class TransformType>
237struct TransformConverter
240 static const TransformType& Convert(
const TransformType& Transform)
245
246
247
248
249 template<
typename OtherTransformType>
250 static TransformType Convert(
const OtherTransformType& Transform)
252 return TransformType(Transform);
257
258
259
260
261template<
typename ResultType,
typename TransformType>
262inline auto TransformCast(
const TransformType& Transform) ->
decltype(TransformConverter<ResultType>::Convert(Transform))
264 return TransformConverter<ResultType>::Convert(Transform);
268
269
270
271template<
typename TransformTypeA,
typename TransformTypeB>
277template<
typename TransformType>
284
285
286
287
288
289
290
291
292template<
typename TransformTypeA,
typename TransformTypeB>
295 typedef typename ConcatenateRules<TransformTypeA, TransformTypeB>::ResultType ReturnType;
298 return Concatenate(TransformCast<ReturnType>(LHS), TransformCast<ReturnType>(RHS));
304template<
typename ReturnType,
typename LHSType,
typename RHSType>
305inline ReturnType
Concatenate(
const LHSType& LHS,
const RHSType& RHS)
307 return Concatenate(TransformCast<ReturnType>(LHS), TransformCast<ReturnType>(RHS));
311
312
313
314
315
316
317
318template<
typename TransformType>
319inline auto Concatenate(
const TransformType& LHS,
const TransformType& RHS) ->
decltype(LHS.Concatenate(RHS))
323 return LHS.Concatenate(RHS);
327
328
329
330
331
332
333
334
335template<
typename TransformType1,
typename TransformType2,
typename TransformType3>
336inline auto Concatenate(
const TransformType1& TransformAToB,
const TransformType2& TransformBToC,
const TransformType3& TransformCToD) ->
decltype(Concatenate(Concatenate(TransformAToB, TransformBToC), TransformCToD))
338 return Concatenate(Concatenate(TransformAToB, TransformBToC), TransformCToD);
342
343
344
345
346
347
348
349
350
351template<
typename TransformType1,
typename TransformType2,
typename TransformType3,
typename TransformType4>
352inline auto Concatenate(
const TransformType1& TransformAToB,
const TransformType2& TransformBToC,
const TransformType3& TransformCToD,
const TransformType4& TransformDToE) ->
decltype(Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD), TransformDToE))
354 return Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD), TransformDToE);
358
359
360
361
362
363
364
365
366
367
368template<
typename TransformType1,
typename TransformType2,
typename TransformType3,
typename TransformType4,
typename TransformType5>
369inline auto Concatenate(
const TransformType1& TransformAToB,
const TransformType2& TransformBToC,
const TransformType3& TransformCToD,
const TransformType4& TransformDToE,
const TransformType5& TransformEToF) ->
decltype(Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD, TransformDToE), TransformEToF))
371 return Concatenate(Concatenate(TransformAToB, TransformBToC, TransformCToD, TransformDToE), TransformEToF);
375
376
377
378
379
380
381template<
typename TransformType>
382inline auto Inverse(
const TransformType& Transform) ->
decltype(Transform.Inverse())
384 return Transform.Inverse();
388
389
390template <
typename TransformType,
typename PositionType>
391inline PositionType
TransformPoint(
const TransformType& Transform,
const PositionType& Point)
393 return Transform.TransformPoint(Point);
397
398
399template <
typename TransformType,
typename VectorType>
400inline VectorType
TransformVector(
const TransformType& Transform,
const VectorType& Vector)
402 return Transform.TransformVector(Vector);
414
415
416
417
418
419
427
428
429
430
431
432
440
441
442template<
typename PositionType>
445 return Transform * Point;
448template<
typename PositionType>
451 return Transform * Point;
455
456
457template<
typename VectorType>
460 return Transform * Vector;
463template<
typename VectorType>
466 return Transform * Vector;
#define TEMPLATE_REQUIRES(...)