svn-gvsig-desktop / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / primitive / Surface.java @ 29018
History | View | Annotate | Download (4.92 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 |
/**
|
31 |
* <p>
|
32 |
* This interface is equivalent to the GM_Surface specified in
|
33 |
* <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>.
|
34 |
* Surface is a subclass of {@link Primitive} and is the basis for 2-dimensional geometry.
|
35 |
* Unorientable surfaces such as the M�bius band are not allowed.
|
36 |
* <p/>
|
37 |
* <p>
|
38 |
* The orientation of a surface chooses an "up" direction through the choice of the upward normal,
|
39 |
* which, if the surface is not a cycle, is the side of the surface from which the exterior boundary
|
40 |
* appears counterclockwise. Reversal of the surface orientation reverses the curve orientation of
|
41 |
* each boundary component, and interchanges the conceptual "up" and "down" direction of the surface.
|
42 |
* </p>
|
43 |
* <p>
|
44 |
* If the surface is the boundary of a solid, the "up" direction is usually outward.
|
45 |
* For closed surfaces, which have no boundary, the up direction is that of the surface patches,
|
46 |
* which must be consistent with one another.
|
47 |
* </p>
|
48 |
* @see <a href="http://www.iso.org/iso/iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=26012">ISO 19107</a>
|
49 |
* @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
|
50 |
*/
|
51 |
public interface Surface extends OrientableSurface { |
52 |
|
53 |
|
54 |
public static final class AttributeBinding { |
55 |
// default
|
56 |
public static final int BIND_OFF = 0; |
57 |
public static final int BIND_OVERALL = 1; |
58 |
public static final int BIND_PER_PRIMITIVE_SET = 2; |
59 |
public static final int BIND_PER_PRIMITIVE = 3; |
60 |
public static final int BIND_PER_VERTEX = 4; |
61 |
} |
62 |
|
63 |
|
64 |
/**
|
65 |
* Sets all the coordinates of the surface.
|
66 |
* @param generalPathX
|
67 |
* The generalPath that contains all the coordinates.
|
68 |
*/
|
69 |
public void setGeneralPath(GeneralPathX generalPathX); |
70 |
|
71 |
/**
|
72 |
* Gets the one of the values of a coordinate (direct position)
|
73 |
* in a concrete dimension.
|
74 |
* @param index
|
75 |
* The index of the direct position to set.
|
76 |
* @param dimension
|
77 |
* The dimension of the direct position.
|
78 |
* @return
|
79 |
* The value of the coordinate
|
80 |
*/
|
81 |
public double getCoordinateAt(int index, int dimension); |
82 |
|
83 |
/**
|
84 |
* Sets the value of a coordinate (direct position) in a concrete dimension.
|
85 |
* @param index
|
86 |
* The index of the direct position to set.
|
87 |
* @param dimension
|
88 |
* The dimension of the direct position.
|
89 |
* @param value
|
90 |
* The value to set
|
91 |
*/
|
92 |
public void setCoordinateAt(int index, int dimension, double value); |
93 |
|
94 |
/**
|
95 |
* Adds a vertex (or direct position) to the curve.
|
96 |
* @param point
|
97 |
* The new point to add.
|
98 |
*/
|
99 |
public void addVertex(Point point); |
100 |
|
101 |
/**
|
102 |
* Remove a vertex (direct position) to the curve.
|
103 |
* @param index
|
104 |
* The index of the vertex to remove.
|
105 |
*/
|
106 |
public void removeVertex(int index); |
107 |
|
108 |
/** Gets a vertex (direct position).
|
109 |
* @param index
|
110 |
* The index of the vertex to get.
|
111 |
* @return
|
112 |
* One point.
|
113 |
*/
|
114 |
public Point getVertex(int index); |
115 |
|
116 |
/**
|
117 |
* Gets the number of vertices (direct positions) of the curve.
|
118 |
* @return
|
119 |
* The number of vertices.
|
120 |
*/
|
121 |
public int getNumVertices(); |
122 |
|
123 |
/**
|
124 |
* Inserts a vertex (direct position) to the curve.
|
125 |
* @param index
|
126 |
* The index of the vertex where the new point has to be added.
|
127 |
* @param p
|
128 |
* The vertex to add.
|
129 |
*/
|
130 |
|
131 |
|
132 |
public void insertVertex(int index, Point p); |
133 |
|
134 |
//COLORS
|
135 |
|
136 |
public void addColor(Point p); |
137 |
|
138 |
public void setColorAt(int index, Point p); |
139 |
|
140 |
public Point getColorAt(int index); |
141 |
|
142 |
public int getNumColors(); |
143 |
|
144 |
public void setColorBinding(AttributeBinding binding); |
145 |
|
146 |
public AttributeBinding getColorBinding();
|
147 |
|
148 |
//NORMALS
|
149 |
|
150 |
public void addNormal(Point p); |
151 |
|
152 |
public void setNormalAt(int index, Point p); |
153 |
|
154 |
public Point getNormalAt(int index); |
155 |
|
156 |
public int getNumNormals(); |
157 |
|
158 |
public void setNormalBinding(AttributeBinding binding); |
159 |
|
160 |
public AttributeBinding getNormalBinding();
|
161 |
|
162 |
//TEXTURECOORDS
|
163 |
|
164 |
public void addTextureCoord(int index, Point p); |
165 |
|
166 |
public void setTextureCoordAt(int index, Point p); |
167 |
|
168 |
public Point getTextureCoordAt(int index); |
169 |
|
170 |
public int getNumTextureCoords(); |
171 |
|
172 |
|
173 |
} |