svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.api / src / main / java / org / gvsig / fmap / geom / primitive / Envelope.java @ 40559
History | View | Annotate | Download (5.62 KB)
1 | 40559 | jjdelcerro | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | 40435 | jjdelcerro | *
|
4 | 40559 | jjdelcerro | * Copyright (C) 2007-2013 gvSIG Association.
|
5 | *
|
||
6 | 40435 | jjdelcerro | * This program is free software; you can redistribute it and/or
|
7 | * modify it under the terms of the GNU General Public License
|
||
8 | 40559 | jjdelcerro | * as published by the Free Software Foundation; either version 3
|
9 | 40435 | jjdelcerro | * of the License, or (at your option) any later version.
|
10 | 40559 | jjdelcerro | *
|
11 | 40435 | jjdelcerro | * This program is distributed in the hope that it will be useful,
|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | 40559 | jjdelcerro | *
|
16 | 40435 | jjdelcerro | * You should have received a copy of the GNU General Public License
|
17 | * along with this program; if not, write to the Free Software
|
||
18 | 40559 | jjdelcerro | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 | 40435 | jjdelcerro | * MA 02110-1301, USA.
|
20 | 40559 | jjdelcerro | *
|
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | 40435 | jjdelcerro | */
|
24 | /*
|
||
25 | * AUTHORS (In addition to CIT):
|
||
26 | * 2009 {Iver T.I.} {Task}
|
||
27 | */
|
||
28 | |||
29 | package org.gvsig.fmap.geom.primitive; |
||
30 | |||
31 | import org.cresques.cts.ICoordTrans; |
||
32 | import org.gvsig.fmap.geom.Geometry; |
||
33 | import org.gvsig.tools.lang.Cloneable; |
||
34 | import org.gvsig.tools.persistence.Persistent; |
||
35 | |||
36 | /**
|
||
37 | * <p>
|
||
38 | * This interface is equivalent to the GM_Envelope specified in
|
||
39 | * <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>.
|
||
40 | * A minimum bounding box or rectangle. Regardless of dimension, an Envelope
|
||
41 | * can be represented without ambiguity as two direct positions (coordinate
|
||
42 | * points). To encode an Envelope, it is sufficient to encode these two
|
||
43 | * points. This is consistent with all of the data types in this
|
||
44 | * specification, their state is represented by their publicly accessible
|
||
45 | * attributes.
|
||
46 | * </p>
|
||
47 | * @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>
|
||
48 | * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
||
49 | */
|
||
50 | public interface Envelope extends Persistent, Cloneable{ |
||
51 | /**
|
||
52 | * Returns the center ordinate along the specified dimension.
|
||
53 | * @param dimension.
|
||
54 | * The dimension
|
||
55 | * @return
|
||
56 | * The value of the ordinate.
|
||
57 | * @throws EnvelopeNotInitializedException
|
||
58 | * if the envelope is empty.
|
||
59 | */
|
||
60 | double getCenter(int dimension); |
||
61 | |||
62 | /**
|
||
63 | * The length of coordinate sequence (the number of entries) in this
|
||
64 | * envelope.
|
||
65 | * @return
|
||
66 | * The dimension of the envelope.
|
||
67 | */
|
||
68 | int getDimension();
|
||
69 | |||
70 | /**
|
||
71 | * Returns the envelope length along the specified dimension.
|
||
72 | * @param dimension
|
||
73 | * The dimension.
|
||
74 | * @return
|
||
75 | * The envelope length along a dimension.
|
||
76 | * @throws EnvelopeNotInitializedException
|
||
77 | * if the envelope is empty.
|
||
78 | */
|
||
79 | double getLength(int dimension); |
||
80 | |||
81 | /**
|
||
82 | * A coordinate position consisting of all the minimal ordinates for each
|
||
83 | * dimension for all points within the Envelope.
|
||
84 | * @return
|
||
85 | * The lower corner.
|
||
86 | */
|
||
87 | Point getLowerCorner();
|
||
88 | |||
89 | /**
|
||
90 | * Sets the coordinate position consisting of all the minimal ordinates for each
|
||
91 | * dimension for all points within the Envelope.
|
||
92 | * @param point
|
||
93 | * The lower corner.
|
||
94 | */
|
||
95 | void setLowerCorner(Point point); |
||
96 | |||
97 | /**
|
||
98 | * Returns the maximal ordinate along the specified dimension.
|
||
99 | * @param dimension
|
||
100 | * The dimension.
|
||
101 | * @return
|
||
102 | * The maximum value
|
||
103 | * @throws EnvelopeNotInitializedException
|
||
104 | * if the envelope is empty.
|
||
105 | */
|
||
106 | double getMaximum(int dimension); |
||
107 | |||
108 | /**
|
||
109 | * Returns the minimal ordinate along the specified dimension.
|
||
110 | * @param dimension
|
||
111 | * The dimension.
|
||
112 | * @return
|
||
113 | * The minimum value.
|
||
114 | * @throws EnvelopeNotInitializedException
|
||
115 | * if the envelope is empty.
|
||
116 | */
|
||
117 | double getMinimum(int dimension); |
||
118 | |||
119 | /**
|
||
120 | * A coordinate position consisting of all the maximal ordinates for each
|
||
121 | * dimension for all points within the Envelope.
|
||
122 | * @return
|
||
123 | * The upper corner
|
||
124 | */
|
||
125 | Point getUpperCorner();
|
||
126 | |||
127 | /**
|
||
128 | * Sets the coordinate position consisting of all the maximal ordinates for each
|
||
129 | * dimension for all points within the Envelope.
|
||
130 | * @param point
|
||
131 | * The upper corner.
|
||
132 | */
|
||
133 | void setUpperCorner(Point upperCorner); |
||
134 | |||
135 | /**
|
||
136 | * Adds a envelope to the current envelope.
|
||
137 | * @param envelope
|
||
138 | * The envelope to add.
|
||
139 | */
|
||
140 | void add(Envelope envelope);
|
||
141 | |||
142 | /**
|
||
143 | * It returns the equivalent of an envelope like a geometry.
|
||
144 | * @return
|
||
145 | * A geometry that contains the same area that the envelope.
|
||
146 | * @throws EnvelopeNotInitializedException
|
||
147 | * if the envelope is empty.
|
||
148 | */
|
||
149 | Geometry getGeometry(); |
||
150 | |||
151 | /**
|
||
152 | * Returns <code>true</code> if the new envelope is contained in the
|
||
153 | * current envelope.
|
||
154 | * @param envelope
|
||
155 | * The envelope to compare.
|
||
156 | * @return
|
||
157 | * If the current envelope contains the new envelope
|
||
158 | */
|
||
159 | boolean contains(Envelope envelope);
|
||
160 | |||
161 | /**
|
||
162 | * Returns <code>true</code> if the new envelope intersects with the
|
||
163 | * current envelope.
|
||
164 | * @param envelope
|
||
165 | * The envelope to compare.
|
||
166 | * @return
|
||
167 | * If the current envelope intersects with the new envelope
|
||
168 | */
|
||
169 | boolean intersects(Envelope envelope);
|
||
170 | |||
171 | /**
|
||
172 | * Converts the envelope to other coordinate reference system
|
||
173 | * @param trans
|
||
174 | * The CRS conversor
|
||
175 | * @return
|
||
176 | * A new envelope in other CRS
|
||
177 | * @throws EnvelopeNotInitializedException
|
||
178 | * if the envelope is empty.
|
||
179 | */
|
||
180 | Envelope convert(ICoordTrans trans); |
||
181 | |||
182 | /**
|
||
183 | * Gets if the envelope is <code>null</code> or not. Is
|
||
184 | * Empty means that the lower and upper corner are
|
||
185 | * <code>null</code>.
|
||
186 | * @return
|
||
187 | * <code>null</code> or not if is empty.
|
||
188 | */
|
||
189 | boolean isEmpty();
|
||
190 | } |