/* One can add python methods to your module by putting code in %pythoncode blocks This function can be called as IMP.examples.say_hello(). */ %pythoncode %{ def create_model_and_particles(): m= IMP.Model() sc= IMP.container.ListSingletonContainer() b= IMP.algebra.BoundingBox3D(IMP.algebra.Vector3D(0,0,0), IMP.algebra.Vector3D(10,10,10)) for i in range(0,100): p= IMP.Particle(m) sc.add_particle(p) d=IMP.core.XYZR.setup_particle(p, IMP.algebra.Sphere3D(IMP.algebra.get_random_vector_in(b), 1)) d.set_coordinates_are_optimized(True) return (m, sc) %} /* Wrap our own classes */ %include "IMP/example/ExampleRestraint.h" %include "IMP/example/ExampleDecorator.h" %include "IMP/example/ExampleUnaryFunction.h" %include "IMP/example/ExampleRefCounted.h" %include "IMP/example/ExampleSingletonModifier.h" %include "IMP/example/ExampleTemplateClass.h" namespace IMP { namespace example { // Tell swig to create a copy of the class with dimension 3 %template(ExampleTemplateClass3D) ExampleTemplateClass<3>; // This macro defines the ExampleDecorators and ExampleDecoratorsTemp types for python IMP_SWIG_DECORATORS(ExampleDecorator, ExampleDecorators, Particles); } }