diff --git a/Common/Visibility.cpp b/Common/Visibility.cpp
index bae999db4f69894a37a5e48d249c8b22f6e8d570..cad27794322bdf6d8388d9b41ad95d70bb79f753 100644
--- a/Common/Visibility.cpp
+++ b/Common/Visibility.cpp
@@ -1,4 +1,4 @@
-// $Id: Visibility.cpp,v 1.27 2007-08-21 19:05:39 geuzaine Exp $
+// $Id: Visibility.cpp,v 1.28 2008-01-10 14:56:54 remacle Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -19,6 +19,7 @@
 // 
 // Please report all bugs and problems to <gmsh@geuz.org>.
 
+#include <string.h>
 #include "Visibility.h"
 #include "GModel.h"
 #include "Parser.h" // for Symbol_T
diff --git a/Graphics/Post.cpp b/Graphics/Post.cpp
index 63c4ec9a7ddad39ea7b52b61a455b7afa9658bf3..71af2094b828cceae32b1cffebbf6272cf9ef122 100644
--- a/Graphics/Post.cpp
+++ b/Graphics/Post.cpp
@@ -1,4 +1,4 @@
-// $Id: Post.cpp,v 1.143 2007-12-08 07:09:29 geuzaine Exp $
+// $Id: Post.cpp,v 1.144 2008-01-10 14:56:54 remacle Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -28,6 +28,7 @@
 #include "VertexArray.h"
 #include "Context.h"
 #include "gl2ps.h"
+#include <algorithm>
 
 #if defined(HAVE_MATH_EVAL)
 #include "matheval.h"
diff --git a/Plugin/Makefile b/Plugin/Makefile
index 71dd42b7c478c0b03e8395a5b196270e278d221f..e9793c6262829a78fb069ff482331e9851c23f4a 100644
--- a/Plugin/Makefile
+++ b/Plugin/Makefile
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.134 2007-09-22 20:35:19 geuzaine Exp $
+# $Id: Makefile,v 1.135 2008-01-10 14:56:54 remacle Exp $
 #
 # Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 #
@@ -35,6 +35,7 @@ SRC = Plugin.cpp PluginManager.cpp\
         Eigenvectors.cpp Eigenvalues.cpp\
         StreamLines.cpp CutGrid.cpp\
         Transform.cpp\
+				TransformLatLon.cpp\
         Triangulate.cpp\
         Warp.cpp SphericalRaise.cpp\
         Skin.cpp\
@@ -73,275 +74,246 @@ Plugin.o: Plugin.cpp Plugin.h ../Common/Options.h ../Post/ColorTable.h \
   ../Common/Message.h ../Post/PView.h ../Common/SmoothData.h \
   ../Numeric/Numeric.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \
   ../Geo/SPoint3.h ../Post/PViewOptions.h ../Post/ColorTable.h \
-  ../Post/PViewDataList.h ../Post/PViewData.h ../Post/AdaptiveViews.h \
-  ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/PViewDataList.h ../Post/AdaptiveViews.h ../DataStr/List.h \
+  ../Common/GmshMatrix.h
 PluginManager.o: PluginManager.cpp Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  PluginManager.h CutMap.h Levelset.h CutGrid.h StreamLines.h CutPlane.h \
-  CutParametric.h CutSphere.h Skin.h ../DataStr/Tree.h ../DataStr/avl.h \
-  Extract.h ExtractElements.h ExtractEdges.h HarmonicToTime.h \
-  ModulusPhase.h Integrate.h Gradient.h Curl.h Divergence.h Annotate.h \
-  Remove.h MakeSimplex.h Smooth.h Transform.h Triangulate.h Warp.h \
-  SphericalRaise.h Eigenvectors.h Eigenvalues.h Lambda2.h Evaluate.h \
-  ../Post/OctreePost.h ../Common/Octree.h ../Common/OctreeInternals.h \
-  Probe.h FieldView.h ../Common/Context.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h PluginManager.h CutMap.h \
+  Levelset.h CutGrid.h StreamLines.h CutPlane.h CutParametric.h \
+  CutSphere.h Skin.h ../DataStr/Tree.h ../DataStr/avl.h Extract.h \
+  ExtractElements.h ExtractEdges.h HarmonicToTime.h ModulusPhase.h \
+  Integrate.h Gradient.h Curl.h Divergence.h Annotate.h Remove.h \
+  MakeSimplex.h Smooth.h Transform.h TransformLatLon.h Triangulate.h \
+  Warp.h SphericalRaise.h Eigenvectors.h Eigenvalues.h Lambda2.h \
+  Evaluate.h ../Post/OctreePost.h ../Common/Octree.h \
+  ../Common/OctreeInternals.h Probe.h FieldView.h ../Common/Context.h
 Levelset.o: Levelset.cpp Levelset.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  MakeSimplex.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h MakeSimplex.h
 CutPlane.o: CutPlane.cpp CutPlane.h Levelset.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h ../Common/Context.h ../Common/GmshUI.h \
-  ../Graphics/Draw.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
+  ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h
 CutSphere.o: CutSphere.cpp CutSphere.h Levelset.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h ../Common/Context.h ../Common/GmshUI.h \
-  ../Graphics/Draw.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
+  ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h
 CutMap.o: CutMap.cpp CutMap.h Levelset.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/Context.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/Context.h
 Smooth.o: Smooth.cpp Smooth.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h
 CutParametric.o: CutParametric.cpp ../Post/OctreePost.h \
   ../Common/Octree.h ../Common/OctreeInternals.h CutParametric.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h ../Common/Context.h ../Common/GmshUI.h \
-  ../Graphics/Draw.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
+  ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h \
+  ../contrib/MathEval/matheval.h
 Lambda2.o: Lambda2.cpp Lambda2.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/ShapeFunctions.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/ShapeFunctions.h
 Eigenvectors.o: Eigenvectors.cpp Eigenvectors.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h ../Numeric/EigSolve.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
+  ../Numeric/EigSolve.h
 Eigenvalues.o: Eigenvalues.cpp Eigenvalues.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h
 StreamLines.o: StreamLines.cpp StreamLines.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Post/OctreePost.h ../Common/Octree.h ../Common/OctreeInternals.h \
-  ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Post/OctreePost.h \
+  ../Common/Octree.h ../Common/OctreeInternals.h ../Common/Context.h \
+  ../Common/GmshUI.h ../Graphics/Draw.h
 CutGrid.o: CutGrid.cpp ../Post/OctreePost.h ../Common/Octree.h \
   ../Common/OctreeInternals.h CutGrid.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Common/GmshUI.h ../Graphics/Draw.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/Context.h \
+  ../Common/GmshUI.h ../Graphics/Draw.h
 Transform.o: Transform.cpp Transform.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h
 Triangulate.o: Triangulate.cpp ../Common/Gmsh.h ../Common/Message.h \
   ../DataStr/Malloc.h ../DataStr/List.h ../DataStr/Tree.h \
   ../DataStr/avl.h ../DataStr/Tools.h ../DataStr/List.h ../DataStr/Tree.h \
   ../Geo/gmshFace.h ../Geo/Geo.h ../Common/GmshDefines.h \
   ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \
-  ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SPoint3.h \
-  ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Geo/SPoint2.h \
+  ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SBoundingBox3d.h \
   ../Geo/ExtrudeParams.h ../Common/SmoothData.h ../Numeric/Numeric.h \
-  ../Geo/GFace.h ../Geo/GPoint.h ../Geo/GEntity.h ../Geo/Range.h \
-  ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h ../Geo/GEdgeLoop.h \
-  ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/GEntity.h \
-  ../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h \
-  ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint2.h ../Geo/MElement.h \
-  ../Geo/MVertex.h ../Geo/MEdge.h ../Geo/MVertex.h ../Geo/SVector3.h \
-  ../Common/Hash.h ../Geo/MFace.h ../Geo/MVertex.h ../Geo/SVector3.h \
-  ../Common/Context.h ../Geo/ExtrudeParams.h ../Geo/MElement.h \
-  ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h ../Geo/ExtrudeParams.h \
-  ../Geo/gmshVertex.h ../Geo/Geo.h ../Geo/GVertex.h ../Geo/Range.h \
-  Triangulate.h Plugin.h ../Common/Options.h ../Post/ColorTable.h \
-  ../Post/PView.h ../Post/PViewData.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../Common/GmshMatrix.h
+  ../Geo/GFace.h ../Geo/GPoint.h ../Geo/GEntity.h ../Geo/GEdgeLoop.h \
+  ../Geo/GEdge.h ../Geo/GVertex.h ../Geo/MVertex.h ../Geo/MElement.h \
+  ../Geo/MEdge.h ../Common/Hash.h ../Geo/MFace.h ../Common/Context.h \
+  ../Geo/gmshVertex.h ../Geo/MVertex.h Triangulate.h Plugin.h \
+  ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
+  ../Post/PView.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \
+  ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
+  ../Post/AdaptiveViews.h ../Common/GmshMatrix.h \
+  ../contrib/Triangle/triangle.h
 Warp.o: Warp.cpp Warp.h Plugin.h ../Common/Options.h ../Post/ColorTable.h \
   ../Common/Message.h ../Post/PView.h ../Common/SmoothData.h \
   ../Numeric/Numeric.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \
   ../Geo/SPoint3.h ../Post/PViewOptions.h ../Post/ColorTable.h \
-  ../Post/PViewDataList.h ../Post/PViewData.h ../Post/AdaptiveViews.h \
-  ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/PViewDataList.h ../Post/AdaptiveViews.h ../DataStr/List.h \
+  ../Common/GmshMatrix.h
 SphericalRaise.o: SphericalRaise.cpp SphericalRaise.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
 Skin.o: Skin.cpp Skin.h Plugin.h ../Common/Options.h ../Post/ColorTable.h \
   ../Common/Message.h ../Post/PView.h ../Common/SmoothData.h \
   ../Numeric/Numeric.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \
   ../Geo/SPoint3.h ../Post/PViewOptions.h ../Post/ColorTable.h \
-  ../Post/PViewDataList.h ../Post/PViewData.h ../Post/AdaptiveViews.h \
-  ../DataStr/List.h ../Common/GmshMatrix.h ../DataStr/Tree.h \
-  ../DataStr/avl.h ../DataStr/Malloc.h ../Common/Context.h
+  ../Post/PViewDataList.h ../Post/AdaptiveViews.h ../DataStr/List.h \
+  ../Common/GmshMatrix.h ../DataStr/Tree.h ../DataStr/avl.h \
+  ../DataStr/Malloc.h ../Common/Context.h
 Extract.o: Extract.cpp Extract.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../contrib/MathEval/matheval.h
 ExtractElements.o: ExtractElements.cpp ExtractElements.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
 ExtractEdges.o: ExtractEdges.cpp ExtractEdges.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h ../Mesh/BDS.h ../Geo/GFace.h ../Geo/GPoint.h \
-  ../Geo/GEntity.h ../Geo/Range.h ../Geo/SPoint3.h \
-  ../Geo/SBoundingBox3d.h ../Common/GmshDefines.h ../Geo/GEdgeLoop.h \
-  ../Geo/GEdge.h ../Geo/GEntity.h ../Geo/GVertex.h ../Geo/GEntity.h \
-  ../Geo/MVertex.h ../Geo/SPoint3.h ../Geo/GPoint.h ../Geo/SPoint2.h \
-  ../Geo/SVector3.h ../Geo/SPoint3.h ../Geo/SPoint3.h ../Geo/SPoint2.h \
-  ../Geo/MElement.h ../Geo/MVertex.h ../Geo/MEdge.h ../Geo/MVertex.h \
-  ../Geo/SVector3.h ../Common/Hash.h ../Geo/MFace.h ../Geo/MVertex.h \
-  ../Geo/SVector3.h ../Common/Context.h ../Geo/ExtrudeParams.h \
-  ../Geo/MElement.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/Pair.h \
-  ../Geo/ExtrudeParams.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
+  ../Mesh/BDS.h ../Geo/GFace.h ../Geo/GPoint.h ../Geo/GEntity.h \
+  ../Geo/Range.h ../Geo/SBoundingBox3d.h ../Common/GmshDefines.h \
+  ../Geo/GEdgeLoop.h ../Geo/GEdge.h ../Geo/GVertex.h ../Geo/MVertex.h \
+  ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/MElement.h ../Geo/MEdge.h \
+  ../Common/Hash.h ../Geo/MFace.h ../Common/Context.h \
+  ../Geo/ExtrudeParams.h ../Geo/Pair.h
 MakeSimplex.o: MakeSimplex.cpp MakeSimplex.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h
 Evaluate.o: Evaluate.cpp Evaluate.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Post/OctreePost.h ../Common/Octree.h ../Common/OctreeInternals.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Post/OctreePost.h \
+  ../Common/Octree.h ../Common/OctreeInternals.h \
+  ../contrib/MathEval/matheval.h
 FieldView.o: FieldView.cpp FieldView.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Mesh/Field.h ../Geo/Geo.h ../Common/GmshDefines.h \
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Mesh/Field.h \
+  ../contrib/ANN/include/ANN/ANN.h ../Geo/Geo.h ../Common/GmshDefines.h \
   ../Geo/gmshSurface.h ../Geo/Pair.h ../Geo/Range.h ../Geo/SPoint2.h \
-  ../Geo/SPoint3.h ../Geo/SVector3.h ../Geo/SPoint3.h \
-  ../Geo/SBoundingBox3d.h ../DataStr/Tree.h ../DataStr/avl.h \
-  ../Geo/SPoint2.h ../Geo/ExtrudeParams.h ../Geo/GEdge.h ../Geo/GEntity.h \
-  ../Geo/Range.h ../Geo/SPoint3.h ../Geo/SBoundingBox3d.h \
-  ../Geo/GVertex.h ../Geo/GEntity.h ../Geo/MVertex.h ../Geo/SPoint3.h \
-  ../Geo/GPoint.h ../Geo/SPoint2.h ../Geo/SVector3.h ../Geo/SPoint3.h \
-  ../Geo/SPoint2.h ../Geo/MElement.h ../Geo/MVertex.h ../Geo/MEdge.h \
-  ../Geo/MVertex.h ../Geo/SVector3.h ../Common/Hash.h ../Geo/MFace.h \
-  ../Geo/MVertex.h ../Geo/SVector3.h ../Common/Context.h \
-  ../Geo/ExtrudeParams.h ../Post/OctreePost.h ../Common/Octree.h \
-  ../Common/OctreeInternals.h
+  ../Geo/SVector3.h ../Geo/SBoundingBox3d.h ../DataStr/Tree.h \
+  ../DataStr/avl.h ../Geo/ExtrudeParams.h ../Geo/GEdge.h ../Geo/GEntity.h \
+  ../Geo/GVertex.h ../Geo/MVertex.h ../Geo/GPoint.h ../Geo/MElement.h \
+  ../Geo/MEdge.h ../Common/Hash.h ../Geo/MFace.h ../Common/Context.h \
+  ../Post/OctreePost.h ../Common/Octree.h ../Common/OctreeInternals.h
 Integrate.o: Integrate.cpp Integrate.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/ShapeFunctions.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/ShapeFunctions.h
 Gradient.o: Gradient.cpp Gradient.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/ShapeFunctions.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/ShapeFunctions.h
 Curl.o: Curl.cpp Curl.h Plugin.h ../Common/Options.h ../Post/ColorTable.h \
   ../Common/Message.h ../Post/PView.h ../Common/SmoothData.h \
   ../Numeric/Numeric.h ../Post/PViewData.h ../Geo/SBoundingBox3d.h \
   ../Geo/SPoint3.h ../Post/PViewOptions.h ../Post/ColorTable.h \
-  ../Post/PViewDataList.h ../Post/PViewData.h ../Post/AdaptiveViews.h \
-  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/ShapeFunctions.h
+  ../Post/PViewDataList.h ../Post/AdaptiveViews.h ../DataStr/List.h \
+  ../Common/GmshMatrix.h ../Common/ShapeFunctions.h
 Divergence.o: Divergence.cpp Divergence.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/ShapeFunctions.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/ShapeFunctions.h
 Annotate.o: Annotate.cpp Annotate.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Common/GmshUI.h ../Fltk/GUI.h \
-  ../Fltk/Opengl_Window.h ../Fltk/Colorbar_Window.h \
-  ../Fltk/Popup_Button.h ../Fltk/SpherePosition_Widget.h \
-  ../Graphics/Draw.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/Context.h \
+  ../Common/GmshUI.h ../Fltk/GUI.h ../Fltk/Opengl_Window.h \
+  ../Fltk/Colorbar_Window.h ../Fltk/Popup_Button.h \
+  ../Fltk/SpherePosition_Widget.h ../Graphics/Draw.h
 Remove.o: Remove.cpp Remove.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h
 Probe.o: Probe.cpp Probe.h Plugin.h ../Common/Options.h \
   ../Post/ColorTable.h ../Common/Message.h ../Post/PView.h \
   ../Common/SmoothData.h ../Numeric/Numeric.h ../Post/PViewData.h \
   ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h ../Post/PViewOptions.h \
-  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/PViewData.h \
-  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h \
-  ../Common/Context.h ../Post/OctreePost.h ../Common/Octree.h \
-  ../Common/OctreeInternals.h ../Common/GmshUI.h ../Graphics/Draw.h
+  ../Post/ColorTable.h ../Post/PViewDataList.h ../Post/AdaptiveViews.h \
+  ../DataStr/List.h ../Common/GmshMatrix.h ../Common/Context.h \
+  ../Post/OctreePost.h ../Common/Octree.h ../Common/OctreeInternals.h \
+  ../Common/GmshUI.h ../Graphics/Draw.h
 HarmonicToTime.o: HarmonicToTime.cpp HarmonicToTime.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
 ModulusPhase.o: ModulusPhase.cpp ModulusPhase.h Plugin.h \
   ../Common/Options.h ../Post/ColorTable.h ../Common/Message.h \
   ../Post/PView.h ../Common/SmoothData.h ../Numeric/Numeric.h \
   ../Post/PViewData.h ../Geo/SBoundingBox3d.h ../Geo/SPoint3.h \
   ../Post/PViewOptions.h ../Post/ColorTable.h ../Post/PViewDataList.h \
-  ../Post/PViewData.h ../Post/AdaptiveViews.h ../DataStr/List.h \
-  ../Common/GmshMatrix.h
+  ../Post/AdaptiveViews.h ../DataStr/List.h ../Common/GmshMatrix.h
diff --git a/Plugin/PluginManager.cpp b/Plugin/PluginManager.cpp
index 5571e6aa9b1fa305e670002f1e3784c059c0b08f..71468e4e80a1fe8d26bd1f709206f75d85056b8f 100644
--- a/Plugin/PluginManager.cpp
+++ b/Plugin/PluginManager.cpp
@@ -1,4 +1,4 @@
-// $Id: PluginManager.cpp,v 1.1 2007-09-11 14:01:55 geuzaine Exp $
+// $Id: PluginManager.cpp,v 1.2 2008-01-10 14:56:54 remacle Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -53,6 +53,7 @@
 #include "MakeSimplex.h"
 #include "Smooth.h"
 #include "Transform.h"
+#include "TransformLatLon.h"
 #include "Triangulate.h"
 #include "Warp.h"
 #include "SphericalRaise.h"
@@ -197,6 +198,8 @@ void GMSH_PluginManager::registerDefaultPlugins()
 		      ("Smooth", GMSH_RegisterSmoothPlugin()));
     allPlugins.insert(std::pair < char *, GMSH_Plugin * >
 		      ("Transform", GMSH_RegisterTransformPlugin()));
+    allPlugins.insert(std::pair < char *, GMSH_Plugin * >
+		      ("TransformLatLon", GMSH_RegisterTransformLatLonPlugin()));
     allPlugins.insert(std::pair < char *, GMSH_Plugin * >
 		      ("Warp", GMSH_RegisterWarpPlugin()));
     allPlugins.insert(std::pair < char *, GMSH_Plugin * >
diff --git a/Plugin/TransformLatLon.cpp b/Plugin/TransformLatLon.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..34cdd9c0a09dc55c0e0998e91991edfb005b8b9e
--- /dev/null
+++ b/Plugin/TransformLatLon.cpp
@@ -0,0 +1,194 @@
+// $Id: TransformLatLon.cpp,v 1.1 2008-01-10 14:56:54 remacle Exp $
+//
+// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+// 
+// Please report all bugs and problems to <gmsh@geuz.org>.
+
+#include "TransformLatLon.h"
+
+StringXNumber TransformLatLonOptions_Number[] = {
+  {GMSH_FULLRC,(char*) "iView", NULL, -1.},
+  {GMSH_FULLRC,(char*) "Longitude0", NULL, 0.}
+};
+
+extern "C"
+{
+  GMSH_Plugin *GMSH_RegisterTransformLatLonPlugin()
+  {
+    return new GMSH_TransformLatLonPlugin();
+  }
+}
+
+GMSH_TransformLatLonPlugin::GMSH_TransformLatLonPlugin()
+{
+  ;
+}
+
+void GMSH_TransformLatLonPlugin::getName(char *name) const
+{
+  strcpy(name, "TransformLatLon");
+}
+
+void GMSH_TransformLatLonPlugin::getInfos(char *author, char *copyright,
+                                    char *help_text) const
+{
+  strcpy(author, "C. Geuzaine");
+  strcpy(copyright, "DGR (www.multiphysics.com)");
+  strcpy(help_text,
+         "Plugin(TransformLatLon) transforms the homogeneous\n"
+	 "node coordinates (x,y,z,1) of the elements in\n"
+	 "the view `iView' by the matrix\n"
+         "[`A11' `A12' `A13' `Tx']\n"
+	 "[`A21' `A22' `A23' `Ty']\n"
+	 "[`A31' `A32' `A33' `Tz'].\n"
+	 "If `SwapOrientation' is set, the orientation of the\n"
+	 "elements is reversed. If `iView' < 0, the plugin\n"
+	 "is run on the current view.\n"
+	 "\n"
+	 "Plugin(TransformLatLon) is executed in-place.\n");
+}
+
+int GMSH_TransformLatLonPlugin::getNbOptions() const
+{
+  return sizeof(TransformLatLonOptions_Number) / sizeof(StringXNumber);
+}
+
+StringXNumber *GMSH_TransformLatLonPlugin::getOption(int iopt)
+{
+  return &TransformLatLonOptions_Number[iopt];
+}
+
+void GMSH_TransformLatLonPlugin::catchErrorMessage(char *errorMessage) const
+{
+  strcpy(errorMessage, "TransformLatLon failed...");
+}
+
+// TransformLatLonation
+
+static void transform(double v[3], double *x, double *y, double *z,double rotate)
+{
+	double r = sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]);
+	*y=asin(v[2]/r)*180/M_PI;
+	*x=atan2(v[1],v[0])*180/M_PI+rotate;
+	while(*x>180)*x-=360;
+	*z=0;
+}
+
+static void transform_list(List_T *list, int nbList, List_T *list2, int *nbList2, 
+			   int nbVert, int nbComp,double rotate)
+{
+  if(!nbList) return;
+  int nb = List_Nbr(list) / nbList;
+	double *x2=new double[nbVert];
+	double *y2=new double[nbVert];
+	double *z2=new double[nbVert];
+  for(int i = 0; i < List_Nbr(list); i += nb) {
+    double *x = (double *)List_Pointer_Fast(list, i);
+    double *y = (double *)List_Pointer_Fast(list, i + nbVert);
+    double *z = (double *)List_Pointer_Fast(list, i + 2 * nbVert);
+    for(int j = 0; j < nbVert; j++) {
+      double v[3] = { x[j], y[j], z[j] };
+      transform(v, &x2[j], &y2[j], &z2[j],rotate);
+    }
+		// check the periodicity
+		bool cross=false;
+		for(int j=1;j<nbVert;j++) cross|=(fabs(x2[j]-x2[0])>180);
+		if(cross) for(int j=0;j<nbVert;j++) if(x2[j]<0)x2[j]+=360;
+    for(int j = 0; j < nbVert; j++)List_Add(list2,&x2[j]);
+    for(int j = 0; j < nbVert; j++)List_Add(list2,&y2[j]);
+    for(int j = 0; j < nbVert; j++)List_Add(list2,&z2[j]);
+		for(int k = 0; k < nbVert; k++){
+			double d;
+			for(int l = 0; l < nbComp; l++){
+				List_Read(list, i + 3 * nbVert + nbComp * k + l, &d);
+				List_Add(list2, &d);
+			}
+		}
+    (*nbList2)++;
+		if(cross){
+			for(int j=0;j<nbVert;j++) x2[j]-=360;
+			for(int j = 0; j < nbVert; j++)List_Add(list2,&x2[j]);
+			for(int j = 0; j < nbVert; j++)List_Add(list2,&y2[j]);
+			for(int j = 0; j < nbVert; j++)List_Add(list2,&z2[j]);
+			for(int k = 0; k < nbVert; k++){
+				double d;
+				for(int l = 0; l < nbComp; l++){
+					List_Read(list, i + 3 * nbVert + nbComp * k + l, &d);
+					List_Add(list2, &d);
+				}
+			}
+			(*nbList2)++;
+		}
+  }
+	delete []x2;
+	delete []y2;
+	delete []z2;
+}
+
+PView *GMSH_TransformLatLonPlugin::execute(PView *v)
+{
+  int iView = (int)TransformLatLonOptions_Number[0].def;
+	double rotate = (double)TransformLatLonOptions_Number[1].def;
+
+  PView *v1 = getView(iView, v);
+  if(!v1) return v;
+	PView *v2 = new PView(true);
+  PViewDataList *data2 = getDataList(v2);
+  if(!data2) return v;
+
+  PViewDataList *data1 = getDataList(v1);
+  if(!data1) return v;
+  // points
+  transform_list(data1->SP, data1->NbSP, data2->SP, &data2->NbSP, 1, 1, rotate); 
+  transform_list(data1->VP, data1->NbVP, data2->VP, &data2->NbVP, 1, 3, rotate);
+  transform_list(data1->TP, data1->NbTP, data2->TP, &data2->NbTP, 1, 9, rotate);
+  // lines			                                  	            
+  transform_list(data1->SL, data1->NbSL, data2->SL, &data2->NbSL, 2, 1, rotate); 
+  transform_list(data1->VL, data1->NbVL, data2->VL, &data2->NbVL, 2, 3, rotate);
+  transform_list(data1->TL, data1->NbTL, data2->TL, &data2->NbTL, 2, 9, rotate);
+  // triangles			                                  	        	
+  transform_list(data1->ST, data1->NbST, data2->ST, &data2->NbST, 3, 1, rotate); 
+  transform_list(data1->VT, data1->NbVT, data2->VT, &data2->NbVT, 3, 3, rotate);
+  transform_list(data1->TT, data1->NbTT, data2->TT, &data2->NbTT, 3, 9, rotate);
+  // quadrangles		                                  	        	
+  transform_list(data1->SQ, data1->NbSQ, data2->SQ, &data2->NbSQ, 4, 1, rotate); 
+  transform_list(data1->VQ, data1->NbVQ, data2->VQ, &data2->NbVQ, 4, 3, rotate);
+  transform_list(data1->TQ, data1->NbTQ, data2->TQ, &data2->NbTQ, 4, 9, rotate);
+  // tets			                                  	              
+  transform_list(data1->SS, data1->NbSS, data2->SS, &data2->NbSS, 4, 1, rotate); 
+  transform_list(data1->VS, data1->NbVS, data2->VS, &data2->NbVS, 4, 3, rotate);
+  transform_list(data1->TS, data1->NbTS, data2->TS, &data2->NbTS, 4, 9, rotate);
+  // hexas			                                  	            
+  transform_list(data1->SH, data1->NbSH, data2->SH, &data2->NbSH, 8, 1, rotate); 
+  transform_list(data1->VH, data1->NbVH, data2->VH, &data2->NbVH, 8, 3, rotate);
+  transform_list(data1->TH, data1->NbTH, data2->TH, &data2->NbTH, 8, 9, rotate);
+  // prisms			                                  	            
+  transform_list(data1->SI, data1->NbSI, data2->SI, &data2->NbSI, 6, 1, rotate); 
+  transform_list(data1->VI, data1->NbVI, data2->VI, &data2->NbVI, 6, 3, rotate);
+  transform_list(data1->TI, data1->NbTI, data2->TI, &data2->NbTI, 6, 9, rotate);
+  // pyramids			                                  	          
+  transform_list(data1->SY, data1->NbSY, data2->SY, &data2->NbSY, 5, 1, rotate); 
+  transform_list(data1->VY, data1->NbVY, data2->VY, &data2->NbVY, 5, 3, rotate);
+  transform_list(data1->TY, data1->NbTY, data2->TY, &data2->NbTY, 5, 9, rotate);
+
+  data2->setName(data1->getName() + "_LatLon");
+  data2->setFileName(data1->getName() + "_LatLon.pos");
+  data2->finalize();
+
+  return v2;
+}
diff --git a/Plugin/TransformLatLon.h b/Plugin/TransformLatLon.h
new file mode 100644
index 0000000000000000000000000000000000000000..842293b686e11f4008b03e9b6fed7550bef764bf
--- /dev/null
+++ b/Plugin/TransformLatLon.h
@@ -0,0 +1,42 @@
+#ifndef _TRANSFORMLATLON_H_
+#define _TRANSFORMLATLON_H_
+
+// Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
+// USA.
+// 
+// Please report all bugs and problems to <gmsh@geuz.org>.
+
+#include "Plugin.h"
+
+extern "C"
+{
+  GMSH_Plugin *GMSH_RegisterTransformLatLonPlugin();
+}
+
+class GMSH_TransformLatLonPlugin : public GMSH_Post_Plugin
+{
+public:
+  GMSH_TransformLatLonPlugin();
+  void getName(char *name) const;
+  void getInfos(char *author, char *copyright, char *help_text) const;
+  void catchErrorMessage(char *errorMessage) const;
+  int getNbOptions() const;
+  StringXNumber* getOption(int iopt);  
+  PView *execute(PView *);
+};
+
+#endif
diff --git a/Post/PView.cpp b/Post/PView.cpp
index b37087de47f5338e1b415621fde58e4eb0122042..cc1fdf0c30760bfdfbdfd9d05f7fc8c807758c26 100644
--- a/Post/PView.cpp
+++ b/Post/PView.cpp
@@ -1,4 +1,4 @@
-// $Id: PView.cpp,v 1.11 2007-09-22 20:35:19 geuzaine Exp $
+// $Id: PView.cpp,v 1.12 2008-01-10 14:56:54 remacle Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -26,6 +26,8 @@
 #include "PViewDataList.h"
 #include "VertexArray.h"
 #include "Message.h"
+#include <string.h>
+#include <algorithm>
 
 int PView::_globalNum = 0;
 std::vector<PView*> PView::list;
diff --git a/Post/PViewDataListIO.cpp b/Post/PViewDataListIO.cpp
index 511ae6cc08940831f153316cb9e63b848a3d55b8..1576299a854c0e202e6d63e6cacb11cc3d80a0d7 100644
--- a/Post/PViewDataListIO.cpp
+++ b/Post/PViewDataListIO.cpp
@@ -1,4 +1,4 @@
-// $Id: PViewDataListIO.cpp,v 1.3 2007-09-08 21:26:05 geuzaine Exp $
+// $Id: PViewDataListIO.cpp,v 1.4 2008-01-10 14:56:55 remacle Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -22,6 +22,7 @@
 // Contributor(s):
 // 
 
+#include <string.h>
 #include <set>
 #include "PViewDataList.h"
 #include "Numeric.h"
diff --git a/Post/PViewOptions.cpp b/Post/PViewOptions.cpp
index 7e3f8d0c326008e49e8b783a4f1a8b68f95a2558..cd9217cefd109caeb5c55667d26694ce7fd88bd3 100644
--- a/Post/PViewOptions.cpp
+++ b/Post/PViewOptions.cpp
@@ -1,4 +1,4 @@
-// $Id: PViewOptions.cpp,v 1.16 2007-09-10 04:47:08 geuzaine Exp $
+// $Id: PViewOptions.cpp,v 1.17 2008-01-10 14:56:55 remacle Exp $
 //
 // Copyright (C) 1997-2007 C. Geuzaine, J.-F. Remacle
 //
@@ -22,6 +22,7 @@
 // Contributor(s):
 // 
 
+#include <string.h>
 #include "PViewOptions.h"
 #include "Message.h"
 
diff --git a/contrib/Netgen/libsrc/general/symbolta.hpp b/contrib/Netgen/libsrc/general/symbolta.hpp
index 6b8916e8ead2b60b0fcf44f287a17024b3f42c8c..1b74a8f9421d813276227e22507233300b3d8e49 100644
--- a/contrib/Netgen/libsrc/general/symbolta.hpp
+++ b/contrib/Netgen/libsrc/general/symbolta.hpp
@@ -7,6 +7,7 @@
 /* Author: Joachim Schoeberl                                              */
 /* Date:   01. Jun. 95                                                    */
 /**************************************************************************/
+#include <string.h>
 
 /**
    Base class for the generic SYMBOLTABLE.