Package org.anchoranalysis.mpp.mark
Class Mark
Object
Mark
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
LineSegment
,MarkWithPosition
,PointListBase
Abstract base class representing a mark in 3D space.
A mark is a geometric shape with various properties and operations.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract BoundingBox
box
(Dimensions dimensions, int regionID) Calculates the bounding box for a specific region of the mark.abstract BoundingBox
boxAllRegions
(Dimensions dimensions) Calculates the bounding box for all regions of the mark.abstract Point3d
Returns the center point of the mark.deriveObject
(Dimensions dimensions, RegionMembershipWithFlags region, BinaryValuesByte binaryValues) Creates an ObjectMask representation of the mark.abstract Mark
Creates a duplicate of this mark.boolean
equalsDeep
(Mark mark) Checks if this mark is deeply equal to another mark.boolean
Checks if this mark has the same ID as another object.int
Gets the identifier of the mark.abstract String
getName()
Returns the name of this mark type.Returns a string identifier for the mark.abstract byte
isPointInside
(Point3i point) Determines if a point is inside the mark.abstract int
Returns the number of dimensions of this mark.abstract int
Returns the number of regions in this mark.Provides an optional quick overlap calculation method.abstract void
scale
(ScaleFactor scaleFactor) Scales the mark in X and Y dimensions.void
setId
(int id) Sets the identifier of the mark.abstract double
volume
(int regionID) Calculates the volume of a specific region of the mark.
-
Constructor Details
-
Mark
Copy constructor.- Parameters:
source
- source mark to copy from
-
Mark
public Mark()
-
-
Method Details
-
isPointInside
Determines if a point is inside the mark.- Parameters:
point
- the point to check- Returns:
- a byte representing the region membership of the point
-
duplicate
Creates a duplicate of this mark.- Returns:
- a new Mark instance that is a copy of this one
-
numberRegions
public abstract int numberRegions()Returns the number of regions in this mark.- Returns:
- the number of regions
-
getName
Returns the name of this mark type.- Returns:
- the name of the mark
-
quickOverlap
Provides an optional quick overlap calculation method.- Returns:
- an Optional containing a QuickOverlapCalculation, or empty if not available
-
volume
public abstract double volume(int regionID) Calculates the volume of a specific region of the mark.- Parameters:
regionID
- the ID of the region- Returns:
- the volume of the region
-
scale
Scales the mark in X and Y dimensions.- Parameters:
scaleFactor
- how much to scale by- Throws:
CheckedUnsupportedOperationException
- if scaling is not supported for this mark type
-
numberDimensions
public abstract int numberDimensions()Returns the number of dimensions of this mark.- Returns:
- the number of dimensions
-
centerPoint
Returns the center point of the mark.- Returns:
- the center point as a Point3d
-
box
Calculates the bounding box for a specific region of the mark.- Parameters:
dimensions
- the dimensions of the spaceregionID
- the ID of the region- Returns:
- the bounding box
-
boxAllRegions
Calculates the bounding box for all regions of the mark.- Parameters:
dimensions
- the dimensions of the space- Returns:
- the bounding box
-
equalsID
Checks if this mark has the same ID as another object.- Parameters:
obj
- the object to compare with- Returns:
- true if the IDs are the same, false otherwise
-
equalsDeep
Checks if this mark is deeply equal to another mark.- Parameters:
mark
- the mark to compare with- Returns:
- true if the marks are deeply equal, false otherwise
-
deriveObject
public ObjectMask deriveObject(Dimensions dimensions, RegionMembershipWithFlags region, BinaryValuesByte binaryValues) Creates an ObjectMask representation of the mark.- Parameters:
dimensions
- the dimensions of the spaceregion
- the region membership to considerbinaryValues
- the binary values to use for encoding- Returns:
- an ObjectMask representing the mark
-
identifier
Returns a string identifier for the mark.- Returns:
- a string representation of the mark's ID
-
getIdentifier
public int getIdentifier()Gets the identifier of the mark.- Returns:
- the mark's ID
-
setId
public void setId(int id) Sets the identifier of the mark.- Parameters:
id
- the ID to set
-