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