%include "IMP/core/core_macros.h" /* Add additional IMPCORE_CONTAINER methods for scripting languages when the plural container is in the core namespace. */ %define IMPCORE_CONTAINER_SWIG(type, Ucname, lcname) %extend type { IMP::core::Ucname##s get_##lcname##s() const { IMP::core::Ucname##s ret(self->lcname##s_begin(), self->lcname##s_end()); return ret; } } %enddef namespace IMP { namespace core { IMPCORE_CONTAINER_SWIG(MonteCarlo, Mover, mover) //IMP_CONTAINER_SWIG(FilteredListSingletonContainer, Particle, singleton) //IMP_CONTAINER_SWIG(ListSingletonContainer, Particle, singleton) } } IMP_REFCOUNT_RETURN_SINGLE(IMP::core::Mover) /* Don't wrap internal classes */ %ignore IMP::core::internal::ChildArrayTraits; /* Wrap our own base classes */ %include "IMP/core/ClosePairsFinder.h" %include "IMP/core/Mover.h" %include "IMP/core/MoverBase.h" %include "IMP/core/XYZ.h" %include "IMP/core/XYZR.h" /* Wrap the final classes */ %include "IMP/core/AngleTripletScore.h" %include "IMP/core/AttributeSingletonScore.h" %include "IMP/core/BallMover.h" %include "IMP/core/IncrementalBallMover.h" %include "IMP/core/BoxSweepClosePairsFinder.h" %include "IMP/core/CentroidOfRefined.h" %include "IMP/core/ChecksScoreState.h" %include "IMP/core/ChildrenRefiner.h" %include "IMP/core/ClosedCubicSpline.h" %include "IMP/core/ClosePairsPairScore.h" %include "IMP/core/ConjugateGradients.h" %include "IMP/core/ConnectivityRestraint.h" %include "IMP/core/ConstantRestraint.h" %include "IMP/core/Cosine.h" %include "IMP/core/CoverRefined.h" %include "IMP/core/DerivativesFromRefined.h" %include "IMP/core/DerivativesToRefined.h" %include "IMP/core/DiameterRestraint.h" %include "IMP/core/Transform.h" %include "IMP/core/DihedralRestraint.h" %include "IMP/core/DistancePairScore.h" %include "IMP/core/DistanceRestraint.h" %include "IMP/core/DistanceToSingletonScore.h" %include "IMP/core/ExcludedVolumeRestraint.h" %include "IMP/core/BoundingBox3DSingletonScore.h" %include "IMP/core/FixedRefiner.h" %include "IMP/core/GridClosePairsFinder.h" %include "IMP/core/Harmonic.h" %include "IMP/core/HarmonicLowerBound.h" %include "IMP/core/HarmonicUpperBound.h" %include "IMP/core/Hierarchy.h" %inline %{ namespace IMP { namespace core { void breadth_first_traversal(Hierarchy d, HierarchyVisitor *f) { std::deque stack; stack.push_back(d); //d.show(std::cerr); do { Hierarchy cur= stack.front(); stack.pop_front(); if (f->operator()(cur)) { //std::cerr << "Visiting particle " << cur.get_particle() << std::endl; for (int i=cur.get_number_of_children()-1; i>=0; --i) { stack.push_back(cur.get_child(i)); } } } while (!stack.empty()); } void depth_first_traversal(Hierarchy d, HierarchyVisitor *f) { std::vector stack; stack.push_back(d); do { Hierarchy cur= stack.back(); stack.pop_back(); if (f->operator()(cur)) { for (int i=cur.get_number_of_children()-1; i>=0; --i) { stack.push_back(cur.get_child(i)); } } } while (!stack.empty()); } } } %} %include "IMP/core/LeavesRefiner.h" %include "IMP/core/Linear.h" %include "IMP/core/MonteCarlo.h" %include "IMP/core/NormalMover.h" %include "IMP/core/OpenCubicSpline.h" %include "IMP/core/QuadraticClosePairsFinder.h" %include "IMP/core/RefinedPairsPairScore.h" %include "IMP/core/rigid_bodies.h" %include "IMP/core/RigidClosePairsFinder.h" %include "IMP/core/SphereDistancePairScore.h" %include "IMP/core/SteepestDescent.h" %include "IMP/core/TransformedDistancePairScore.h" %include "IMP/core/TypedPairScore.h" %include "IMP/core/RigidBodyDistancePairScore.h" %include "IMP/core/TableRefiner.h" %include "IMP/core/TruncatedHarmonic.h" %include "IMP/core/MCCGSampler.h" %include "IMP/core/PairRestraint.h" %include "IMP/core/SingletonRestraint.h" %include "IMP/core/TripletRestraint.h" %include "IMP/core/QuadRestraint.h" %include "IMP/core/SingletonConstraint.h" %include "IMP/core/PairConstraint.h" %include "IMP/core/TripletConstraint.h" %include "IMP/core/QuadConstraint.h" %include "IMP/core/AngleRestraint.h" %include "IMP/core/RigidBodyMover.h" %include "IMP/core/VolumeRestraint.h" %include "IMP/core/utility.h" namespace IMP { namespace core { %template(Movers) ::IMP::VectorOfRefCounted< IMP::core::Mover*, IMP::RefCounted::Policy >; %template(MoversTemp) ::std::vector; %implicitconv Mover ; %template(TruncatedHarmonicLowerBound) ::IMP::core::TruncatedHarmonic; %template(TruncatedHarmonicUpperBound) ::IMP::core::TruncatedHarmonic; %template(TruncatedHarmonicBound) ::IMP::core::TruncatedHarmonic; IMP_SWIG_DECORATORS(XYZ, XYZs, Particles) IMP_SWIG_DECORATORS(XYZR, XYZRs, XYZs) IMP_SWIG_DECORATORS(RigidBody, RigidBodies, XYZs) IMP_SWIG_DECORATORS(RigidMember, RigidMembers, XYZs) /* Swig bitches about it having "the same name" as IMP.atom.Hierarchies even though it doesn't. */ %template(GenericHierarchies) ::IMP::DecoratorsWithTraits; %template(GenericHierarchiesTemp) ::IMP::DecoratorsWithTraits; // swig screws up on scopes, I can't be bothered to fix it //%template(show_named_hierarchy) show<::IMP::core::Name>; } namespace algebra { %template(get_transformation_aligning_first_to_second) get_transformation_aligning_first_to_second > >; %template(get_transformation_aligning_first_to_second) get_transformation_aligning_first_to_second; %template(get_transformation_aligning_first_to_second) get_transformation_aligning_first_to_second< std::vector >, core::XYZsTemp>; } }