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

History | View | Annotate | Download (6.89 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
package org.gvsig.fmap.geom.primitive;
25

    
26
/**
27
 * This interface serves to set the surface appearance characteristics like textures 
28
 * materials or colors.
29
 *  
30
 */
31

    
32
/**
33
 * 
34
 * @author Jordi Torres Fabra <jtorres@ai2.upv.es>
35
 * 
36
 */
37

    
38
public interface SurfaceAppearance extends Appearance {
39

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

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

    
61
        public static class PrimitiveType {
62
                public static final int PrimitiveType = 0;
63
                public static final int DrawArrays = 1;
64
                public static final int DrawArrayLengths = 2;
65
                public static final int DrawElementsUInt = 5;
66
        }
67

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

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

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

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

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

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

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

    
128
        /**
129
         * Adds a texture coordinate to TexCoord array in Surface
130
         * 
131
         * @param p
132
         *            the texture coordinate (dimension 2)
133
         */
134

    
135
        public void addTextureCoord(Point p);
136

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

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

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

    
164
        /**
165
         * Remove texture coordinate at concrete position
166
         * 
167
         * @param position
168
         */
169
        public void removeTextureCoord(int position);
170

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

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

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

    
198
        /**
199
         * Remove index element at concrete position
200
         * 
201
         * @param position
202
         *            the concrete position
203
         */
204
        public void removeIndex(int position);
205

    
206
        /**
207
         * Get number of indices in the index array of the surface
208
         * 
209
         * @return the number of indices
210
         */
211
        public int getNumIndices();
212

    
213
        /**
214
         * Get the primitive mode of the surface
215
         * 
216
         * @return the primitive mode
217
         */
218
        public PrimitiveMode getPrimitiveMode();
219

    
220
        /**
221
         * Sets the primitive mode of the surface
222
         * 
223
         * @param mode
224
         *            the primitive mode
225
         */
226
        public void setPrimitiveMode(PrimitiveMode mode);
227

    
228
        /**
229
         * Get the primitive type of the surface
230
         * 
231
         * @return the primitive type
232
         */
233
        public PrimitiveType getPrimitiveType();
234

    
235
        /**
236
         * Set the primitive type of the surface
237
         * 
238
         * @param type
239
         *            the primitive type
240
         */
241
        public void setPrimitiveType(PrimitiveType type);
242

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

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

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

    
270
        /**
271
         * Remove color in a concrete position
272
         * 
273
         * @param position
274
         *            the concrete position
275
         */
276
        public void removeColor(int position);
277

    
278
        /**
279
         * Get the number of colors in the color array of the surface
280
         * 
281
         * @return
282
         */
283
        public int getNumColors();
284

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

    
293
        /**
294
         * Get the color binding of the color array of the surface
295
         * 
296
         * @return Attribute binding representing color binding
297
         */
298
        public AttributeBinding getColorBinding();
299

    
300
}