Module simpa.core

Class Profile

java.lang.Object
simpa.core.api.Profile

public class Profile extends Object
Object that represents a profile of the shape of the beam region.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Profile(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps)
    Creates a rectangular profile in the X, Y plane.
    Profile(double xRadius, double yRadius, int steps, double startingAngle)
    Creates an ellipse profile in the X, Y plane with the following code:
    Creates a general profile in the X, Y plane from a set of 3D points in the given file.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.apache.commons.math3.geometry.euclidean.threed.Vector3D
    Gets the origin of the profile.
    List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D>
    Gets the list of points that make up the profile.
    getTransformedCopy(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot)
    Makes a copy of this profile with the given translation and rotation.
    boolean
     
    void
    setDefaultProfile(boolean defaultProfile)
     
    Returns the points in the profile as string for debugging.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Profile

      public Profile(String file) throws FileNotFoundException
      Creates a general profile in the X, Y plane from a set of 3D points in the given file. The Z coordinate must be zero for all points.
      Parameters:
      file - Filename
      Throws:
      FileNotFoundException - when the file is not found
    • Profile

      public Profile(double xmin, double xmax, double ymin, double ymax, int xsteps, int ysteps)
      Creates a rectangular profile in the X, Y plane. The first profile point is in the bottom left corner.
      Parameters:
      xmin - Minimum X coordinate.
      xmax - Maximum X coordinate.
      ymin - Minimum Y coordinate.
      ymax - Maximum Y coordinate.
      xsteps - Number of points in the profile in the X direction.
      ysteps - Number of points in the profile in the Y direction.
    • Profile

      public Profile(double xRadius, double yRadius, int steps, double startingAngle)
      Creates an ellipse profile in the X, Y plane with the following code:
      Parameters:
      xRadius - Horizontal radius of the ellipse
      yRadius - Vertical radius of the ellipse
      steps - Number of points in the profile
      startingAngle - To modify the staring angle where the profile starts. By default, it is zero and the first profile points starts at fi = -3*Math.PI/4 The retangular profile starts at the left bottom corner. We need to align the ellipse profile to start at the same angle that's why the - 3*Math.PI/4
  • Method Details

    • getTransformedCopy

      public Profile getTransformedCopy(org.apache.commons.math3.geometry.euclidean.threed.Vector3D translation, org.apache.commons.math3.geometry.euclidean.threed.Rotation rot)
      Makes a copy of this profile with the given translation and rotation.
      Parameters:
      translation - distance to add
      rot - rotation to apply to profile
      Returns:
      a copy of the profile with the given translation and rotation
    • getPoints

      public List<org.apache.commons.math3.geometry.euclidean.threed.Vector3D> getPoints()
      Gets the list of points that make up the profile.
      Returns:
      The list of points.
    • getOrigin

      public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getOrigin()
      Gets the origin of the profile.
      Returns:
      Vector3D of the origin.
    • toString

      public String toString()
      Returns the points in the profile as string for debugging. One point per line
      Overrides:
      toString in class Object
    • isDefaultProfile

      public boolean isDefaultProfile()
      Returns:
      A flag indicating if this is a default profile for the beam region. We use this property to detect overlapping vacuum chambers.
    • setDefaultProfile

      public void setDefaultProfile(boolean defaultProfile)