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 / SurfaceAppearance.java @ 40559
History | View | Annotate | Download (6.99 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
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 3
|
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 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
/*
|
25 |
* AUTHORS (In addition to CIT):
|
26 |
* 2008 Instituto de Autom?tica e Inform?tica Industrial, UPV.
|
27 |
*/
|
28 |
package org.gvsig.fmap.geom.primitive; |
29 |
|
30 |
/**
|
31 |
* This interface serves to set the surface appearance characteristics like textures
|
32 |
* materials or colors.
|
33 |
*
|
34 |
*/
|
35 |
|
36 |
/**
|
37 |
*
|
38 |
* @author Jordi Torres Fabra <jtorres@ai2.upv.es>
|
39 |
*
|
40 |
*/
|
41 |
|
42 |
public interface SurfaceAppearance extends Appearance { |
43 |
|
44 |
public static final class AttributeBinding { |
45 |
public static final int BIND_OFF = 0; |
46 |
public static final int BIND_OVERALL = 1; |
47 |
public static final int BIND_PER_PRIMITIVE_SET = 2; |
48 |
public static final int BIND_PER_PRIMITIVE = 3; |
49 |
public static final int BIND_PER_VERTEX = 4; |
50 |
} |
51 |
|
52 |
public static class PrimitiveMode { |
53 |
public static final int POINTS = 0; |
54 |
public static final int LINES = 1; |
55 |
public static final int LINE_STRIP = 3; |
56 |
public static final int LINE_LOOP = 2; |
57 |
public static final int TRIANGLES = 4; |
58 |
public static final int TRIANGLE_STRIP = 5; |
59 |
public static final int TRIANGLE_FAN = 6; |
60 |
public static final int QUADS = 7; |
61 |
public static final int QUAD_STRIP = 8; |
62 |
public static final int POLYGON = 9; |
63 |
} |
64 |
|
65 |
public static class PrimitiveType { |
66 |
public static final int PrimitiveType = 0; |
67 |
public static final int DrawArrays = 1; |
68 |
public static final int DrawArrayLengths = 2; |
69 |
public static final int DrawElementsUInt = 5; |
70 |
} |
71 |
|
72 |
/**
|
73 |
* Add a normal vector to the normal array of the surface
|
74 |
*
|
75 |
* @param p
|
76 |
*/
|
77 |
public void addNormal(Point p); |
78 |
|
79 |
/**
|
80 |
* Sets normal vector in a concrete position.
|
81 |
*
|
82 |
* @param position
|
83 |
* the array position to set the normal vector
|
84 |
* @param p
|
85 |
* the normal vector to set (dimension 3)
|
86 |
*
|
87 |
*/
|
88 |
public void setNormalAt(int position, Point p); |
89 |
|
90 |
/**
|
91 |
* Gets the normal vector in a concrete position
|
92 |
*
|
93 |
* @param position
|
94 |
* the direct position
|
95 |
* @return the normal vector
|
96 |
*
|
97 |
*/
|
98 |
public Point getNormalAt(int position); |
99 |
|
100 |
/**
|
101 |
* Get the number of normals in the surface
|
102 |
*
|
103 |
* @return an integer representing the number of normals
|
104 |
*/
|
105 |
public int getNumNormals(); |
106 |
|
107 |
/**
|
108 |
* Remove normal vector in a concrete position
|
109 |
*
|
110 |
* @param position
|
111 |
* the direct position
|
112 |
*/
|
113 |
public void removeNormal(int position); |
114 |
|
115 |
/**
|
116 |
* Sets the binding of normal array to Surface Geometry.
|
117 |
*
|
118 |
* @param binding
|
119 |
* Value of the binding
|
120 |
*
|
121 |
*/
|
122 |
public void setNormalBinding(AttributeBinding binding); |
123 |
|
124 |
/**
|
125 |
* Gets the binding of normal array
|
126 |
*
|
127 |
* @return Value representing attributeBinding
|
128 |
*
|
129 |
*/
|
130 |
public AttributeBinding getNormalBinding();
|
131 |
|
132 |
/**
|
133 |
* Adds a texture coordinate to TexCoord array in Surface
|
134 |
*
|
135 |
* @param p
|
136 |
* the texture coordinate (dimension 2)
|
137 |
*/
|
138 |
|
139 |
public void addTextureCoord(Point p); |
140 |
|
141 |
/**
|
142 |
* Set texture coordinate at concrete position
|
143 |
*
|
144 |
* @param position
|
145 |
* the concrete position
|
146 |
* @param p
|
147 |
* the texture coordinate value
|
148 |
*/
|
149 |
public void setTextureCoordAt(int position, Point p); |
150 |
|
151 |
/**
|
152 |
* Get texture coordinate at concrete position
|
153 |
*
|
154 |
* @param position
|
155 |
* the concrete position
|
156 |
* @return the texure coordinate (dimension 2)
|
157 |
*/
|
158 |
public Point getTextureCoordAt(int position); |
159 |
|
160 |
/**
|
161 |
* Gets the number of texture coordinates in the texcoord array of the
|
162 |
* surface
|
163 |
*
|
164 |
* @return the number of texture coordinates
|
165 |
*/
|
166 |
public int getNumTextureCoords(); |
167 |
|
168 |
/**
|
169 |
* Remove texture coordinate at concrete position
|
170 |
*
|
171 |
* @param position
|
172 |
*/
|
173 |
public void removeTextureCoord(int position); |
174 |
|
175 |
/**
|
176 |
* Add a index in the index array of the surface
|
177 |
*
|
178 |
* @param element
|
179 |
* the index to add
|
180 |
*/
|
181 |
public void addIndex(int element); |
182 |
|
183 |
/**
|
184 |
* Get the index element at concrete position
|
185 |
*
|
186 |
* @param position
|
187 |
* the concrete position
|
188 |
* @return teh index element
|
189 |
*/
|
190 |
public int getIndexAt(int position); |
191 |
|
192 |
/**
|
193 |
* Set an index element in a concrete position
|
194 |
*
|
195 |
* @param position
|
196 |
* the concrete position
|
197 |
* @param element
|
198 |
* the index element
|
199 |
*/
|
200 |
public void setIndexAt(int position, int element); |
201 |
|
202 |
/**
|
203 |
* Remove index element at concrete position
|
204 |
*
|
205 |
* @param position
|
206 |
* the concrete position
|
207 |
*/
|
208 |
public void removeIndex(int position); |
209 |
|
210 |
/**
|
211 |
* Get number of indices in the index array of the surface
|
212 |
*
|
213 |
* @return the number of indices
|
214 |
*/
|
215 |
public int getNumIndices(); |
216 |
|
217 |
/**
|
218 |
* Get the primitive mode of the surface
|
219 |
*
|
220 |
* @return the primitive mode
|
221 |
*/
|
222 |
public PrimitiveMode getPrimitiveMode();
|
223 |
|
224 |
/**
|
225 |
* Sets the primitive mode of the surface
|
226 |
*
|
227 |
* @param mode
|
228 |
* the primitive mode
|
229 |
*/
|
230 |
public void setPrimitiveMode(PrimitiveMode mode); |
231 |
|
232 |
/**
|
233 |
* Get the primitive type of the surface
|
234 |
*
|
235 |
* @return the primitive type
|
236 |
*/
|
237 |
public PrimitiveType getPrimitiveType();
|
238 |
|
239 |
/**
|
240 |
* Set the primitive type of the surface
|
241 |
*
|
242 |
* @param type
|
243 |
* the primitive type
|
244 |
*/
|
245 |
public void setPrimitiveType(PrimitiveType type); |
246 |
|
247 |
/**
|
248 |
* Add a color to teh color array of the surface
|
249 |
*
|
250 |
* @param p
|
251 |
* the color(dimension 4 rgba)
|
252 |
*/
|
253 |
public void addColor(Point p); |
254 |
|
255 |
/**
|
256 |
* Set a color in a concrete position of the color array
|
257 |
*
|
258 |
* @param position
|
259 |
* the concrete position
|
260 |
* @param p
|
261 |
* the color(dimension 4 rgba)
|
262 |
*/
|
263 |
public void setColorAt(int position, Point p); |
264 |
|
265 |
/**
|
266 |
* Get the color at concrete position
|
267 |
*
|
268 |
* @param position
|
269 |
* the concrete position
|
270 |
* @return the color
|
271 |
*/
|
272 |
public Point getColorAt(int position); |
273 |
|
274 |
/**
|
275 |
* Remove color in a concrete position
|
276 |
*
|
277 |
* @param position
|
278 |
* the concrete position
|
279 |
*/
|
280 |
public void removeColor(int position); |
281 |
|
282 |
/**
|
283 |
* Get the number of colors in the color array of the surface
|
284 |
*
|
285 |
* @return
|
286 |
*/
|
287 |
public int getNumColors(); |
288 |
|
289 |
/**
|
290 |
* Sets the colorbinding of the color array of the surface
|
291 |
*
|
292 |
* @param binding
|
293 |
* attribute binding representing color binding
|
294 |
*/
|
295 |
public void setColorBinding(AttributeBinding binding); |
296 |
|
297 |
/**
|
298 |
* Get the color binding of the color array of the surface
|
299 |
*
|
300 |
* @return Attribute binding representing color binding
|
301 |
*/
|
302 |
public AttributeBinding getColorBinding();
|
303 |
|
304 |
} |