Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openstructure
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
schwede
openstructure
Commits
4ffc9738
Commit
4ffc9738
authored
9 years ago
by
Gerardo Tauriello
Browse files
Options
Downloads
Patches
Plain Diff
Fixed LoadEntity to accept format string.
parent
aad78004
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
modules/io/pymod/wrap_io.cc
+2
-1
2 additions, 1 deletion
modules/io/pymod/wrap_io.cc
modules/io/src/mol/load_entity.cc
+5
-5
5 additions, 5 deletions
modules/io/src/mol/load_entity.cc
modules/io/src/mol/load_entity.hh
+1
-1
1 addition, 1 deletion
modules/io/src/mol/load_entity.hh
with
8 additions
and
7 deletions
modules/io/pymod/wrap_io.cc
+
2
−
1
View file @
4ffc9738
...
@@ -83,7 +83,8 @@ BOOST_PYTHON_MODULE(_ost_io)
...
@@ -83,7 +83,8 @@ BOOST_PYTHON_MODULE(_ost_io)
def
(
"Instance"
,
IOManager
::
Instance
,
def
(
"Instance"
,
IOManager
::
Instance
,
return_value_policy
<
reference_existing_object
>
()
);
return_value_policy
<
reference_existing_object
>
()
);
def
(
"LoadEntity"
,
LoadEntity
,
load_entity_ov
());
def
(
"LoadEntity"
,
LoadEntity
,
load_entity_ov
(
args
(
"filename"
,
"format"
)));
def
(
"SaveEntity"
,
&
save_ent_view
,
def
(
"SaveEntity"
,
&
save_ent_view
,
save_entity_view_ov
(
args
(
"entity"
,
"filename"
,
"format"
)));
save_entity_view_ov
(
args
(
"entity"
,
"filename"
,
"format"
)));
def
(
"SaveEntity"
,
&
save_ent_handle
,
def
(
"SaveEntity"
,
&
save_ent_handle
,
...
...
This diff is collapsed.
Click to expand it.
modules/io/src/mol/load_entity.cc
+
5
−
5
View file @
4ffc9738
...
@@ -30,13 +30,13 @@ namespace ost { namespace io {
...
@@ -30,13 +30,13 @@ namespace ost { namespace io {
namespace
{
namespace
{
void
Import
(
mol
::
EntityHandle
&
eh
,
const
String
&
filename
,
int
flag
)
void
Import
(
mol
::
EntityHandle
&
eh
,
const
String
&
filename
,
const
String
&
format
)
{
{
Profile
profile_import
(
"import"
);
Profile
profile_import
(
"import"
);
LOG_DEBUG
(
"creating EntityIOHandle for "
<<
filename
);
LOG_DEBUG
(
"creating EntityIOHandle for "
<<
filename
);
EntityIOHandlerP
ent_io
=
IOManager
::
Instance
().
FindEntityImportHandler
(
filename
);
EntityIOHandlerP
ent_io
=
IOManager
::
Instance
().
FindEntityImportHandler
(
filename
,
format
);
//
TODO: proper
error handling
//
note:
error handling
done in FindEntityImportHandler
LOG_DEBUG
(
"calling import on entity io handle"
);
LOG_DEBUG
(
"calling import on entity io handle"
);
ent_io
->
Import
(
eh
,
filename
);
ent_io
->
Import
(
eh
,
filename
);
...
@@ -53,12 +53,12 @@ void Import(mol::EntityHandle& eh, const String& filename, int flag)
...
@@ -53,12 +53,12 @@ void Import(mol::EntityHandle& eh, const String& filename, int flag)
}
// anon ns
}
// anon ns
mol
::
EntityHandle
LoadEntity
(
const
String
&
filename
,
int
flag
)
mol
::
EntityHandle
LoadEntity
(
const
String
&
filename
,
const
String
&
format
)
{
{
LOG_DEBUG
(
"creating emtpy entity"
);
LOG_DEBUG
(
"creating emtpy entity"
);
mol
::
EntityHandle
eh
=
mol
::
CreateEntity
();
mol
::
EntityHandle
eh
=
mol
::
CreateEntity
();
mol
::
XCSEditor
xcs_lock
=
eh
.
EditXCS
(
mol
::
BUFFERED_EDIT
);
mol
::
XCSEditor
xcs_lock
=
eh
.
EditXCS
(
mol
::
BUFFERED_EDIT
);
Import
(
eh
,
filename
,
flag
);
Import
(
eh
,
filename
,
format
);
return
eh
;
return
eh
;
}
}
...
...
This diff is collapsed.
Click to expand it.
modules/io/src/mol/load_entity.hh
+
1
−
1
View file @
4ffc9738
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
namespace
ost
{
namespace
io
{
namespace
ost
{
namespace
io
{
// load unmanaged entity
// load unmanaged entity
DLLEXPORT_OST_IO
mol
::
EntityHandle
LoadEntity
(
const
String
&
filename
,
int
flag
=
0
);
DLLEXPORT_OST_IO
mol
::
EntityHandle
LoadEntity
(
const
String
&
filename
,
const
String
&
format
=
"auto"
);
}}
// ns
}}
// ns
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment