Interface ILspStampLocationLabelPainter
- All Superinterfaces:
ILspLabelPainter
,ILspPainter
,ILspPaintGroupsChangeListener
- All Known Implementing Classes:
TLspLabelPainter
ILspLabelPainter
extension that adds support for ALspStampLabelLocation
s.
ILspStampLocationLabelPainter
extends ILspLabelPainter
by imposing an additional requirement:
the label size must not depend on the label location. So you can think of it as a fixed stamp, that is only moved
and rotated to avoid label overlap, but does not change size. As this allows labeling algorithms to work more
efficiently, most of the Lightspeed labeling facility works with stamp labels.
The exact location of this label can be interpreted using the following methods:
labelAnchorPointSFCT
: the stamp label location specifies the location of this anchor point.labelDimensionSFCT
: returns the dimension of this label. CallinglabelBoundsSFCT
using anALspStampLabelLocation
should return bounds with the same dimension as returned by this method.labelAnchorPointOffsetSFCT
: returns the offset of the anchor point, relative to the upper left corner of the bounds, assuming the rotation is0
.worldObjectAnchorPointSFCT
: the anchor point of the label is defined relative to this point, unless it is a label of an other label.viewObjectAnchorPointSFCT
: the anchor point of the label is defined relative to this point, if it is a label of an other label. In this case theworld offset
is ignored.
This interface makes a few assumptions:
- The size of the label should not depend on the label location.
- The anchor point should not depend on the label location. I.e. : the (unrotated) offset between the upper left corner of the bounds and the anchor point should always be the same for a label.
- Since:
- 2012.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.luciad.view.lightspeed.layer.paintgroup.ILspPaintGroupsChangeListener
ILspPaintGroupsChangeListener.Callback
-
Method Summary
Modifier and TypeMethodDescriptionvoid
labelAnchorPointOffsetSFCT
(TLspLabelID aLabel, Dimension2D aDimension, TLspPaintState aPaintState, TLspContext aContext, ILcd2DEditablePoint aOffsetSFCT) Returns the anchor point offset.void
labelDimensionSFCT
(TLspLabelID aLabelID, TLspPaintState aPaintState, TLspContext aContext, Dimension2D aDimensionSFCT) Returns the dimension of the given label.void
viewObjectAnchorPointSFCT
(TLspLabelID aLabel, ALspLabelLocations aLabelLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditablePoint aObjectAnchorPointSFCT) Calculates the object anchor point for the given label in view coordinates.void
worldObjectAnchorPointSFCT
(TLspLabelID aLabel, ALspLabelLocations aLabelLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditablePoint aObjectAnchorPointSFCT) Calculates the object anchor point for the given label in world coordinates.Methods inherited from interface com.luciad.view.lightspeed.painter.label.ILspLabelPainter
getAnchorObject, getLabelIDs, labelAnchorPointSFCT, labelBoundsSFCT
Methods inherited from interface com.luciad.view.lightspeed.painter.ILspPainter
addPropertyChangeListener, getRequiredOpenGLProfile, getStyler, paintObjects, query, registerLayer, removePropertyChangeListener, unregisterLayer
Methods inherited from interface com.luciad.view.lightspeed.layer.paintgroup.ILspPaintGroupsChangeListener
commitChanges, prepareChanges
-
Method Details
-
labelDimensionSFCT
void labelDimensionSFCT(TLspLabelID aLabelID, TLspPaintState aPaintState, TLspContext aContext, Dimension2D aDimensionSFCT) throws TLcdNoBoundsException Returns the dimension of the given label. Since the dimension shouldn't depend on the location of the label, noALspLabelLocation
is passed in this method.- Parameters:
aLabelID
- the identifier of the label for which to calculate the dimension.aPaintState
- the paint state.aContext
- the context.aDimensionSFCT
- the object in which to store the dimension.- Throws:
TLcdNoBoundsException
- when the dimension of the label could not be calculated.
-
labelAnchorPointOffsetSFCT
void labelAnchorPointOffsetSFCT(TLspLabelID aLabel, Dimension2D aDimension, TLspPaintState aPaintState, TLspContext aContext, ILcd2DEditablePoint aOffsetSFCT) Returns the anchor point offset. This value is the offset of the anchor point, relative to the upper left corner of the bounds, assuming the rotation is0
.By default this method returns an offset of
(width / 2, height / 2)
. Since the anchor offset shouldn't depend on the location of the label, noALspLabelLocation
is passed in this method.- Parameters:
aLabel
- a label.aDimension
- the dimension of the label.aPaintState
- the paint state.aContext
- the context.aOffsetSFCT
- the point in which the anchor point offset will be stored.
-
worldObjectAnchorPointSFCT
void worldObjectAnchorPointSFCT(TLspLabelID aLabel, ALspLabelLocations aLabelLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditablePoint aObjectAnchorPointSFCT) throws TLcdNoBoundsException Calculates the object anchor point for the given label in world coordinates.
Note : the returned point should not depend on the given label location. I.e. it should be the same point for every stamp label location.
If the given label is anchored to another label, i.e.
getAnchorObject
returns aTLspLabelID
, this method will throw aTLcdNoBoundsException
.- Parameters:
aLabel
- the identifier of the label for which to calculate the anchor point.aLabelLocations
- context information. Can be used when a label depends on an other label.aPaintState
- the paint state.aContext
- the context.aObjectAnchorPointSFCT
- the point in which to store the object anchor point.- Throws:
TLcdNoBoundsException
- when the label is anchored to aTLspLabelID
or when the object anchor point could not be calculated.
-
viewObjectAnchorPointSFCT
void viewObjectAnchorPointSFCT(TLspLabelID aLabel, ALspLabelLocations aLabelLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditablePoint aObjectAnchorPointSFCT) throws TLcdNoBoundsException Calculates the object anchor point for the given label in view coordinates.Note : the returned point should not depend on the given label location. I.e. it should be the same point for every stamp label location.
- Parameters:
aLabel
- the identifier of the label for which to calculate the anchor point.aLabelLocations
- context information. Can be used when a label depends on an other label.aPaintState
- the paint state.aContext
- the context.aObjectAnchorPointSFCT
- the point in which to store the object anchor point.- Throws:
TLcdNoBoundsException
- when the object anchor point could not be calculated.
-