java.lang.Object
simpa.core.api.utils.SolutionTransformer
Class for transforming solution files with a given rotation and/or
translation.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
transform
(String name, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, boolean inverseRot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, boolean inverseTransl, String outName) Rotates then translates the position and orientation of the sources (for current sources, electric monopoles are only translated) in a solution file corresponding to the accelerator element with the given name.
-
Constructor Details
-
SolutionTransformer
public SolutionTransformer()
-
-
Method Details
-
transform
public static void transform(String name, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot, boolean inverseRot, org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, boolean inverseTransl, String outName) throws IOException Rotates then translates the position and orientation of the sources (for current sources, electric monopoles are only translated) in a solution file corresponding to the accelerator element with the given name. The file "NAME-SOLUTION.txt" will be copied first to "NAME-SOLUTION.txt.original" as a backup. Then the given transformations will be applied and the result will be written to "NAME-SOLUTION.txt"- Parameters:
name
- Name of the accelerator element.rot
- A rotation to be applied, can be null.inverseRot
- If true it applies the inverse of the rotation.translation
- A translation to be applied after the rotation, can be null.inverseTransl
- If true it applies the inverse of the translation.outName
- Optionally an output name can be given. If not null. the original solution file is kept and the transformed solution file will be written with his name.- Throws:
IOException
- When the generated input file could not be found.
-