/* Ignore things to prevent SWIG warning about them */ namespace IMP::em { %ignore DensityMap::operator =; } %ignore operator<<(std::ostream&, const DensityHeader &); %ignore operator<<(std::ostream&, const EMHeader &); %ignore operator<<(std::ostream&, const MRCHeader &); /* Make selected classes extensible in Python */ IMP_SWIG_OBJECT(IMP::em, DensityMap, DensityMaps); IMP_SWIG_OBJECT(IMP::em, SampledDensityMap, SampledDensityMaps); IMP_SWIG_OBJECT(IMP::em, SurfaceShellDensityMap, SurfaceShellDensityMaps); IMP_SWIG_OBJECT(IMP::em, FitRestraint, FitRestraints); IMP_SWIG_OBJECT(IMP::em, Image, Images); IMP_SWIG_VALUE(IMP::em, RadiusDependentKernelParameters, RadiusDependentKernelParametersList); IMP_SWIG_VALUE(IMP::em, KernelParameters, KernelParametersList); /* Wrap our own classes */ %include "IMP/em/def.h" %include "IMP/em/DensityHeader.h" %include "IMP/em/MapReaderWriter.h" %include "IMP/em/DensityMap.h" %include "IMP/em/masking.h" %include "IMP/em/EMReaderWriter.h" %include "IMP/em/XplorReaderWriter.h" %include "IMP/em/MRCReaderWriter.h" %include "IMP/em/KernelParameters.h" %include "IMP/em/SampledDensityMap.h" %include "IMP/em/SurfaceShellDensityMap.h" %include "IMP/em/CoarseCC.h" %include "IMP/em/CoarseConvolution.h" %include "IMP/em/CoarseCCatIntervals.h" %include "IMP/em/FitRestraint.h" %include "IMP/em/converters.h" %include "IMP/em/SpiderHeader.h" %include "IMP/em/ImageHeader.h" %include "IMP/em/ImageReaderWriter.h" %include "IMP/em/SpiderReaderWriter.h" %include "IMP/em/Image.h" %include "IMP/em/noise.h" %include "IMP/em/filters.h" %include "IMP/em/rigid_fitting.h" %include "IMP/em/envelope_penetration.h" %include "IMP/em/image_transformations.h" /* Allow runtime casting of Restraint* objects to FitRestraint* */ namespace IMP { namespace em { %extend FitRestraint { static FitRestraint* cast(Restraint *r) { return dynamic_cast(r); } } %template(_ImageReaderWriter) ::IMP::em::ImageReaderWriter; %template(_SpiderImageReaderWriter) ::IMP::em::SpiderImageReaderWriter; %template(floats) ::std::vector; %template(add_noise) ::IMP::em::add_noise<::IMP::algebra::Matrix2D >; %template(add_noise_d) ::IMP::em::add_noise<::IMP::algebra::Matrix2D >; %template(FilterByThreshold2D) ::IMP::em::FilterByThreshold; %template(FilterByThreshold3D) ::IMP::em::FilterByThreshold; } } // Cannot instantiate template classes directly, since SWIG complains about // attempts to redefine the template classes; so rename them in the Python layer %pythoncode { ImageReaderWriter = _ImageReaderWriter SpiderImageReaderWriter = _SpiderImageReaderWriter }