Statistics
| Revision:

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 @ 40435

History | View | Annotate | Download (6.97 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *  osgVP. OSG Virtual Planets.
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
 */
23
/*
24
 * AUTHORS (In addition to CIT):
25
 * 2008 Instituto de Autom?tica e Inform?tica Industrial, UPV.
26
 */
27
package org.gvsig.fmap.geom.primitive;
28

    
29
/**
30
 * This interface serves to set the surface appearance characteristics like textures 
31
 * materials or colors.
32
 *  
33
 */
34

    
35
/**
36
 * 
37
 * @author Jordi Torres Fabra <jtorres@ai2.upv.es>
38
 * 
39
 */
40

    
41
public interface SurfaceAppearance extends Appearance {
42

    
43
        public static final class AttributeBinding {
44
                public static final int BIND_OFF = 0;
45
                public static final int BIND_OVERALL = 1;
46
                public static final int BIND_PER_PRIMITIVE_SET = 2;
47
                public static final int BIND_PER_PRIMITIVE = 3;
48
                public static final int BIND_PER_VERTEX = 4;
49
        }
50

    
51
        public static class PrimitiveMode {
52
                public static final int POINTS = 0;
53
                public static final int LINES = 1;
54
                public static final int LINE_STRIP = 3;
55
                public static final int LINE_LOOP = 2;
56
                public static final int TRIANGLES = 4;
57
                public static final int TRIANGLE_STRIP = 5;
58
                public static final int TRIANGLE_FAN = 6;
59
                public static final int QUADS = 7;
60
                public static final int QUAD_STRIP = 8;
61
                public static final int POLYGON = 9;
62
        }
63

    
64
        public static class PrimitiveType {
65
                public static final int PrimitiveType = 0;
66
                public static final int DrawArrays = 1;
67
                public static final int DrawArrayLengths = 2;
68
                public static final int DrawElementsUInt = 5;
69
        }
70

    
71
        /**
72
         * Add a normal vector to the normal array of the surface
73
         * 
74
         * @param p
75
         */
76
        public void addNormal(Point p);
77

    
78
        /**
79
         * Sets normal vector in a concrete position.
80
         * 
81
         * @param position
82
         *            the array position to set the normal vector
83
         * @param p
84
         *            the normal vector to set (dimension 3)
85
         * 
86
         */
87
        public void setNormalAt(int position, Point p);
88

    
89
        /**
90
         * Gets the normal vector in a concrete position
91
         * 
92
         * @param position
93
         *            the direct position
94
         * @return the normal vector
95
         * 
96
         */
97
        public Point getNormalAt(int position);
98

    
99
        /**
100
         * Get the number of normals in the surface
101
         * 
102
         * @return an integer representing the number of normals
103
         */
104
        public int getNumNormals();
105

    
106
        /**
107
         * Remove normal vector in a concrete position
108
         * 
109
         * @param position
110
         *            the direct position
111
         */
112
        public void removeNormal(int position);
113

    
114
        /**
115
         * Sets the binding of normal array to Surface Geometry.
116
         * 
117
         * @param binding
118
         *            Value of the binding
119
         * 
120
         */
121
        public void setNormalBinding(AttributeBinding binding);
122

    
123
        /**
124
         * Gets the binding of normal array
125
         * 
126
         * @return Value representing attributeBinding
127
         * 
128
         */
129
        public AttributeBinding getNormalBinding();
130

    
131
        /**
132
         * Adds a texture coordinate to TexCoord array in Surface
133
         * 
134
         * @param p
135
         *            the texture coordinate (dimension 2)
136
         */
137

    
138
        public void addTextureCoord(Point p);
139

    
140
        /**
141
         * Set texture coordinate at concrete position
142
         * 
143
         * @param position
144
         *            the concrete position
145
         * @param p
146
         *            the texture coordinate value
147
         */
148
        public void setTextureCoordAt(int position, Point p);
149

    
150
        /**
151
         * Get texture coordinate at concrete position
152
         * 
153
         * @param position
154
         *            the concrete position
155
         * @return the texure coordinate (dimension 2)
156
         */
157
        public Point getTextureCoordAt(int position);
158

    
159
        /**
160
         * Gets the number of texture coordinates in the texcoord array of the
161
         * surface
162
         * 
163
         * @return the number of texture coordinates
164
         */
165
        public int getNumTextureCoords();
166

    
167
        /**
168
         * Remove texture coordinate at concrete position
169
         * 
170
         * @param position
171
         */
172
        public void removeTextureCoord(int position);
173

    
174
        /**
175
         * Add a index in the index array of the surface
176
         * 
177
         * @param element
178
         *            the index to add
179
         */
180
        public void addIndex(int element);
181

    
182
        /**
183
         * Get the index element at concrete position
184
         * 
185
         * @param position
186
         *            the concrete position
187
         * @return teh index element
188
         */
189
        public int getIndexAt(int position);
190

    
191
        /**
192
         * Set an index element in a concrete position
193
         * 
194
         * @param position
195
         *            the concrete position
196
         * @param element
197
         *            the index element
198
         */
199
        public void setIndexAt(int position, int element);
200

    
201
        /**
202
         * Remove index element at concrete position
203
         * 
204
         * @param position
205
         *            the concrete position
206
         */
207
        public void removeIndex(int position);
208

    
209
        /**
210
         * Get number of indices in the index array of the surface
211
         * 
212
         * @return the number of indices
213
         */
214
        public int getNumIndices();
215

    
216
        /**
217
         * Get the primitive mode of the surface
218
         * 
219
         * @return the primitive mode
220
         */
221
        public PrimitiveMode getPrimitiveMode();
222

    
223
        /**
224
         * Sets the primitive mode of the surface
225
         * 
226
         * @param mode
227
         *            the primitive mode
228
         */
229
        public void setPrimitiveMode(PrimitiveMode mode);
230

    
231
        /**
232
         * Get the primitive type of the surface
233
         * 
234
         * @return the primitive type
235
         */
236
        public PrimitiveType getPrimitiveType();
237

    
238
        /**
239
         * Set the primitive type of the surface
240
         * 
241
         * @param type
242
         *            the primitive type
243
         */
244
        public void setPrimitiveType(PrimitiveType type);
245

    
246
        /**
247
         * Add a color to teh color array of the surface
248
         * 
249
         * @param p
250
         *            the color(dimension 4 rgba)
251
         */
252
        public void addColor(Point p);
253

    
254
        /**
255
         * Set a color in a concrete position of the color array
256
         * 
257
         * @param position
258
         *            the concrete position
259
         * @param p
260
         *            the color(dimension 4 rgba)
261
         */
262
        public void setColorAt(int position, Point p);
263

    
264
        /**
265
         * Get the color at concrete position
266
         * 
267
         * @param position
268
         *            the concrete position
269
         * @return the color
270
         */
271
        public Point getColorAt(int position);
272

    
273
        /**
274
         * Remove color in a concrete position
275
         * 
276
         * @param position
277
         *            the concrete position
278
         */
279
        public void removeColor(int position);
280

    
281
        /**
282
         * Get the number of colors in the color array of the surface
283
         * 
284
         * @return
285
         */
286
        public int getNumColors();
287

    
288
        /**
289
         * Sets the colorbinding of the color array of the surface
290
         * 
291
         * @param binding
292
         *            attribute binding representing color binding
293
         */
294
        public void setColorBinding(AttributeBinding binding);
295

    
296
        /**
297
         * Get the color binding of the color array of the surface
298
         * 
299
         * @return Attribute binding representing color binding
300
         */
301
        public AttributeBinding getColorBinding();
302

    
303
}