Class ALspStampLabelLocation.LocationData
- Enclosing class:
ALspStampLabelLocation
This object describes the exact location of the anchor point and the rotation of a label:
- World offset: this offset, defined in world coordinates, is added to the anchor point
- View offset: this offset, defined in pixels, is added on the screen to the projected anchor point+offset
This location also defines a rotation that will be applied on the label:
- World rotation: defined as a vector in world coordinates
- View rotation: defined as an angle on the screen
The exact location of this label can be interpreted using the methods of
ILspStampLocationLabelPainter
.
- Since:
- 2012.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
getViewOffset
(ILcd3DEditablePoint aViewOffsetSFCT) This method returns the view offset and stores it in the given point.double
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
Returns if this location is an absolute view locations.boolean
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.toString()
-
Constructor Details
-
LocationData
public LocationData()
-
-
Method Details
-
reset
public void reset()Resets this object to its default values. I.e. a view offset of (0, 0), a world offset of (0, 0, 0), a view rotation of 0 and a world rotation offset of (0, 0, 0) will be set. Also the view dependent flag will betrue
and the absolute view location flag will be set totrue
. -
isViewDependent
public boolean isViewDependent()Returns if this location is view dependent. This means that it needs to be updated every time the world to view transformation changes. By default, its value istrue
.- Returns:
- if this location is view dependent.
- See Also:
-
setViewDependent
public void setViewDependent(boolean aViewDependent) Sets if this location is view dependent.- Parameters:
aViewDependent
-true
if this location is view dependent.- See Also:
-
isAbsoluteViewLocation
public boolean isAbsoluteViewLocation()Returns if this location is an absolute view locations. When this method returnstrue
, this location is anchored to the screen bounds. In that case, only thegetViewOffset
andgetViewRotation
methods are relevant. Also, theisViewDependent
method should returnfalse
, since an absolute view location does not depend on the world to view transformation.- Returns:
- if this location is an absolute view locations.
-
setAbsoluteViewLocation
public void setAbsoluteViewLocation(boolean aAbsoluteViewLocation) Sets if this location is an absolute location.- Parameters:
aAbsoluteViewLocation
-true
if this location is an absolute location.- See Also:
-
getViewOffset
This method returns the view offset and stores it in the given point. The view offset is applied after applying theworld offset
. So the label anchor point defined by this location can be retrieved by taking theanchor object
in world coordinates, adding theworld offset
, converting to view coordinates and adding the view offset.- Parameters:
aViewOffsetSFCT
- the point in which the view offset is stored.- See Also:
-
setViewOffset
public void setViewOffset(double aViewOffsetX, double aViewOffsetY) Sets the view offset. No reference to the given point is stored.- Parameters:
aViewOffsetX
- the x-part of the view offset.aViewOffsetY
- the y-part of the view offset.- See Also:
-
getWorldOffset
This method returns the world offset and stores it in the given point. The world offset is added to theanchor object
in world coordinates. This makes it possible to define labels that are located a fixed distance away from the anchor point.- Parameters:
aWorldOffsetSFCT
- the point in which the world offset is stored.- See Also:
-
setWorldOffset
public void setWorldOffset(double aWorldOffsetX, double aWorldOffsetY, double aWorldOffsetZ) Sets the world offset. No reference to the given point is stored.- Parameters:
aWorldOffsetX
- the x-part of the world offset.aWorldOffsetY
- the y-part of the world offset.aWorldOffsetZ
- the z-part of the world offset.- See Also:
-
getViewRotation
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.
- Returns:
- The rotation of the label in radians.
- See Also:
-
setViewRotation
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.
- Parameters:
aViewRotation
- The rotation of the label in radians.- See Also:
-
getWorldRotationOffset
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.
- Parameters:
aWorldRotationOffsetSFCT
- the point in which the world orientation vector is stored.- Returns:
false
if no valid orientation vector is stored.- See Also:
-
setWorldRotationOffset
public void setWorldRotationOffset(double aWorldRotationOffsetX, double aWorldRotationOffsetY, double aWorldRotationOffsetZ) Sets the world rotation offset. To remove the world orientation from a location, these values can be set to(0, 0, 0)
.- Parameters:
aWorldRotationOffsetX
- the x component of the world orientation vectoraWorldRotationOffsetY
- the y component of the world orientation vectoraWorldRotationOffsetZ
- the z component of the world orientation vector- See Also:
-
toString
-