Class SurfaceMaskRectangleImpl
java.lang.Object
cz.fidentis.analyst.data.surfacemask.impl.SurfaceMask2DImpl
cz.fidentis.analyst.data.surfacemask.impl.SurfaceMaskRectangleImpl
- All Implemented Interfaces:
SurfaceMask2D
,SurfaceMaskRectangle
- Direct Known Subclasses:
SurfaceMaskEllipseImpl
A class representing a 2D surface mask in the shape of a rectangle
-
Nested Class Summary
Nested classes/interfaces inherited from interface cz.fidentis.analyst.data.surfacemask.SurfaceMask2D
SurfaceMask2D.PointToProject
-
Field Summary
Fields inherited from interface cz.fidentis.analyst.data.surfacemask.SurfaceMaskRectangle
DEFAULT_SIZE, POINT_SIZE
-
Constructor Summary
ConstructorsConstructorDescriptionParemeterless constructorCopy constructor -
Method Summary
Modifier and TypeMethodDescriptionboolean
addNewPoint
(Point point) Define a new point for the maskboolean
containsPoint
(Point middle) Checks if point is inside of surface mask shapeRetrieves the points representing the bounding shape (e.g., rectangle) around the ellipse.int
Calculates the rectangle's heightGets points to be projected.Gets the resize pointint
getWidth()
Calculates the rectangle's widthboolean
selectPoint
(Point location) Selects a point for further manipulationvoid
Sets the resize pointvoid
shiftMask
(int dx, int dy) Shifts the mask by a delta in the x and y direction.Methods inherited from class cz.fidentis.analyst.data.surfacemask.impl.SurfaceMask2DImpl
getCameraPosition, getColor, getOrigin, getSamplingStrength, getSelectedPoint, getShiftPoint, setCameraPosition, setColor, setOrigin, setSamplingStrength, setSelectedPoint, setShiftPoint, updateSelectedPoint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface cz.fidentis.analyst.data.surfacemask.SurfaceMask2D
getCameraPosition, getColor, getOrigin, getSelectedPoint, getShiftPoint, setCameraPosition, setColor, setOrigin, setSamplingStrength, setSelectedPoint, setShiftPoint, updateSelectedPoint
-
Constructor Details
-
SurfaceMaskRectangleImpl
public SurfaceMaskRectangleImpl()Paremeterless constructor -
SurfaceMaskRectangleImpl
Copy constructor- Parameters:
mask
- to copy
-
-
Method Details
-
getResize
Description copied from interface:SurfaceMask2D
Gets the resize point- Specified by:
getResize
in interfaceSurfaceMask2D
- Specified by:
getResize
in interfaceSurfaceMaskRectangle
- Overrides:
getResize
in classSurfaceMask2DImpl
- Returns:
- resize point
-
setResize
Description copied from interface:SurfaceMask2D
Sets the resize point- Specified by:
setResize
in interfaceSurfaceMask2D
- Overrides:
setResize
in classSurfaceMask2DImpl
- Parameters:
resize
- point to be set
-
getWidth
public int getWidth()Calculates the rectangle's width- Specified by:
getWidth
in interfaceSurfaceMaskRectangle
- Returns:
- the width as a positive integer
-
getHeight
public int getHeight()Calculates the rectangle's height- Specified by:
getHeight
in interfaceSurfaceMaskRectangle
- Returns:
- the height as a positive integer
-
getPointsToProject
Description copied from interface:SurfaceMask2D
Gets points to be projected.- Specified by:
getPointsToProject
in interfaceSurfaceMask2D
- Specified by:
getPointsToProject
in classSurfaceMask2DImpl
- Returns:
- a list of Point
-
shiftMask
public void shiftMask(int dx, int dy) Description copied from interface:SurfaceMask2D
Shifts the mask by a delta in the x and y direction. Delta is calculated from the previous and the current shift point- Specified by:
shiftMask
in interfaceSurfaceMask2D
- Specified by:
shiftMask
in classSurfaceMask2DImpl
- Parameters:
dx
- delta in the x directiondy
- delta in the y direction
-
getBoundingPoints
Description copied from interface:SurfaceMask2D
Retrieves the points representing the bounding shape (e.g., rectangle) around the ellipse. These points define the corners or edges of the bounding shape that encapsulates the ellipse. If mask is not ellipse returns null- Specified by:
getBoundingPoints
in interfaceSurfaceMask2D
- Returns:
- a list of
SurfaceMask2D.PointToProject
representing the bounding points.
-
containsPoint
Checks if point is inside of surface mask shape- Specified by:
containsPoint
in interfaceSurfaceMask2D
- Specified by:
containsPoint
in classSurfaceMask2DImpl
- Parameters:
middle
- location to check- Returns:
- true if inside else false
-
selectPoint
Description copied from interface:SurfaceMask2D
Selects a point for further manipulation- Specified by:
selectPoint
in interfaceSurfaceMask2D
- Specified by:
selectPoint
in classSurfaceMask2DImpl
- Parameters:
location
- of the point to select- Returns:
- true if selected
-
addNewPoint
Description copied from interface:SurfaceMask2D
Define a new point for the mask- Specified by:
addNewPoint
in interfaceSurfaceMask2D
- Specified by:
addNewPoint
in classSurfaceMask2DImpl
- Parameters:
point
- new point to add- Returns:
- true if addition succeded
-