Beispiel #1
0
	  { // Byte code:
		//   0: aload_0
		//   1: getfield npoints : I
		//   4: iconst_2
		//   5: if_icmple -> 20
		//   8: aload_0
		//   9: invokevirtual getBounds : ()Ljava/awt/Rectangle;
		//   12: dload_1
		//   13: dload_3
		//   14: invokevirtual contains : (DD)Z
		//   17: ifne -> 22
		//   20: iconst_0
		//   21: ireturn
		//   22: iconst_0
		//   23: istore #5
		//   25: aload_0
		//   26: getfield xpoints : [D
		//   29: aload_0
		//   30: getfield npoints : I
		//   33: iconst_1
		//   34: isub
		//   35: daload
		//   36: dstore #6
		//   38: aload_0
		//   39: getfield ypoints : [D
		//   42: aload_0
		//   43: getfield npoints : I
		//   46: iconst_1
		//   47: isub
		//   48: daload
		//   49: dstore #8
		//   51: iconst_0
		//   52: istore #14
		//   54: iload #14
		//   56: aload_0
		//   57: getfield npoints : I
		//   60: if_icmpge -> 263
		//   63: aload_0
		//   64: getfield xpoints : [D
		//   67: iload #14
		//   69: daload
		//   70: dstore #10
		//   72: aload_0
		//   73: getfield ypoints : [D
		//   76: iload #14
		//   78: daload
		//   79: dstore #12
		//   81: dload #12
		//   83: dload #8
		//   85: dcmpl
		//   86: ifne -> 92
		//   89: goto -> 249
		//   92: dload #10
		//   94: dload #6
		//   96: dcmpg
		//   97: ifge -> 117
		//   100: dload_1
		//   101: dload #6
		//   103: dcmpl
		//   104: iflt -> 110
		//   107: goto -> 249
		//   110: dload #10
		//   112: dstore #15
		//   114: goto -> 131
		//   117: dload_1
		//   118: dload #10
		//   120: dcmpl
		//   121: iflt -> 127
		//   124: goto -> 249
		//   127: dload #6
		//   129: dstore #15
		//   131: dload #12
		//   133: dload #8
		//   135: dcmpg
		//   136: ifge -> 184
		//   139: dload_3
		//   140: dload #12
		//   142: dcmpg
		//   143: iflt -> 249
		//   146: dload_3
		//   147: dload #8
		//   149: dcmpl
		//   150: iflt -> 156
		//   153: goto -> 249
		//   156: dload_1
		//   157: dload #15
		//   159: dcmpg
		//   160: ifge -> 169
		//   163: iinc #5, 1
		//   166: goto -> 249
		//   169: dload_1
		//   170: dload #10
		//   172: dsub
		//   173: dstore #17
		//   175: dload_3
		//   176: dload #12
		//   178: dsub
		//   179: dstore #19
		//   181: goto -> 226
		//   184: dload_3
		//   185: dload #8
		//   187: dcmpg
		//   188: iflt -> 249
		//   191: dload_3
		//   192: dload #12
		//   194: dcmpl
		//   195: iflt -> 201
		//   198: goto -> 249
		//   201: dload_1
		//   202: dload #15
		//   204: dcmpg
		//   205: ifge -> 214
		//   208: iinc #5, 1
		//   211: goto -> 249
		//   214: dload_1
		//   215: dload #6
		//   217: dsub
		//   218: dstore #17
		//   220: dload_3
		//   221: dload #8
		//   223: dsub
		//   224: dstore #19
		//   226: dload #17
		//   228: dload #19
		//   230: dload #8
		//   232: dload #12
		//   234: dsub
		//   235: ddiv
		//   236: dload #6
		//   238: dload #10
		//   240: dsub
		//   241: dmul
		//   242: dcmpg
		//   243: ifge -> 249
		//   246: iinc #5, 1
		//   249: dload #10
		//   251: dstore #6
		//   253: dload #12
		//   255: dstore #8
		//   257: iinc #14, 1
		//   260: goto -> 54
		//   263: iload #5
		//   265: iconst_1
		//   266: iand
		//   267: ifeq -> 274
		//   270: iconst_1
		//   271: goto -> 275
		//   274: iconst_0
		//   275: ireturn }

	  private Crossings getCrossings(double paramDouble1, double paramDouble2, double paramDouble3, double paramDouble4)
	  {
		Crossings.EvenOdd evenOdd = new Crossings.EvenOdd(paramDouble1, paramDouble2, paramDouble3, paramDouble4);
		double d1 = this.xpoints[this.npoints - 1];
		double d2 = this.ypoints[this.npoints - 1];
		for (sbyte b = 0; b < this.npoints; b++)
		{
		  double d3 = this.xpoints[b];
		  double d4 = this.ypoints[b];
		  if (evenOdd.accumulateLine(d1, d2, d3, d4))
		  {
			return null;
		  }
		  d1 = d3;
		  d2 = d4;
		}
		return evenOdd;
	  }
Beispiel #2
0
        private Crossings GetCrossings(double xlo, double ylo, double xhi, double yhi)
        {
            Crossings cross = new Crossings.EvenOdd(xlo, ylo, xhi, yhi);
            int       lastx = Xpoints[Npoints - 1];
            int       lasty = Ypoints[Npoints - 1];
            int       curx, cury;

            // Walk the edges of the polygon
            for (int i = 0; i < Npoints; i++)
            {
                curx = Xpoints[i];
                cury = Ypoints[i];
                if (cross.accumulateLine(lastx, lasty, curx, cury))
                {
                    return(null);
                }
                lastx = curx;
                lasty = cury;
            }

            return(cross);
        }