Revision 16355
tags/tmp_build/extensions/extAnimation3D/build.xml | ||
---|---|---|
1 |
<project name="Generar extension en Andami" default="generate-without-source" basedir="."> |
|
2 |
<description> |
|
3 |
Instala el plugin de ejemplo en Andami. |
|
4 |
</description> |
|
5 |
<!-- set global properties for this build --> |
|
6 |
<property name="src" location="src" /> |
|
7 |
<property name="build" location="bin" /> |
|
8 |
<property name="dist" location="dist" /> |
|
9 |
<property name="plugin" value="com.iver.ai2.animation3D" /> |
|
10 |
<property name="extension-dir" location="../_fwAndami/gvSIG/extensiones" /> |
|
11 |
<property name="logos-dir" location="../_fwAndami/theme" /> |
|
12 |
<property name="gvsig-lib" location="../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib" /> |
|
13 |
<!--property name="binaries-dir" location="../binaries" /--> |
|
14 |
|
|
15 |
<target name="init"> |
|
16 |
<!-- Create the time stamp --> |
|
17 |
<tstamp /> |
|
18 |
<!-- Create the build directory structure used by compile --> |
|
19 |
<mkdir dir="${build}" /> |
|
20 |
<!-- Creamos un fichero con el timeStamp para que lo lea el FPanelAbout --> |
|
21 |
<buildnumber /> |
|
22 |
|
|
23 |
</target> |
|
24 |
|
|
25 |
<target name="generate-without-source" description="generate the distribution without the source file" depends=""> |
|
26 |
<!-- Create the distribution directory --> |
|
27 |
<mkdir dir="${dist}" /> |
|
28 |
<mkdir dir="${dist}/lib" /> |
|
29 |
<mkdir dir="${dist}/binaries" /> |
|
30 |
<!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file |
|
31 |
Except classes to be instantiated in core gvSIG --> |
|
32 |
<jar jarfile="${dist}/lib/${plugin}.jar" basedir="${build}" /> |
|
33 |
|
|
34 |
<copy todir="${dist}/lib/"> |
|
35 |
<fileset dir="lib/" includes="**/**" /> |
|
36 |
</copy> |
|
37 |
<!-- Put in this .jar the classes to be instantiated in gvSIG --> |
|
38 |
<copy file="config/config.xml" todir="${dist}" /> |
|
39 |
<copy file="config/about.htm" todir="${dist}" /> |
|
40 |
|
|
41 |
<copy todir="${dist}"> |
|
42 |
<fileset dir="config" includes="text*.properties" /> |
|
43 |
</copy> |
|
44 |
<copy todir="${dist}/images"> |
|
45 |
<fileset dir="images/" includes="**/**" excludes="**/*.db" /> |
|
46 |
</copy> |
|
47 |
|
|
48 |
<move todir="${extension-dir}/${plugin}/"> |
|
49 |
<fileset dir="${dist}" includes="**/**" /> |
|
50 |
</move> |
|
51 |
</target> |
|
52 |
|
|
53 |
<target name="copy-binaries"> |
|
54 |
<copy todir="${binaries-dir}"> |
|
55 |
<fileset dir="binaries/" includes="**" /> |
|
56 |
</copy> |
|
57 |
</target> |
|
58 |
|
|
59 |
<target name="debug-yes"> |
|
60 |
<property name="debug" value="on" /> |
|
61 |
<property name="debuglevel" value="lines, vars" /> |
|
62 |
</target> |
|
63 |
|
|
64 |
</project> |
|
65 |
|
tags/tmp_build/extensions/extAnimation3D/.classpath | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<classpath> |
|
3 |
<classpathentry kind="src" path="src"/> |
|
4 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
|
5 |
<classpathentry kind="lib" path="/_fwAndami/lib/iver-utiles.jar" sourcepath="/Utiles/src"/> |
|
6 |
<classpathentry combineaccessrules="false" kind="src" path="/ext3D"/> |
|
7 |
<classpathentry combineaccessrules="false" kind="src" path="/_fwAndami"/> |
|
8 |
<classpathentry combineaccessrules="false" kind="src" path="/appgvSIG"/> |
|
9 |
<classpathentry combineaccessrules="false" kind="src" path="/libFMap"/> |
|
10 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.ai2.gvsig3d/lib/gluegen-rt.jar"/> |
|
11 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.ai2.gvsig3d/lib/jogl.jar"/> |
|
12 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.ai2.gvsig3d/lib/libjosg-core-1.0-SNAPSHOT.jar"/> |
|
13 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.ai2.gvsig3d/lib/libjosg-features-1.0-SNAPSHOT.jar"/> |
|
14 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.ai2.gvsig3d/lib/libjosg-planets-1.0-SNAPSHOT.jar"/> |
|
15 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.ai2.gvsig3d/lib/libjosg-viewer-1.0-SNAPSHOT.jar"/> |
|
16 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/gvsig-animation.jar"/> |
|
17 |
<classpathentry kind="lib" path="/_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/lib/cms.jar"/> |
|
18 |
<classpathentry kind="output" path="bin"/> |
|
19 |
</classpath> |
tags/tmp_build/extensions/extAnimation3D/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>extAnimation3D</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
</buildSpec> |
|
14 |
<natures> |
|
15 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
16 |
</natures> |
|
17 |
</projectDescription> |
tags/tmp_build/extensions/extAnimation3D/config/about.htm | ||
---|---|---|
1 |
<html> |
|
2 |
<head> |
|
3 |
<title>Extension 3D del programa GvSIG </title> |
|
4 |
<meta content=""> |
|
5 |
<style></style> |
|
6 |
</head> |
|
7 |
<body> |
|
8 |
<table width="60%" border="0"> |
|
9 |
<tr> |
|
10 |
<td width="64%"><img src="images/logo_horiz_bicolor_gva.png" width="329" height="50"></td> |
|
11 |
<td width="36%"><div align="right"><img src="images/logoIver.png" width="87" height="50"></div></td> |
|
12 |
</tr> |
|
13 |
<tr> |
|
14 |
<td colspan="2"><font face="Arial, Helvetica, sans-serif">© Copyright |
|
15 |
Generalitat Valenciana, IVER T.I and other contributors 2005.</font></td> |
|
16 |
</tr> |
|
17 |
</table> |
|
18 |
<h3>Extesión de la Aplicación para el tratamiento de topónimos del Instituto Geográfico Nacional</h3> |
|
19 |
<p><br><br><b> Build Number: #build.number#</b></p> |
|
20 |
</body> |
|
21 |
</html> |
tags/tmp_build/extensions/extAnimation3D/config/text_ca.properties | ||
---|---|---|
1 |
#Translations for language [ca] |
|
2 |
#AnimationGui |
|
3 |
Check_Text=Visualizaci?n frames |
|
4 |
Label_Duration =Duraci?n |
|
5 |
Label_Mode=Modo |
|
6 |
Window_Title=Controles de animaci?n |
|
7 |
Text_Secs=segs |
|
8 |
Capturar_encuadre=Capturar encuadre |
|
9 |
Capturar_capa=Capturar capa |
|
10 |
Controles_de_animacion=Controles de animaci?n |
|
11 |
Exportar_video=Exportar v?deo |
|
12 |
Borrar_animacion=Borrar animaci?n |
|
13 |
Animacion=Animaci?n |
tags/tmp_build/extensions/extAnimation3D/config/config.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<plugin-config> |
|
3 |
<depends plugin-name="com.iver.cit.gvsig" /> |
|
4 |
<depends plugin-name="com.iver.ai2.gvsig3d" /> |
|
5 |
|
|
6 |
<libraries library-dir="./lib"/> |
|
7 |
<resourceBundle name="text"/> |
|
8 |
<extensions> |
|
9 |
<extension class-name="com.iver.cit.gvsig.animation.ExtensionAnimacion3D" |
|
10 |
description="Extensi?n encargada de registrar los tipos de animacion 3D." |
|
11 |
active="true" |
|
12 |
priority="50"> |
|
13 |
</extension> |
|
14 |
</extensions> |
|
15 |
</plugin-config> |
tags/tmp_build/extensions/extAnimation3D/config/text.properties | ||
---|---|---|
1 |
#Default language |
|
2 |
#AnimationGui |
|
3 |
Check_Text=Visualizaci?n frames |
|
4 |
Label_Duration =Duraci?n |
|
5 |
Label_Mode=Modo |
|
6 |
Window_Title=Controles de animaci?n |
|
7 |
Text_Secs=segs |
|
8 |
Capturar_encuadre=Capturar encuadre |
|
9 |
Capturar_capa=Capturar capa |
|
10 |
Controles_de_animacion=Controles de animaci?n |
|
11 |
Exportar_video=Exportar v?deo |
|
12 |
Borrar_animacion=Borrar animaci?n |
|
13 |
Animacion=Animaci?n |
tags/tmp_build/extensions/extAnimation3D/src/com/iver/cit/gvsig/animation/AnimationLayer3DFlat.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation; |
|
2 |
|
|
3 |
import com.iver.ai2.gvsig3d.camera.ProjectCamera; |
|
4 |
import com.iver.ai2.gvsig3d.gui.View3D; |
|
5 |
import com.iver.cit.gvsig.animation.keyframe.IAnimationTypeKeyFrame; |
|
6 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolator; |
|
7 |
|
|
8 |
public class AnimationLayer3DFlat implements IAnimationTypeKeyFrame { |
|
9 |
|
|
10 |
private String className = this.getClass().getName(); |
|
11 |
private String description = "Animacion basada en encuadres para vista 3D plana"; |
|
12 |
private String name = "Animacion vista 3D plana"; |
|
13 |
private int typeTrack = IAnimationType.TIME_TYPE_TRACK; |
|
14 |
private IInterpolator interpolator; |
|
15 |
private View3D view; |
|
16 |
|
|
17 |
public AnimationLayer3DFlat() { |
|
18 |
this.interpolator = new Interpolator3DFlat(); |
|
19 |
} |
|
20 |
|
|
21 |
public String getClassName() { |
|
22 |
return className; |
|
23 |
} |
|
24 |
|
|
25 |
public String getDescription() { |
|
26 |
return description; |
|
27 |
} |
|
28 |
|
|
29 |
public String getName() { |
|
30 |
return name; |
|
31 |
} |
|
32 |
|
|
33 |
public void setClassName(String className) { |
|
34 |
this.className = className; |
|
35 |
} |
|
36 |
|
|
37 |
public void setDescription(String description) { |
|
38 |
this.description = description; |
|
39 |
} |
|
40 |
|
|
41 |
public void setName(String name) { |
|
42 |
this.name = name; |
|
43 |
} |
|
44 |
|
|
45 |
public void AppliesToObject(Object animated) { |
|
46 |
|
|
47 |
// TODO implementar esta funcion para vistas 3D esfericas. |
|
48 |
KeyFrame3DFlat keyf = (KeyFrame3DFlat) animated; |
|
49 |
ProjectCamera projectCamera = (ProjectCamera) keyf.getAnimatedObject(); |
|
50 |
|
|
51 |
view.setCamera(projectCamera.getCamera()); |
|
52 |
// Hud hud = (Hud) view.getCanvas3d().getOSGViewer().getNodeFromHUD(0); |
|
53 |
// hud.setAnimationTime(AnimationPlayer.getCurrentTime()/1000); |
|
54 |
// hud.updateHud(); |
|
55 |
|
|
56 |
|
|
57 |
view.getCanvas3d().repaint(); |
|
58 |
|
|
59 |
} |
|
60 |
|
|
61 |
public int getTypeTrack() { |
|
62 |
return typeTrack; |
|
63 |
} |
|
64 |
|
|
65 |
public void setTypeTrack(int typeTrack) { |
|
66 |
this.typeTrack = typeTrack; |
|
67 |
|
|
68 |
} |
|
69 |
|
|
70 |
public IInterpolator getInterpolator() { |
|
71 |
return this.interpolator; |
|
72 |
} |
|
73 |
|
|
74 |
public void setInterpolator(IInterpolator interpolator) { |
|
75 |
this.interpolator = interpolator; |
|
76 |
|
|
77 |
} |
|
78 |
|
|
79 |
public Object getAnimatedObject() { |
|
80 |
// TODO Auto-generated method stub |
|
81 |
return this.view; |
|
82 |
} |
|
83 |
|
|
84 |
public void setAnimatedObject(Object object) { |
|
85 |
this.view = (View3D) object; |
|
86 |
|
|
87 |
} |
|
88 |
|
|
89 |
} |
tags/tmp_build/extensions/extAnimation3D/src/com/iver/cit/gvsig/animation/date/AnimationDate3D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.date; |
|
2 |
|
|
3 |
import com.iver.ai2.gvsig3d.gui.View3D; |
|
4 |
import com.iver.andami.PluginServices; |
|
5 |
import com.iver.andami.ui.mdiManager.IWindow; |
|
6 |
import com.iver.cit.gvsig.animation.IAnimationType; |
|
7 |
import com.iver.cit.gvsig.animation.dateFilter.DateFilter; |
|
8 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
9 |
import com.iver.cit.gvsig.fmap.layers.ICustomVectorialFilter; |
|
10 |
|
|
11 |
public class AnimationDate3D implements IAnimationType { |
|
12 |
|
|
13 |
private String className = this.getClass().getName(); |
|
14 |
private String description = "Animacion basada en encuadres para vista 3D plana"; |
|
15 |
private String name = "Animacion vista 3D plana"; |
|
16 |
private int typeTrack = IAnimationType.TIME_TYPE_TRACK; |
|
17 |
FLayer layer; |
|
18 |
private int filterMode = 0; |
|
19 |
ICustomVectorialFilter temporalFilter = null; |
|
20 |
|
|
21 |
public AnimationDate3D() { |
|
22 |
} |
|
23 |
|
|
24 |
public void AppliesToObject(Object animated) { |
|
25 |
// TODO Auto-generated method stub |
|
26 |
|
|
27 |
if (temporalFilter == null) |
|
28 |
temporalFilter = (ICustomVectorialFilter) animated; |
|
29 |
|
|
30 |
ICustomVectorialFilter filter = (ICustomVectorialFilter) animated; |
|
31 |
// System.out.println("fechaaaa " + filter); |
|
32 |
((DateFilter)filter).setFilterMode(filterMode); |
|
33 |
layer.setProperty("CustomVectorialFilter", filter); |
|
34 |
// layer.setDirty(true); |
|
35 |
|
|
36 |
boolean b = temporalFilter.compareTo(filter); |
|
37 |
// System.out.println("PINTANDO " + b); |
|
38 |
if (!b){ |
|
39 |
System.out.println("FALSE FALSE FALSE FALSE FALSE FALSE"); |
|
40 |
System.out.println("ANTERIOR"); |
|
41 |
System.out.println(temporalFilter); |
|
42 |
System.out.println("ACTUAL"); |
|
43 |
System.out.println(filter); |
|
44 |
layer.getMapContext().redraw(); |
|
45 |
|
|
46 |
IWindow[] f = PluginServices |
|
47 |
.getMDIManager().getAllWindows(); |
|
48 |
for (int i = 0; i < f.length; i++) { |
|
49 |
IWindow v = f[i]; |
|
50 |
if (v instanceof View3D) { |
|
51 |
View3D view3D = (View3D) v; |
|
52 |
view3D.getCanvas3d().repaint(); |
|
53 |
} |
|
54 |
} |
|
55 |
temporalFilter = filter; |
|
56 |
} |
|
57 |
// System.out.println("Filtro aplicado a la capa_" + layer.getName()); |
|
58 |
|
|
59 |
} |
|
60 |
|
|
61 |
public Object getAnimatedObject() { |
|
62 |
return this.layer; |
|
63 |
} |
|
64 |
|
|
65 |
public String getClassName() { |
|
66 |
return this.name; |
|
67 |
} |
|
68 |
|
|
69 |
public String getDescription() { |
|
70 |
return this.description; |
|
71 |
} |
|
72 |
|
|
73 |
public String getName() { |
|
74 |
return this.name; |
|
75 |
} |
|
76 |
|
|
77 |
public int getTypeTrack() { |
|
78 |
return this.typeTrack; |
|
79 |
} |
|
80 |
|
|
81 |
public void setAnimatedObject(Object object) { |
|
82 |
this.layer = (FLayer) object; |
|
83 |
|
|
84 |
} |
|
85 |
|
|
86 |
public void setTypeTrack(int typeTrack) { |
|
87 |
this.typeTrack = typeTrack; |
|
88 |
|
|
89 |
} |
|
90 |
|
|
91 |
public void setClassName(String className) { |
|
92 |
this.className = className; |
|
93 |
} |
|
94 |
|
|
95 |
public void setName(String name) { |
|
96 |
this.name = name; |
|
97 |
} |
|
98 |
|
|
99 |
public void setDescription(String description) { |
|
100 |
this.description = description; |
|
101 |
} |
|
102 |
|
|
103 |
public int getFilterMode() { |
|
104 |
return filterMode; |
|
105 |
} |
|
106 |
|
|
107 |
public void setFilterMode(int filterMode) { |
|
108 |
this.filterMode = filterMode; |
|
109 |
} |
|
110 |
|
|
111 |
} |
tags/tmp_build/extensions/extAnimation3D/src/com/iver/cit/gvsig/animation/date/AnimationTypeFactoryDate3D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation.date; |
|
2 |
|
|
3 |
import com.iver.cit.gvsig.animation.AnimationFactory; |
|
4 |
|
|
5 |
public class AnimationTypeFactoryDate3D extends AnimationFactory { |
|
6 |
|
|
7 |
public static String registerName = "AnimationDate3D"; |
|
8 |
|
|
9 |
|
|
10 |
public static AnimationDate3D animationDate; |
|
11 |
|
|
12 |
static { |
|
13 |
if (animationDate == null) { |
|
14 |
animationDate = new AnimationDate3D(); |
|
15 |
animationDate.setClassName("AnimationDate3D"); |
|
16 |
animationDate.setName("AnimationDate3D"); |
|
17 |
animationDate.setDescription("Animacion de tipo fecha sobre una capa"); |
|
18 |
} |
|
19 |
} |
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
public Object create() { |
|
24 |
|
|
25 |
return animationDate; |
|
26 |
} |
|
27 |
|
|
28 |
/** |
|
29 |
* Registers in the points of extension the Factory with alias. |
|
30 |
* |
|
31 |
*/ |
|
32 |
public static void register() { |
|
33 |
register(registerName, new AnimationTypeFactoryDate3D(), "com.iver.cit.gvsig.animation.date.AnimationDate3D"); |
|
34 |
} |
|
35 |
|
|
36 |
public String getRegisterName() { |
|
37 |
return registerName; |
|
38 |
} |
|
39 |
|
|
40 |
} |
tags/tmp_build/extensions/extAnimation3D/src/com/iver/cit/gvsig/animation/Interpolator3DFlat.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
import com.iver.ai2.gvsig3d.camera.ProjectCamera; |
|
6 |
import com.iver.ai2.gvsig3d.gui.View3D; |
|
7 |
import com.iver.cit.gvsig.animation.keyframe.IKeyFrame; |
|
8 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolator; |
|
9 |
import com.iver.cit.gvsig.animation.keyframe.interpolator.IInterpolatorFuntion; |
|
10 |
|
|
11 |
import es.upv.ai2.libjosg.Vec3; |
|
12 |
import es.upv.ai2.libjosg.viewer.Camera; |
|
13 |
|
|
14 |
public class Interpolator3DFlat implements IInterpolator { |
|
15 |
|
|
16 |
public View3D view; |
|
17 |
private IInterpolatorFuntion funtion; |
|
18 |
|
|
19 |
public IKeyFrame interpolate(List kfList, int index, double time) { |
|
20 |
KeyFrame3DFlat KF = new KeyFrame3DFlat(); |
|
21 |
|
|
22 |
if (kfList == null) |
|
23 |
return null; |
|
24 |
|
|
25 |
if (this.view == null) |
|
26 |
return null; |
|
27 |
|
|
28 |
|
|
29 |
// convert the time in the new time using funtion |
|
30 |
double newTime = this.getFuntion().interpolate(time); |
|
31 |
|
|
32 |
switch (kfList.size()) { |
|
33 |
// this case when there are only has 2 keyframes |
|
34 |
case 2: |
|
35 |
// getting the keyframes |
|
36 |
KeyFrame3DFlat kf1 = (KeyFrame3DFlat) kfList.get(0); |
|
37 |
KeyFrame3DFlat kf2 = (KeyFrame3DFlat) kfList.get(1); |
|
38 |
|
|
39 |
if (index == 1) { |
|
40 |
KeyFrame3DFlat kaux = kf1; |
|
41 |
kf1 = kf2; |
|
42 |
kf2 = kaux; |
|
43 |
} |
|
44 |
|
|
45 |
if ((kf1 == null) ||(kf2 == null)) |
|
46 |
return null; |
|
47 |
ProjectCamera vp1 = (ProjectCamera) kf1.getAnimatedObject(); |
|
48 |
ProjectCamera vp2 = (ProjectCamera) kf2.getAnimatedObject(); |
|
49 |
|
|
50 |
// ViewPort vp = view.getMapControl().getViewPort(); |
|
51 |
|
|
52 |
Camera cam1 = vp1.getCamera(); |
|
53 |
Camera cam2 = vp2.getCamera(); |
|
54 |
double time1 = kf1.getTime(); |
|
55 |
double time2 = kf2.getTime(); |
|
56 |
|
|
57 |
Vec3 eye = linearInterpolate(cam1.getEye(), cam2.getEye(), time1, time2, newTime); |
|
58 |
Vec3 center = linearInterpolate(cam1.getCenter(), cam2.getCenter(), time1, time2, newTime); |
|
59 |
// Vec3 center = new Vec3(eye.x(),eye.y(),0.0); |
|
60 |
Vec3 up = linearInterpolate(cam1.getUp(), cam2.getUp(), time1, time2, newTime); |
|
61 |
|
|
62 |
Camera newCamera = new Camera(); |
|
63 |
// newCamera.setViewByLookAt(eye, center, cam1.getUp()); |
|
64 |
newCamera.setViewByLookAt(eye, center, up); |
|
65 |
|
|
66 |
ProjectCamera pe = new ProjectCamera(); |
|
67 |
pe.setCamera(newCamera); |
|
68 |
KF.setName("temporal_keyframe"); |
|
69 |
// vp.setExtent(newExtent); |
|
70 |
KF.setAnimatedObject(pe); |
|
71 |
break; |
|
72 |
|
|
73 |
} |
|
74 |
|
|
75 |
return KF; |
|
76 |
} |
|
77 |
|
|
78 |
private double linearInterpolate(double minX, double minX2, double timePos, |
|
79 |
double timePos2, double time) { |
|
80 |
// P1 + (P2-P1)*((t-t1)/(t2-t1)) |
|
81 |
return (minX + (minX2 - minX) |
|
82 |
* ((time - timePos) / (timePos2 - timePos))); |
|
83 |
} |
|
84 |
|
|
85 |
private Vec3 linearInterpolate(Vec3 minX, Vec3 minX2, double timePos, |
|
86 |
double timePos2, double time) { |
|
87 |
|
|
88 |
Vec3 result = new Vec3(); |
|
89 |
|
|
90 |
double ele1 = linearInterpolate(minX.x(), minX2.x(), timePos, timePos2, |
|
91 |
time); |
|
92 |
double ele2 = linearInterpolate(minX.y(), minX2.y(), timePos, timePos2, |
|
93 |
time); |
|
94 |
double ele3 = linearInterpolate(minX.z(), minX2.z(), timePos, timePos2, |
|
95 |
time); |
|
96 |
|
|
97 |
result.setX(ele1); |
|
98 |
result.setY(ele2); |
|
99 |
result.setZ(ele3); |
|
100 |
return result; |
|
101 |
} |
|
102 |
|
|
103 |
public Object getAnimatedObject() { |
|
104 |
|
|
105 |
return this.view; |
|
106 |
} |
|
107 |
|
|
108 |
public void setAnimatedObject(Object ani) { |
|
109 |
this.view = (View3D) ani; |
|
110 |
|
|
111 |
} |
|
112 |
|
|
113 |
public IInterpolatorFuntion getFuntion() { |
|
114 |
return this.funtion; |
|
115 |
} |
|
116 |
|
|
117 |
public void setFuntion(IInterpolatorFuntion funtion) { |
|
118 |
this.funtion = funtion; |
|
119 |
|
|
120 |
} |
|
121 |
} |
tags/tmp_build/extensions/extAnimation3D/src/com/iver/cit/gvsig/animation/KeyFrame3DFlat.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation; |
|
2 |
|
|
3 |
import java.util.List; |
|
4 |
|
|
5 |
import com.iver.ai2.gvsig3d.camera.ProjectCamera; |
|
6 |
import com.iver.cit.gvsig.animation.keyframe.IKeyFrame; |
|
7 |
import com.iver.utiles.XMLEntity; |
|
8 |
|
|
9 |
public class KeyFrame3DFlat implements IKeyFrame { |
|
10 |
|
|
11 |
private String name; |
|
12 |
private double time; |
|
13 |
|
|
14 |
ProjectCamera projectCamera = null; |
|
15 |
|
|
16 |
public void Apply(double Tini) { |
|
17 |
// TODO Auto-generated method stub |
|
18 |
|
|
19 |
} |
|
20 |
|
|
21 |
public void CapturesProperties() { |
|
22 |
// TODO Auto-generated method stub |
|
23 |
|
|
24 |
} |
|
25 |
|
|
26 |
public void CapturesProperties(ProjectCamera projectCamera) { |
|
27 |
this.projectCamera = projectCamera; |
|
28 |
|
|
29 |
} |
|
30 |
|
|
31 |
public String getName() { |
|
32 |
// TODO Auto-generated method stub |
|
33 |
return this.name; |
|
34 |
} |
|
35 |
|
|
36 |
public List getPropertiesList() { |
|
37 |
// TODO Auto-generated method stub |
|
38 |
return null; |
|
39 |
} |
|
40 |
|
|
41 |
public void setName(String name) { |
|
42 |
this.name = name; |
|
43 |
|
|
44 |
} |
|
45 |
|
|
46 |
public void setPropertiesList(List list) { |
|
47 |
// TODO Auto-generated method stub |
|
48 |
|
|
49 |
} |
|
50 |
|
|
51 |
public String toString() { |
|
52 |
String result; |
|
53 |
result = " keyframe3DFlats:\n"; |
|
54 |
result += " tiempo: " + this.time; |
|
55 |
result += " nombre del extent: " + this.projectCamera.getDescription(); |
|
56 |
|
|
57 |
// result= "Name: " + this.getName(); |
|
58 |
return result; |
|
59 |
} |
|
60 |
|
|
61 |
public void Interpolate(Object p1, Object p2, double time) { |
|
62 |
// TODO Auto-generated method stub |
|
63 |
} |
|
64 |
|
|
65 |
public Object getAnimatedObject() { |
|
66 |
// TODO Auto-generated method stub |
|
67 |
return projectCamera; |
|
68 |
} |
|
69 |
public void setAnimatedObject(Object object) { |
|
70 |
this.projectCamera = (ProjectCamera) object; |
|
71 |
} |
|
72 |
|
|
73 |
public double getTime() { |
|
74 |
return time; |
|
75 |
} |
|
76 |
|
|
77 |
public void setTime(double time) { |
|
78 |
this.time = time; |
|
79 |
} |
|
80 |
|
|
81 |
public String getClassName() { |
|
82 |
// TODO Auto-generated method stub |
|
83 |
return null; |
|
84 |
} |
|
85 |
|
|
86 |
public XMLEntity getXMLEntity() { |
|
87 |
// TODO Auto-generated method stub |
|
88 |
return null; |
|
89 |
} |
|
90 |
|
|
91 |
public void setXMLEntity(XMLEntity xml) { |
|
92 |
// TODO Auto-generated method stub |
|
93 |
|
|
94 |
} |
|
95 |
|
|
96 |
} |
tags/tmp_build/extensions/extAnimation3D/src/com/iver/cit/gvsig/animation/ExtensionAnimacion3D.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation; |
|
2 |
|
|
3 |
import com.iver.andami.plugins.Extension; |
|
4 |
import com.iver.cit.gvsig.animation.date.AnimationTypeFactoryDate3D; |
|
5 |
import com.iver.utiles.extensionPoints.ExtensionPoint; |
|
6 |
import com.iver.utiles.extensionPoints.ExtensionPoints; |
|
7 |
import com.iver.utiles.extensionPoints.ExtensionPointsSingleton; |
|
8 |
|
|
9 |
//import com.iver.ai2.gvsig3d.gui.AnimationContol3D; |
|
10 |
|
|
11 |
/** |
|
12 |
* @author |
|
13 |
* @since 1.1 |
|
14 |
* |
|
15 |
* Menu of animation toolbar's options. |
|
16 |
*/ |
|
17 |
|
|
18 |
public class ExtensionAnimacion3D extends Extension { |
|
19 |
|
|
20 |
public void execute(String actionCommand) { |
|
21 |
|
|
22 |
} |
|
23 |
|
|
24 |
public void initialize() { |
|
25 |
|
|
26 |
// Registering Animation Type AnimationLayer3DFlat |
|
27 |
AnimationTypeFactoryLayer3DFlat.register(); |
|
28 |
// Registering Animation Type AnimationDate3D |
|
29 |
AnimationTypeFactoryDate3D.register(); |
|
30 |
|
|
31 |
|
|
32 |
} |
|
33 |
|
|
34 |
public boolean isEnabled() { |
|
35 |
// TODO Auto-generated method stub |
|
36 |
return true; |
|
37 |
} |
|
38 |
|
|
39 |
public boolean isVisible() { |
|
40 |
|
|
41 |
return false; |
|
42 |
} |
|
43 |
|
|
44 |
} |
tags/tmp_build/extensions/extAnimation3D/src/com/iver/cit/gvsig/animation/AnimationTypeFactoryLayer3DFlat.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.animation; |
|
2 |
|
|
3 |
import com.iver.cit.gvsig.animation.AnimationFactory; |
|
4 |
|
|
5 |
public class AnimationTypeFactoryLayer3DFlat extends AnimationFactory { |
|
6 |
|
|
7 |
public static String registerName = "AnimationLayer3DFlat"; |
|
8 |
|
|
9 |
|
|
10 |
public static AnimationLayer3DFlat animationLayer3DFlat; |
|
11 |
|
|
12 |
static { |
|
13 |
if (animationLayer3DFlat == null) { |
|
14 |
animationLayer3DFlat = new AnimationLayer3DFlat(); |
|
15 |
animationLayer3DFlat.setClassName("AnimationLayer3DFlat"); |
|
16 |
animationLayer3DFlat.setName("AnimationLayer3DFlat"); |
|
17 |
animationLayer3DFlat.setDescription("Animacion basada en encuadres para vista 3D plana"); |
|
18 |
} |
|
19 |
} |
|
20 |
|
|
21 |
|
|
22 |
|
|
23 |
public Object create() { |
|
24 |
|
|
25 |
return animationLayer3DFlat; |
|
26 |
} |
|
27 |
|
|
28 |
/** |
|
29 |
* Registers in the points of extension the Factory with alias. |
|
30 |
* |
|
31 |
*/ |
|
32 |
public static void register() { |
|
33 |
register(registerName, new AnimationTypeFactoryLayer3DFlat(), "com.iver.cit.gvsig.animation.AnimationLayer3DFlat"); |
|
34 |
} |
|
35 |
|
|
36 |
public String getRegisterName() { |
|
37 |
return registerName; |
|
38 |
} |
|
39 |
|
|
40 |
} |
tags/tmp_build/extensions/extGeoProcessing/.classpath | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<classpath> |
|
3 |
<classpathentry kind="src" path="src"/> |
|
4 |
<classpathentry kind="src" output="bin-test" path="src-test"/> |
|
5 |
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/> |
|
6 |
<classpathentry kind="src" path="/libFMap"/> |
|
7 |
<classpathentry kind="lib" path="/libFMap/lib/gdbms-0.8-SNAPSHOT.jar"/> |
|
8 |
<classpathentry kind="lib" path="/libFMap/lib/driver-manager-1.1.jar"/> |
|
9 |
<classpathentry kind="lib" path="lib/ehcache-1.2beta4.jar"/> |
|
10 |
<classpathentry kind="lib" path="lib/spatialindex.jar"/> |
|
11 |
<classpathentry combineaccessrules="false" kind="src" path="/_fwAndami"/> |
|
12 |
<classpathentry combineaccessrules="false" kind="src" path="/libIverUtiles"/> |
|
13 |
<classpathentry combineaccessrules="false" kind="src" path="/appgvSIG"/> |
|
14 |
<classpathentry kind="var" path="JUNIT_HOME/junit.jar"/> |
|
15 |
<classpathentry kind="lib" path="/libFMap/lib/org.cresques.cts.jar"/> |
|
16 |
<classpathentry kind="lib" path="/libFMap/lib/org.gvsig.exceptions.jar"/> |
|
17 |
<classpathentry kind="lib" path="/_fwAndami/lib/org.gvsig.ui.jar"/> |
|
18 |
<classpathentry kind="lib" path="/libFMap/lib/jts-1.8.jar"/> |
|
19 |
<classpathentry kind="output" path="bin"/> |
|
20 |
</classpath> |
|
0 | 21 |
tags/tmp_build/extensions/extGeoProcessing/.project | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
<projectDescription> |
|
3 |
<name>extGeoProcessing</name> |
|
4 |
<comment></comment> |
|
5 |
<projects> |
|
6 |
</projects> |
|
7 |
<buildSpec> |
|
8 |
<buildCommand> |
|
9 |
<name>org.eclipse.jdt.core.javabuilder</name> |
|
10 |
<arguments> |
|
11 |
</arguments> |
|
12 |
</buildCommand> |
|
13 |
<buildCommand> |
|
14 |
<name>de.loskutov.FileSync.FSBuilder</name> |
|
15 |
<arguments> |
|
16 |
</arguments> |
|
17 |
</buildCommand> |
|
18 |
</buildSpec> |
|
19 |
<natures> |
|
20 |
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature> |
|
21 |
<nature>org.eclipse.jdt.core.javanature</nature> |
|
22 |
<nature>org.eclipse.jem.beaninfo.BeanInfoNature</nature> |
|
23 |
</natures> |
|
24 |
</projectDescription> |
|
0 | 25 |
tags/tmp_build/extensions/extGeoProcessing/src-test/com/iver/cit/gvsig/geoprocess/impl/dissolve/DissolveTest.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 25/08/2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 2 |
|
11 |
* of the License, or (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program; if not, write to the Free Software |
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
21 |
* |
|
22 |
* For more information, contact: |
|
23 |
* |
|
24 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id$ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1 2007-09-14 15:10:34 azabala |
|
49 |
* *** empty log message *** |
|
50 |
* |
|
51 |
* |
|
52 |
*/ |
|
53 |
package com.iver.cit.gvsig.geoprocess.impl.dissolve; |
|
54 |
|
|
55 |
import junit.framework.TestCase; |
|
56 |
|
|
57 |
public class DissolveTest extends TestCase { |
|
58 |
public void testSpureusLines(){ |
|
59 |
|
|
60 |
} |
|
61 |
} |
|
62 |
|
|
0 | 63 |
tags/tmp_build/extensions/extGeoProcessing/src-test/com/iver/cit/gvsig/geoprocess/impl/buffer/BufferTest.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 25-abr-2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 2 |
|
11 |
* of the License, or (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program; if not, write to the Free Software |
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
21 |
* |
|
22 |
* For more information, contact: |
|
23 |
* |
|
24 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id$ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1 2007-08-07 16:21:00 azabala |
|
49 |
* new version in cvs. |
|
50 |
* |
|
51 |
* Revision 1.1 2007/07/12 11:33:24 azabala |
|
52 |
* *** empty log message *** |
|
53 |
* |
|
54 |
* |
|
55 |
*/ |
|
56 |
package com.iver.cit.gvsig.geoprocess.impl.buffer; |
|
57 |
|
|
58 |
import java.io.File; |
|
59 |
import java.net.URL; |
|
60 |
import java.util.HashMap; |
|
61 |
|
|
62 |
import junit.framework.TestCase; |
|
63 |
|
|
64 |
import org.cresques.cts.IProjection; |
|
65 |
|
|
66 |
import com.hardcode.gdbms.driver.exceptions.InitializeWriterException; |
|
67 |
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException; |
|
68 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
|
69 |
import com.iver.cit.gvsig.fmap.drivers.SHPLayerDefinition; |
|
70 |
import com.iver.cit.gvsig.fmap.edition.IWriter; |
|
71 |
import com.iver.cit.gvsig.fmap.edition.ShpSchemaManager; |
|
72 |
import com.iver.cit.gvsig.fmap.edition.writers.shp.MultiShpWriter; |
|
73 |
import com.iver.cit.gvsig.fmap.edition.writers.shp.ShpWriter; |
|
74 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
75 |
import com.iver.cit.gvsig.fmap.layers.FLyrVect; |
|
76 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
|
77 |
import com.iver.cit.gvsig.geoprocess.core.fmap.GeoprocessException; |
|
78 |
import com.iver.cit.gvsig.geoprocess.core.fmap.XTypes; |
|
79 |
import com.iver.cit.gvsig.geoprocess.impl.buffer.fmap.BufferGeoprocess; |
|
80 |
import com.iver.cit.gvsig.geoprocess.impl.buffer.fmap.BufferVisitor; |
|
81 |
|
|
82 |
|
|
83 |
//TODO All geoprocessing test classes must hava a common abstract base class |
|
84 |
//(a lot of code is repeated) |
|
85 |
// |
|
86 |
|
|
87 |
public class BufferTest extends TestCase { |
|
88 |
|
|
89 |
static final String fwAndamiDriverPath = "../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers"; |
|
90 |
private static File baseDataPath; |
|
91 |
private static File baseDriversPath; |
|
92 |
public static String SHP_DRIVER_NAME = "gvSIG shp driver"; |
|
93 |
|
|
94 |
static IProjection PROJECTION_DEFAULT = CRSFactory.getCRS("EPSG:23030"); |
|
95 |
|
|
96 |
|
|
97 |
protected void setUp() throws Exception { |
|
98 |
URL url = BufferTest.class.getResource("testdata"); |
|
99 |
if (url == null) |
|
100 |
throw new Exception("No se encuentra el directorio con datos de prueba"); |
|
101 |
|
|
102 |
baseDataPath = new File(url.getFile()); |
|
103 |
if (!baseDataPath.exists()) |
|
104 |
throw new Exception("No se encuentra el directorio con datos de prueba"); |
|
105 |
|
|
106 |
baseDriversPath = new File(fwAndamiDriverPath); |
|
107 |
if (!baseDriversPath.exists()) |
|
108 |
throw new Exception("Can't find drivers path: " + fwAndamiDriverPath); |
|
109 |
|
|
110 |
LayerFactory.setDriversPath(baseDriversPath.getAbsolutePath()); |
|
111 |
LayerFactory.setWritersPath(baseDriversPath.getAbsolutePath()); |
|
112 |
if (LayerFactory.getDM().getDriverNames().length < 1) |
|
113 |
throw new Exception("Can't find drivers in path: " + fwAndamiDriverPath); |
|
114 |
|
|
115 |
} |
|
116 |
|
|
117 |
|
|
118 |
public static FLayer newLayer(String fileName, |
|
119 |
String driverName) |
|
120 |
throws LoadLayerException { |
|
121 |
File file = new File(baseDataPath, fileName); |
|
122 |
return LayerFactory.createLayer(fileName, |
|
123 |
driverName, |
|
124 |
file, PROJECTION_DEFAULT); |
|
125 |
} |
|
126 |
|
|
127 |
|
|
128 |
|
|
129 |
public void test1() throws LoadLayerException, InitializeWriterException, GeoprocessException { |
|
130 |
FLyrVect inputLayer = (FLyrVect) newLayer("parcelas.shp", SHP_DRIVER_NAME); |
|
131 |
File outputFile = new File(baseDataPath+"/test1result.shp"); |
|
132 |
BufferGeoprocess geoprocess = new BufferGeoprocess(inputLayer); |
|
133 |
|
|
134 |
HashMap params = new HashMap(); |
|
135 |
//buffer all features (onlySelection = false) |
|
136 |
//buffer distance = 10m, buffer type = outside, number of radial polygons = 1 |
|
137 |
params.put("layer_selection", new Boolean(false)); |
|
138 |
params.put("dissolve_buffers", new Boolean(true)); |
|
139 |
params.put("buffer_distance", new Double(10d)); |
|
140 |
params.put("strategy_flag", new Byte(BufferGeoprocess.CONSTANT_DISTANCE_STRATEGY)); |
|
141 |
params.put("numRings", new Integer(1)); |
|
142 |
params.put("typePolBuffer", new Byte(BufferVisitor.BUFFER_OUTSIDE_POLY)); |
|
143 |
params.put("cap", new Byte(BufferVisitor.CAP_ROUND)); |
|
144 |
params.put("projection", PROJECTION_DEFAULT); |
|
145 |
params.put("distanceunits", new Integer(1)); |
|
146 |
params.put("mapunits", new Integer(1)); |
|
147 |
|
|
148 |
geoprocess.setParameters(params); |
|
149 |
|
|
150 |
|
|
151 |
SHPLayerDefinition definition = (SHPLayerDefinition) geoprocess.createLayerDefinition(); |
|
152 |
definition.setFile(outputFile); |
|
153 |
ShpSchemaManager schemaManager = new ShpSchemaManager(outputFile.getAbsolutePath()); |
|
154 |
IWriter writer = null; |
|
155 |
int shapeType = definition.getShapeType(); |
|
156 |
if(shapeType != XTypes.MULTI){ |
|
157 |
writer = new ShpWriter(); |
|
158 |
((ShpWriter) writer).setFile(definition.getFile()); |
|
159 |
writer.initialize(definition); |
|
160 |
}else{ |
|
161 |
writer = new MultiShpWriter(); |
|
162 |
((MultiShpWriter) writer).setFile(definition.getFile()); |
|
163 |
writer.initialize(definition); |
|
164 |
} |
|
165 |
geoprocess.setResultLayerProperties(writer, schemaManager); |
|
166 |
|
|
167 |
geoprocess.checkPreconditions(); |
|
168 |
geoprocess.process(); |
|
169 |
|
|
170 |
} |
|
171 |
|
|
172 |
} |
|
173 |
|
|
0 | 174 |
tags/tmp_build/extensions/extGeoProcessing/src-test/com/iver/cit/gvsig/geoprocess/impl/difference/DifferenceTest.java | ||
---|---|---|
1 |
/* |
|
2 |
* Created on 25-abr-2007 |
|
3 |
* |
|
4 |
* gvSIG. Sistema de Informaci?n Geogr?fica de la Generalitat Valenciana |
|
5 |
* |
|
6 |
* Copyright (C) 2004 IVER T.I. and Generalitat Valenciana. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 2 |
|
11 |
* of the License, or (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program; if not, write to the Free Software |
|
20 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,USA. |
|
21 |
* |
|
22 |
* For more information, contact: |
|
23 |
* |
|
24 |
* Generalitat Valenciana |
|
25 |
* Conselleria d'Infraestructures i Transport |
|
26 |
* Av. Blasco Ib??ez, 50 |
|
27 |
* 46010 VALENCIA |
|
28 |
* SPAIN |
|
29 |
* |
|
30 |
* +34 963862235 |
|
31 |
* gvsig@gva.es |
|
32 |
* www.gvsig.gva.es |
|
33 |
* |
|
34 |
* or |
|
35 |
* |
|
36 |
* IVER T.I. S.A |
|
37 |
* Salamanca 50 |
|
38 |
* 46005 Valencia |
|
39 |
* Spain |
|
40 |
* |
|
41 |
* +34 963163400 |
|
42 |
* dac@iver.es |
|
43 |
*/ |
|
44 |
/* CVS MESSAGES: |
|
45 |
* |
|
46 |
* $Id$ |
|
47 |
* $Log$ |
|
48 |
* Revision 1.1 2007-07-12 11:33:24 azabala |
|
49 |
* *** empty log message *** |
|
50 |
* |
|
51 |
* |
|
52 |
*/ |
|
53 |
package com.iver.cit.gvsig.geoprocess.impl.difference; |
|
54 |
|
|
55 |
import java.io.File; |
|
56 |
import java.net.URL; |
|
57 |
|
|
58 |
import junit.framework.TestCase; |
|
59 |
|
|
60 |
import org.cresques.cts.IProjection; |
|
61 |
|
|
62 |
import com.iver.cit.gvsig.exceptions.layers.LoadLayerException; |
|
63 |
import com.iver.cit.gvsig.fmap.crs.CRSFactory; |
|
64 |
import com.iver.cit.gvsig.fmap.layers.FLayer; |
|
65 |
import com.iver.cit.gvsig.fmap.layers.LayerFactory; |
|
66 |
|
|
67 |
public class DifferenceTest extends TestCase { |
|
68 |
|
|
69 |
static final String fwAndamiDriverPath = "../_fwAndami/gvSIG/extensiones/com.iver.cit.gvsig/drivers"; |
|
70 |
private File baseDataPath; |
|
71 |
private File baseDriversPath; |
|
72 |
|
|
73 |
private String SHP_DRIVER_NAME = "gvSIG shp driver"; |
|
74 |
private String DXF_DRIVER_NAME = "gvSIG DXF Memory Driver"; |
|
75 |
|
|
76 |
private IProjection PROJECTION_DEFAULT = |
|
77 |
CRSFactory.getCRS("EPSG:23030"); |
|
78 |
private IProjection newProjection = |
|
79 |
CRSFactory.getCRS("EPSG:23029"); |
|
80 |
|
|
81 |
protected void setUp() throws Exception { |
|
82 |
super.setUp(); |
|
83 |
URL url = this.getClass().getResource("testdata"); |
|
84 |
if (url == null) |
|
85 |
throw new Exception("No se encuentra el directorio con datos de prueba"); |
|
86 |
|
|
87 |
baseDataPath = new File(url.getFile()); |
|
88 |
if (!baseDataPath.exists()) |
|
89 |
throw new Exception("No se encuentra el directorio con datos de prueba"); |
|
90 |
|
|
91 |
baseDriversPath = new File(fwAndamiDriverPath); |
|
92 |
if (!baseDriversPath.exists()) |
|
93 |
throw new Exception("Can't find drivers path: " + fwAndamiDriverPath); |
|
94 |
|
|
95 |
LayerFactory.setDriversPath(baseDriversPath.getAbsolutePath()); |
|
96 |
if (LayerFactory.getDM().getDriverNames().length < 1) |
|
97 |
throw new Exception("Can't find drivers in path: " + fwAndamiDriverPath); |
|
98 |
} |
|
99 |
|
|
100 |
|
|
101 |
private FLayer newLayer(String fileName, |
|
102 |
String driverName) |
|
103 |
throws LoadLayerException { |
|
104 |
File file = new File(baseDataPath, fileName); |
|
105 |
return LayerFactory.createLayer(fileName, |
|
106 |
driverName, |
|
107 |
file, PROJECTION_DEFAULT); |
|
108 |
} |
|
109 |
|
|
110 |
|
|
111 |
public void test1() { |
|
112 |
// try { |
|
113 |
// //pruebas de reproyeccion y seleccion de numero de campos |
|
114 |
// FLyrVect lyr = (FLyrVect) newLayer("Cantabria.shp", SHP_DRIVER_NAME); |
|
115 |
// lyr.setAvailable(true); |
|
116 |
|
|
117 |
} |
|
118 |
|
|
119 |
} |
|
120 |
|
|
0 | 121 |
tags/tmp_build/extensions/extGeoProcessing/src-test/com/iver/cit/gvsig/geoprocess/AllTests.java | ||
---|---|---|
1 |
package com.iver.cit.gvsig.geoprocess; |
|
2 |
|
|
3 |
import junit.framework.Test; |
|
4 |
import junit.framework.TestSuite; |
|
5 |
|
|
6 |
import com.iver.cit.gvsig.geoprocess.impl.buffer.BufferTest; |
|
7 |
import com.iver.cit.gvsig.geoprocess.impl.difference.DifferenceTest; |
|
8 |
|
|
9 |
public class AllTests { |
|
10 |
|
|
11 |
public static Test suite() { |
|
12 |
TestSuite suite = new TestSuite( |
|
13 |
"Test for com.iver.cit.gvsig.geoprocess"); |
|
14 |
//$JUnit-BEGIN$ |
|
15 |
suite.addTestSuite(BufferTest.class); |
|
16 |
suite.addTestSuite(DifferenceTest.class); |
|
17 |
//$JUnit-END$ |
|
18 |
return suite; |
|
19 |
} |
|
20 |
|
|
21 |
} |
|
0 | 22 |
tags/tmp_build/extensions/extGeoProcessing/config/text_en.properties | ||
---|---|---|
1 |
#Translations for language [en] |
|
2 |
#Mon Oct 30 09:38:21 CET 2006 |
|
3 |
Abrir=Choose |
|
4 |
Abrir_Geoproceso=Open Geoprocess |
|
5 |
Aceptar=Accept |
|
6 |
Agregacion=Aggregation |
|
7 |
Agregacion_Desc=Geoprocesses that transform detailed data in resumed data. |
|
8 |
Analisis=Analisis |
|
9 |
Analisis_Desc=Geoprocesses that make explicit information from data |
|
10 |
Anterior=Back |
|
11 |
Area_de_influencia=Buffer |
|
12 |
Area_de_influencia_definida_por_un_campo=Buffer defined by field |
|
13 |
Area_de_influencia_definida_por_una_distancia=Buffer defined by distance |
|
14 |
Areas_de_influencia._Introduccion_de_datos=Buffer. Data input |
|
15 |
Asistente_de_geoprocesamiento=Geoprocessing Wizard |
|
16 |
Atributos_Numericos=Numerical attributes |
|
17 |
Campo_para_disolver=Field to dissolve |
|
18 |
Capas_del_directorio=Layers on directory |
|
19 |
Cerrar=Close |
|
20 |
Cobertura_de_datos=Data cover |
|
21 |
Cobertura_de_entrada=Input cover |
|
22 |
Cobertura_de_recorte=Clip cover |
|
23 |
Cobertura_de_salida=Output cover |
|
24 |
Coberturas_de_entrada=Input cover set |
|
25 |
Conversion_de_datos=Data conversion |
|
26 |
Conversion_de_datos_Desc=Geoprocesses that transform data (format conversion, reproject, etc.) |
|
27 |
Convex_Hull=Convex Hull |
|
28 |
Convex_Hull._Introduccion_de_datos=Convex Hull. Data input |
|
29 |
Crear_Buffer=Create Buffer... |
|
30 |
Crear_Indice=Spatial index creation... |
|
31 |
Crear_Indice_Pregunta_1=Do you want to create an spatial index for layer |
|
32 |
Crear_Indice_Pregunta_2=? |
|
33 |
De=of |
|
34 |
Dentro=inside de polygon |
|
35 |
Dentro_y_fuera=Inside and outside de polygon |
|
36 |
Diferencia=Difference |
|
37 |
Diferencia_Introduccion_de_datos=Difference. Fill in data |
|
38 |
Disolver=Dissolve |
|
39 |
Disolver._Introduccion_de_datos=Dissolve. Data input |
|
40 |
Disolver_entidades=Dissolve entities |
|
41 |
Elija_una_herramienta_de_analisis=Choose an analisys tool |
|
42 |
Enlace_espacial=Spatial join |
|
43 |
Enlace_espacial._Introduccion_de_datos=Spatial join. Data input |
|
44 |
Error_atributo_no_numerico=Not numeric buffer field |
|
45 |
Error_capa_vacia=Result layer is empty.\nCheck for a possible error. |
|
46 |
Error_chequeando_precondiciones=Check preconditions error |
|
47 |
Error_chequeo_tipo_geometria=Error during checking geometry type |
|
48 |
Error_distancia_buffer=You must enter a buffer distance |
|
49 |
Error_ejecucion=Execution error |
|
50 |
Error_entrada_datos=Data entry error |
|
51 |
Error_escritura_resultados=Data writing error |
|
52 |
Error_fallo_geoproceso=Error during geoprocess execution |
|
53 |
Error_preparar_escritura_resultados=Error during preparation of result layer |
|
54 |
Error_seleccionar_capas_merge=You must select the layers to merge. |
|
55 |
Error_seleccionar_esquema_merge=Error choosing merge eschema |
|
56 |
Error_seleccionar_gp=Must select a geoprocess in the tree |
|
57 |
Error_seleccionar_gp_desc="You've selected a package.\nPackages are logic groups of geoprocesses. Expand the tree and select a geoprocess to launch it |
|
58 |
Error_seleccionar_resultado=You must specify a result file |
|
59 |
Error_spjoinmn_sin_funcion=In a 1-N spatial join you must specify sumarization functions |
|
60 |
Escoger_Fun_Resumen=<- |
|
61 |
Ficheros_de_cartografia=Layer files |
|
62 |
Ficheros_SHP=SHP Files |
|
63 |
Fuera=Outside the polygon |
|
64 |
Funciones_Sumarizacion=Group by functions |
|
65 |
GC=Computational Geometry |
|
66 |
GC_Desc=Geoprocesses that make task related with computational geometry. |
|
67 |
Geoprocesos=Geoprocesses |
|
68 |
Gestor_de_Geoprocesos=Geoprocess toolbox |
|
69 |
Herramientas_de_analisis=Analisys Tools |
|
70 |
Interseccion=Intersect |
|
71 |
Interseccion._Introduccion_de_datos=Intersect. Data input |
Also available in: Unified diff