From 4fb76b54de900cdfea6f7c61ddce3d9ca7408d48 Mon Sep 17 00:00:00 2001
From: Christophe Geuzaine <cgeuzaine@ulg.ac.be>
Date: Thu, 31 Jan 2013 15:37:43 +0000
Subject: [PATCH] try to use adaptive data if available

---
 Plugin/Warp.cpp | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Plugin/Warp.cpp b/Plugin/Warp.cpp
index 46ec517bc7..e6951c9138 100644
--- a/Plugin/Warp.cpp
+++ b/Plugin/Warp.cpp
@@ -62,8 +62,8 @@ PView *GMSH_WarpPlugin::execute(PView *v)
   PView *v2 = getView(otherView, v);
   if(!v2) return v;
 
-  PViewData *data1 = v1->getData();
-  PViewData *data2 = v2->getData();
+  PViewData *data1 = getPossiblyAdaptiveData(v1);
+  PViewData *data2 = getPossiblyAdaptiveData(v2);
 
   // sanity checks
   if(data1->getNumEntities() != data2->getNumEntities() ||
@@ -75,7 +75,7 @@ PView *GMSH_WarpPlugin::execute(PView *v)
     Msg::Error("Invalid TimeStep (%d) in View[%d]", TimeStep, v2->getIndex());
     return v;
   }
-  
+
   // create smooth normal field if we don't have an explicit warp field
   smooth_normals *normals = 0;
   if(otherView < 0){
@@ -106,7 +106,7 @@ PView *GMSH_WarpPlugin::execute(PView *v)
       }
     }
   }
-  
+
   // transform each "0" node: (x,y,z) += factor * mult * (valx, valy, valz)
   for(int step = 0; step < data1->getNumTimeSteps(); step++){
     for(int ent = 0; ent < data1->getNumEntities(step); ent++){
@@ -143,7 +143,7 @@ PView *GMSH_WarpPlugin::execute(PView *v)
       }
     }
   }
-  
+
   if(normals) delete normals;
 
   data1->finalize();
-- 
GitLab