Skip to content
Snippets Groups Projects
Commit c5331bdb authored by Xavier Robin's avatar Xavier Robin
Browse files

Allow running the Processor with PDBStrToEntity.

parent 00b3ffb5
No related branches found
No related tags found
No related merge requests found
......@@ -98,7 +98,9 @@ void export_pdb_io()
def("EntityToPDBStr", pdb_str_b,
(arg("entity"), arg("profile")=IOProfile()));
def("PDBStrToEntity", &PDBStringToEntity, (arg("pdb_string"),arg("profile")=IOProfile()));
def("PDBStrToEntity", &PDBStringToEntity, (arg("pdb_string"),
arg("profile")=IOProfile(),
arg("process")=false));
// we need to make sure there are no pending references to Python objects
// tied to the IOProfileRegistry singleton. The destructor of
......
......@@ -37,11 +37,15 @@ String EntityToPDBString(const mol::EntityView& ent, const IOProfile& profile) {
return stream.str();
}
mol::EntityHandle PDBStringToEntity(const String& pdb, const IOProfile& profile) {
mol::EntityHandle PDBStringToEntity(const String& pdb, const IOProfile& profile,
bool process) {
std::stringstream stream(pdb);
PDBReader reader(stream, profile);
mol::EntityHandle ent = mol::CreateEntity();
reader.Import(ent);
if(profile.processor && process) {
profile.processor->Process(ent);
}
return ent;
}
......
......@@ -34,7 +34,8 @@ String DLLEXPORT_OST_IO
EntityToPDBString(const mol::EntityView& ent, const IOProfile& profile=IOProfile());
mol::EntityHandle DLLEXPORT_OST_IO
PDBStringToEntity(const String& pdb, const IOProfile& profile=IOProfile());
PDBStringToEntity(const String& pdb, const IOProfile& profile=IOProfile(),
bool process=false);
}}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment