Class TLcdMultilevelGridUtil
java.lang.Object
com.luciad.view.map.multilevelgrid.TLcdMultilevelGridUtil
A utility class for multilevel grid coordinates. It enables to:
- find the location of a multilevel grid coordinate in the reference on which the grid is based,
- find the bounds of a multilevel grid coordinate in the reference on which the grid is based,
- find the multilevel coordinate at a given level that covers a location expressed in the reference on which the grid is based,
- apply a function to all multilevel coordinates at a given level that overlap with a bounds given in the reference on which the grid is based.
- Since:
- 7.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Designates to return the center right point for aILcdMultilevelGridCoordinate
.static final int
Designates to return the lower left point for aILcdMultilevelGridCoordinate
.static final int
Designates to return the lower right point for aILcdMultilevelGridCoordinate
.static final int
Designates to return the upper left point for aILcdMultilevelGridCoordinate
.static final int
Designates to return the upper right point for aILcdMultilevelGridCoordinate
. -
Method Summary
Modifier and TypeMethodDescriptionstatic int
applyOnInteract
(ILcdBounds aBounds, ILcdFunction aFunction, int aLevel, ILcdMultilevelGrid aGrid, ILcdGeoReference aGeoReference) Finds allILcdMultilevelGridCoordinate
defined with regard to aILcdMultilevelGrid
passed at a given level that are inside the bounds passed and applies the function passed on them.static void
multilevelCoordinateAtSFCT
(ILcdPoint aPoint, int aNumberOfLevels, ILcdMultilevelGrid aMultilevelGrid, ILcdGeoReference aGeoReference, ILcdEditableMultilevelGridCoordinate aEditableMultilevelCoordinateSFCT) Finds the multilevel coordinate with the given number of levels specified that covers the point passed.static void
multilevelCoordinateBoundsSFCT
(ILcdMultilevelGridCoordinate aMultilevelGridCoordinate, ILcdMultilevelGrid aMultilevelGrid, ILcd2DEditableBounds a2DEditableBoundsSFCT) Moves a bounds, expressed with regard to the reference on which a coordinates grid is based, so that it coincides with the multilevel coordinate given.static void
pointAtSFCT
(ILcdMultilevelGridCoordinate aMultilevelGridCoordinate, ILcdMultilevelGrid aMultilevelGrid, int aRelativeLocation, ILcd2DEditablePoint aPointSFCT) Moves a point to the lower left corner of theILcdMultilevelGridCoordinate
passed.
-
Field Details
-
LOWER_LEFT
public static final int LOWER_LEFTDesignates to return the lower left point for aILcdMultilevelGridCoordinate
.- See Also:
-
LOWER_RIGHT
public static final int LOWER_RIGHTDesignates to return the lower right point for aILcdMultilevelGridCoordinate
.- See Also:
-
UPPER_LEFT
public static final int UPPER_LEFTDesignates to return the upper left point for aILcdMultilevelGridCoordinate
.- See Also:
-
UPPER_RIGHT
public static final int UPPER_RIGHTDesignates to return the upper right point for aILcdMultilevelGridCoordinate
.- See Also:
-
CENTER
public static final int CENTERDesignates to return the center right point for aILcdMultilevelGridCoordinate
.- See Also:
-
-
Method Details
-
pointAtSFCT
public static void pointAtSFCT(ILcdMultilevelGridCoordinate aMultilevelGridCoordinate, ILcdMultilevelGrid aMultilevelGrid, int aRelativeLocation, ILcd2DEditablePoint aPointSFCT) throws TLcdOutOfBoundsException Moves a point to the lower left corner of theILcdMultilevelGridCoordinate
passed. The lower left corner is the corner with the smallest coordinates.- Parameters:
aMultilevelGridCoordinate
- a valid multilevel coordinate: the number of specified levels is smaller than the number of levels in the grid passed and the coordinate at each level is less than or equal to the number of subdivisions of the grid at that level.aMultilevelGrid
- the grid with regards to which the coordinate has to be interpreted.aRelativeLocation
- the relative location where the point should be placed, should be one of UPPER_LEFT, LOWER_LEFT, LOWER_RIGHT, UPPER_RIGHT or CENTER.aPointSFCT
- the point to move to the lower left location of the grid element specified by the coordinate passed.- Throws:
TLcdOutOfBoundsException
- when the multilevel coordinate has no levels specified.
-
multilevelCoordinateAtSFCT
public static void multilevelCoordinateAtSFCT(ILcdPoint aPoint, int aNumberOfLevels, ILcdMultilevelGrid aMultilevelGrid, ILcdGeoReference aGeoReference, ILcdEditableMultilevelGridCoordinate aEditableMultilevelCoordinateSFCT) throws TLcdOutOfBoundsException Finds the multilevel coordinate with the given number of levels specified that covers the point passed. If the point is located on the boundary of two or more multilevel grid coordinates the coordinates will always be the lowest possible for every axis.- Parameters:
aPoint
- the point in model space to find the grid coordinate of.aNumberOfLevels
- the number of levels to which the SFCT coordinate should be specified when returning from this method. Note that this number should be one higher than the index of the highest level to be specified.aMultilevelGrid
- the grid with regards to which the SFCT coordinate will be specified.aGeoReference
- the reference in which the point and the multilevel grid are defined.aEditableMultilevelCoordinateSFCT
- the multilevel grid coordinate that corresponds to the point passed at up until the level passed.- Throws:
TLcdOutOfBoundsException
- when the point passed is not inside the grid passed.
-
multilevelCoordinateBoundsSFCT
public static void multilevelCoordinateBoundsSFCT(ILcdMultilevelGridCoordinate aMultilevelGridCoordinate, ILcdMultilevelGrid aMultilevelGrid, ILcd2DEditableBounds a2DEditableBoundsSFCT) throws TLcdNoBoundsException Moves a bounds, expressed with regard to the reference on which a coordinates grid is based, so that it coincides with the multilevel coordinate given.- Parameters:
aMultilevelGridCoordinate
- the multilevel coordinate to find the model bounds for.aMultilevelGrid
- the grid with regard to which the coordinate is defined.a2DEditableBoundsSFCT
- the bounds to move so that it exactly contains the area defined by the multilevel coordinate.- Throws:
TLcdNoBoundsException
- when the multilevel coordinate is not valid in the multilevel grid grid passed.
-
applyOnInteract
public static int applyOnInteract(ILcdBounds aBounds, ILcdFunction aFunction, int aLevel, ILcdMultilevelGrid aGrid, ILcdGeoReference aGeoReference) Finds allILcdMultilevelGridCoordinate
defined with regard to aILcdMultilevelGrid
passed at a given level that are inside the bounds passed and applies the function passed on them. This implementation always passes the sameILcdMultilevelGridCoordinate
to the function. Note that the bounds and the multilevel grid are assumed to be defined in respect of the same model reference.- Parameters:
aBounds
- the bounds to find allILcdMultilevelGridCoordinate
objects in.aFunction
- the function that will be applied to allILcdMultilevelGridCoordinate
that are located in the bounds. OnlyILcdMultilevelGridCoordinate
objects will be passed to the function. This implementation always passes the same object to the function.aLevel
- the exact level up to which theILcdMultilevelGridCoordinate
passed to the function will be specified. Coordinates of higher levels should not be taken into account when handling object in the function.aGrid
- the grid with regard to which theILcdMultilevelGridCoordinate
passed to the function are specified. The grid is assumed to be based on the same reference as the bounds passed.aGeoReference
- the reference in which the point and the multilevel grid are defined.- Returns:
- the number of
ILcdMultilevelGridCoordinate
objects found in the bounds and passed to the function.
-