Class for managing transformations in CSG objects.
More...
#include <CSGTransformationHelper.h>
Class for managing transformations in CSG objects.
Definition at line 34 of file CSGTransformationHelper.h.
◆ CSGTransformationHelper()
| CSG::CSGTransformationHelper::CSGTransformationHelper |
( |
| ) |
|
|
default |
◆ addTransformation()
Add a transformation to the list of transformations.
- Parameters
-
| type | The type of transformation |
| values | The values for the transformation |
Definition at line 16 of file CSGTransformationHelper.C.
20 mooseError(
"Invalid transformation values provided for transformation type " +
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
◆ 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.
Referenced by CSG::CSGSurface::getHalfspaceFromPoint().
79 auto trans_type = it->first;
80 auto val = it->second;
84 Point offset(std::get<0>(val), std::get<1>(val), std::get<2>(val));
89 Point
scale(std::get<0>(val), std::get<1>(val), std::get<2>(val));
90 for (
int i = 0; i < 3; ++i)
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;
102 mooseError(
"Transformation type is not recognized.");
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
static TensorValue< Real > intrinsic_rotation_matrix(Real phi, Real theta, Real psi)
◆ FRIEND_TEST() [1/2]
| CSG::CSGTransformationHelper::FRIEND_TEST |
( |
CSGSurfaceTest |
, |
|
|
testHalfspaceWithTransform |
|
|
) |
| |
|
protected |
Friends for unit testing.
◆ FRIEND_TEST() [2/2]
| CSG::CSGTransformationHelper::FRIEND_TEST |
( |
CSGSurfaceTest |
, |
|
|
testHalfspaceWithNullTransform |
|
|
) |
| |
|
protected |
◆ getTransformations()
◆ getTransformationsAsStrings()
| std::vector< std::pair< std::string, std::tuple< Real, Real, Real > > > CSG::CSGTransformationHelper::getTransformationsAsStrings |
( |
| ) |
const |
Get the transformations of this object with string representations for types.
- Returns
- Vector of transformation pairs with string representations for types
Definition at line 65 of file CSGTransformationHelper.C.
67 std::vector<std::pair<std::string, std::tuple<Real, Real, Real>>> result;
◆ 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.
Referenced by addTransformation(), and getTransformationsAsStrings().
60 enum_copy =
static_cast<int>(type);
61 return std::string(enum_copy);
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.
◆ isValidTransformationValue()
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.
Referenced by addTransformation().
46 if (std::get<0>(values) == 0.0 || std::get<1>(values) == 0.0 || std::get<2>(values) == 0.0)
void mooseError(Args &&... args)
Emit an error message with the given stringified, concatenated args and terminate the application...
◆ CSGBase
◆ _transformations
The documentation for this class was generated from the following files: