svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / primitive / Envelope.java @ 28990
History | View | Annotate | Download (4.95 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 |
|
33 |
/**
|
34 |
* <p>
|
35 |
* This interface is equivalent to the GM_Envelope specified in
|
36 |
* <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>.
|
37 |
* A minimum bounding box or rectangle. Regardless of dimension, an Envelope
|
38 |
* can be represented without ambiguity as two direct positions (coordinate
|
39 |
* points). To encode an Envelope, it is sufficient to encode these two
|
40 |
* points. This is consistent with all of the data types in this
|
41 |
* specification, their state is represented by their publicly accessible
|
42 |
* attributes.
|
43 |
* </p>
|
44 |
* @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>
|
45 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
46 |
*/
|
47 |
public interface Envelope { |
48 |
/**
|
49 |
* Returns the center ordinate along the specified dimension.
|
50 |
* @param dimension.
|
51 |
* The dimension
|
52 |
* @return
|
53 |
* The value of the ordinate.
|
54 |
*/
|
55 |
double getCenter(int dimension); |
56 |
|
57 |
/**
|
58 |
* The length of coordinate sequence (the number of entries) in this
|
59 |
* envelope.
|
60 |
* @return
|
61 |
* The dimension of the envelope.
|
62 |
*/
|
63 |
int getDimension();
|
64 |
|
65 |
/**
|
66 |
* Returns the envelope length along the specified dimension.
|
67 |
* @param dimension
|
68 |
* The dimension.
|
69 |
* @return
|
70 |
* The envelope length along a dimension.
|
71 |
*/
|
72 |
double getLength(int dimension); |
73 |
|
74 |
/**
|
75 |
* A coordinate position consisting of all the minimal ordinates for each
|
76 |
* dimension for all points within the Envelope.
|
77 |
* @return
|
78 |
* The lower corner.
|
79 |
*/
|
80 |
Point getLowerCorner();
|
81 |
|
82 |
/**
|
83 |
* Sets the coordinate position consisting of all the minimal ordinates for each
|
84 |
* dimension for all points within the Envelope.
|
85 |
* @param point
|
86 |
* The lower corner.
|
87 |
*/
|
88 |
void setLowerCorner(Point point); |
89 |
|
90 |
/**
|
91 |
* Returns the maximal ordinate along the specified dimension.
|
92 |
* @param dimension
|
93 |
* The dimension.
|
94 |
* @return
|
95 |
* The maximum value
|
96 |
*/
|
97 |
double getMaximum(int dimension); |
98 |
|
99 |
/**
|
100 |
* Returns the minimal ordinate along the specified dimension.
|
101 |
* @param dimension
|
102 |
* The dimension.
|
103 |
* @return
|
104 |
* The minimum value.
|
105 |
*/
|
106 |
double getMinimum(int dimension); |
107 |
|
108 |
/**
|
109 |
* A coordinate position consisting of all the maximal ordinates for each
|
110 |
* dimension for all points within the Envelope.
|
111 |
* @return
|
112 |
* The upper corner
|
113 |
*/
|
114 |
Point getUpperCorner();
|
115 |
|
116 |
/**
|
117 |
* Sets the coordinate position consisting of all the maximal ordinates for each
|
118 |
* dimension for all points within the Envelope.
|
119 |
* @param point
|
120 |
* The upper corner.
|
121 |
*/
|
122 |
void setUpperCorner(Point upperCorner); |
123 |
|
124 |
/**
|
125 |
* Adds a envelope to the current envelope.
|
126 |
* @param envelope
|
127 |
* The envelope to add.
|
128 |
*/
|
129 |
void add(Envelope envelope);
|
130 |
|
131 |
/**
|
132 |
* This method exists by historical reasons. It return the same
|
133 |
* instance of the Envelope.
|
134 |
* @deprecated
|
135 |
* @return
|
136 |
* The envelope.
|
137 |
*/
|
138 |
Geometry getGeometry(); |
139 |
|
140 |
/**
|
141 |
* Returns <code>true</code> if the new envelope is contained in the
|
142 |
* current envelope.
|
143 |
* @param envelope
|
144 |
* The envelope to compare.
|
145 |
* @return
|
146 |
* If the current envelope contains the new envelope
|
147 |
*/
|
148 |
boolean contains(Envelope envelope);
|
149 |
|
150 |
/**
|
151 |
* Returns <code>true</code> if the new envelope intersects with the
|
152 |
* current envelope.
|
153 |
* @param envelope
|
154 |
* The envelope to compare.
|
155 |
* @return
|
156 |
* If the current envelope intersects with the new envelope
|
157 |
*/
|
158 |
boolean intersects(Envelope envelope);
|
159 |
|
160 |
/**
|
161 |
* Converts the envelope to other coordinate reference system
|
162 |
* @param trans
|
163 |
* The CRS conversor
|
164 |
* @return
|
165 |
* A new envelope in other CRS
|
166 |
*/
|
167 |
Envelope convert(ICoordTrans trans); |
168 |
} |