wuzp
Wrong Unit? Zero Points! Compile-time checks for units, coordinate systems and points vs. vectors.
Toggle main menu visibility
Loading...
Searching...
No Matches
ActiveTransformation.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <type_traits>
4
#include <utility>
5
6
#include "
wuzp/core/helpers.hpp
"
7
#include "
wuzp/core/traits.hpp
"
8
#include "
wuzp/trafo/Transformation.hpp
"
9
#include "
wuzp/trafo/traits.hpp
"
10
11
namespace
wuzp
{
12
14
template
<
typename
DerivedT_>
15
class
ActiveTransformation
:
public
internal::Crtp<DerivedT_, Transformation<DerivedT_>> {
16
public
:
18
template
<
typename
ObjectT_>
19
auto
transform
(ObjectT_&&
object
)
const
{
20
return
TransformationTraits<DerivedT_, std::remove_cvref_t<ObjectT_>
>
::transform
(this->derived(), std::forward<ObjectT_>(
object
));
21
}
22
};
23
28
template
<
typename
LhsT_,
typename
RhsT_>
29
auto
operator*
(
const
ActiveTransformation<LhsT_>
& lhs,
const
ActiveTransformation<RhsT_>
& rhs) {
30
static_assert
(std::is_same_v<typename GetCoordinateSystem<LhsT_>::type,
typename
GetCoordinateSystem<RhsT_>::type
>,
31
"Coordinate systems do not match."
);
32
return
CompositionTraits<LhsT_, RhsT_>::compose
(
static_cast<
const
LhsT_&
>
(lhs),
static_cast<
const
RhsT_&
>
(rhs));
33
}
34
35
}
// namespace wuzp
Transformation.hpp
wuzp::ActiveTransformation
An active transformation, which moves objects within its coordinate system (see Transformation).
Definition
ActiveTransformation.hpp:15
wuzp::ActiveTransformation::transform
auto transform(ObjectT_ &&object) const
The transformed object. A temporary is passed on as one, like with PassiveTransformation::transform()...
Definition
ActiveTransformation.hpp:19
traits.hpp
helpers.hpp
wuzp
Definition
Absolute.hpp:15
wuzp::operator*
auto operator*(const Quantities< ValuesLhsT_, UnitsLhsT_ > &lhs, const ValueRhsT_ rhs)
Definition
Quantities.hpp:503
wuzp::CompositionTraits
The composition lhs * rhs of two transformations, which applies rhs first, then lhs: (lhs * rhs)....
Definition
traits.hpp:39
wuzp::GetCoordinateSystem
Definition
traits.hpp:293
wuzp::TransformationTraits
How a transformation transforms an object: static auto transform(const TransformationT_&,...
Definition
traits.hpp:19
traits.hpp
wuzp
include
wuzp
trafo
ActiveTransformation.hpp
Generated by
1.18.0