Revision 25790
branches/v2_0_0_prep/libraries/libDXF/src/org/cresques/px/dxf/DxfFeatureMaker.java | ||
---|---|---|
361 | 361 |
|
362 | 362 |
if (i0 > 0) { |
363 | 363 |
if ((facesIterador % 2) != 0) { |
364 |
ls1.add((Point2D) lineString3D.get(i0 - 1));
|
|
365 |
pl1.add((Point2D) polygon3D.get(i0 - 1));
|
|
364 |
ls1.add(lineString3D.get(i0 - 1)); |
|
365 |
pl1.add(polygon3D.get(i0 - 1)); |
|
366 | 366 |
} else { |
367 |
ls2.add((Point2D) lineString3D.get(i0 - 1));
|
|
368 |
pl2.add((Point2D) polygon3D.get(i0 - 1));
|
|
367 |
ls2.add(lineString3D.get(i0 - 1)); |
|
368 |
pl2.add(polygon3D.get(i0 - 1)); |
|
369 | 369 |
} |
370 | 370 |
|
371 | 371 |
facesIterador = facesIterador + 1; |
... | ... | |
516 | 516 |
|
517 | 517 |
if (i0 > 0) { |
518 | 518 |
if ((facesIterador % 2) != 0) { |
519 |
ls1.add((Point2D) lineString3D.get(i0 - 1));
|
|
519 |
ls1.add(lineString3D.get(i0 - 1)); |
|
520 | 520 |
|
521 | 521 |
//ls.add((Point2D)lineString.get(Math.abs(i1)-1)); |
522 | 522 |
} else { |
523 |
ls2.add((Point2D) lineString3D.get(i0 - 1));
|
|
523 |
ls2.add(lineString3D.get(i0 - 1)); |
|
524 | 524 |
|
525 | 525 |
//ls.add((Point2D)lineString.get(Math.abs(i1)-1)); |
526 | 526 |
} |
... | ... | |
667 | 667 |
// Son vertices que se trataran cuando se implementen |
668 | 668 |
// los splines. En principio no se hace nada con ellos. |
669 | 669 |
} else { |
670 |
Point3D pt = new Point3D(proj.createPoint(x, y).getX(),
|
|
671 |
proj.createPoint(x, y).getY(), z);
|
|
670 |
Point2D ptaux = proj.createPoint(x, y);
|
|
671 |
Point3D pt = new Point3D(ptaux.getX(), ptaux.getY(), z);
|
|
672 | 672 |
lineString3D.add(pt); |
673 | 673 |
polygon3D.add(pt); |
674 | 674 |
|
... | ... | |
787 | 787 |
} else if ((vFlags & 16) == 16) { |
788 | 788 |
// no se hace nada. |
789 | 789 |
} else { |
790 |
Point3D pt = new Point3D(proj.createPoint(x, y).getX(),
|
|
791 |
proj.createPoint(x, y).getY(), z);
|
|
790 |
Point2D ptaux = proj.createPoint(x, y);
|
|
791 |
Point3D pt = new Point3D(ptaux.getX(), ptaux.getY(), z);
|
|
792 | 792 |
lineString3D.add(pt); |
793 | 793 |
|
794 | 794 |
//System.out.println("addVertex: pt = " + pt); |
... | ... | |
1014 | 1014 |
if (hasBulge) { |
1015 | 1015 |
Point2D finalPoint = new Point2D.Double(x, y); |
1016 | 1016 |
|
1017 |
if ((((LineString3D) lineString3D).get(lineString3D.pointNr() -
|
|
1017 |
if (((lineString3D).get(lineString3D.pointNr() - |
|
1018 | 1018 |
1).getX() == finalPoint.getX()) && |
1019 |
(((LineString3D) lineString3D).get(lineString3D.pointNr() -
|
|
1019 |
((lineString3D).get(lineString3D.pointNr() - |
|
1020 | 1020 |
1).getY() == finalPoint.getY())) { |
1021 | 1021 |
// no se construye el arco |
1022 | 1022 |
} else { |
1023 |
Vector arc = createArc(((LineString3D) lineString3D).get(lineString3D.pointNr() -
|
|
1023 |
Vector arc = createArc((lineString3D).get(lineString3D.pointNr() - |
|
1024 | 1024 |
1), |
1025 | 1025 |
finalPoint, bulgeLwp); |
1026 | 1026 |
lineString3D.remove(lineString3D.pointNr() - 1); |
... | ... | |
1076 | 1076 |
bulgeLwp = 0.0; |
1077 | 1077 |
} else { |
1078 | 1078 |
//System.out.println("createLwPolyline: hasBulge siempre es false"); |
1079 |
Point3D ptAux3D = new Point3D(proj.createPoint(x, y).getX(),
|
|
1080 |
proj.createPoint(x, y).getY(),
|
|
1081 |
elev);
|
|
1079 |
Point2D ptAux2D = proj.createPoint(x, y);
|
|
1080 |
Point3D ptAux3D = new Point3D(ptAux2D.getX(), ptAux2D
|
|
1081 |
.getY(), elev);
|
|
1082 | 1082 |
lineString3D.add(ptAux3D); |
1083 | 1083 |
|
1084 | 1084 |
if (isDoubleFeatured) { |
... | ... | |
1102 | 1102 |
|
1103 | 1103 |
if (isDoubleFeatured) { |
1104 | 1104 |
//geometria.add(proj.createPoint(firstX, firstY)); |
1105 |
Point3D ptAux3D = new Point3D(proj.createPoint(firstX, firstY).getX(),
|
|
1106 |
proj.createPoint(firstX, firstY).getY(),
|
|
1105 |
Point2D ptAux2D = proj.createPoint(firstX, firstY);
|
|
1106 |
Point3D ptAux3D = new Point3D(ptAux2D.getX(), ptAux2D.getY(),
|
|
1107 | 1107 |
elev); |
1108 | 1108 |
lineString3D.add(ptAux3D); |
1109 | 1109 |
polygon3D.add(ptAux3D); |
... | ... | |
1783 | 1783 |
pts[angulo] = new Point3D(center.getX(), center.getY(), |
1784 | 1784 |
center.getZ()); |
1785 | 1785 |
pts[angulo] = new Point3D(pts[angulo].getX() + |
1786 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1786 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1787 | 1787 |
pts[angulo].getY() + |
1788 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1788 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1789 | 1789 |
center.getZ()); |
1790 | 1790 |
|
1791 | 1791 |
if (pts.length == 1) { |
... | ... | |
1932 | 1932 |
pts = new Point3D[(iacaba - iempieza) + 2]; |
1933 | 1933 |
angulo = empieza; |
1934 | 1934 |
pts[0] = new Point3D(center.getX() + |
1935 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1935 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1936 | 1936 |
center.getY() + |
1937 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1937 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1938 | 1938 |
center.getZ()); |
1939 | 1939 |
|
1940 | 1940 |
for (int i = 1; i <= ((iacaba - iempieza) + 1); i++) { |
1941 |
angulo = (double) (iempieza + i);
|
|
1941 |
angulo = (iempieza + i); |
|
1942 | 1942 |
pts[i] = new Point3D(center.getX() + |
1943 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1943 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1944 | 1944 |
center.getY() + |
1945 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1945 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1946 | 1946 |
center.getZ()); |
1947 | 1947 |
} |
1948 | 1948 |
|
1949 | 1949 |
angulo = acaba; |
1950 | 1950 |
pts[(iacaba - iempieza) + 1] = new Point3D(center.getX() + |
1951 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1951 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1952 | 1952 |
center.getY() + |
1953 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1953 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1954 | 1954 |
center.getZ()); |
1955 | 1955 |
} else { |
1956 | 1956 |
pts = new Point3D[(360 - iempieza) + iacaba + 2]; |
... | ... | |
1958 | 1958 |
|
1959 | 1959 |
//System.out.println("pts[0] = " + pts[0] + ", center = " + center + ", angulo = " + angulo); |
1960 | 1960 |
pts[0] = new Point3D(center.getX() + |
1961 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1961 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1962 | 1962 |
center.getY() + |
1963 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1963 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1964 | 1964 |
center.getZ()); |
1965 | 1965 |
|
1966 | 1966 |
for (int i = 1; i <= (360 - iempieza); i++) { |
1967 |
angulo = (double) (iempieza + i);
|
|
1967 |
angulo = (iempieza + i); |
|
1968 | 1968 |
pts[i] = new Point3D(center.getX() + |
1969 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1969 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1970 | 1970 |
center.getY() + |
1971 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1971 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1972 | 1972 |
center.getZ()); |
1973 | 1973 |
} |
1974 | 1974 |
|
1975 | 1975 |
for (int i = (360 - iempieza) + 1; |
1976 | 1976 |
i <= ((360 - iempieza) + iacaba); i++) { |
1977 |
angulo = (double) (i - (360 - iempieza));
|
|
1977 |
angulo = (i - (360 - iempieza)); |
|
1978 | 1978 |
pts[i] = new Point3D(center.getX() + |
1979 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1979 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1980 | 1980 |
center.getY() + |
1981 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1981 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1982 | 1982 |
center.getZ()); |
1983 | 1983 |
} |
1984 | 1984 |
|
1985 | 1985 |
angulo = acaba; |
1986 | 1986 |
pts[(360 - iempieza) + iacaba + 1] = new Point3D(center.getX() + |
1987 |
(r * Math.cos((angulo * Math.PI) / (double) 180.0)),
|
|
1987 |
(r * Math.cos((angulo * Math.PI) / 180.0)), |
|
1988 | 1988 |
center.getY() + |
1989 |
(r * Math.sin((angulo * Math.PI) / (double) 180.0)),
|
|
1989 |
(r * Math.sin((angulo * Math.PI) / 180.0)), |
|
1990 | 1990 |
center.getZ()); |
1991 | 1991 |
} |
1992 | 1992 |
|
Also available in: Unified diff