svn-gvsig-desktop / trunk / org.gvsig.desktop / org.gvsig.desktop.compat.cdc / org.gvsig.fmap.geometry / org.gvsig.fmap.geometry.operation / src / main / java / org / gvsig / fmap / geom / operation / perpendicular / PerpendicularPointOperationContext.java @ 40559
History | View | Annotate | Download (2.34 KB)
1 |
/**
|
---|---|
2 |
* gvSIG. Desktop Geographic Information System.
|
3 |
*
|
4 |
* Copyright (C) 2007-2013 gvSIG Association.
|
5 |
*
|
6 |
* This program is free software; you can redistribute it and/or
|
7 |
* modify it under the terms of the GNU General Public License
|
8 |
* as published by the Free Software Foundation; either version 3
|
9 |
* of the License, or (at your option) any later version.
|
10 |
*
|
11 |
* This program is distributed in the hope that it will be useful,
|
12 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14 |
* GNU General Public License for more details.
|
15 |
*
|
16 |
* You should have received a copy of the GNU General Public License
|
17 |
* along with this program; if not, write to the Free Software
|
18 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
19 |
* MA 02110-1301, USA.
|
20 |
*
|
21 |
* For any additional information, do not hesitate to contact us
|
22 |
* at info AT gvsig.com, or visit our website www.gvsig.com.
|
23 |
*/
|
24 |
package org.gvsig.fmap.geom.operation.perpendicular; |
25 |
|
26 |
import org.gvsig.fmap.geom.operation.GeometryOperationContext; |
27 |
import org.gvsig.fmap.geom.primitive.Point; |
28 |
|
29 |
|
30 |
/**
|
31 |
* @author gvSIG Team
|
32 |
* @version $Id$
|
33 |
*/
|
34 |
public class PerpendicularPointOperationContext extends GeometryOperationContext { |
35 |
public static final String SECOND_POINT = "secondPoint"; |
36 |
public static final String PERPENDICULAR_POINT = "perpendicularPoint"; |
37 |
public static final String DISTANCE = "distance"; |
38 |
|
39 |
public PerpendicularPointOperationContext(Point secondPoint, Point perpendicularPoint, double distance) { |
40 |
this.setSecondPoint(secondPoint);
|
41 |
this.setPerpendicularPoint(perpendicularPoint);
|
42 |
this.setDistance(distance);
|
43 |
} |
44 |
|
45 |
public void setSecondPoint(Point secondPoint) { |
46 |
this.setAttribute(SECOND_POINT, secondPoint);
|
47 |
} |
48 |
|
49 |
public Point getSecondPoint() { |
50 |
return (Point) this.getAttribute(SECOND_POINT); |
51 |
} |
52 |
|
53 |
public void setPerpendicularPoint(Point perpendicularPoint) { |
54 |
this.setAttribute(PERPENDICULAR_POINT, perpendicularPoint);
|
55 |
} |
56 |
|
57 |
public Point getPerpendicularPoint() { |
58 |
return (Point) this.getAttribute(PERPENDICULAR_POINT); |
59 |
} |
60 |
|
61 |
public double getDistance() { |
62 |
return ((Double) this.getAttribute(DISTANCE)).doubleValue(); |
63 |
} |
64 |
|
65 |
public void setDistance(double distance) { |
66 |
this.setAttribute(DISTANCE, new Double(distance)); |
67 |
} |
68 |
} |