← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3735: Provide VTK6-support.

 

------------------------------------------------------------
revno: 3735
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2013-10-30 08:54:30 +0100
message:
  Provide VTK6-support.
modified:
  CMakeLists.txt
  pkg/dem/VTKRecorder.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt	2013-10-29 15:16:57 +0000
+++ CMakeLists.txt	2013-10-30 07:54:30 +0000
@@ -122,7 +122,7 @@
 SET(LINKLIBS  "${LINKLIBS};${BZIP2_LIBRARIES};${ZLIB_LIBRARIES};")
 #===========================================================
 IF(ENABLE_VTK)
-  FIND_PACKAGE(VTK COMPONENTS Common) 
+  FIND_PACKAGE(VTK) 
   IF(VTK_FOUND)
     INCLUDE_DIRECTORIES(${VTK_INCLUDE_DIRS})
     LINK_DIRECTORIES( ${VTK_LIBRARY_DIRS} )
@@ -379,7 +379,12 @@
 TARGET_LINK_LIBRARIES(boot yade)
 
 IF(ENABLE_VTK)
-  TARGET_LINK_LIBRARIES(yade vtkHybrid)
+  IF(${VTK_MAJOR_VERSION} EQUAL 6)
+    TARGET_LINK_LIBRARIES(yade ${VTK_LIBRARIES})
+    ADD_DEFINITIONS("-DYADE_VTK6")
+  ELSE(${VTK_MAJOR_VERSION} EQUAL 6)
+    TARGET_LINK_LIBRARIES(yade vtkHybrid)
+  ENDIF(${VTK_MAJOR_VERSION} EQUAL 6)
 ENDIF(ENABLE_VTK)
 IF(ENABLE_GUI)
   TARGET_LINK_LIBRARIES(yade _GLViewer ${GUI_LIBS})

=== modified file 'pkg/dem/VTKRecorder.cpp'
--- pkg/dem/VTKRecorder.cpp	2013-10-04 15:30:32 +0000
+++ pkg/dem/VTKRecorder.cpp	2013-10-30 07:54:30 +0000
@@ -574,7 +574,11 @@
 			if(ascii) writer->SetDataModeToAscii();
 			string fn=fileName+"spheres."+lexical_cast<string>(scene->iter)+".vtu";
 			writer->SetFileName(fn.c_str());
-			writer->SetInput(spheresUg);
+			#ifdef YADE_VTK6
+				writer->SetInputData(spheresUg);
+			#else
+				writer->SetInput(spheresUg);
+			#endif
 			writer->Write();
 		}
 	}
@@ -598,7 +602,11 @@
 			if(ascii) writer->SetDataModeToAscii();
 			string fn=fileName+"facets."+lexical_cast<string>(scene->iter)+".vtu";
 			writer->SetFileName(fn.c_str());
-			writer->SetInput(facetsUg);
+			#ifdef YADE_VTK6
+				writer->SetInputData(facetsUg);
+			#else
+				writer->SetInput(facetsUg);
+			#endif
 			writer->Write();	
 		}
 	}
@@ -622,7 +630,11 @@
 			if(ascii) writer->SetDataModeToAscii();
 			string fn=fileName+"boxes."+lexical_cast<string>(scene->iter)+".vtu";
 			writer->SetFileName(fn.c_str());
-			writer->SetInput(boxesUg);
+			#ifdef YADE_VTK6
+				writer->SetInputData(boxesUg);
+			#else
+				writer->SetInput(boxesUg);
+			#endif
 			writer->Write();	
 		}
 	}
@@ -649,7 +661,11 @@
 			if(ascii) writer->SetDataModeToAscii();
 			string fn=fileName+"intrs."+lexical_cast<string>(scene->iter)+".vtp";
 			writer->SetFileName(fn.c_str());
-			writer->SetInput(intrPd);
+			#ifdef YADE_VTK6
+				writer->SetInputData(intrPd);
+			#else
+				writer->SetInput(intrPd);
+			#endif
 			writer->Write();
 		}
 	}
@@ -666,7 +682,11 @@
 			if(ascii) writer->SetDataModeToAscii();
 			string fn=fileName+"pericell."+lexical_cast<string>(scene->iter)+".vtu";
 			writer->SetFileName(fn.c_str());
-			writer->SetInput(pericellUg);
+			#ifdef YADE_VTK6
+				writer->SetInputData(pericellUg);
+			#else
+				writer->SetInput(pericellUg);
+			#endif
 			writer->Write();
 		}
 	}
@@ -725,13 +745,12 @@
 		if(ascii) writer->SetDataModeToAscii();
 		string fn=fileName+"cracks."+lexical_cast<string>(scene->iter)+".vtu";
 		writer->SetFileName(fn.c_str());
-		writer->SetInput(crackUg);
+		#ifdef YADE_VTK6
+			writer->SetInputData(crackUg);
+		#else
+			writer->SetInput(crackUg);
+		#endif
 		writer->Write();
-		
-// 		fn=fileName+"newcracks."+lexical_cast<string>(scene->iter)+".vtu";
-// 		writer->SetFileName(fn.c_str());
-// 		writer->SetInput(crackUgNew);
-// 		writer->Write();
 	}
 
 	#ifdef YADE_VTK_MULTIBLOCK
@@ -746,7 +765,11 @@
 			if(ascii) writer->SetDataModeToAscii();
 			string fn=fileName+lexical_cast<string>(scene->iter)+".vtm";
 			writer->SetFileName(fn.c_str());
-			writer->SetInput(multiblockDataset);
+			#ifdef YADE_VTK6
+				writer->SetInputData(multiblockDataset);
+			#else
+				writer->SetInput(multiblockDataset);
+			#endif
 			writer->Write();	
 		}
 	#endif


Follow ups