Statistics
| Revision:

root / branches / v2_0_0_prep / libraries / libFMap_geometries / src / org / gvsig / fmap / geom / operation / perpendicular / PerpendicularPointOperationContext.java @ 36197

History | View | Annotate | Download (2.3 KB)

1
/* gvSIG. Geographic Information System of the Valencian Government
2
 *
3
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
4
 * of the Valencian Government (CIT)
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 2
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
 */
22
package org.gvsig.fmap.geom.operation.perpendicular;
23

    
24
import org.gvsig.fmap.geom.operation.GeometryOperationContext;
25
import org.gvsig.fmap.geom.primitive.Point;
26

    
27

    
28
/**
29
 * @author gvSIG Team
30
 * @version $Id$
31
 */
32
public class PerpendicularPointOperationContext extends GeometryOperationContext {
33
    public static final String SECOND_POINT = "secondPoint";
34
    public static final String PERPENDICULAR_POINT = "perpendicularPoint";
35
    public static final String DISTANCE = "distance";
36

    
37
    public PerpendicularPointOperationContext(Point secondPoint, Point perpendicularPoint, double distance) {
38
        this.setSecondPoint(secondPoint);
39
        this.setPerpendicularPoint(perpendicularPoint);
40
        this.setDistance(distance);
41
    }    
42
    
43
    public void setSecondPoint(Point secondPoint) {
44
        this.setAttribute(SECOND_POINT, secondPoint);
45
    }
46

    
47
    public Point getSecondPoint() {
48
        return (Point) this.getAttribute(SECOND_POINT);
49
    }
50
    
51
    public void setPerpendicularPoint(Point perpendicularPoint) {
52
        this.setAttribute(PERPENDICULAR_POINT, perpendicularPoint);
53
    }
54

    
55
    public Point getPerpendicularPoint() {
56
        return (Point) this.getAttribute(PERPENDICULAR_POINT);
57
    }
58
    
59
    public double getDistance() {
60
        return ((Double) this.getAttribute(DISTANCE)).doubleValue();
61
    }
62

    
63
    public void setDistance(double distance) {
64
        this.setAttribute(DISTANCE, Double.valueOf(distance));
65
    }
66
}