Class for managing transformations in CSG objects.
More...
#include <CSGTransformationHelper.h>
Class for managing transformations in CSG objects.
Definition at line 38 of file CSGTransformationHelper.h.
◆ CSGTransformationHelper()
| CSG::CSGTransformationHelper::CSGTransformationHelper |
( |
| ) |
|
|
default |
◆ addTransformation()
| void CSG::CSGTransformationHelper::addTransformation |
( |
TransformationType |
type, |
|
|
const std::tuple< Real, Real, Real > & |
values |
|
) |
| |
|
protected |
◆ applyReverseTransformsToPoint()
| Point CSG::CSGTransformationHelper::applyReverseTransformsToPoint |
( |
Point |
p | ) |
const |
|
protected |
update the value of point p by applying the inverse of the list of transformations to the point
- Parameters
-
- Returns
- transformed point
Definition at line 74 of file CSGTransformationHelper.C.
75{
76
78 {
79 auto trans_type = it->first;
80 auto val = it->second;
81
83 {
84 Point offset(std::get<0>(val), std::get<1>(val), std::get<2>(val));
85 p -= offset;
86 }
88 {
89 Point
scale(std::get<0>(val), std::get<1>(val), std::get<2>(val));
90 for (int i = 0; i < 3; ++i)
92 }
94 {
95
96 const auto rot_matrix = RealTensorValue::intrinsic_rotation_matrix(
97 std::get<0>(val), std::get<1>(val), std::get<2>(val));
98 const auto rot_transpose = rot_matrix.transpose();
99 p = rot_transpose * p;
100 }
101 else
102 mooseError(
"Transformation type is not recognized.");
103 }
104 return p;
105}
Referenced by CSG::CSGSurface::getHalfspaceFromPoint().
◆ FRIEND_TEST() [1/3]
| CSG::CSGTransformationHelper::FRIEND_TEST |
( |
CSGEngUnitTest |
, |
|
|
testEngUnitEqual |
|
|
) |
| |
|
protected |
◆ FRIEND_TEST() [2/3]
| CSG::CSGTransformationHelper::FRIEND_TEST |
( |
CSGSurfaceTest |
, |
|
|
testHalfspaceWithNullTransform |
|
|
) |
| |
|
protected |
◆ FRIEND_TEST() [3/3]
| CSG::CSGTransformationHelper::FRIEND_TEST |
( |
CSGSurfaceTest |
, |
|
|
testHalfspaceWithTransform |
|
|
) |
| |
|
protected |
Friends for unit testing.
◆ getTransformations()
| const std::vector< std::pair< TransformationType, std::tuple< Real, Real, Real > > > & CSG::CSGTransformationHelper::getTransformations |
( |
| ) |
const |
|
inline |
◆ getTransformationsAsStrings()
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > CSG::CSGTransformationHelper::getTransformationsAsStrings |
( |
| ) |
const |
◆ getTransformationTypeString()
| std::string CSG::CSGTransformationHelper::getTransformationTypeString |
( |
TransformationType |
type | ) |
|
|
static |
Get the string representation of the transformation type.
- Parameters
-
| type | The transformation type |
- Returns
- String name of the transformation type
Definition at line 56 of file CSGTransformationHelper.C.
57{
58
60 enum_copy = static_cast<int>(type);
61 return std::string(enum_copy);
62}
This is a "smart" enum class intended to replace many of the shortcomings in the C++ enum type It sho...
static const MooseEnum transformation_type_enum
MooseEnum for transformation types, matching the TransformationType enum values.
Referenced by addTransformation(), and getTransformationsAsStrings().
◆ isValidTransformationValue()
| bool CSG::CSGTransformationHelper::isValidTransformationValue |
( |
TransformationType |
type, |
|
|
const std::tuple< Real, Real, Real > & |
values |
|
) |
| |
|
static |
Check if the transformation value is valid for the given type.
- Parameters
-
| type | The type of transformation |
| values | The values for the transformation |
- Returns
- True if the values are valid for the type
Definition at line 26 of file CSGTransformationHelper.C.
28{
29
30 switch (type)
31 {
33
34 return true;
35
37
38
39
40
41
42 return true;
43
45
46 if (std::get<0>(
values) == 0.0 || std::get<1>(
values) == 0.0 || std::get<2>(
values) == 0.0)
47 return false;
48 return true;
49
50 default:
52 }
53}
Referenced by addTransformation().
◆ CSGBase
◆ _transformations
| std::vector<std::pair<TransformationType, std::tuple<Real, Real, Real> > > CSG::CSGTransformationHelper::_transformations |
|
protected |
The documentation for this class was generated from the following files: