Revision 228

View differences:

1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/GeometryFactory3D.java
1
package org.gvsig;
2

  
3
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
4
import org.gvsig.fmap.geom.primitive.Point;
5
import org.gvsig.geometries3D.MultiGeometry;
6
import org.gvsig.geometries3D.MultiSolid;
7
import org.gvsig.geometries3D.Point3D;
8
import org.gvsig.geometries3D.Solid;
9

  
10
public class GeometryFactory3D extends org.gvsig.fmap.geom.GeometryFactory {
11

  
12
	public Point createPoint3D(String id) {
13
		return createPoint3D(id, 0.0, 0.0, 0.0);
14
	}
15

  
16
	public Point createPoint3D(String id, double x, double y, double z) {
17
		Point3D point3D = new Point3D(id);
18
		point3D.setX(x);
19
		point3D.setY(y);
20
		point3D.setZ(z);
21
		return point3D;
22
	}
23

  
24
	public AbstractPrimitive createSolid(String id) {
25
		Solid solid = new Solid(id);
26
		return solid;
27
	}
28

  
29
	public AbstractPrimitive createMultiGeometry(String id) {
30
		MultiGeometry multiGeometry = new MultiGeometry(id, null);
31
		return multiGeometry;
32
	}
33

  
34
	public AbstractPrimitive createMultiSolid(String id) {
35
		MultiSolid multiGeometry = new MultiSolid(id, null);
36
		return multiGeometry;
37
	}
38
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/Material.java
1
package org.gvsig.geometries3D;
2

  
3
import java.awt.Color;
4

  
5
public class Material {
6

  
7
	public static class Face {
8
		public final static int FRONT = 0;
9
		public final static int BACK = 1;
10
		public final static int FRONT_AND_BACK = 2;
11

  
12
	}
13

  
14
	public static class ColorMode {
15
		public final static int AMBIENT = 0;
16
		public final static int DIFFUSE = 1;
17
		public final static int SPECULAR = 2;
18
		public final static int EMISSION = 3;
19
		public final static int AMBIENT_AND_DIFFUSE = 4;
20
		public final static int OFF = 5;
21

  
22
	}
23

  
24
	protected int face = Face.FRONT;
25

  
26
	protected int mode = ColorMode.OFF;
27

  
28
	private Color ambient;
29
	private Color diffuse;
30
	private Color specular;
31
	private Color emission;
32
	private float shininess;
33

  
34
	public Material() {
35

  
36
	}
37

  
38
	public Material(int face, int mode) {
39
		this.setMode(mode);
40
		this.setFace(face);
41

  
42
	}
43

  
44
	public int getFace() {
45
		return face;
46
	}
47

  
48
	public void setFace(int face) {
49
		this.face = face;
50
	}
51

  
52
	public int getMode() {
53
		return mode;
54
	}
55

  
56
	public void setMode(int mode) {
57
		this.mode = mode;
58
	}
59

  
60
	public Color getAmbient() {
61
		return ambient;
62
	}
63

  
64
	public void setAmbient(Color ambient) {
65
		this.ambient = ambient;
66
	}
67

  
68
	public Color getDiffuse() {
69
		return diffuse;
70
	}
71

  
72
	public void setDiffuse(Color diffuse) {
73
		this.diffuse = diffuse;
74
	}
75

  
76
	public Color getSpecular() {
77
		return specular;
78
	}
79

  
80
	public void setSpecular(Color specular) {
81
		this.specular = specular;
82
	}
83

  
84
	public Color getEmission() {
85
		return emission;
86
	}
87

  
88
	public void setEmission(Color emission) {
89
		this.emission = emission;
90
	}
91

  
92
	public float getShininess() {
93
		return shininess;
94
	}
95

  
96
	public void setShininess(float shininess) {
97
		this.shininess = shininess;
98
	}
99

  
100
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/Polygon3D.java
1
package org.gvsig.geometries3D;
2

  
3
import java.awt.Rectangle;
4
import java.awt.geom.AffineTransform;
5
import java.awt.geom.PathIterator;
6
import java.awt.geom.Point2D;
7
import java.awt.geom.Rectangle2D;
8
import java.util.Vector;
9

  
10
import org.cresques.cts.ICoordTrans;
11
import org.gvsig.fmap.geom.GeometryManager;
12
import org.gvsig.fmap.geom.handler.Handler;
13
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
14
import org.gvsig.fmap.geom.primitive.Envelope;
15
import org.gvsig.fmap.geom.primitive.FShape;
16
import org.gvsig.fmap.geom.primitive.GeneralPathX;
17
import org.gvsig.fmap.geom.type.GeometryType;
18

  
19
public class Polygon3D extends AbstractPrimitive {
20
	/**
21
	 * 
22
	 */
23
	private static final long serialVersionUID = 1L;
24
	private static final GeometryType geomType = GeometryManager.getInstance()
25
	.registerGeometryType(Polygon3D.class);
26
	
27
	
28
	public static final int CODE = geomType.getType();
29
	
30
	protected Vector<Point3D> _varray;
31
	
32
	public Polygon3D(String id) {
33
		super(id, null);
34
		_varray = new Vector<Point3D>();
35
	}
36
	
37
	@Override
38
	public GeometryType getGeometryType() {
39
		return geomType;
40
	}
41
	public void addVertex(Point3D p){
42
		_varray.add(p);
43
	}
44
	public void removeVertex(int index){
45
		_varray.remove(index);
46
	}
47
	public Point3D getVertex(int index)
48
	{
49
		return _varray.get(index);
50
	}
51
	public int getNumVertices(){
52
		return _varray.size();
53
	}
54
	public void insertVertex(int index, Point3D p){
55
		_varray.insertElementAt(p, index);
56
	}
57

  
58
	@Override
59
	public int getShapeType() {
60
		// TODO Auto-generated method stub
61
		return 0;
62
	}
63

  
64
	public Rectangle2D getBounds2D() {
65
		// TODO Auto-generated method stub
66
		return null;
67
	}
68

  
69
	public int getCoordinateDimension() {
70
		// TODO Auto-generated method stub
71
		return 0;
72
	}
73

  
74
	public Envelope getEnvelope() {
75
		// TODO Auto-generated method stub
76
		return null;
77
	}
78

  
79
	public GeneralPathX getGeneralPath() {
80
		// TODO Auto-generated method stub
81
		return null;
82
	}
83

  
84
	public PathIterator getPathIterator(AffineTransform arg0) {
85
		// TODO Auto-generated method stub
86
		return null;
87
	}
88

  
89
	public PathIterator getPathIterator(AffineTransform arg0, double arg1) {
90
		// TODO Auto-generated method stub
91
		return null;
92
	}
93

  
94
	public int getType() {
95
	
96
		return CODE;
97
	}
98

  
99
	public boolean intersects(Rectangle2D arg0) {
100
		// TODO Auto-generated method stub
101
		return false;
102
	}
103

  
104
	public void reProject(ICoordTrans arg0) {
105
		// TODO Auto-generated method stub
106
		
107
	}
108

  
109
	public void transform(AffineTransform arg0) {
110
		// TODO Auto-generated method stub
111
		
112
	}
113

  
114
	public boolean contains(Point2D arg0) {
115
		// TODO Auto-generated method stub
116
		return false;
117
	}
118

  
119
	public boolean contains(Rectangle2D arg0) {
120
		// TODO Auto-generated method stub
121
		return false;
122
	}
123

  
124
	public boolean contains(double arg0, double arg1) {
125
		// TODO Auto-generated method stub
126
		return false;
127
	}
128

  
129
	public boolean contains(double arg0, double arg1, double arg2, double arg3) {
130
		// TODO Auto-generated method stub
131
		return false;
132
	}
133

  
134
	public Rectangle getBounds() {
135
		// TODO Auto-generated method stub
136
		return null;
137
	}
138

  
139
	public boolean intersects(double arg0, double arg1, double arg2, double arg3) {
140
		// TODO Auto-generated method stub
141
		return false;
142
	}
143

  
144
	public FShape cloneFShape() {
145
		// TODO Auto-generated method stub
146
		return null;
147
	}
148

  
149
	public Handler[] getSelectHandlers() {
150
		// TODO Auto-generated method stub
151
		return null;
152
	}
153

  
154
	public Handler[] getStretchingHandlers() {
155
		// TODO Auto-generated method stub
156
		return null;
157
	}
158

  
159
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/Point3D.java
1
package org.gvsig.geometries3D;
2

  
3

  
4
import java.awt.Rectangle;
5
import java.awt.geom.AffineTransform;
6
import java.awt.geom.PathIterator;
7
import java.awt.geom.Point2D;
8
import java.awt.geom.Rectangle2D;
9

  
10
import org.cresques.cts.ICoordTrans;
11
import org.gvsig.fmap.geom.GeometryManager;
12
import org.gvsig.fmap.geom.handler.Handler;
13
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
14
import org.gvsig.fmap.geom.primitive.Envelope;
15
import org.gvsig.fmap.geom.primitive.FShape;
16
import org.gvsig.fmap.geom.primitive.GeneralPathX;
17
import org.gvsig.fmap.geom.primitive.Point;
18
import org.gvsig.fmap.geom.type.GeometryType;
19

  
20

  
21
public class Point3D extends AbstractPrimitive	implements Point {
22

  
23
	private static final long serialVersionUID = 1L;
24

  
25
	/** Instancia de GeometryType obtenida al registrar esta clase */
26
	private static final GeometryType geomType = GeometryManager.getInstance()
27
			.registerGeometryType(Point3D.class);
28
		
29
	
30
	public static final int CODE = geomType.getType();
31
	
32
	public Point3D(String id) {
33
		super(id, null);
34
//		th 	is.setId(id);
35
	}
36
	
37
	public Point3D(String id, double x, double y, double z){
38
		super(id, null);
39
		this.setX(x);
40
		this.setY(y);
41
		this.setZ(z);
42
	}
43
	
44
	private double x = 0;
45
	private double y = 0;
46
	private double z = 0;
47
	private String id;
48

  
49
//	public void setId(String id) {
50
//		this.id = id;
51
//	}
52

  
53
	public double getX() {
54
		return x;
55
	}
56

  
57
	public void setX(double x) {
58
		this.x = x;
59
	}
60

  
61
	public double getY() {
62
		return y;
63
	}
64

  
65
	public void setY(double y) {
66
		this.y = y;
67
	}
68

  
69
	public double getZ() {
70
		return z;
71
	}
72

  
73
	public void setZ(double z) {
74
		this.z = z;
75
	}
76

  
77
	@Override
78
	public GeometryType getGeometryType() {
79
		return geomType;
80
	}
81

  
82
	@Override
83
	public int getShapeType() {
84
		// TODO Auto-generated method stub
85
		return 0;
86
	}
87

  
88
	public Rectangle2D getBounds2D() {
89
		// TODO Auto-generated method stub
90
		return null;
91
	}
92

  
93
	public int getCoordinateDimension() {
94
		// TODO Auto-generated method stub
95
		return 0;
96
	}
97

  
98
	public PathIterator getPathIterator(AffineTransform arg0) {
99
		// TODO Auto-generated method stub
100
		return null;
101
	}
102

  
103
	public PathIterator getPathIterator(AffineTransform arg0, double arg1) {
104
		// TODO Auto-generated method stub
105
		return null;
106
	}
107

  
108
	public int getType() {
109
		return CODE;
110
	}
111

  
112
	public boolean intersects(Rectangle2D arg0) {
113
		// TODO Auto-generated method stub
114
		return false;
115
	}
116

  
117
	public void reProject(ICoordTrans arg0) {
118
		// TODO Auto-generated method stub
119
		
120
	}
121

  
122
	public void transform(AffineTransform arg0) {
123
		// TODO Auto-generated method stub
124
		
125
	}
126

  
127
	public boolean contains(Point2D p) {
128
		// TODO Auto-generated method stub
129
		return false;
130
	}
131

  
132
	public boolean contains(Rectangle2D r) {
133
		// TODO Auto-generated method stub
134
		return false;
135
	}
136

  
137
	public boolean contains(double x, double y) {
138
		// TODO Auto-generated method stub
139
		return false;
140
	}
141

  
142
	public boolean contains(double x, double y, double w, double h) {
143
		// TODO Auto-generated method stub
144
		return false;
145
	}
146

  
147
	public Rectangle getBounds() {
148
		// TODO Auto-generated method stub
149
		return null;
150
	}
151

  
152
	public boolean intersects(double x, double y, double w, double h) {
153
		// TODO Auto-generated method stub
154
		return false;
155
	}
156

  
157
	public FShape cloneFShape() {
158
		// TODO Auto-generated method stub
159
		return null;
160
	}
161

  
162
	public Handler[] getSelectHandlers() {
163
		// TODO Auto-generated method stub
164
		return null;
165
	}
166

  
167
	public Handler[] getStretchingHandlers() {
168
		// TODO Auto-generated method stub
169
		return null;
170
	}
171

  
172
	public Envelope getEnvelope() {
173
		// TODO Auto-generated method stub
174
		return null;
175
	}
176

  
177
	public GeneralPathX getGeneralPath() {
178
		// TODO Auto-generated method stub
179
		return null;
180
	}
181

  
182
	/* *************************************************************************
183
	 * 
184
	 * All this methods are from abstract geometry
185
	 * 
186
	 **************************************************************************/
187
//	public IGeometry cloneGeometry() {
188
//		Point3D point3D = new Point3D(this.getId());
189
//		point3D.setX(this.getX());
190
//		point3D.setY(this.getY());
191
//		point3D.setZ(this.getZ());
192
//		return point3D;
193
//	}
194

  
195

  
196
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/Polyline3D.java
1
package org.gvsig.geometries3D;
2

  
3
import java.awt.Rectangle;
4
import java.awt.geom.AffineTransform;
5
import java.awt.geom.PathIterator;
6
import java.awt.geom.Point2D;
7
import java.awt.geom.Rectangle2D;
8
import java.util.Vector;
9

  
10
import org.cresques.cts.ICoordTrans;
11
import org.gvsig.fmap.geom.GeometryManager;
12
import org.gvsig.fmap.geom.handler.Handler;
13
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
14
import org.gvsig.fmap.geom.primitive.Envelope;
15
import org.gvsig.fmap.geom.primitive.FShape;
16
import org.gvsig.fmap.geom.primitive.GeneralPathX;
17
import org.gvsig.fmap.geom.type.GeometryType;
18

  
19
public class Polyline3D extends AbstractPrimitive {
20
	
21
	/**
22
	 * 
23
	 */
24
	private static final long serialVersionUID = 1L;
25
	private static final GeometryType geomType = GeometryManager.getInstance()
26
	.registerGeometryType(Polyline3D.class);
27
	
28
	
29
	public static final int CODE = geomType.getType();
30
	
31
	protected Vector<Point3D> _varray;
32
	
33
	public Polyline3D(String id) {
34
		super(id, null);
35
		_varray = new Vector<Point3D>();
36
	}
37
	
38
	@Override
39
	public GeometryType getGeometryType() {
40
		return geomType;
41
	}
42
	public void addVertex(Point3D p){
43
		_varray.add(p);
44
	}
45
	public void removeVertex(int index){
46
		_varray.remove(index);
47
	}
48
	public Point3D getVertex(int index)
49
	{
50
		return _varray.get(index);
51
	}
52
	public int getNumVertices(){
53
		return _varray.size();
54
	}
55
	public void insertVertex(int index, Point3D p){
56
		_varray.insertElementAt(p, index);
57
	}
58

  
59
	@Override
60
	public int getShapeType() {
61
		// TODO Auto-generated method stub
62
		return 0;
63
	}
64

  
65
	public Rectangle2D getBounds2D() {
66
		// TODO Auto-generated method stub
67
		return null;
68
	}
69

  
70
	public int getCoordinateDimension() {
71
		// TODO Auto-generated method stub
72
		return 0;
73
	}
74

  
75
	public Envelope getEnvelope() {
76
		// TODO Auto-generated method stub
77
		return null;
78
	}
79

  
80
	public GeneralPathX getGeneralPath() {
81
		// TODO Auto-generated method stub
82
		return null;
83
	}
84

  
85
	public PathIterator getPathIterator(AffineTransform arg0) {
86
		// TODO Auto-generated method stub
87
		return null;
88
	}
89

  
90
	public PathIterator getPathIterator(AffineTransform arg0, double arg1) {
91
		// TODO Auto-generated method stub
92
		return null;
93
	}
94

  
95
	public int getType() {
96
	
97
		return CODE;
98
	}
99

  
100
	public boolean intersects(Rectangle2D arg0) {
101
		// TODO Auto-generated method stub
102
		return false;
103
	}
104

  
105
	public void reProject(ICoordTrans arg0) {
106
		// TODO Auto-generated method stub
107
		
108
	}
109

  
110
	public void transform(AffineTransform arg0) {
111
		// TODO Auto-generated method stub
112
		
113
	}
114

  
115
	public boolean contains(Point2D arg0) {
116
		// TODO Auto-generated method stub
117
		return false;
118
	}
119

  
120
	public boolean contains(Rectangle2D arg0) {
121
		// TODO Auto-generated method stub
122
		return false;
123
	}
124

  
125
	public boolean contains(double arg0, double arg1) {
126
		// TODO Auto-generated method stub
127
		return false;
128
	}
129

  
130
	public boolean contains(double arg0, double arg1, double arg2, double arg3) {
131
		// TODO Auto-generated method stub
132
		return false;
133
	}
134

  
135
	public Rectangle getBounds() {
136
		// TODO Auto-generated method stub
137
		return null;
138
	}
139

  
140
	public boolean intersects(double arg0, double arg1, double arg2, double arg3) {
141
		// TODO Auto-generated method stub
142
		return false;
143
	}
144

  
145
	public FShape cloneFShape() {
146
		// TODO Auto-generated method stub
147
		return null;
148
	}
149

  
150
	public Handler[] getSelectHandlers() {
151
		// TODO Auto-generated method stub
152
		return null;
153
	}
154

  
155
	public Handler[] getStretchingHandlers() {
156
		// TODO Auto-generated method stub
157
		return null;
158
	}
159

  
160
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/PrimitiveSet.java
1
package org.gvsig.geometries3D;
2

  
3

  
4
import java.util.Vector;
5

  
6
public class PrimitiveSet {
7
	public static class Mode {
8
		public final static int POINTS = 0;
9
		public final static int LINES = 1;
10
		public final static int LINE_STRIP = 2;
11
		public final static int LINE_LOOP = 3;
12
		public final static int TRIANGLES = 4;
13
		public final static int TRIANGLE_STRIP = 5;
14
		public final static int TRIANGLE_FAN = 6;
15
		public final static int QUADS = 7;
16
		public final static int QUAD_STRIP = 8;
17
		public final static int POLYGON = 9;
18
	}
19

  
20
	public static class Type {
21
		public final static int PrimitiveType = 0;
22
		public final static int DrawArrays= 1;
23
		public final static int DrawArrayLengths= 2;
24
		public final static int DrawElementsUInt = 5;
25
	}
26
	
27
	private Vector<Integer> indices = null;
28
	
29
	protected int mode =  Mode.TRIANGLES;
30
	
31
	protected int type = Type.DrawArrays;
32
	
33
	public PrimitiveSet() {
34
		
35
	}
36
	
37
	public PrimitiveSet(int mode, int type) {
38
		this.mode = mode;
39
		this.type = type;
40
		indices = new Vector<Integer>();
41
	}
42

  
43
	public Vector<Integer> getIndexArray() {
44
		return indices;
45
	}
46

  
47
	public void setIndexArray(Vector<Integer> indices) {
48
		this.indices = indices;
49
	}
50

  
51
	public int getMode() {
52
		return mode;
53
	}
54

  
55
	public void setMode(int mode) {
56
		this.mode = mode;
57
	}
58

  
59
	public int getType() {
60
		return type;
61
	}
62

  
63
	public void setType(int type) {
64
		this.type = type;
65
	}
66

  
67
	public Vector<Integer> getIndices() {
68
		return indices;
69
	}
70

  
71
	public void setIndices(Vector<Integer> indices) {
72
		this.indices = indices;
73
	}
74
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/MultiSolid.java
1
package org.gvsig.geometries3D;
2

  
3
/* gvSIG. Geographic Information System of the Valencian Government
4
 *  osgVP. OSG Virtual Planets.
5
 *
6
 * Copyright (C) 2007-2008 Infrastructures and Transports Department
7
 * of the Valencian Government (CIT)
8
 *
9
 * This program is free software; you can redistribute it and/or
10
 * modify it under the terms of the GNU General Public License
11
 * as published by the Free Software Foundation; either version 2
12
 * of the License, or (at your option) any later version.
13
 *
14
 * This program is distributed in the hope that it will be useful,
15
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
 * GNU General Public License for more details.
18
 *
19
 * You should have received a copy of the GNU General Public License
20
 * along with this program; if not, write to the Free Software
21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
 * MA  02110-1301, USA.
23
 *
24
 */
25
/*
26
 * AUTHORS (In addition to CIT):
27
 * 2008 Instituto de Automรกtica e Informรกtica Industrial, UPV.
28
 */
29

  
30
import java.awt.Rectangle;
31
import java.awt.geom.AffineTransform;
32
import java.awt.geom.PathIterator;
33
import java.awt.geom.Point2D;
34
import java.awt.geom.Rectangle2D;
35
import java.util.Vector;
36

  
37
import org.cresques.cts.ICoordTrans;
38
import org.cresques.cts.IProjection;
39
import org.gvsig.fmap.geom.GeometryManager;
40
import org.gvsig.fmap.geom.handler.Handler;
41
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
42
import org.gvsig.fmap.geom.primitive.Envelope;
43
import org.gvsig.fmap.geom.primitive.FShape;
44
import org.gvsig.fmap.geom.primitive.GeneralPathX;
45
import org.gvsig.fmap.geom.type.GeometryType;
46

  
47
public class MultiSolid extends AbstractPrimitive {
48

  
49
	private static final long serialVersionUID = 1L;
50
	private Vector<Solid> solids = new Vector<Solid>();
51

  
52
	/** Instancia de GeometryType obtenida al registrar esta clase */
53
	private static final GeometryType geomType = GeometryManager.getInstance()
54
			.registerGeometryType(MultiSolid.class);
55

  
56
	public MultiSolid(String id, IProjection projection) {
57
		super(id, projection);
58
	}
59

  
60
	public MultiSolid(IProjection projection) {
61
		super(projection);
62
	}
63

  
64
	public void addSolid(Solid ge) {
65
		solids.add(ge);
66
	}
67

  
68
	public GeometryType getGeometryType() {
69
		return geomType;
70
	}
71

  
72
	public int getType() {
73
		return geomType.getType();
74
	}
75
	
76
	public int getCoordinateDimension() {
77
		// TODO Auto-generated method stub
78
		return 3;
79
	}
80

  
81
	public Envelope getEnvelope() {
82
		return null;
83
	}
84

  
85
	public void reProject(ICoordTrans arg0) {
86
		// TODO Auto-generated method stub
87
	}
88
	
89
	
90
	/* **********************************/
91
	/* All this methods don?t use in 3D */
92
	/* **********************************/
93
	
94
	
95
	public int getShapeType() {
96
		return 0;
97
	}
98
	
99
	public Rectangle2D getBounds2D() {
100
		return null;
101
	}
102

  
103
	public GeneralPathX getGeneralPath() {
104
		return null;
105
	}
106
	
107
	public PathIterator getPathIterator(AffineTransform arg0) {
108
		return null;
109
	}
110
	
111
	public PathIterator getPathIterator(AffineTransform arg0, double arg1) {
112
		return null;
113
	}
114
	
115
	public boolean intersects(Rectangle2D arg0) {
116
		return false;
117
	}
118
	public void transform(AffineTransform arg0) {
119
		// TODO Auto-generated method stub
120

  
121
	}
122

  
123
	public boolean contains(Point2D p) {
124
		return false;
125
	}
126

  
127
	public boolean contains(Rectangle2D r) {
128
		return false;
129
	}
130

  
131
	public boolean contains(double x, double y) {
132
		return false;
133
	}
134

  
135
	public boolean contains(double x, double y, double w, double h) {
136
		return false;
137
	}
138

  
139
	public Rectangle getBounds() {
140
		return null;
141
	}
142

  
143
	public boolean intersects(double x, double y, double w, double h) {
144
		return false;
145
	}
146

  
147
	public FShape cloneFShape() {
148
		return null;
149
	}
150

  
151
	public Handler[] getSelectHandlers() {
152
		return null;
153
	}
154

  
155
	public Handler[] getStretchingHandlers() {
156
		return null;
157
	}
158

  
159
	public Vector<Solid> getSolids() {
160
		return solids;
161
	}
162

  
163
	public void setSolids(Vector<Solid> solids) {
164
		this.solids = solids;
165
	}
166
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/MultiGeometry.java
1
package org.gvsig.geometries3D;
2

  
3
/* gvSIG. Geographic Information System of the Valencian Government
4
*  osgVP. OSG Virtual Planets.
5
*
6
* Copyright (C) 2007-2008 Infrastructures and Transports Department
7
* of the Valencian Government (CIT)
8
*
9
* This program is free software; you can redistribute it and/or
10
* modify it under the terms of the GNU General Public License
11
* as published by the Free Software Foundation; either version 2
12
* of the License, or (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program; if not, write to the Free Software
21
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
22
* MA  02110-1301, USA.
23
*
24
*/
25
/*
26
* AUTHORS (In addition to CIT):
27
* 2008 Instituto de Automรกtica e Informรกtica Industrial, UPV.
28
*/
29

  
30

  
31

  
32
import java.awt.Rectangle;
33
import java.awt.geom.AffineTransform;
34
import java.awt.geom.PathIterator;
35
import java.awt.geom.Point2D;
36
import java.awt.geom.Rectangle2D;
37
import java.util.Vector;
38

  
39
import org.cresques.cts.ICoordTrans;
40
import org.cresques.cts.IProjection;
41
import org.gvsig.fmap.geom.GeometryManager;
42
import org.gvsig.fmap.geom.handler.Handler;
43
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
44
import org.gvsig.fmap.geom.primitive.Envelope;
45
import org.gvsig.fmap.geom.primitive.FShape;
46
import org.gvsig.fmap.geom.primitive.GeneralPathX;
47
import org.gvsig.fmap.geom.type.GeometryType;
48

  
49
public class MultiGeometry extends AbstractPrimitive {
50
	
51

  
52

  
53
	private static final long serialVersionUID = 1L;
54
	
55
	/** Instancia de GeometryType obtenida al registrar esta clase */
56
	private static final GeometryType geomType = GeometryManager.getInstance()
57
			.registerGeometryType(MultiGeometry.class);
58

  
59
	private Vector<AbstractPrimitive> geometries = new Vector<AbstractPrimitive>();
60
	
61
	public MultiGeometry(IProjection projection) {
62
		super(projection);
63
		// TODO Auto-generated constructor stub
64
	}
65

  
66
	public MultiGeometry(String id, IProjection projection) {
67
		super(id, projection);
68
		// TODO Auto-generated constructor stub
69
	}
70
	public void addGeometry(AbstractPrimitive fe){
71
		
72
		geometries.add(fe);
73
		
74
	}
75

  
76
	public GeometryType getGeometryType() {
77
		return geomType;
78
	}
79
	
80
	public int getCoordinateDimension() {
81
		return 3;
82
	}
83
	
84
	public int getType() {
85
		return geomType.getType();
86
	}
87

  
88
	@Override
89
	public int getShapeType() {
90
		// TODO Auto-generated method stub
91
		return 0;
92
	}
93

  
94
	public Rectangle2D getBounds2D() {
95
		// TODO Auto-generated method stub
96
		return null;
97
	}
98

  
99

  
100
	public Envelope getEnvelope() {
101
		// TODO Auto-generated method stub
102
		return null;
103
	}
104

  
105
	public GeneralPathX getGeneralPath() {
106
		// TODO Auto-generated method stub
107
		return null;
108
	}
109

  
110
	public PathIterator getPathIterator(AffineTransform arg0) {
111
		// TODO Auto-generated method stub
112
		return null;
113
	}
114

  
115
	public PathIterator getPathIterator(AffineTransform arg0, double arg1) {
116
		// TODO Auto-generated method stub
117
		return null;
118
	}
119

  
120

  
121
	public boolean intersects(Rectangle2D arg0) {
122
		// TODO Auto-generated method stub
123
		return false;
124
	}
125

  
126
	public void reProject(ICoordTrans arg0) {
127
		// TODO Auto-generated method stub
128
		
129
	}
130

  
131
	public void transform(AffineTransform arg0) {
132
		// TODO Auto-generated method stub
133
		
134
	}
135

  
136
	public boolean contains(Point2D p) {
137
		// TODO Auto-generated method stub
138
		return false;
139
	}
140

  
141
	public boolean contains(Rectangle2D r) {
142
		// TODO Auto-generated method stub
143
		return false;
144
	}
145

  
146
	public boolean contains(double x, double y) {
147
		// TODO Auto-generated method stub
148
		return false;
149
	}
150

  
151
	public boolean contains(double x, double y, double w, double h) {
152
		// TODO Auto-generated method stub
153
		return false;
154
	}
155

  
156
	public Rectangle getBounds() {
157
		// TODO Auto-generated method stub
158
		return null;
159
	}
160

  
161
	public boolean intersects(double x, double y, double w, double h) {
162
		// TODO Auto-generated method stub
163
		return false;
164
	}
165

  
166
	public FShape cloneFShape() {
167
		// TODO Auto-generated method stub
168
		return null;
169
	}
170

  
171
	public Handler[] getSelectHandlers() {
172
		// TODO Auto-generated method stub
173
		return null;
174
	}
175

  
176
	public Handler[] getStretchingHandlers() {
177
		// TODO Auto-generated method stub
178
		return null;
179
	}
180

  
181
	public Vector<AbstractPrimitive> getGeometries() {
182
		return geometries;
183
	}
184

  
185
	public void setGeometries(Vector<AbstractPrimitive> geometries) {
186
		this.geometries = geometries;
187
	}
188

  
189
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/main/java/org/gvsig/geometries3D/Solid.java
1
package org.gvsig.geometries3D;
2

  
3
import java.awt.Color;
4
import java.awt.Image;
5
import java.awt.Rectangle;
6
import java.awt.geom.AffineTransform;
7
import java.awt.geom.PathIterator;
8
import java.awt.geom.Point2D;
9
import java.awt.geom.Rectangle2D;
10
import java.util.Vector;
11

  
12
import org.cresques.cts.ICoordTrans;
13
import org.gvsig.fmap.geom.GeometryManager;
14
import org.gvsig.fmap.geom.handler.Handler;
15
import org.gvsig.fmap.geom.primitive.AbstractPrimitive;
16
import org.gvsig.fmap.geom.primitive.Envelope;
17
import org.gvsig.fmap.geom.primitive.FShape;
18
import org.gvsig.fmap.geom.primitive.GeneralPathX;
19
import org.gvsig.fmap.geom.type.GeometryType;
20

  
21
public class Solid extends AbstractPrimitive {
22

  
23
	
24
	/** Instancia de GeometryType obtenida al registrar esta clase */
25
	private static final GeometryType geomType = GeometryManager.getInstance()
26
			.registerGeometryType(Solid.class);
27
	
28
	
29
	
30
	public static class AttributeBinding {
31
		// default
32
		public static int BIND_OFF = 0;
33
		public static int BIND_OVERALL = 1;
34
		public static int BIND_PER_PRIMITIVE_SET = 2;
35
		public static int BIND_PER_PRIMITIVE = 3;
36
		public static int BIND_PER_VERTEX = 4;
37
	}
38

  
39
	private Vector<PrimitiveSet> primitiveSets;
40

  
41
	private Vector<Point3D> vertices;
42

  
43
	private Vector<Point3D> normals;
44

  
45
	private Vector<Color> colors;
46

  
47
	private Vector<Vector<Point2D>> texcoord;
48

  
49
	private Vector<Image> textures;
50

  
51
	private int colorBinding, normalBinding;
52

  
53
	private Material material;
54

  
55
	private boolean blending = false;
56
	
57
	private String id;
58

  
59
	public Solid(String id) {
60
		super(id,null);
61
//		this.setId(id);
62
		this.setPrimitiveSets(new Vector<PrimitiveSet>());
63
		this.setVertices(new Vector<Point3D>());
64
		this.setNormals(new Vector<Point3D>());
65
		this.setColors(new Vector<Color>());
66
		this.setTexcoord(new Vector<Vector<Point2D>>());
67
		this.setTextures(new Vector<Image>());
68
		this.setColorBinding(AttributeBinding.BIND_OFF);
69
		this.setNormalBinding(AttributeBinding.BIND_OFF);
70
	}
71

  
72
	
73
	
74
	public Vector<PrimitiveSet> getPrimitiveSets() {
75
		return primitiveSets;
76
	}
77

  
78

  
79

  
80
	public void setPrimitiveSets(Vector<PrimitiveSet> primitiveSets) {
81
		this.primitiveSets = primitiveSets;
82
	}
83

  
84

  
85

  
86
	public Vector<Point3D> getVertices() {
87
		return vertices;
88
	}
89

  
90

  
91

  
92
	public void setVertices(Vector<Point3D> vertices) {
93
		this.vertices = vertices;
94
	}
95

  
96

  
97

  
98
	public Vector<Point3D> getNormals() {
99
		return normals;
100
	}
101

  
102

  
103

  
104
	public void setNormals(Vector<Point3D> normals) {
105
		this.normals = normals;
106
	}
107

  
108

  
109

  
110
	public Vector<Color> getColors() {
111
		return colors;
112
	}
113

  
114

  
115

  
116
	public void setColors(Vector<Color> colors) {
117
		this.colors = colors;
118
	}
119

  
120

  
121

  
122
	public Vector<Vector<Point2D>> getTexcoord() {
123
		return texcoord;
124
	}
125

  
126

  
127

  
128
	public void setTexcoord(Vector<Vector<Point2D>> texcoord) {
129
		this.texcoord = texcoord;
130
	}
131

  
132

  
133

  
134
	public Vector<Image> getTextures() {
135
		return textures;
136
	}
137

  
138

  
139

  
140
	public void setTextures(Vector<Image> textures) {
141
		this.textures = textures;
142
	}
143

  
144

  
145

  
146
	public int getColorBinding() {
147
		return colorBinding;
148
	}
149

  
150

  
151

  
152
	public void setColorBinding(int colorBinding) {
153
		this.colorBinding = colorBinding;
154
	}
155

  
156

  
157

  
158
	public int getNormalBinding() {
159
		return normalBinding;
160
	}
161

  
162

  
163

  
164
	public void setNormalBinding(int normalBinding) {
165
		this.normalBinding = normalBinding;
166
	}
167

  
168

  
169

  
170
	public Material getMaterial() {
171
		return material;
172
	}
173

  
174

  
175

  
176
	public void setMaterial(Material material) {
177
		this.material = material;
178
	}
179

  
180

  
181

  
182
	public boolean isBlending() {
183
		return blending;
184
	}
185

  
186

  
187

  
188
	public void setBlending(boolean blending) {
189
		this.blending = blending;
190
	}
191

  
192

  
193
	/* *************************************************************************
194
	 * 
195
	 * All this methods are from abstract geometry
196
	 * 
197
	 **************************************************************************/
198
	
199
	
200
	@Override
201
	public GeometryType getGeometryType() {
202
		return geomType;
203
	}
204

  
205

  
206

  
207
	@Override
208
	public int getShapeType() {
209
		// TODO Auto-generated method stub
210
		return 0;
211
	}
212

  
213

  
214

  
215
	public Rectangle2D getBounds2D() {
216
		// TODO Auto-generated method stub
217
		return null;
218
	}
219

  
220

  
221

  
222
	public int getCoordinateDimension() {
223
		// TODO Auto-generated method stub
224
		return 0;
225
	}
226

  
227

  
228

  
229
	public PathIterator getPathIterator(AffineTransform arg0) {
230
		// TODO Auto-generated method stub
231
		return null;
232
	}
233

  
234

  
235

  
236
	public PathIterator getPathIterator(AffineTransform arg0, double arg1) {
237
		// TODO Auto-generated method stub
238
		return null;
239
	}
240

  
241

  
242

  
243
	public int getType() {
244
		return geomType.getType();
245
	}
246

  
247

  
248

  
249
	public boolean intersects(Rectangle2D arg0) {
250
		// TODO Auto-generated method stub
251
		return false;
252
	}
253

  
254

  
255

  
256
	public void reProject(ICoordTrans arg0) {
257
		// TODO Auto-generated method stub
258
		
259
	}
260

  
261

  
262

  
263
	public void transform(AffineTransform arg0) {
264
		// TODO Auto-generated method stub
265
		
266
	}
267

  
268

  
269

  
270
	public boolean contains(Point2D p) {
271
		// TODO Auto-generated method stub
272
		return false;
273
	}
274

  
275

  
276

  
277
	public boolean contains(Rectangle2D r) {
278
		// TODO Auto-generated method stub
279
		return false;
280
	}
281

  
282

  
283

  
284
	public boolean contains(double x, double y) {
285
		// TODO Auto-generated method stub
286
		return false;
287
	}
288

  
289

  
290

  
291
	public boolean contains(double x, double y, double w, double h) {
292
		// TODO Auto-generated method stub
293
		return false;
294
	}
295

  
296

  
297

  
298
	public Rectangle getBounds() {
299
		// TODO Auto-generated method stub
300
		return null;
301
	}
302

  
303

  
304

  
305
	public boolean intersects(double x, double y, double w, double h) {
306
		// TODO Auto-generated method stub
307
		return false;
308
	}
309

  
310

  
311

  
312
	public FShape cloneFShape() {
313
		// TODO Auto-generated method stub
314
		return null;
315
	}
316

  
317

  
318

  
319
	public Handler[] getSelectHandlers() {
320
		// TODO Auto-generated method stub
321
		return null;
322
	}
323

  
324

  
325

  
326
	public Handler[] getStretchingHandlers() {
327
		// TODO Auto-generated method stub
328
		return null;
329
	}
330

  
331

  
332

  
333
	public Envelope getEnvelope() {
334
		// TODO Auto-generated method stub
335
		return null;
336
	}
337

  
338

  
339

  
340
	public GeneralPathX getGeneralPath() {
341
		// TODO Auto-generated method stub
342
		return null;
343
	}
344

  
345

  
346

  
347

  
348

  
349

  
350
	
351
	
352
}
1.10/tags/gvSIG_3D_Animation_1_10_build_20_RC1/libraries/libGeometries3D/src/test/java/org/gvsig/geometries3D/Geometry3DFactoryTest.java
1
package org.gvsig.geometries3D;
2

  
3
import org.gvsig.GeometryFactory3D;
4
import org.gvsig.exceptions.BaseException;
5
import org.gvsig.fmap.geom.GeometryManager;
6

  
7
import junit.framework.TestCase;
8

  
9
public class Geometry3DFactoryTest extends TestCase {
10
	
11
	public void testRegisterGeometryFactory() throws BaseException {
12
		System.out.println("Creating new 3D factory.");
13
		GeometryFactory3D geomfact3D = new GeometryFactory3D();
14
		System.out.println("Registering it into the geometry manager.");
15
		GeometryManager.getInstance().registerGeometryFactory(geomfact3D);
16
	}
17

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff