Statistics
| Revision:

root / org.gvsig.toolbox / trunk / org.gvsig.toolbox / org.gvsig.toolbox.algorithm / src / main / java / es / unex / sextante / tridimensional / interpolation / Interpolation3DAlgorithm.java @ 59

History | View | Annotate | Download (2.14 KB)

1

    
2

    
3
package es.unex.sextante.tridimensional.interpolation;
4

    
5
import es.unex.sextante.core.GeoAlgorithm;
6
import es.unex.sextante.core.Sextante;
7
import es.unex.sextante.dataObjects.I3DRasterLayer;
8
import es.unex.sextante.dataObjects.IVectorLayer;
9
import es.unex.sextante.exceptions.GeoAlgorithmExecutionException;
10
import es.unex.sextante.exceptions.OptionalParentParameterException;
11
import es.unex.sextante.exceptions.RepeatedParameterNameException;
12
import es.unex.sextante.exceptions.UndefinedParentParameterNameException;
13

    
14

    
15
public class Interpolation3DAlgorithm
16
         extends
17
            GeoAlgorithm {
18

    
19

    
20
   private static final String RESULT = "RESULT";
21
   private static final String FIELD  = "FIELD";
22
   private static final String POINTS = "POINTS";
23
   private Object              m_Result;
24

    
25

    
26
   @Override
27
   public void defineCharacteristics() {
28

    
29
      setName(Sextante.getText("3D_Interpolation"));
30
      setGroup(Sextante.getText("3D"));
31

    
32
      setUserCanDefineAnalysisExtent(true);
33

    
34
      try {
35
         m_Parameters.addInputVectorLayer(POINTS, Sextante.getText("Points"), IVectorLayer.SHAPE_TYPE_POINT, true);
36
         m_Parameters.addTableField(FIELD, Sextante.getText("Field"), POINTS);
37
         addOutput3DRasterLayer(RESULT, Sextante.getText("Result"));
38
      }
39
      catch (final RepeatedParameterNameException e) {
40
         Sextante.addErrorToLog(e);
41
      }
42
      catch (final UndefinedParentParameterNameException e) {
43
         Sextante.addErrorToLog(e);
44
      }
45
      catch (final OptionalParentParameterException e) {
46
         Sextante.addErrorToLog(e);
47
      }
48

    
49
   }
50

    
51

    
52
   @Override
53
   public boolean processAlgorithm() throws GeoAlgorithmExecutionException {
54

    
55
      final IVectorLayer pointsLayer = m_Parameters.getParameterValueAsVectorLayer(POINTS);
56
      m_Result = getNew3DRasterLayer(RESULT, pointsLayer.getName(), I3DRasterLayer.RASTER_DATA_TYPE_DOUBLE);
57

    
58
      //TODO: implement interpolation algorithm
59

    
60
      return !m_Task.isCanceled();
61

    
62
   }
63

    
64

    
65
   @Override
66
   public boolean is3D() {
67

    
68
      return true;
69

    
70
   }
71

    
72

    
73
   @Override
74
   public boolean isActive() {
75

    
76
      return false;
77

    
78
   }
79

    
80
}