Revision 28990 branches/v2_0_0_prep/libraries/libFMap_geometries/src/org/gvsig/fmap/geom/primitive/Envelope.java

View differences:

Envelope.java
1

  
2 1
/* gvSIG. Geographic Information System of the Valencian Government
3
*
4
* Copyright (C) 2007-2008 Infrastructures and Transports Department
5
* of the Valencian Government (CIT)
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation; either version 2
10
* of the License, or (at your option) any later version.
11
*
12
* This program is distributed in the hope that it will be useful,
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
* GNU General Public License for more details.
16
*
17
* You should have received a copy of the GNU General Public License
18
* along with this program; if not, write to the Free Software
19
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
* MA  02110-1301, USA.
21
*
22
*/
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
 */
23 22

  
24 23
/*
25
* AUTHORS (In addition to CIT):
26
* ${year} IVER T.I. S.A.   {{Task}}
27
*/
24
 * AUTHORS (In addition to CIT):
25
 * 2009 {Iver T.I.}   {Task}
26
 */
28 27

  
29
/* gvSIG. Geographic Information System of the Valencian Government
30
*
31
* Copyright (C) 2007-2008 Infrastructures and Transports Department
32
* of the Valencian Government (CIT)
33
*
34
* This program is free software; you can redistribute it and/or
35
* modify it under the terms of the GNU General Public License
36
* as published by the Free Software Foundation; either version 2
37
* of the License, or (at your option) any later version.
38
*
39
* This program is distributed in the hope that it will be useful,
40
* but WITHOUT ANY WARRANTY; without even the implied warranty of
41
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
42
* GNU General Public License for more details.
43
*
44
* You should have received a copy of the GNU General Public License
45
* along with this program; if not, write to the Free Software
46
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
47
* MA  02110-1301, USA.
48
*
49
*/
50
/*
51
* AUTHORS (In addition to CIT):
52
* ${year} IVER T.I. S.A.   {{Task}}
53
*/
54 28
package org.gvsig.fmap.geom.primitive;
55 29

  
56 30
import org.cresques.cts.ICoordTrans;
57 31
import org.gvsig.fmap.geom.Geometry;
58 32

  
59

  
60

  
61 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>.
62 37
 * A minimum bounding box or rectangle. Regardless of dimension, an Envelope
63 38
 * can be represented without ambiguity as two direct positions (coordinate
64 39
 * points). To encode an Envelope, it is sufficient to encode these two
65 40
 * points. This is consistent with all of the data types in this
66 41
 * specification, their state is represented by their publicly accessible
67 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>
68 46
 */
69 47
public interface Envelope {
70 48
    /**
71 49
     * Returns the center ordinate along the specified dimension.
72
     *
73
     * @param dimension DOCUMENT ME!
74
     *
75
     * @return DOCUMENT ME!
50
     * @param dimension.
51
     * The dimension
52
     * @return 
53
     * The value of the ordinate.
76 54
     */
77 55
    double getCenter(int dimension);
78 56

  
79 57
    /**
80 58
     * The length of coordinate sequence (the number of entries) in this
81 59
     * envelope.
82
     *
83
     * @return DOCUMENT ME!
60
     * @return 
61
     * The dimension of the envelope.
84 62
     */
85 63
    int getDimension();
86 64

  
87 65
    /**
88 66
     * Returns the envelope length along the specified dimension.
89
     *
90 67
     * @param dimension
91
     *
68
     * The dimension.
92 69
     * @return
70
     * The envelope length along a dimension.
93 71
     */
94 72
    double getLength(int dimension);
95 73

  
96 74
    /**
97 75
     * A coordinate position consisting of all the minimal ordinates for each
98 76
     * dimension for all points within the Envelope.
99
     *
100 77
     * @return
78
     * The lower corner.
101 79
     */
102 80
    Point getLowerCorner();
103 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
     */
104 88
    void setLowerCorner(Point point);
105 89

  
106 90
    /**
107 91
     * Returns the maximal ordinate along the specified dimension.
108
     *
109 92
     * @param dimension
110
     *
93
     * The dimension.
111 94
     * @return
95
     * The maximum value
112 96
     */
113 97
    double getMaximum(int dimension);
114 98

  
115 99
    /**
116 100
     * Returns the minimal ordinate along the specified dimension.
117
     *
118
     * @param dimension
119
     *
101
     * @param dimension     
102
     * The dimension.
120 103
     * @return
104
     * The minimum value.
121 105
     */
122 106
    double getMinimum(int dimension);
123 107

  
124 108
    /**
125 109
     * A coordinate position consisting of all the maximal ordinates for each
126 110
     * dimension for all points within the Envelope.
127
     *
128 111
     * @return
112
     * The upper corner
129 113
     */
130 114
    Point getUpperCorner();
131 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
     */
132 122
    void setUpperCorner(Point upperCorner);
133 123

  
134
	void add(Envelope boundsShp);
124
    /**
125
     * Adds a envelope to the current envelope.
126
     * @param envelope
127
     * The envelope to add.
128
     */
129
	void add(Envelope envelope);
135 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
	 */
136 138
	Geometry getGeometry();
137 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
	 */
138 148
	boolean contains(Envelope envelope);
139 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
	 */
140 158
	boolean intersects(Envelope envelope);
141 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
	 */
142 167
	Envelope convert(ICoordTrans trans);
143 168
}

Also available in: Unified diff