Statistics
| Revision:

svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.jts / src / main / java / org / gvsig / fmap / geom / jts / primitive / surface / filledspline / FilledSpline3D.java @ 42441

History | View | Annotate | Download (5.26 KB)

1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2015 gvSIG Association
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., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.fmap.geom.jts.primitive.surface.filledspline;
24

    
25
import com.vividsolutions.jts.geom.Coordinate;
26

    
27
import org.gvsig.fmap.geom.Geometry;
28
import org.gvsig.fmap.geom.jts.primitive.curve.spline.BaseSpline3D;
29
import org.gvsig.fmap.geom.jts.util.JTSUtils;
30
import org.gvsig.fmap.geom.operation.GeometryOperationException;
31
import org.gvsig.fmap.geom.operation.GeometryOperationNotSupportedException;
32
import org.gvsig.fmap.geom.primitive.FilledSpline;
33
import org.gvsig.fmap.geom.primitive.Line;
34
import org.gvsig.fmap.geom.primitive.Polygon;
35
import org.gvsig.fmap.geom.primitive.Ring;
36
import org.gvsig.fmap.geom.primitive.SurfaceAppearance;
37

    
38

    
39
/**
40
 * @author fdiaz
41
 *
42
 */
43
public class FilledSpline3D extends BaseSpline3D implements FilledSpline {
44

    
45
    /**
46
     *
47
     */
48
    private static final long serialVersionUID = -8947796452807902242L;
49

    
50
    /**
51
     *
52
     */
53
    public FilledSpline3D() {
54
        super(Geometry.TYPES.FILLEDSPLINE);
55
    }
56

    
57
    /**
58
     * @param coordinates
59
     */
60
    public FilledSpline3D(Coordinate[] coordinates) {
61
        super(Geometry.TYPES.FILLEDSPLINE, coordinates);
62
    }
63

    
64
    /* (non-Javadoc)
65
     * @see org.gvsig.fmap.geom.primitive.Surface#setSurfaceAppearance(org.gvsig.fmap.geom.primitive.SurfaceAppearance)
66
     */
67
    public void setSurfaceAppearance(SurfaceAppearance app) {
68
        // TODO Auto-generated method stub
69

    
70
    }
71

    
72
    /* (non-Javadoc)
73
     * @see org.gvsig.fmap.geom.primitive.Surface#getSurfaceAppearance()
74
     */
75
    public SurfaceAppearance getSurfaceAppearance() {
76
        // TODO Auto-generated method stub
77
        return null;
78
    }
79

    
80
    /* (non-Javadoc)
81
     * @see org.gvsig.fmap.geom.primitive.Surface#getNumInteriorRings()
82
     */
83
    public int getNumInteriorRings() {
84
        String message = "Calling deprecated method getNumInteriorRings of a filled spline";
85
        notifyDeprecated(message);
86
        throw new UnsupportedOperationException(message);
87
    }
88

    
89
    /* (non-Javadoc)
90
     * @see org.gvsig.fmap.geom.primitive.Surface#getInteriorRing(int)
91
     */
92
    public Ring getInteriorRing(int index) {
93
        String message = "Calling deprecated method getInteriorRing of a filled spline";
94
        notifyDeprecated(message);
95
        throw new UnsupportedOperationException(message);
96
    }
97

    
98
    /* (non-Javadoc)
99
     * @see org.gvsig.fmap.geom.primitive.Surface#addInteriorRing(org.gvsig.fmap.geom.primitive.Ring)
100
     */
101
    public void addInteriorRing(Ring ring) {
102
        String message = "Calling deprecated method addInteriorRing of a filled spline";
103
        notifyDeprecated(message);
104
        throw new UnsupportedOperationException(message);
105
    }
106

    
107
    /* (non-Javadoc)
108
     * @see org.gvsig.fmap.geom.primitive.Surface#addInteriorRing(org.gvsig.fmap.geom.primitive.Line)
109
     */
110
    public void addInteriorRing(Line line) {
111
        String message = "Calling deprecated method addInteriorRing of a filled spline";
112
        notifyDeprecated(message);
113
        throw new UnsupportedOperationException(message);
114
    }
115

    
116
    /* (non-Javadoc)
117
     * @see org.gvsig.fmap.geom.primitive.Surface#addInteriorRing(org.gvsig.fmap.geom.primitive.Polygon)
118
     */
119
    public void addInteriorRing(Polygon polygon) {
120
        String message = "Calling deprecated method addInteriorRing of a filled spline";
121
        notifyDeprecated(message);
122
        throw new UnsupportedOperationException(message);
123
    }
124

    
125
    /* (non-Javadoc)
126
     * @see org.gvsig.fmap.geom.primitive.Surface#removeInteriorRing(int)
127
     */
128
    public void removeInteriorRing(int index) {
129
        String message = "Calling deprecated method removeInteriorRing of a circle";
130
        notifyDeprecated(message);
131
        throw new UnsupportedOperationException(message);
132
    }
133

    
134
    /* (non-Javadoc)
135
     * @see org.gvsig.fmap.geom.Geometry#cloneGeometry()
136
     */
137
    public Geometry cloneGeometry() {
138
        return new FilledSpline3D(cloneCoordinates().toCoordinateArray());
139
        }
140

    
141
    /*
142
     * (non-Javadoc)
143
     *
144
     * @see org.gvsig.fmap.geom.jts.GeometryJTS#getJTS()
145
     */
146
    public com.vividsolutions.jts.geom.Geometry getJTS() {
147
        return JTSUtils.createJTSPolygon(getSplineCoordinates());
148
    }
149

    
150

    
151
    /* (non-Javadoc)
152
     * @see org.gvsig.fmap.geom.Geometry#offset(double)
153
     */
154
    public Geometry offset(double distance) throws GeometryOperationNotSupportedException, GeometryOperationException {
155
        return JTSUtils.createGeometry(getJTS().buffer(distance));
156
    }
157
}