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 shapeint
Calculates the rectangle's heightGets the origin pointGets points to be projected.Gets the resize pointint
getWidth()
Calculates the rectangle's widthboolean
selectPoint
(Point location) Selects a point for further manipulationvoid
void
void
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
getSamplingStrength, getSelectedPoint, getShiftPoint, 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
getSelectedPoint, getShiftPoint, setSamplingStrength, setSelectedPoint, setShiftPoint, updateSelectedPoint
-
Constructor Details
-
SurfaceMaskRectangleImpl
public SurfaceMaskRectangleImpl()Paremeterless constructor -
SurfaceMaskRectangleImpl
Copy constructor- Parameters:
mask
- to copy
-
-
Method Details
-
getOrigin
Description copied from interface:SurfaceMaskRectangle
Gets the origin point- Specified by:
getOrigin
in interfaceSurfaceMaskRectangle
- Returns:
- origin point
-
setOrigin
-
getResize
Description copied from interface:SurfaceMaskRectangle
Gets the resize point- Specified by:
getResize
in interfaceSurfaceMaskRectangle
- Returns:
- resize point
-
setResize
-
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
-
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
-