public interface ILspStampLocationLabelPainter extends ILspLabelPainter
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. Calling
labelBoundsSFCT
using an ALspStampLabelLocation
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 is
0
.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 the
world offset
is ignored.This interface makes a few assumptions:
ILspPaintGroupsChangeListener.Callback
Modifier and Type | Method and Description |
---|---|
void |
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.
|
getAnchorObject, getLabelIDs, labelAnchorPointSFCT, labelBoundsSFCT
addPropertyChangeListener, getRequiredOpenGLProfile, getStyler, paintObjects, query, registerLayer, removePropertyChangeListener, unregisterLayer
commitChanges, prepareChanges
void labelDimensionSFCT(TLspLabelID aLabelID, TLspPaintState aPaintState, TLspContext aContext, Dimension2D aDimensionSFCT) throws TLcdNoBoundsException
ALspLabelLocation
is passed in this method.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.TLcdNoBoundsException
- when the dimension of the label could not be calculated.void labelAnchorPointOffsetSFCT(TLspLabelID aLabel, Dimension2D aDimension, TLspPaintState aPaintState, TLspContext aContext, ILcd2DEditablePoint aOffsetSFCT)
0
. 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, no ALspLabelLocation
is passed in
this method.
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.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 a TLspLabelID
, this method will throw a TLcdNoBoundsException
.
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.TLcdNoBoundsException
- when the label is anchored to a
TLspLabelID
or when the object anchor point could not be calculated.void viewObjectAnchorPointSFCT(TLspLabelID aLabel, ALspLabelLocations aLabelLocations, TLspPaintState aPaintState, TLspContext aContext, ILcd3DEditablePoint aObjectAnchorPointSFCT) throws TLcdNoBoundsException
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.
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.TLcdNoBoundsException
- when the object anchor point could not be calculated.