Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
libcifpp
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
libcifpp
Commits
faa9cd04
Unverified
Commit
faa9cd04
authored
Jan 12, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added another rotate/translate method to mmcif::Structure
parent
e0c3c239
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
include/cif++/Structure.hpp
+6
-0
src/Structure.cpp
+15
-0
test/structure-test.cpp
+20
-0
No files found.
include/cif++/Structure.hpp
View file @
faa9cd04
...
...
@@ -165,6 +165,9 @@ class Atom
/// \brief Translate and rotate the position of this atom by \a t and \a q
void
translateAndRotate
(
Point
t
,
Quaternion
q
);
/// \brief Translate, rotate and translate again the coordinates this atom by \a t1 , \a q and \a t2
void
translateRotateAndTranslate
(
Point
t1
,
Quaternion
q
,
Point
t2
);
// for direct access to underlying data, be careful!
const
cif
::
Row
getRow
()
const
{
return
mImpl
->
mRow
;
}
const
cif
::
Row
getRowAniso
()
const
;
...
...
@@ -609,6 +612,9 @@ class Structure
/// \brief Translate and rotate the coordinates of all atoms in the structure by \a t and \a q
void
translateAndRotate
(
Point
t
,
Quaternion
q
);
/// \brief Translate, rotate and translate again the coordinates of all atoms in the structure by \a t1 , \a q and \a t2
void
translateRotateAndTranslate
(
Point
t1
,
Quaternion
q
,
Point
t2
);
const
std
::
vector
<
Residue
>
&
getNonPolymers
()
const
{
return
mNonPolymers
;
}
const
std
::
vector
<
Residue
>
&
getBranchResidues
()
const
{
return
mBranchResidues
;
}
...
...
src/Structure.cpp
View file @
faa9cd04
...
...
@@ -458,6 +458,15 @@ void Atom::translateAndRotate(Point t, Quaternion q)
location
(
loc
);
}
void
Atom
::
translateRotateAndTranslate
(
Point
t1
,
Quaternion
q
,
Point
t2
)
{
auto
loc
=
location
();
loc
+=
t1
;
loc
.
rotate
(
q
);
loc
+=
t2
;
location
(
loc
);
}
bool
Atom
::
operator
==
(
const
Atom
&
rhs
)
const
{
return
mImpl
==
rhs
.
mImpl
or
...
...
@@ -2198,4 +2207,10 @@ void Structure::translateAndRotate(Point t, Quaternion q)
a
.
translateAndRotate
(
t
,
q
);
}
void
Structure
::
translateRotateAndTranslate
(
Point
t1
,
Quaternion
q
,
Point
t2
)
{
for
(
auto
&
a
:
mAtoms
)
a
.
translateRotateAndTranslate
(
t1
,
q
,
t2
);
}
}
// namespace mmcif
test/structure-test.cpp
View file @
faa9cd04
...
...
@@ -179,3 +179,23 @@ _struct_asym.details ?
<<
structure
.
getFile
().
data
()
<<
std
::
endl
;
}
}
// // --------------------------------------------------------------------
// BOOST_AUTO_TEST_CASE(test_load_1)
// {
// mmcif::File cf(gTestDir / "5v3g.cif.gz");
// mmcif::Structure s(cf);
// for (auto &poly : s.polymers())
// {
// std::cout << std::string(80, '=') << std::endl;
// for (auto &res : poly)
// {
// std::cout << res << std::endl;
// for (auto &atom : res.atoms())
// std::cout << " " << atom << std::endl;
// }
// }
// }
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment