svn-gvsig-desktop / branches / CqCMSDvp / libraries / libCq CMS for java.old / src / org / cresques / px / gml / Geometry.java @ 2312
History | View | Annotate | Download (1.92 KB)
1 |
/*
|
---|---|
2 |
* Cresques Mapping Suite. Graphic Library for constructing mapping applications.
|
3 |
*
|
4 |
* Copyright (C) 2004-5.
|
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA.
|
19 |
*
|
20 |
* For more information, contact:
|
21 |
*
|
22 |
* cresques@gmail.com
|
23 |
*/
|
24 |
package org.cresques.px.gml; |
25 |
|
26 |
import java.util.Vector; |
27 |
|
28 |
import java.awt.geom.Point2D; |
29 |
|
30 |
import java.awt.Graphics2D; |
31 |
|
32 |
import org.cresques.cts.ICoordTrans; |
33 |
import org.cresques.cts.IProjection; |
34 |
import org.cresques.geo.Projected; |
35 |
import org.cresques.geo.ViewPortData; |
36 |
import org.cresques.px.Extent; |
37 |
import org.cresques.px.PxObj; |
38 |
|
39 |
/**
|
40 |
* Clase base para geometr?as.
|
41 |
* @author "Luis W. Sevilla" <sevilla_lui@gva.es>
|
42 |
*/
|
43 |
|
44 |
abstract public class Geometry extends PxObj implements Projected { |
45 |
protected IProjection proj;
|
46 |
// protected Extent extent = null;
|
47 |
Vector data = null; |
48 |
|
49 |
public Geometry() {
|
50 |
extent = new Extent();
|
51 |
data = new Vector(); |
52 |
} |
53 |
public void add(Point2D pt) { |
54 |
extent.add(pt); |
55 |
data.add(pt); |
56 |
} |
57 |
public Point2D get(int i) { |
58 |
return (Point2D)data.get(i); |
59 |
} |
60 |
public int pointNr() { |
61 |
return data.size();
|
62 |
} |
63 |
public Vector getData() { |
64 |
return data;
|
65 |
} |
66 |
public Extent getExtent() { return extent; } |
67 |
|
68 |
abstract public IProjection getProjection(); |
69 |
abstract public void reProject(ICoordTrans rp); |
70 |
|
71 |
public void draw(Graphics2D g, ViewPortData vp) { |
72 |
} |
73 |
} |