Class LineSegment
- All Implemented Interfaces:
Serializable
Represents a line segment in 3D space as a Mark.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLineSegment
(Point3i startPoint, Point3i endPoint) Constructs a LineSegment with given start and end points. -
Method Summary
Modifier and TypeMethodDescriptionbox
(Dimensions dimensions, int regionID) Calculates the bounding box for a specific region of the mark.boxAllRegions
(Dimensions dimensions) Calculates the bounding box for all regions of the mark.Returns the center point of the mark.Creates a duplicate of this mark.Gets the direction vector of the line segment.Gets the end point of the line segment.getName()
Returns the name of this mark type.Gets the start point of the line segment.byte
isPointInside
(Point3i point) Determines if a point is inside the mark.int
Returns the number of dimensions of this mark.int
Returns the number of regions in this mark.void
scale
(ScaleFactor scaleFactor) Scales the mark in X and Y dimensions.void
Sets the start and end points of the line segment.void
Sets the start and end points of the line segment.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
-
Constructor Details
-
LineSegment
Constructs a LineSegment with given start and end points.- Parameters:
startPoint
- the start point of the line segmentendPoint
- the end point of the line segment
-
LineSegment
public LineSegment()
-
-
Method Details
-
isPointInside
Description copied from class:Mark
Determines if a point is inside the mark.- Specified by:
isPointInside
in classMark
- Parameters:
point
- the point to check- Returns:
- a byte representing the region membership of the point
-
box
Description copied from class:Mark
Calculates the bounding box for a specific region of the mark. -
duplicate
Description copied from class:Mark
Creates a duplicate of this mark. -
volume
public double volume(int regionID) Description copied from class:Mark
Calculates the volume of a specific region of the mark. -
toString
-
numberDimensions
public int numberDimensions()Description copied from class:Mark
Returns the number of dimensions of this mark.- Specified by:
numberDimensions
in classMark
- Returns:
- the number of dimensions
-
getName
Description copied from class:Mark
Returns the name of this mark type. -
scale
Description copied from class:Mark
Scales the mark in X and Y dimensions. -
centerPoint
Description copied from class:Mark
Returns the center point of the mark.- Specified by:
centerPoint
in classMark
- Returns:
- the center point as a Point3d
-
setPoints
Sets the start and end points of the line segment.- Parameters:
startPoint
- the start pointendPoint
- the end point
-
setPoints
Sets the start and end points of the line segment.- Parameters:
startPoint
- the start pointendPoint
- the end point
-
getStartPoint
Gets the start point of the line segment.- Returns:
- the start point
-
getEndPoint
Gets the end point of the line segment.- Returns:
- the end point
-
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 classMark
- Returns:
- the number of regions
-
boxAllRegions
Description copied from class:Mark
Calculates the bounding box for all regions of the mark.- Specified by:
boxAllRegions
in classMark
- Parameters:
dimensions
- the dimensions of the space- Returns:
- the bounding box
-