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 / point / Point3DM.java @ 42260
History | View | Annotate | Download (2.9 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.point; |
24 |
|
25 |
import com.vividsolutions.jts.geom.Coordinate; |
26 |
|
27 |
import org.gvsig.fmap.geom.Geometry; |
28 |
import org.gvsig.fmap.geom.GeometryLocator; |
29 |
import org.gvsig.fmap.geom.jts.MCoordinate; |
30 |
import org.gvsig.fmap.geom.jts.utils.JTSUtils; |
31 |
import org.gvsig.fmap.geom.type.GeometryType; |
32 |
|
33 |
|
34 |
/**
|
35 |
* @author fdiaz
|
36 |
*
|
37 |
*/
|
38 |
public class Point3DM extends AbstractPoint { |
39 |
|
40 |
/**
|
41 |
*
|
42 |
*/
|
43 |
private static final long serialVersionUID = 5749444180040735731L; |
44 |
|
45 |
/**
|
46 |
*
|
47 |
*/
|
48 |
public Point3DM(Coordinate coordinates) {
|
49 |
super(Geometry.SUBTYPES.GEOM3DM, coordinates);
|
50 |
} |
51 |
|
52 |
/**
|
53 |
*
|
54 |
*/
|
55 |
public Point3DM() {
|
56 |
this(JTSUtils.createMCoordinate(0, 0, 0, 0)); |
57 |
} |
58 |
|
59 |
/**
|
60 |
*
|
61 |
*/
|
62 |
public Point3DM(double x, double y, double z, double m) { |
63 |
this(JTSUtils.createMCoordinate(x, y, z, m));
|
64 |
} |
65 |
|
66 |
public double getM() { |
67 |
return ((MCoordinate)this.coordinate).m; |
68 |
} |
69 |
|
70 |
|
71 |
/* (non-Javadoc)
|
72 |
* @see org.gvsig.fmap.geom.Geometry#getDimension()
|
73 |
*/
|
74 |
public int getDimension() { |
75 |
return 4; |
76 |
} |
77 |
|
78 |
/* (non-Javadoc)
|
79 |
* @see org.gvsig.fmap.geom.Geometry#getGeometryType()
|
80 |
*/
|
81 |
public GeometryType getGeometryType() {
|
82 |
try {
|
83 |
return GeometryLocator.getGeometryManager().getGeometryType(Geometry.TYPES.POINT, Geometry.SUBTYPES.GEOM3DM);
|
84 |
} catch (Exception e) { |
85 |
return null; |
86 |
} |
87 |
} |
88 |
|
89 |
|
90 |
/* (non-Javadoc)
|
91 |
* @see org.gvsig.fmap.geom.Geometry#cloneGeometry()
|
92 |
*/
|
93 |
public Geometry cloneGeometry() {
|
94 |
return new Point2DM((MCoordinate)this.coordinate.clone()); |
95 |
} |
96 |
|
97 |
/* (non-Javadoc)
|
98 |
* @see org.gvsig.fmap.geom.jts.GeometryJTS#is3D()
|
99 |
*/
|
100 |
public boolean is3D() { |
101 |
return true; |
102 |
} |
103 |
|
104 |
/* (non-Javadoc)
|
105 |
* @see org.gvsig.fmap.geom.jts.primitive.point.PointJTS#setJTSCoordinate(com.vividsolutions.jts.geom.Coordinate)
|
106 |
*/
|
107 |
public void setJTSCoordinate(Coordinate coordinate) { |
108 |
this.coordinate = coordinate;
|
109 |
} |
110 |
|
111 |
} |