← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2993: - erase bodies before adding spheres from file

 

------------------------------------------------------------
revno: 2993
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2012-01-13 20:25:54 +0100
message:
  - erase bodies before adding spheres from file
modified:
  pkg/dem/TesselationWrapper.cpp


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/dem/TesselationWrapper.cpp'
--- pkg/dem/TesselationWrapper.cpp	2012-01-13 19:19:18 +0000
+++ pkg/dem/TesselationWrapper.cpp	2012-01-13 19:25:54 +0000
@@ -318,6 +318,7 @@
 	size_t imax=sp1.pack.size();
 	if (imax!=sp2.pack.size()) LOG_ERROR("The files have different numbers of spheres");
 	shared_ptr<Body> body;
+	scene->bodies->clear();
 	for(size_t i=0; i<imax; i++){
 		const SpherePack::Sph& sp(sp1.pack[i]);
 		LOG_DEBUG("sphere (" << sp.c << " " << sp.r << ")");