Class MarkWithPositionAndSingleRadius
Object
Mark
MarkWithPosition
MarkWithPositionAndSingleRadius
- All Implemented Interfaces:
Serializable
public abstract class MarkWithPositionAndSingleRadius
extends MarkWithPosition
implements Serializable
Base-class for a conic that has a single radius (circle, sphere etc.)
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
protected
MarkWithPositionAndSingleRadius
(Bound boundRadius) Constructor with a bound on the radius.protected
Copy constructor. -
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.boolean
equalsDeep
(Mark mark) Checks if this mark is equal to another mark by comparing all attributes.double
final byte
isPointInside
(Point3i point) Determines if a point is inside the mark.int
Returns the number of regions in this mark.Provides an optional quick overlap calculation method.protected double
radiusForRegion
(int regionID) Calculates the radius for a specific region.protected double
radiusForRegionSquared
(int regionID) Calculates the squared radius for a specific region.void
scale
(ScaleFactor scaleFactor) Objects are scaled in pre-rotated position.void
setRadius
(double radius) Sets the radius of the mark.strMarks()
Returns a string representation of the mark's attributes.Methods inherited from class org.anchoranalysis.mpp.mark.MarkWithPosition
centerPoint, getPosition, positionString, setPosition
Methods inherited from class org.anchoranalysis.mpp.mark.Mark
deriveObject, duplicate, equalsID, getIdentifier, getName, identifier, numberDimensions, setId, volume
-
Constructor Details
-
MarkWithPositionAndSingleRadius
Constructor with a bound on the radius.- Parameters:
boundRadius
- the bound for the radius
-
MarkWithPositionAndSingleRadius
Copy constructor.- Parameters:
src
- the source object to copy from
-
MarkWithPositionAndSingleRadius
protected MarkWithPositionAndSingleRadius()
-
-
Method Details
-
scale
Objects are scaled in pre-rotated position.So when aligned to axes, we actually scale in all 3 dimensions, and ignore scene-resolution
- Overrides:
scale
in classMarkWithPosition
- Parameters:
scaleFactor
- how much to scale by- Throws:
CheckedUnsupportedOperationException
- when the scale-factor is not identical for the X and Y dimensions.
-
box
Description copied from class:Mark
Calculates the bounding box for a specific region of the mark. -
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
-
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
-
quickOverlap
Description copied from class:Mark
Provides an optional quick overlap calculation method.- Overrides:
quickOverlap
in classMark
- Returns:
- an Optional containing a QuickOverlapCalculation, or empty if not available
-
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
-
equalsDeep
Description copied from class:MarkWithPosition
Checks if this mark is equal to another mark by comparing all attributes.- Overrides:
equalsDeep
in classMarkWithPosition
- Parameters:
mark
- the mark to compare with- Returns:
- true if the marks are equal, false otherwise
-
strMarks
Returns a string representation of the mark's attributes.- Returns:
- a string containing the radius value
-
setRadius
public void setRadius(double radius) Sets the radius of the mark.- Parameters:
radius
- the new radius value
-
radiusForRegion
protected double radiusForRegion(int regionID) Calculates the radius for a specific region.- Parameters:
regionID
- the ID of the region- Returns:
- the radius for the specified region
-
radiusForRegionSquared
protected double radiusForRegionSquared(int regionID) Calculates the squared radius for a specific region.- Parameters:
regionID
- the ID of the region- Returns:
- the squared radius for the specified region
-
getRadius
public double getRadius() -
getBoundRadius
-