Class RotatableBoundingBox
Object
Mark
MarkWithPosition
RotatableBoundingBox
- All Implemented Interfaces:
Serializable
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:
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new RotatableBoundingBox with default values. -
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.Creates a duplicate of this mark.getName()Returns the name of this mark type.byteisPointInside(Point3i point) Determines if a point is inside the mark.intReturns the number of dimensions of this mark.intReturns the number of regions in this mark.voidscale(ScaleFactor scaleFactor) Scales the mark in X and Y dimensions.toString()voidupdate(Point2d distanceToLeftBottom, Point2d distanceToRightTop, 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
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(Point2d distanceToLeftBottom, Point2d distanceToRightTop, 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
Description 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
-