PageRenderTime 21ms CodeModel.GetById 15ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/Prototipo/PrototipoCommons/src/memoria/commons/structures/MultiPolygon.java

http://prototipomemoria.googlecode.com/
Java | 74 lines | 46 code | 20 blank | 8 comment | 1 complexity | a3fea954e16551ea52383d52f99b5f92 MD5 | raw file
 1/*
 2 * To change this template, choose Tools | Templates
 3 * and open the template in the editor.
 4 */
 5
 6package memoria.commons.structures;
 7
 8import java.util.ArrayList;
 9import java.util.List;
10
11/**
12 *
13 * @author diego
14 */
15public class MultiPolygon extends AbstractGeographicElement {
16
17    private Polygon outerRing;
18    private List<Polygon> poligonos = new ArrayList<Polygon>();
19
20    public List<Polygon> getLineas() {
21        return poligonos;
22    }
23
24    @Override
25    public String getTypeRepresentation()
26    {
27       return "Multipolygon";
28    }
29    public void setLineas(List<Polygon> lineas) {
30        this.poligonos = lineas;
31    }
32
33    public MultiPolygon(Polygon outerRing) {
34        this.setOuterRing(outerRing);
35    }
36
37    @Override
38    public List<Point> getCenterPoints(){
39        return outerRing.getCenterPoints();
40    }
41
42    @Override
43    public List<Point> getPoints() {
44        List<Point> results = new ArrayList<Point>();
45        for(Polygon pols : poligonos){
46            results.addAll(pols.getPoints());
47        }
48        results.addAll(this.outerRing.getPoints());
49        return results;
50    }
51
52    public List<Polygon> getPoligonos() {
53        return poligonos;
54    }
55
56    public void setPoligonos(List<Polygon> poligonos) {
57        this.poligonos = poligonos;
58    }
59
60    public Polygon getOuterRing() {
61        return outerRing;
62    }
63
64    public void setOuterRing(Polygon outerRing) {
65        this.outerRing = outerRing;
66    }
67
68
69
70
71
72    
73
74}