Skip to content
Snippets Groups Projects
Commit 366d1451 authored by Marco Biasini's avatar Marco Biasini
Browse files

unbreak numpy build

parent fa88ef65
Branches
Tags
No related merge requests found
......@@ -22,7 +22,10 @@
using namespace boost::python;
#include <ost/mol/mol.hh>
#include <ost/mol/impl/entity_impl.hh>
#include <ost/mol/impl/chain_impl.hh>
#include <ost/mol/impl/residue_impl.hh>
#include <ost/mol/impl/atom_impl.hh>
using namespace ost;
using namespace ost::mol;
......@@ -175,9 +178,18 @@ void set_pos(XCSEditor& e, object o1, object o2, bool trans)
}
std::map<unsigned long,AtomHandle> amap;
EntityHandle eh=e.GetEntity();
for(AtomHandleIter ait=eh.AtomsBegin(), aite=eh.AtomsEnd(); ait!=aite; ++ait) {
amap[(*ait).GetIndex()]=*ait;
impl::EntityImplPtr ei=e.GetEntity().Impl();
for(impl::ChainImplList::iterator cit=ei->GetChainList().begin();
cit!=ei->GetChainList().end();++cit) {
for (impl::ResidueImplList::iterator rit = (*cit)->GetResidueList().begin(),
ret = (*cit)->GetResidueList().end(); rit != ret; ++rit) {
for (impl::AtomImplList::iterator ait = (*rit)->GetAtomList().begin(),
aet = (*rit)->GetAtomList().end(); ait != aet; ++ait) {
amap[(*ait)->GetIndex()]=*ait;
}
}
}
AtomHandleList alist;
......
......@@ -21,6 +21,11 @@
using namespace boost::python;
#include <ost/mol/entity_view.hh>
#include <ost/mol/impl/entity_impl.hh>
#include <ost/mol/impl/chain_impl.hh>
#include <ost/mol/impl/residue_impl.hh>
#include <ost/mol/impl/atom_impl.hh>
#include <ost/mol/query.hh>
#include <ost/mol/mol.hh>
#include "bounds.hh"
......@@ -85,12 +90,20 @@ PyObject* get_pos2(EntityHandle& entity, bool id_sorted)
nad[2]=static_cast<npy_float>(pos[2]);
}
} else {
for(AtomHandleIter it=entity.AtomsBegin();it!=entity.AtomsEnd();++it,nad+=3) {
geom::Vec3 pos=(*it).GetPos();
nad[0]=static_cast<npy_float>(pos[0]);
nad[1]=static_cast<npy_float>(pos[1]);
nad[2]=static_cast<npy_float>(pos[2]);
}
impl::EntityImplPtr ei=entity.Impl();
for(impl::ChainImplList::iterator cit=ei->GetChainList().begin();
cit!=ei->GetChainList().end();++cit) {
for (impl::ResidueImplList::iterator rit = (*cit)->GetResidueList().begin(),
ret = (*cit)->GetResidueList().end(); rit != ret; ++rit) {
for (impl::AtomImplList::iterator ait = (*rit)->GetAtomList().begin(),
aet = (*rit)->GetAtomList().end(); ait != aet; ++ait, nad+=3) {
geom::Vec3 pos=(*ait)->TransformedPos();
nad[0]=static_cast<npy_float>(pos[0]);
nad[1]=static_cast<npy_float>(pos[1]);
nad[2]=static_cast<npy_float>(pos[2]);
}}}
}
return na;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment