Interface Component2D


  • public interface Component2D
    2D Geometry object that supports spatial relationships with bounding boxes, triangles and points.
    NOTE: This API is for internal purposes only and might change in incompatible ways in the next release.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Interface Description
      static class  Component2D.WithinRelation
      Used by withinTriangle to check the within relationship between a triangle and the query shape (e.g.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      boolean contains​(double x, double y)
      relates this component2D with a point
      static boolean containsPoint​(double x, double y, double minX, double maxX, double minY, double maxY)
      returns true if rectangle (defined by minX, maxX, minY, maxY) contains the X Y point
      static boolean disjoint​(double minX1, double maxX1, double minY1, double maxY1, double minX2, double maxX2, double minY2, double maxY2)
      Compute whether the bounding boxes are disjoint
      double getMaxX()
      max X value for the component
      double getMaxY()
      max Y value for the component
      double getMinX()
      min X value for the component
      double getMinY()
      min Y value for the component
      static boolean pointInTriangle​(double minX, double maxX, double minY, double maxY, double x, double y, double aX, double aY, double bX, double bY, double cX, double cY)
      Compute whether the given x, y point is in a triangle; uses the winding order method
      PointValues.Relation relate​(double minX, double maxX, double minY, double maxY)
      relates this component2D with a bounding box
      default PointValues.Relation relateTriangle​(double aX, double aY, double bX, double bY, double cX, double cY)
      relates this component2D with a triangle
      PointValues.Relation relateTriangle​(double minX, double maxX, double minY, double maxY, double aX, double aY, double bX, double bY, double cX, double cY)
      relates this component2D with a triangle
      static boolean within​(double minX1, double maxX1, double minY1, double maxY1, double minX2, double maxX2, double minY2, double maxY2)
      Compute whether the first bounding box 1 is within the second bounding box
      default Component2D.WithinRelation withinTriangle​(double aX, double aY, boolean ab, double bX, double bY, boolean bc, double cX, double cY, boolean ca)
      Compute the within relation of this component2D with a triangle
      Component2D.WithinRelation withinTriangle​(double minX, double maxX, double minY, double maxY, double aX, double aY, boolean ab, double bX, double bY, boolean bc, double cX, double cY, boolean ca)
      Compute the within relation of this component2D with a triangle
    • Method Detail

      • getMinX

        double getMinX()
        min X value for the component
      • getMaxX

        double getMaxX()
        max X value for the component
      • getMinY

        double getMinY()
        min Y value for the component
      • getMaxY

        double getMaxY()
        max Y value for the component
      • contains

        boolean contains​(double x,
                         double y)
        relates this component2D with a point
      • relate

        PointValues.Relation relate​(double minX,
                                    double maxX,
                                    double minY,
                                    double maxY)
        relates this component2D with a bounding box
      • relateTriangle

        PointValues.Relation relateTriangle​(double minX,
                                            double maxX,
                                            double minY,
                                            double maxY,
                                            double aX,
                                            double aY,
                                            double bX,
                                            double bY,
                                            double cX,
                                            double cY)
        relates this component2D with a triangle
      • relateTriangle

        default PointValues.Relation relateTriangle​(double aX,
                                                    double aY,
                                                    double bX,
                                                    double bY,
                                                    double cX,
                                                    double cY)
        relates this component2D with a triangle
      • withinTriangle

        default Component2D.WithinRelation withinTriangle​(double aX,
                                                          double aY,
                                                          boolean ab,
                                                          double bX,
                                                          double bY,
                                                          boolean bc,
                                                          double cX,
                                                          double cY,
                                                          boolean ca)
        Compute the within relation of this component2D with a triangle
      • withinTriangle

        Component2D.WithinRelation withinTriangle​(double minX,
                                                  double maxX,
                                                  double minY,
                                                  double maxY,
                                                  double aX,
                                                  double aY,
                                                  boolean ab,
                                                  double bX,
                                                  double bY,
                                                  boolean bc,
                                                  double cX,
                                                  double cY,
                                                  boolean ca)
        Compute the within relation of this component2D with a triangle
      • disjoint

        static boolean disjoint​(double minX1,
                                double maxX1,
                                double minY1,
                                double maxY1,
                                double minX2,
                                double maxX2,
                                double minY2,
                                double maxY2)
        Compute whether the bounding boxes are disjoint
      • within

        static boolean within​(double minX1,
                              double maxX1,
                              double minY1,
                              double maxY1,
                              double minX2,
                              double maxX2,
                              double minY2,
                              double maxY2)
        Compute whether the first bounding box 1 is within the second bounding box
      • containsPoint

        static boolean containsPoint​(double x,
                                     double y,
                                     double minX,
                                     double maxX,
                                     double minY,
                                     double maxY)
        returns true if rectangle (defined by minX, maxX, minY, maxY) contains the X Y point
      • pointInTriangle

        static boolean pointInTriangle​(double minX,
                                       double maxX,
                                       double minY,
                                       double maxY,
                                       double x,
                                       double y,
                                       double aX,
                                       double aY,
                                       double bX,
                                       double bY,
                                       double cX,
                                       double cY)
        Compute whether the given x, y point is in a triangle; uses the winding order method