Class LineSegment

Object
org.anchoranalysis.mpp.mark.Mark
org.anchoranalysis.mpp.mark.points.LineSegment
All Implemented Interfaces:
Serializable

public class LineSegment
extends Mark
Represents a line segment in 3D space as a Mark.
See Also:
Serialized Form
  • Constructor Summary

    Constructors 
    Constructor Description
    LineSegment()  
    LineSegment​(org.anchoranalysis.spatial.point.Point3i startPoint, org.anchoranalysis.spatial.point.Point3i endPoint)
    Constructs a LineSegment with given start and end points.
  • Method Summary

    Modifier and Type Method Description
    org.anchoranalysis.spatial.box.BoundingBox box​(Dimensions dimensions, int regionID)
    Calculates the bounding box for a specific region of the mark.
    org.anchoranalysis.spatial.box.BoundingBox boxAllRegions​(Dimensions dimensions)
    Calculates the bounding box for all regions of the mark.
    org.anchoranalysis.spatial.point.Point3d centerPoint()
    Returns the center point of the mark.
    Mark duplicate()
    Creates a duplicate of this mark.
    org.anchoranalysis.spatial.point.Point3d getDirectionVector()
    Gets the direction vector of the line segment.
    org.anchoranalysis.spatial.point.Point3d getEndPoint()
    Gets the end point of the line segment.
    String getName()
    Returns the name of this mark type.
    org.anchoranalysis.spatial.point.Point3d getStartPoint()
    Gets the start point of the line segment.
    byte isPointInside​(org.anchoranalysis.spatial.point.Point3i point)
    Determines if a point is inside the mark.
    int numberDimensions()
    Returns the number of dimensions of this mark.
    int numberRegions()
    Returns the number of regions in this mark.
    void scale​(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor)
    Scales the mark in X and Y dimensions.
    void setPoints​(org.anchoranalysis.spatial.point.Point3d startPoint, org.anchoranalysis.spatial.point.Point3d endPoint)
    Sets the start and end points of the line segment.
    void setPoints​(org.anchoranalysis.spatial.point.Point3i startPoint, org.anchoranalysis.spatial.point.Point3i endPoint)
    Sets the start and end points of the line segment.
    String toString()  
    double volume​(int regionID)
    Calculates the volume of a specific region of the mark.

    Methods inherited from class org.anchoranalysis.mpp.mark.Mark

    deriveObject, equalsDeep, equalsID, getIdentifier, identifier, quickOverlap, setId

    Methods inherited from class java.lang.Object

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

    • LineSegment

      public LineSegment​(org.anchoranalysis.spatial.point.Point3i startPoint, org.anchoranalysis.spatial.point.Point3i endPoint)
      Constructs a LineSegment with given start and end points.
      Parameters:
      startPoint - the start point of the line segment
      endPoint - the end point of the line segment
    • LineSegment

      public LineSegment()
  • Method Details

    • isPointInside

      public byte isPointInside​(org.anchoranalysis.spatial.point.Point3i point)
      Description copied from class: Mark
      Determines if a point is inside the mark.
      Specified by:
      isPointInside in class Mark
      Parameters:
      point - the point to check
      Returns:
      a byte representing the region membership of the point
    • box

      public org.anchoranalysis.spatial.box.BoundingBox box​(Dimensions dimensions, int regionID)
      Description copied from class: Mark
      Calculates the bounding box for a specific region of the mark.
      Specified by:
      box in class Mark
      Parameters:
      dimensions - the dimensions of the space
      regionID - the ID of the region
      Returns:
      the bounding box
    • duplicate

      public Mark duplicate()
      Description copied from class: Mark
      Creates a duplicate of this mark.
      Specified by:
      duplicate in class Mark
      Returns:
      a new Mark instance that is a copy of this one
    • volume

      public double volume​(int regionID)
      Description copied from class: Mark
      Calculates the volume of a specific region of the mark.
      Specified by:
      volume in class Mark
      Parameters:
      regionID - the ID of the region
      Returns:
      the volume of the region
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • numberDimensions

      public int numberDimensions()
      Description copied from class: Mark
      Returns the number of dimensions of this mark.
      Specified by:
      numberDimensions in class Mark
      Returns:
      the number of dimensions
    • getName

      public String getName()
      Description copied from class: Mark
      Returns the name of this mark type.
      Specified by:
      getName in class Mark
      Returns:
      the name of the mark
    • scale

      public void scale​(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor)
      Description copied from class: Mark
      Scales the mark in X and Y dimensions.
      Specified by:
      scale in class Mark
      Parameters:
      scaleFactor - how much to scale by
    • centerPoint

      public org.anchoranalysis.spatial.point.Point3d centerPoint()
      Description copied from class: Mark
      Returns the center point of the mark.
      Specified by:
      centerPoint in class Mark
      Returns:
      the center point as a Point3d
    • setPoints

      public void setPoints​(org.anchoranalysis.spatial.point.Point3i startPoint, org.anchoranalysis.spatial.point.Point3i endPoint)
      Sets the start and end points of the line segment.
      Parameters:
      startPoint - the start point
      endPoint - the end point
    • setPoints

      public void setPoints​(org.anchoranalysis.spatial.point.Point3d startPoint, org.anchoranalysis.spatial.point.Point3d endPoint)
      Sets the start and end points of the line segment.
      Parameters:
      startPoint - the start point
      endPoint - the end point
    • getStartPoint

      public org.anchoranalysis.spatial.point.Point3d getStartPoint()
      Gets the start point of the line segment.
      Returns:
      the start point
    • getEndPoint

      public org.anchoranalysis.spatial.point.Point3d getEndPoint()
      Gets the end point of the line segment.
      Returns:
      the end point
    • getDirectionVector

      public org.anchoranalysis.spatial.point.Point3d getDirectionVector()
      Gets the direction vector of the line segment.
      Returns:
      the direction vector
    • numberRegions

      public int numberRegions()
      Description copied from class: Mark
      Returns the number of regions in this mark.
      Specified by:
      numberRegions in class Mark
      Returns:
      the number of regions
    • boxAllRegions

      public org.anchoranalysis.spatial.box.BoundingBox boxAllRegions​(Dimensions dimensions)
      Description copied from class: Mark
      Calculates the bounding box for all regions of the mark.
      Specified by:
      boxAllRegions in class Mark
      Parameters:
      dimensions - the dimensions of the space
      Returns:
      the bounding box