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
32b1bbd9
Unverified
Commit
32b1bbd9
authored
Jan 05, 2022
by
Maarten L. Hekkelman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
combine translate and rotate in a single call
parent
1abf31ff
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
6 deletions
+23
-6
include/cif++/Structure.hpp
+6
-0
src/Structure.cpp
+17
-6
No files found.
include/cif++/Structure.hpp
View file @
32b1bbd9
...
...
@@ -162,6 +162,9 @@ class Atom
/// \brief Rotate the position of this atom by \a q
void
rotate
(
Quaternion
q
);
/// \brief Translate and rotate the position of this atom by \a t and \a q
void
translateAndRotate
(
Point
t
,
Quaternion
q
);
// for direct access to underlying data, be careful!
const
cif
::
Row
getRow
()
const
{
return
mImpl
->
mRow
;
}
const
cif
::
Row
getRowAniso
()
const
;
...
...
@@ -603,6 +606,9 @@ class Structure
/// \brief Rotate the coordinates of all atoms in the structure by \a q
void
rotate
(
Quaternion
t
);
/// \brief Translate and rotate the coordinates of all atoms in the structure by \a t and \a q
void
translateAndRotate
(
Point
t
,
Quaternion
q
);
const
std
::
vector
<
Residue
>
&
getNonPolymers
()
const
{
return
mNonPolymers
;
}
const
std
::
vector
<
Residue
>
&
getBranchResidues
()
const
{
return
mBranchResidues
;
}
...
...
src/Structure.cpp
View file @
32b1bbd9
...
...
@@ -295,12 +295,9 @@ void Atom::AtomImpl::moveTo(const Point &p)
if
(
not
mClone
)
{
// set_property("Cartn_x", std::to_string(p.getX()));
// set_property("Cartn_y", std::to_string(p.getY()));
// set_property("Cartn_z", std::to_string(p.getZ()));
mRow
.
assign
(
"Cartn_x"
,
std
::
to_string
(
p
.
getX
()),
true
);
mRow
.
assign
(
"Cartn_y"
,
std
::
to_string
(
p
.
getY
()),
true
);
mRow
.
assign
(
"Cartn_z"
,
std
::
to_string
(
p
.
getZ
()),
true
);
mRow
.
assign
(
"Cartn_x"
,
std
::
to_string
(
p
.
getX
()),
false
,
false
);
mRow
.
assign
(
"Cartn_y"
,
std
::
to_string
(
p
.
getY
()),
false
,
false
);
mRow
.
assign
(
"Cartn_z"
,
std
::
to_string
(
p
.
getZ
()),
false
,
false
);
}
mLocation
=
p
;
...
...
@@ -453,6 +450,14 @@ void Atom::rotate(Quaternion q)
location
(
loc
);
}
void
Atom
::
translateAndRotate
(
Point
t
,
Quaternion
q
)
{
auto
loc
=
location
();
loc
+=
t
;
loc
.
rotate
(
q
);
location
(
loc
);
}
bool
Atom
::
operator
==
(
const
Atom
&
rhs
)
const
{
return
mImpl
==
rhs
.
mImpl
or
...
...
@@ -2186,4 +2191,10 @@ void Structure::rotate(Quaternion q)
a
.
rotate
(
q
);
}
void
Structure
::
translateAndRotate
(
Point
t
,
Quaternion
q
)
{
for
(
auto
&
a
:
mAtoms
)
a
.
translateAndRotate
(
t
,
q
);
}
}
// namespace mmcif
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