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.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.toString()
void
update
(Point2d distanceToLeftBottom, Point2d distanceToRightTop, Orientation orientation) Updates the bounding box with new dimensions and orientation.double
volume
(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, setPosition
Methods 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: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
-
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: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
-
box
Description copied from class:Mark
Calculates the bounding box for a specific region of the mark. -
volume
public double volume(int regionID) Description copied from class:Mark
Calculates the volume of a specific region of the mark. -
duplicate
Description copied from class:Mark
Creates a duplicate of this mark. -
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
-
getName
Description copied from class:Mark
Returns the name of this mark type. -
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
-
scale
Description copied from class:Mark
Scales the mark in X and Y dimensions.- Overrides:
scale
in classMarkWithPosition
- Parameters:
scaleFactor
- how much to scale by- Throws:
CheckedUnsupportedOperationException
- if scaling is not supported for this mark type
-