Revision 15682
trunk/libraries/libRaster/src/org/gvsig/raster/datastruct/Extent.java | ||
---|---|---|
52 | 52 |
public Extent(Point2D ul, Point2D lr) { |
53 | 53 |
this.ul = ul; |
54 | 54 |
this.lr = lr; |
55 |
newExtent(ul.getX(), ul.getY(), lr.getX(), lr.getY()); |
|
55 |
newExtent(ul.getX(), ul.getY(), lr.getX(), lr.getY());
|
|
56 | 56 |
} |
57 | 57 |
|
58 | 58 |
/** |
... | ... | |
63 | 63 |
* @param ll punto que representa la esquina inferior izquierda |
64 | 64 |
*/ |
65 | 65 |
public Extent(Point2D ul, Point2D lr, Point2D ur, Point2D ll) { |
66 |
this.ul = ul;
|
|
67 |
this.lr = lr;
|
|
68 |
this.ur = ur;
|
|
69 |
this.ll = ll;
|
|
70 |
min = new Point2D.Double(
|
|
71 |
Math.min(Math.min(ul.getX(), lr.getX()), Math.min(ur.getX(), ll.getX())),
|
|
72 |
Math.min(Math.min(ul.getY(), lr.getY()), Math.min(ur.getY(), ll.getY())));
|
|
73 |
max = new Point2D.Double(
|
|
74 |
Math.max(Math.max(ul.getX(), lr.getX()), Math.max(ur.getX(), ll.getX())),
|
|
75 |
Math.max(Math.max(ul.getY(), lr.getY()), Math.max(ur.getY(), ll.getY())));
|
|
66 |
this.ul = ul;
|
|
67 |
this.lr = lr;
|
|
68 |
this.ur = ur;
|
|
69 |
this.ll = ll;
|
|
70 |
min = new Point2D.Double(
|
|
71 |
Math.min(Math.min(ul.getX(), lr.getX()), Math.min(ur.getX(), ll.getX())),
|
|
72 |
Math.min(Math.min(ul.getY(), lr.getY()), Math.min(ur.getY(), ll.getY())));
|
|
73 |
max = new Point2D.Double(
|
|
74 |
Math.max(Math.max(ul.getX(), lr.getX()), Math.max(ur.getX(), ll.getX())),
|
|
75 |
Math.max(Math.max(ul.getY(), lr.getY()), Math.max(ur.getY(), ll.getY())));
|
|
76 | 76 |
} |
77 | 77 |
|
78 | 78 |
/** |
... | ... | |
85 | 85 |
public Extent(double x1, double y1, double x2, double y2) { |
86 | 86 |
ul.setLocation(x1, y1); |
87 | 87 |
lr.setLocation(x2, y2); |
88 |
newExtent(x1, y1, x2, y2); |
|
89 |
/* |
|
90 |
ll.setLocation(getMin().getX(), getMin().getY()); |
|
91 |
ul.setLocation(getMin().getX(), getMax().getY()); |
|
92 |
lr.setLocation(getMax().getX(), getMin().getY()); |
|
93 |
ur.setLocation(getMax().getX(), getMax().getY());*/ |
|
88 |
newExtent(x1, y1, x2, y2); |
|
94 | 89 |
} |
95 | 90 |
|
96 | 91 |
/** |
... | ... | |
100 | 95 |
public Extent(Rectangle2D r) { |
101 | 96 |
ul.setLocation(r.getX(), r.getY() + r.getHeight()); |
102 | 97 |
lr.setLocation(r.getX() + r.getWidth(), r.getY()); |
103 |
newExtent(r.getX(), r.getY(), r.getX() + r.getWidth(), r.getY() + r.getHeight()); |
|
98 |
newExtent(r.getX(), r.getY(), r.getX() + r.getWidth(), |
|
99 |
r.getY() + r.getHeight()); |
|
104 | 100 |
} |
105 | 101 |
|
106 | 102 |
/** |
Also available in: Unified diff