Class ExtrudeMarker

All Implemented Interfaces:
DetailMarker

public class ExtrudeMarker extends ObjectMarker
  • Constructor Details

    • ExtrudeMarker

      public ExtrudeMarker(String label, Shape shape, float shapeMinY, float shapeMaxY)
      Creates a new ExtrudeMarker.

      (The position of the marker will be the center of the shape (it's bounding box))

      Parameters:
      label - the label of the marker
      shape - the Shape of the marker
      shapeMinY - the minimum y-position of the extruded shape
      shapeMaxY - the maximum y-position of the extruded shape
      See Also:
    • ExtrudeMarker

      public ExtrudeMarker(String label, Vector3d position, Shape shape, float shapeMinY, float shapeMaxY)
      Creates a new ExtrudeMarker.

      (Since the shape has its own positions, the position is only used to determine e.g. the distance to the camera)

      Parameters:
      label - the label of the marker
      position - the coordinates of the marker
      shape - the shape of the marker
      shapeMinY - the minimum y-position of the extruded shape
      shapeMaxY - the maximum y-position of the extruded shape
      See Also:
  • Method Details

    • getShape

      public Shape getShape()
      Getter for Shape of this ExtrudeMarker.

      The shape is placed on the xz-plane of the map, so the y-coordinates of the Shape's points are the z-coordinates in the map.

      Returns:
      the Shape
    • getShapeMinY

      public float getShapeMinY()
      Getter for the minimum height (y-coordinate) of where the shape is displayed on the map.
      (The shape will be extruded from this value to getShapeMaxY() on the map)
      Returns:
      the min-height of the shape on the map
    • getShapeMaxY

      public float getShapeMaxY()
      Getter for the maximum height (y-coordinate) of where the shape is displayed on the map. (The shape will be extruded from getShapeMinY() to this value on the map)
      Returns:
      the max-height of the shape on the map
    • setShape

      public void setShape(Shape shape, float minY, float maxY)
      Sets the Shape of this ExtrudeMarker.

      The shape is placed on the xz-plane of the map, so the y-coordinates of the Shape's points will be the z-coordinates in the map.

      (The shape will be extruded from minY to maxY on the map)
      Parameters:
      shape - the new Shape
      minY - the new min-height (y-coordinate) of the shape on the map
      maxY - the new max-height (y-coordinate) of the shape on the map
      See Also:
    • getHoles

      public Collection<Shape> getHoles()
      Getter for the mutable collection of holes in this ExtrudeMarker.

      Any shape in this collection will be a hole in the main Shape of this marker

      Returns:
      A mutable collection of hole-shapes
    • centerPosition

      public void centerPosition()
      Sets the position of this ExtrudeMarker to the center of the Shape (it's bounding box).

      (Invoke this after changing the Shape to make sure the markers position gets updated as well)

    • isDepthTestEnabled

      public boolean isDepthTestEnabled()
      If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
      Returns:
      true if the depthTest is enabled
    • setDepthTestEnabled

      public void setDepthTestEnabled(boolean enabled)
      If the depth-test is disabled, you can see the marker fully through all objects on the map. If it is enabled, you'll only see the marker when it is not behind anything.
      Parameters:
      enabled - if the depth-test should be enabled for this ExtrudeMarker
    • getLineWidth

      public int getLineWidth()
      Getter for the width of the lines of this ExtrudeMarker.
      Returns:
      the width of the lines in pixels
    • setLineWidth

      public void setLineWidth(int width)
      Sets the width of the lines for this ExtrudeMarker.
      Parameters:
      width - the new width in pixels
    • getLineColor

      public Color getLineColor()
      Getter for the Color of the border-line of the shape.
      Returns:
      the line-color
    • setLineColor

      public void setLineColor(Color color)
      Sets the Color of the border-line of the shape.
      Parameters:
      color - the new line-color
    • getFillColor

      public Color getFillColor()
      Getter for the fill-Color of the shape.
      Returns:
      the fill-color
    • setFillColor

      public void setFillColor(Color color)
      Sets the fill-Color of the shape.
      Parameters:
      color - the new fill-color
    • setColors

      public void setColors(Color lineColor, Color fillColor)
      Sets the border- and fill- color.
      Parameters:
      lineColor - the new border-color
      fillColor - the new fill-color
      See Also:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class ObjectMarker
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class ObjectMarker
    • builder

      public static ExtrudeMarker.Builder builder()
      Creates a Builder for ExtrudeMarkers.
      Returns:
      a new Builder