← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3672: added Polyhedra.setVertices function, which also updates internal variables (shape.v=... does not)

 

------------------------------------------------------------
revno: 3672
committer: Jan Stransky <jan.stransky@xxxxxxxxxxx>
timestamp: Sat 2015-06-06 14:45:20 +0200
message:
  added Polyhedra.setVertices function, which also updates internal variables (shape.v=... does not)
modified:
  pkg/dem/Polyhedra.hpp


--
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 'pkg/dem/Polyhedra.hpp'
--- pkg/dem/Polyhedra.hpp	2014-11-08 09:56:26 +0000
+++ pkg/dem/Polyhedra.hpp	2015-06-06 12:45:20 +0000
@@ -69,6 +69,7 @@
 		Quaternionr GetOri(){Initialize(); return orientation;}
 		Polyhedron GetPolyhedron(){return P;};
 		void Clear(){v.clear(); P.clear(); init = 0; size = Vector3r(1.,1.,1.); faceTri.clear();};
+		void setVertices(const std::vector<Vector3r>& v) { init=false; this->v=v; Initialize(); }
 
 	protected:	
 		//triangulation of facets for plotting
@@ -102,6 +103,7 @@
 			.def("GetCentroid",&Polyhedra::GetCentroid,"return polyhedra's centroid")
 			.def("GetSurfaceTriangulation",&Polyhedra::GetSurfaceTriangulation,"triangulation of facets (for plotting)")
 			.def("GetSurfaces",&Polyhedra::GetSurfaces,"get indices of surfaces' vertices (for postprocessing)")
+			.def("setVertices",&Polyhedra::setVertices,"set vertices and update receiver")
 		);		
 		REGISTER_CLASS_INDEX(Polyhedra,Shape);
 };