Statistics
| Revision:

root / trunk / extensions / extRasterTools-SE / src / org / gvsig / rastertools / vectorizacion / vector / VectorData.java @ 23467

History | View | Annotate | Download (4.63 KB)

1
/* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana
2
 *
3
 * Copyright (C) 2007 IVER T.I. and Generalitat Valenciana.
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,USA.
18
 */
19
package org.gvsig.rastertools.vectorizacion.vector;
20

    
21
import java.util.Observable;
22

    
23
import org.cresques.cts.IProjection;
24
/**
25
 * Modelo de datos correspondiente a la interfaz de vectorizaci?n
26
 * 
27
 * 15/07/2008
28
 * @author Nacho Brodin nachobrodin@gmail.com
29
 */
30
public class VectorData extends Observable {
31
        public static int       NONE                  = -1;
32
        public final static int CONTOUR_LINES         = 1;
33
        public final static int POTRACE_LINES         = 2;
34
        private int             algorithm             = CONTOUR_LINES;
35
        private double          distance              = 255;
36
        private IProjection     projLayer             = null;
37
        private int             policy                = 5;
38
        private int             despeckle             = 0;
39
        private double          cornerThreshold       = 1.0;
40
        private double          optimizationTolerance = 0.2;
41
        private int             outputQuantizqtion    = 10;
42
        private boolean         curveOptimization     = true;
43

    
44
        /**
45
         * @return the policy
46
         */
47
        public int getPolicy() {
48
                return policy;
49
        }
50

    
51
        /**
52
         * @param policy the policy to set
53
         */
54
        public void setPolicy(int policy) {
55
                this.policy = policy;
56
                updateObservers();
57
        }
58

    
59
        /**
60
         * @return the despeckle
61
         */
62
        public int getDespeckle() {
63
                return despeckle;
64
        }
65

    
66
        /**
67
         * @param despeckle the despeckle to set
68
         */
69
        public void setDespeckle(int despeckle) {
70
                this.despeckle = despeckle;
71
                updateObservers();
72
        }
73

    
74
        /**
75
         * @return the cornerThreshold
76
         */
77
        public double getCornerThreshold() {
78
                return cornerThreshold;
79
        }
80

    
81
        /**
82
         * @param cornerThreshold the cornerThreshold to set
83
         */
84
        public void setCornerThreshold(double cornerThreshold) {
85
                this.cornerThreshold = cornerThreshold;
86
                updateObservers();
87
        }
88

    
89
        /**
90
         * @return the optimizationTolerance
91
         */
92
        public double getOptimizationTolerance() {
93
                return optimizationTolerance;
94
        }
95

    
96
        /**
97
         * @param optimizationTolerance the optimizationTolerance to set
98
         */
99
        public void setOptimizationTolerance(double optimizationTolerance) {
100
                this.optimizationTolerance = optimizationTolerance;
101
                updateObservers();
102
        }
103

    
104
        /**
105
         * @return the outputQuantizqtion
106
         */
107
        public int getOutputQuantizqtion() {
108
                return outputQuantizqtion;
109
        }
110

    
111
        /**
112
         * @param outputQuantizqtion the outputQuantizqtion to set
113
         */
114
        public void setOutputQuantizqtion(int outputQuantizqtion) {
115
                this.outputQuantizqtion = outputQuantizqtion;
116
                updateObservers();
117
        }
118

    
119
        /**
120
         * @return the curveOptimization
121
         */
122
        public boolean isCurveOptimization() {
123
                return curveOptimization;
124
        }
125

    
126
        /**
127
         * @param curveOptimization the curveOptimization to set
128
         */
129
        public void setCurveOptimization(boolean curveOptimization) {
130
                this.curveOptimization = curveOptimization;
131
                updateObservers();
132
        }
133

    
134
        /**
135
         * Obtiene la proyeccion que se le asignar? a la capa 
136
         * vectorial.
137
         * @return IProjection
138
         */
139
        public IProjection getProjLayer() {
140
                return projLayer;
141
        }
142

    
143
        /**
144
         * Asigna la proyeccion que se le asignar? a la capa 
145
         * vectorial.
146
         * @param IProjection
147
         */
148
        public void setProjLayer(IProjection projLayer) {
149
                this.projLayer = projLayer;
150
                updateObservers();
151
        }
152

    
153
        /**
154
         * Obtiene el algoritmo de vectorizaci?n
155
         * @return
156
         */
157
        public int getAlgorithm() {
158
                return algorithm;
159
        }
160
        
161
        /**
162
         * Asigna el algoritmo de vectorizaci?n
163
         * @param algorithm
164
         */
165
        public void setAlgorithm(int algorithm) {
166
                this.algorithm = algorithm;
167
                updateObservers();
168
        }
169

    
170
        /**
171
         * Obtiene el valor de distancia para el algoritmo de vectorizaci?n de 
172
         * l?neas de contorno.
173
         * @return
174
         */
175
        public double getDistance() {
176
                return distance;
177
        }
178

    
179
        /**
180
         * Asigna el valor de distancia para el algoritmo de vectorizaci?n de 
181
         * l?neas de contorno.
182
         * @return
183
         */
184
        public void setDistance(double distance) {
185
                this.distance = distance;
186
                updateObservers();
187
        }
188
        
189
        /**
190
         * Actualiza datos y llama al update de los observadores
191
         */
192
        public void updateObservers() {
193
                setChanged();
194
                notifyObservers();
195
        }
196
}