public static class ALspStampLabelLocation.LocationData extends Object
This object describes the exact location of the anchor point and the rotation of a label:
This location also defines a rotation that will be applied on the label:
The exact location of this label can be interpreted using the methods of
ILspStampLocationLabelPainter
.
Constructor and Description |
---|
LocationData() |
Modifier and Type | Method and Description |
---|---|
void |
getViewOffset(ILcd3DEditablePoint aViewOffsetSFCT)
This method returns the view offset and stores it in the given point.
|
double |
getViewRotation()
Returns the rotation of the label around its anchor point.
|
void |
getWorldOffset(ILcd3DEditablePoint aWorldOffsetSFCT)
This method returns the world offset and stores it in the given point.
|
boolean |
getWorldRotationOffset(ILcd3DEditablePoint aWorldRotationOffsetSFCT)
This method returns a world orientation vector.
|
boolean |
isAbsoluteViewLocation()
Returns if this location is an absolute view locations.
|
boolean |
isViewDependent()
Returns if this location is view dependent.
|
void |
reset()
Resets this object to its default values.
|
void |
setAbsoluteViewLocation(boolean aAbsoluteViewLocation)
Sets if this location is an absolute location.
|
void |
setViewDependent(boolean aViewDependent)
Sets if this location is view dependent.
|
void |
setViewOffset(double aViewOffsetX,
double aViewOffsetY)
Sets the view offset.
|
void |
setViewRotation(double aViewRotation)
Sets the rotation of the label around its anchor point.
|
void |
setWorldOffset(double aWorldOffsetX,
double aWorldOffsetY,
double aWorldOffsetZ)
Sets the world offset.
|
void |
setWorldRotationOffset(double aWorldRotationOffsetX,
double aWorldRotationOffsetY,
double aWorldRotationOffsetZ)
Sets the world rotation offset.
|
String |
toString() |
public void reset()
true
and
the absolute view location flag will be set to true
.public boolean isViewDependent()
true
.setViewDependent(boolean)
public void setViewDependent(boolean aViewDependent)
aViewDependent
- true
if this location is view dependent.isViewDependent()
public boolean isAbsoluteViewLocation()
true
, this location is anchored to the screen bounds. In that case, only
the getViewOffset
and getViewRotation
methods are relevant.
Also, the isViewDependent
method should return false
,
since an absolute view location does not depend on the world to view transformation.public void setAbsoluteViewLocation(boolean aAbsoluteViewLocation)
aAbsoluteViewLocation
- true
if this location is an absolute location.isAbsoluteViewLocation()
public void getViewOffset(ILcd3DEditablePoint aViewOffsetSFCT)
world offset
. So the label anchor
point defined by this location can be retrieved by taking the
anchor object
in world coordinates, adding the world offset
, converting to view
coordinates and adding the view offset.aViewOffsetSFCT
- the point in which the view offset is stored.setViewOffset(double, double)
public void setViewOffset(double aViewOffsetX, double aViewOffsetY)
aViewOffsetX
- the x-part of the view offset.aViewOffsetY
- the y-part of the view offset.getViewOffset(com.luciad.shape.shape3D.ILcd3DEditablePoint)
public void getWorldOffset(ILcd3DEditablePoint aWorldOffsetSFCT)
anchor object
in world coordinates. This makes it possible to define labels that are
located a fixed distance away from the anchor point.aWorldOffsetSFCT
- the point in which the world offset is stored.setWorldOffset(double, double, double)
public void setWorldOffset(double aWorldOffsetX, double aWorldOffsetY, double aWorldOffsetZ)
aWorldOffsetX
- the x-part of the world offset.aWorldOffsetY
- the y-part of the world offset.aWorldOffsetZ
- the z-part of the world offset.getWorldOffset(com.luciad.shape.shape3D.ILcd3DEditablePoint)
public double getViewRotation()
Returns the rotation of the label around its anchor point. This rotation is given in radians, clockwise and with 0 radians at 3 o'clock. The rotation is defined as the rotation of the label around the label anchor point.
setViewRotation(double)
public void setViewRotation(double aViewRotation)
Sets the rotation of the label around its anchor point. This rotation is given in radians, clockwise and with 0 radians at 3 o'clock. The rotation is defined as the rotation of the label around the label anchor point.
aViewRotation
- The rotation of the label in radians.getViewRotation()
public boolean getWorldRotationOffset(ILcd3DEditablePoint aWorldRotationOffsetSFCT)
This method returns a world orientation vector. This world orientation can be calculated using two
points. One point is determined by worldObjectAnchorPointSFCT
+ getWorldOffset
. The other point is the first
point, with the world orientation vector added. These two world points can be transformed to view
coordinates, and using these view coordinates a screen rotation can be calculated.
The advantage of using this world orientation vector is that label positions and orientations can be represented independently from the view-world transformation.
This rotation is different from the view rotation. When using a view rotation, the label is rotated around its label anchor point. When using a world rotation, the label is rotated around its object anchor point.
aWorldRotationOffsetSFCT
- the point in which the world orientation vector is stored.false
if no valid orientation vector is stored.setWorldRotationOffset(double, double, double)
public void setWorldRotationOffset(double aWorldRotationOffsetX, double aWorldRotationOffsetY, double aWorldRotationOffsetZ)
(0, 0, 0)
.aWorldRotationOffsetX
- the x component of the world orientation vectoraWorldRotationOffsetY
- the y component of the world orientation vectoraWorldRotationOffsetZ
- the z component of the world orientation vectorgetWorldRotationOffset(com.luciad.shape.shape3D.ILcd3DEditablePoint)