Package java.awt.geom

Examples of java.awt.geom.Rectangle2D.outcode()


    r = new Rectangle2D.Float(0.0f, 0.0f, 0.0f, 0.0f);
    int outside = Rectangle2D.OUT_LEFT | Rectangle2D.OUT_RIGHT
      | Rectangle2D.OUT_TOP | Rectangle2D.OUT_BOTTOM;
    harness.check(r.outcode(-1.0, -1.0) == outside);
    harness.check(r.outcode(-1.0, 0.0) == outside);
    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
View Full Code Here


    int outside = Rectangle2D.OUT_LEFT | Rectangle2D.OUT_RIGHT
      | Rectangle2D.OUT_TOP | Rectangle2D.OUT_BOTTOM;
    harness.check(r.outcode(-1.0, -1.0) == outside);
    harness.check(r.outcode(-1.0, 0.0) == outside);
    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
View Full Code Here

      | Rectangle2D.OUT_TOP | Rectangle2D.OUT_BOTTOM;
    harness.check(r.outcode(-1.0, -1.0) == outside);
    harness.check(r.outcode(-1.0, 0.0) == outside);
    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
 
View Full Code Here

    harness.check(r.outcode(-1.0, -1.0) == outside);
    harness.check(r.outcode(-1.0, 0.0) == outside);
    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
 
    boolean pass = false;
View Full Code Here

    harness.check(r.outcode(-1.0, 0.0) == outside);
    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
 
    boolean pass = false;
    try
View Full Code Here

    harness.check(r.outcode(-1.0, 1.0) == outside);
    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
 
    boolean pass = false;
    try
    {
View Full Code Here

    harness.check(r.outcode(0.0, -1.0) == outside);
    harness.check(r.outcode(0.0, 0.0) == outside);
    harness.check(r.outcode(0.0, 1.0) == outside);
    harness.check(r.outcode(1.0, -1.0) == outside);
    harness.check(r.outcode(1.0, 0.0) == outside);
    harness.check(r.outcode(1.0, 1.0) == outside);
 
    boolean pass = false;
    try
    {
      r.outcode(null);
View Full Code Here

  public void testOutcode() {
    Point2D pInexact = new Point2D.Double(), pExact = new Point2D.Double();
    Rectangle2D rect = new Rectangle2D.Double(0, 0, 10, 10);
    pExact.setLocation(10, 5);
    pInexact.setLocation(10.00001, 5.00001);
    assertEquals("regular outcode() says outside", 4, rect.outcode(pInexact));
    assertEquals("custom outcode() should say inside", 0,
      GeometryUtil.getInstance().outcode(rect, pInexact));
  }

  /**
 
View Full Code Here

    double x1 = origin.x,
        y1 = origin.y;
    //System.out.println("SINGLE-RAY READING");
    //System.out.println(" Ray from " + x1 + "," + y1 + " to " + x2 + "," + y2);
    //System.out.println(" Bounding box " + bounds);
    int out1, out2 = bounds.outcode(x2, y2);
    while ((out1 = bounds.outcode(x1, y1)) != 0) {
      if ((out1 & out2) != 0) {
        //System.out.println("  No intersection, returning");
        return 0;
      }
View Full Code Here

        y1 = origin.y;
    //System.out.println("SINGLE-RAY READING");
    //System.out.println(" Ray from " + x1 + "," + y1 + " to " + x2 + "," + y2);
    //System.out.println(" Bounding box " + bounds);
    int out1, out2 = bounds.outcode(x2, y2);
    while ((out1 = bounds.outcode(x1, y1)) != 0) {
      if ((out1 & out2) != 0) {
        //System.out.println("  No intersection, returning");
        return 0;
      }
      if ((out1 & (Rectangle2D.OUT_LEFT | Rectangle2D.OUT_RIGHT)) != 0) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.