Class RotatableBoundingBox
Object
org.anchoranalysis.mpp.mark.Mark
org.anchoranalysis.mpp.mark.MarkWithPosition
org.anchoranalysis.mpp.mark.points.RotatableBoundingBox
- All Implemented Interfaces:
Serializable
public class RotatableBoundingBox extends MarkWithPosition
A two-dimensional bounding-box rotated at arbitrary angle in XY plane around a point.
Axis-aligned bounding boxes are also supported by fixing orientation.
- Author:
- Owen Feehan
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description RotatableBoundingBox()Creates a new RotatableBoundingBox with default values. -
Method Summary
Modifier and Type Method Description org.anchoranalysis.spatial.box.BoundingBoxbox(Dimensions dimensions, int regionID)Calculates the bounding box for a specific region of the mark.org.anchoranalysis.spatial.box.BoundingBoxboxAllRegions(Dimensions dimensions)Calculates the bounding box for all regions of the mark.Markduplicate()Creates a duplicate of this mark.StringgetName()Returns the name of this mark type.byteisPointInside(org.anchoranalysis.spatial.point.Point3i point)Determines if a point is inside the mark.intnumberDimensions()Returns the number of dimensions of this mark.intnumberRegions()Returns the number of regions in this mark.voidscale(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor)Scales the mark in X and Y dimensions.StringtoString()voidupdate(org.anchoranalysis.spatial.point.Point2d distanceToLeftBottom, org.anchoranalysis.spatial.point.Point2d distanceToRightTop, org.anchoranalysis.spatial.orientation.Orientation orientation)Updates the bounding box with new dimensions and orientation.doublevolume(int regionID)Calculates the volume of a specific region of the mark.Methods inherited from class org.anchoranalysis.mpp.mark.MarkWithPosition
centerPoint, equalsDeep, getPosition, positionString, setPositionMethods inherited from class org.anchoranalysis.mpp.mark.Mark
deriveObject, equalsID, getIdentifier, identifier, quickOverlap, setId
-
Constructor Details
-
RotatableBoundingBox
public RotatableBoundingBox()Creates a new RotatableBoundingBox with default values.
-
-
Method Details
-
isPointInside
public byte isPointInside(org.anchoranalysis.spatial.point.Point3i point)Description copied from class:MarkDetermines if a point is inside the mark.- Specified by:
isPointInsidein classMark- Parameters:
point- the point to check- Returns:
- a byte representing the region membership of the point
-
update
public void update(org.anchoranalysis.spatial.point.Point2d distanceToLeftBottom, org.anchoranalysis.spatial.point.Point2d distanceToRightTop, org.anchoranalysis.spatial.orientation.Orientation orientation)Updates the bounding box with new dimensions and orientation.- Parameters:
distanceToLeftBottom- the distance to the left-bottom cornerdistanceToRightTop- the distance to the right-top cornerorientation- the orientation of the bounding box
-
boxAllRegions
Description copied from class:MarkCalculates the bounding box for all regions of the mark.- Specified by:
boxAllRegionsin classMark- Parameters:
dimensions- the dimensions of the space- Returns:
- the bounding box
-
box
Description copied from class:MarkCalculates the bounding box for a specific region of the mark. -
volume
public double volume(int regionID)Description copied from class:MarkCalculates the volume of a specific region of the mark. -
duplicate
Description copied from class:MarkCreates a duplicate of this mark. -
numberRegions
public int numberRegions()Description copied from class:MarkReturns the number of regions in this mark.- Specified by:
numberRegionsin classMark- Returns:
- the number of regions
-
getName
Description copied from class:MarkReturns the name of this mark type. -
toString
-
numberDimensions
public int numberDimensions()Description copied from class:MarkReturns the number of dimensions of this mark.- Specified by:
numberDimensionsin classMark- Returns:
- the number of dimensions
-
scale
public void scale(org.anchoranalysis.spatial.scale.ScaleFactor scaleFactor) throws CheckedUnsupportedOperationExceptionDescription copied from class:MarkScales the mark in X and Y dimensions.- Overrides:
scalein classMarkWithPosition- Parameters:
scaleFactor- how much to scale by- Throws:
CheckedUnsupportedOperationException- if scaling is not supported for this mark type
-