Class TLspIsTouchedQuery

java.lang.Object
com.luciad.view.lightspeed.query.ALspPaintQuery<Boolean>
com.luciad.view.lightspeed.query.TLspIsTouchedQuery

public class TLspIsTouchedQuery extends ALspPaintQuery<Boolean>
Query to determine whether an object is touched.

If this query is used for an object that is currently not painted (ex. because it is outside the view) then this query determines whether the object would have been touched if it were painted.

The touched(com.luciad.view.lightspeed.layer.ALspWorldTouchInfo) methods may be called multiple times if the object is touched at multiple points. This implementation only keeps track of the first touched point. You can override this class if you want to handle all touched points.

Since:
2012.0
See Also:
  • Constructor Details

    • TLspIsTouchedQuery

      public TLspIsTouchedQuery(Object aObject, TLspPaintRepresentation aPaintRepresentation, ILcdPoint aViewPoint, double aSensitivity)
      Creates a new is touched query.
      Parameters:
      aObject - the object that should be tested
      aPaintRepresentation - the paint representation
      aViewPoint - the view point
      aSensitivity - the sensitivity
    • TLspIsTouchedQuery

      public TLspIsTouchedQuery(TLspLabelID aLabel, ILcdPoint aViewPoint, double aSensitivity)
      Creates a new is touched query for a label.
      Parameters:
      aLabel - the label that should be tested
      aViewPoint - the view point
      aSensitivity - the sensitivity
    • TLspIsTouchedQuery

      public TLspIsTouchedQuery(TLspLabelID aLabel, ILcdPoint aViewPoint, double aSensitivity, ALspLabelLocation aLabelLocation)
      Creates a new is touched query for a label, for the given location. If this location is null, the label location is retrieved from the ILspLabelPlacer instead.
      Parameters:
      aLabel - the label that should be tested
      aViewPoint - the view point
      aSensitivity - the sensitivity
  • Method Details

    • getObject

      public Object getObject()
      Returns the object that should be queried.
      Returns:
      the object
    • getLabel

      public TLspLabelID getLabel()
      Returns the label that should be queried.
      Returns:
      the label
    • getLabelLocation

      public ALspLabelLocation getLabelLocation()
      Returns the label location for the label that should be queried.
      Returns:
      the label location. Can be null.
    • getPaintRepresentation

      public TLspPaintRepresentation getPaintRepresentation()
      Returns the paint representation that should be queried.
      Returns:
      the paint representation
    • getViewPoint

      public ILcdPoint getViewPoint()
      Returns the view point that should be queried.
      Returns:
      the view point
    • getSensitivity

      public double getSensitivity()
      Returns the sensitivity in pixels.
      Returns:
      the sensitivity
    • getResult

      public Boolean getResult()
      Returns whether the object is touched.
      Specified by:
      getResult in class ALspPaintQuery<Boolean>
      Returns:
      true if the object is touched, false otherwise
    • touched

      public boolean touched(ALspWorldTouchInfo aTouchInfo)
      Called if the object is touched at a point in world coordinates.

      Note that the aTouchInfo may change after this method call returns. The implementation can create a ALspTouchInfo.clone() if it still needs it after the method call returns.

      Parameters:
      aTouchInfo - the touch info
      Returns:
      true if the query should continue, false if it should stop
    • touched

      public boolean touched(ALspViewTouchInfo aTouchInfo)
      Called if the object is touched at a point in view coordinates.

      Note that the aTouchInfo may change after this method call returns. The implementation can create a ALspTouchInfo.clone() if it still needs it after the method call returns.

      Parameters:
      aTouchInfo - the touch info
      Returns:
      true if the query should continue, false if it should stop
    • isTouched

      public boolean isTouched()
      Returns whether the object is touched.
      Returns:
      true if the object is touched, false otherwise
    • getTouchInfo

      public ALspTouchInfo getTouchInfo()
      Returns the touch info if the object is touched.
      Returns:
      the touch info or null