| Bsoft 2.0.5 Bernard's software package

mol_transform.cpp
Go to the documentation of this file.
1
9 #include "rwmolecule.h"
10 #include "mol_transform.h"
11 #include "mol_util.h"
12 #include "linked_list.h"
13 #include "utilities.h"
14
15 // Declaration of global variables
16 extern int verbose; // Level of output to the screen
17
18 // Internal function prototypes
19 Bmolgroup* molgroup_rotate(Bmolgroup* molgroup, Matrix3 mat, Vector3<double> origin, Vector3<double> trans);
20 Bmolecule* mol_rotate(Bmolecule* mol, Matrix3 mat, Vector3<double> origin, Vector3<double> trans);
21
28 int molgroup_coor_shift(Bmolgroup* molgroup, Vector3<double> shift)
29 {
30 if ( shift.length() < 1e-30 ) return 0;
31
32 Bmolecule* mol;
33 Bresidue* res;
34 Batom* atom;
35
36 if ( verbose & VERB_FULL )
37 cout << "Shifting coordinates: " << shift << endl;
38
39 for ( mol = molgroup->mol; mol; mol = mol->next ) {
40 for( res = mol->res; res; res = res->next ) {
41 for ( atom = res->atom; atom; atom = atom->next ) {
42 atom->coord = atom->coord + shift;
43 }
44 }
45 }
46
47 return 0;
48 }
49
56 int mol_coor_shift(Bmolecule* mol, Vector3<double> shift)
57 {
58 if ( shift.length() < 1e-30 ) return 0;
59
60 Bresidue* res;
61 Batom* atom;
62
63 if ( verbose & VERB_FULL )
64 cout << "Shifting coordinates: " << shift << endl;
65
66 for( res = mol->res; res; res = res->next ) {
67 for ( atom = res->atom; atom; atom = atom->next ) {
68 atom->coord = atom->coord + shift;
69 }
70 }
71
72 // mol_stats(mol);
73
74 return 0;
75 }
76
87 int molgroup_coor_rotate(Bmolgroup* molgroup, Transform t)
88 {
89 if ( ( t.angle == 0 || t.axis.length() < 1e-10 ) && ( t.trans.length() < 1e-10 ) )return 0;
90
91 Matrix3 mat = Matrix3(t.axis, t.angle);
92
93 Bmolecule* mol;
94 Bresidue* res;
95 Batom* atom;
96
97 if ( verbose & VERB_FULL ) {
98 cout << endl << "Rotating and translating coordinates:" << endl;
99 cout << "Rotation axis and angle: " << t.axis << " " << t.angle*180.0/M_PI << endl;
100 cout << "Rotation origin: " << t.origin << endl;
101 cout << "Rotation matrix:" << endl;
102 cout << mat << endl;
103 cout << "Determinant: " << mat.determinant() << endl;
104 cout << "Translation: " << t.trans << endl << endl;
105 }
106
107 Vector3<double> shift = t.origin + t.trans;
108 for ( mol = molgroup->mol; mol; mol = mol->next ) {
109 for( res = mol->res; res; res = res->next ) {
110 for ( atom = res->atom; atom; atom = atom->next ) {
111 atom->coord = atom->coord - t.origin;
112 atom->coord = mat * atom->coord;
113 atom->coord = atom->coord + shift;
114 }
115 }
116 }
117
118 return 0;
119 }
120
131 int mol_coor_rotate(Bmolecule* mol, Transform t)
132 {
133 if ( verbose & VERB_DEBUG )
134 cout << "DEBUG mol_coor_rotate: t.angle=" << t.angle << endl;
135
136 if ( t.angle < 1e-20 ) return 0;
137
138 if ( t.axis.length() < 1e-10 ) return 0;
139
140 Matrix3 mat = Matrix3(t.axis, t.angle);
141
142 Bresidue* res;
143 Batom* atom;
144
145 if ( verbose & VERB_FULL ) {
146 cout << endl << "Rotating and translating coordinates:" << endl;
147 cout << "Rotation axis and angle: " << t.axis << " " << t.angle*180.0/M_PI << endl;
148 cout << "Rotation origin: " << t.origin << endl;
149 cout << "Rotation matrix:" << endl;
150 cout << mat << endl;
151 cout << "Determinant: " << mat.determinant() << endl;
152 cout << "Translation: " << t.trans << endl << endl;
153 }
154
155 Vector3<double> shift = t.origin + t.trans;
156 for( res = mol->res; res; res = res->next ) {
157 for ( atom = res->atom; atom; atom = atom->next ) {
158 atom->coord = atom->coord - t.origin;
159 atom->coord = mat * atom->coord;
160 atom->coord = atom->coord + shift;
161 }
162 }
163
164 // mol_stats(mol);
165
166 return 0;
167 }
168
180 Bmolgroup* molgroup_rotate_to_view(Bmolgroup* molgroup, View view, Vector3<double> origin, Vector3<double> trans)
181 {
182 if ( verbose & VERB_FULL ) {
183 cout << "Rotating and translating coordinates:" << endl;
184 cout << "Rotation to view: " << view << endl;
185 }
186
187 Matrix3 mat = view.matrix();
188
189 return molgroup_rotate(molgroup, mat, origin, trans);
190 }
191
203 Bmolgroup* molgroup_rotate_from_view(Bmolgroup* molgroup, View view, Vector3<double> origin, Vector3<double> trans)
204 {
205 if ( verbose & VERB_FULL ) {
206 cout << "Rotating and translating coordinates:" << endl;
207 cout << "Rotation from view: " << view << endl;
208 }
209
210 Matrix3 mat = view.matrix();
211 mat = mat.transpose();
212
213 return molgroup_rotate(molgroup, mat, origin, trans);
214 }
215
216 Bmolgroup* molgroup_rotate(Bmolgroup* molgroup, Matrix3 mat, Vector3<double> origin, Vector3<double> trans)
217 {
218 Bmolgroup* mol_rot = molgroup_copy(molgroup);
219
220 Vector3<double> shift = origin + trans;
221
222 Bmolecule* mol;
223 Bresidue* res;
224 Batom* atom;
225
226 if ( verbose & VERB_FULL ) {
227 cout << "Origin: " << origin << endl;
228 cout << "Rotation matrix:" << endl;
229 cout << mat << endl;
230 cout << "Determinant: " << mat.determinant() << endl;
231 cout << "Translation: " << trans << endl << endl;
232 }
233
234 for ( mol = mol_rot->mol; mol; mol = mol->next ) {
235 for( res = mol->res; res; res = res->next ) {
236 for ( atom = res->atom; atom; atom = atom->next ) {
237 atom->coord = atom->coord - origin;
238 atom->coord = mat * atom->coord;
239 atom->coord = atom->coord + shift;
240 }
241 }
242 }
243
244 return mol_rot;
245 }
246
258 Bmolecule* mol_rotate_to_view(Bmolecule* mol, View view, Vector3<double> origin, Vector3<double> trans)
259 {
260 if ( verbose & VERB_FULL ) {
261 cout << "Rotating and translating coordinates:" << endl;
262 cout << "Rotation to view: " << view << endl;
263 }
264
265 Matrix3 mat = view.matrix();
266
267 return mol_rotate(mol, mat, origin, trans);
268 }
269
281 Bmolecule* mol_rotate_from_view(Bmolecule* mol, View view, Vector3<double> origin, Vector3<double> trans)
282 {
283 if ( verbose & VERB_FULL ) {
284 cout << "Rotating and translating coordinates:" << endl;
285 cout << "Rotation from view: " << view << endl;
286 }
287
288 Matrix3 mat = view.matrix();
289 mat = mat.transpose();
290
291 return mol_rotate(mol, mat, origin, trans);
292 }
293
294 Bmolecule* mol_rotate(Bmolecule* mol, Matrix3 mat, Vector3<double> origin, Vector3<double> trans)
295 {
296 Bmolecule* mol_rot = molecule_copy(mol);
297
298 Vector3<double> shift = origin + trans;
299
300 Bresidue* res;
301 Batom* atom;
302
303 if ( verbose & VERB_FULL ) {
304 cout << "Origin: " << origin << endl;
305 cout << "Rotation matrix:" << endl;
306 cout << mat << endl;
307 cout << "Determinant: " << mat.determinant() << endl;
308 cout << "Translation: " << trans << endl << endl;
309 }
310
311 for( res = mol_rot->res; res; res = res->next ) {
312 for ( atom = res->atom; atom; atom = atom->next ) {
313 atom->coord = atom->coord + origin;
314 atom->coord = mat * atom->coord;
315 atom->coord = atom->coord + shift;
316 }
317 }
318
319 return mol_rot;
320 }
321
332 int molgroup_coor_transform(Bmolgroup* molgroup, Transform t)
333 {
334 Matrix3 mat = Matrix3(t.axis, t.angle);
335
336 Bmolecule* mol;
337 Bresidue* res;
338 Batom* atom;
339
340 if ( verbose & VERB_FULL ) {
341 cout << "Transforming coordinates:" << endl;
342 cout << "Rotation axis and angle: " << t.axis << " " << t.angle*180.0/M_PI << endl;
343 cout << "Rotation origin: " << t.origin << endl;
344 cout << "Rotation matrix:" << endl;
345 cout << mat << endl;
346 cout << "Determinant: " << mat.determinant() << endl;
347 cout << "Translation: " << t.trans << endl;
348 cout << "Scale: " << t.scale << endl << endl;
349 }
350
351 mat = t.scale * mat;
352
353 Vector3<double> shift = t.origin + t.trans;
354
355 for ( mol = molgroup->mol; mol; mol = mol->next ) {
356 for( res = mol->res; res; res = res->next ) {
357 for ( atom = res->atom; atom; atom = atom->next ) {
358 atom->coord = atom->coord - t.origin;
359 atom->coord = mat * atom->coord;
360 atom->coord = atom->coord + shift;
361 }
362 }
363 }
364
365 return 0;
366 }
367
378 int mol_coor_transform(Bmolecule* mol, Transform t)
379 {
380 Matrix3 mat = Matrix3(t.axis, t.angle);
381
382 Bresidue* res;
383 Batom* atom;
384
385 if ( verbose & VERB_FULL ) {
386 cout << "Transforming and translating coordinates:" << endl;
387 cout << "Rotation axis and angle: " << t.axis << " " << t.angle*180.0/M_PI << endl;
388 cout << "Rotation origin: " << t.origin << endl;
389 cout << "Rotation matrix:" << endl;
390 cout << mat << endl;
391 cout << "Determinant: " << mat.determinant() << endl;
392 cout << "Translation: " << t.trans << endl;
393 cout << "Scale: " << t.scale << endl << endl;
394 }
395
396 mat = t.scale * mat;
397
398 Vector3<double> shift = t.origin + t.trans;
399
400 for( res = mol->res; res; res = res->next ) {
401 for ( atom = res->atom; atom; atom = atom->next ) {
402 atom->coord = atom->coord - t.origin;
403 atom->coord = mat * atom->coord;
404 atom->coord = atom->coord + shift;
405 }
406 }
407
408 // mol_stats(mol);
409
410 return 0;
411 }
412
419 int molgroup_coor_invert(Bmolgroup* molgroup, Vector3<double> point)
420 {
421 Bmolecule* mol;
422 Bresidue* res;
423 Batom* atom;
424
425 if ( verbose & VERB_PROCESS )
426 cout << "Inverting coordinates: " << point << endl;
427
428 for ( mol = molgroup->mol; mol; mol = mol->next ) {
429 for( res = mol->res; res; res = res->next ) {
430 for ( atom = res->atom; atom; atom = atom->next ) {
431 atom->coord[0] = 2*point[0] - atom->coord[0];
432 atom->coord[1] = 2*point[1] - atom->coord[1];
433 atom->coord[2] = 2*point[2] - atom->coord[2];
434 }
435 }
436 }
437
438 return 0;
439 }
440
450 int molgroup_resolve_pbc(Bmolgroup* molgroup)
451 {
452 Bmolecule* mol;
453 Bresidue* res;
454 Batom* atom;
455 double summass;
456 Vector3<double> csum, shift;
457 Vector3<double> box = molgroup->box;
458
459 if ( verbose & VERB_PROCESS ) {
460 cout << "Resolving periodic box coordinates:" << endl;
461 cout << "Box: " << molgroup->box << endl << endl;
462 }
463
464 for ( mol = molgroup->mol; mol; mol = mol->next ) {
465 csum = 0;
466 summass = 0;
467 for( res = mol->res; res; res = res->next ) {
468 for ( atom = res->atom; atom; atom = atom->next ) {
469 if ( summass == 0 ) {
470 csum = atom->coord * atom->mass;
471 } else {
472 shift = csum / summass;
473 shift += vector3_difference_PBC(atom->coord, shift, box);
474 csum += shift * atom->mass;
475 }
476 summass += atom->mass;
477 }
478 }
479 if ( summass ) csum /= summass;
480 if ( csum[0] < 0 ) csum[0] += box[0];
481 if ( csum[1] < 0 ) csum[1] += box[1];
482 if ( csum[2] < 0 ) csum[2] += box[2];
483 if ( csum[0] > molgroup->box[0] ) csum[0] -= box[0];
484 if ( csum[1] > molgroup->box[1] ) csum[1] -= box[1];
485 if ( csum[2] > molgroup->box[2] ) csum[2] -= box[2];
486 if ( verbose & VERB_FULL )
487 cout << "COM for molecule " << mol->id << ", mass " << summass << ": " << csum << endl;
488 for( res = mol->res; res; res = res->next ) {
489 for ( atom = res->atom; atom; atom = atom->next ) {
490 shift = atom->coord - csum;
491 if ( 2*shift[0] > box[0] ) shift[0] = -box[0];
492 else if ( 2*shift[0] < -box[0] ) shift[0] = box[0];
493 else shift[0] = 0;
494 if ( 2*shift[1] > box[1] ) shift[1] = -box[1];
495 else if ( 2*shift[1] < -box[1] ) shift[1] = box[1];
496 else shift[1] = 0;
497 if ( 2*shift[2] > box[2] ) shift[2] = -box[2];
498 else if ( 2*shift[2] < -box[2] ) shift[2] = box[2];
499 else shift[2] = 0;
500 atom->coord = atom->coord + shift;
501 }
502 }
503 }
504
505 return 0;
506 }
507
513 int molgroup_pack_in_periodic_box(Bmolgroup* molgroup)
514 {
515 Bmolecule* mol;
516 Bresidue* res;
517 Batom* atom;
518
519 if ( verbose & VERB_PROCESS ) {
520 cout << "Wrapping coordinates within a periodic box:" << endl;
521 cout << "Box: " << molgroup->box << endl << endl;
522 }
523
524 for ( mol = molgroup->mol; mol; mol = mol->next ) {
525 for( res = mol->res; res; res = res->next ) {
526 for ( atom = res->atom; atom; atom = atom->next ) {
527 atom->coord = vector3_set_PBC(atom->coord, molgroup->box);
528 }
529 }
530 }
531
532 return 0;
533 }
534
544 int molgroup_coor_shift_PBC(Bmolgroup* molgroup, Vector3<double> shift)
545 {
546 if ( shift.length2() < 1e-30 ) return 0;
547
548 Bmolecule* mol;
549 Bresidue* res;
550 Batom* atom;
551
552 if ( verbose & VERB_PROCESS ) {
553 cout << "Shifting coordinates: " << shift << endl;
554 cout << "Wrapping within box: " << molgroup->box << endl;
555 }
556
557 for ( mol = molgroup->mol; mol; mol = mol->next ) {
558 for( res = mol->res; res; res = res->next ) {
559 for ( atom = res->atom; atom; atom = atom->next ) {
560 atom->coord = atom->coord + shift;
561 atom->coord = vector3_set_PBC(atom->coord, molgroup->box);
562 }
563 }
564 }
565
566 return 0;
567 }
568
581 int molgroup_coor_shift_rotate_PBC(Bmolgroup* molgroup, Vector3<double> origin,
582 Matrix3 mat, Vector3<double> shift)
583 {
584 if ( shift.length2() < 1e-30 ) return 0;
585
586 Bmolecule* mol;
587 Bresidue* res;
588 Batom* atom;
589
590 if ( verbose & VERB_PROCESS ) {
591 cout << endl << "Rotating and translating coordinates:" << endl;
592 cout << "Rotation origin: " << origin << endl;
593 cout << "Rotation matrix:" << endl;
594 cout << mat << endl;
595 cout << "Determinant: " << mat.determinant() << endl;
596 cout << "Translation after rotation: " << shift << endl;
597 cout << "Wrapping within box: " << molgroup->box << endl << endl;
598 }
599
600 shift += origin;
601
602 for ( mol = molgroup->mol; mol; mol = mol->next ) {
603 for( res = mol->res; res; res = res->next ) {
604 for ( atom = res->atom; atom; atom = atom->next ) {
605 atom->coord = atom->coord - origin;
606 atom->coord = mat * atom->coord;
607 atom->coord = atom->coord + shift;
608 atom->coord = vector3_set_PBC(atom->coord, molgroup->box);
609 }
610 }
611 }
612
613 return 0;
614 }
615
625 int molgroup_shift_to_center_of_mass(Bmolgroup* molgroup)
626 {
627 Vector3<double> com = molgroup_center_of_mass(molgroup);
628
629 com = -com;
630
631 molgroup_coor_shift(molgroup, com);
632
633 return 0;
634 }
635
645 int mol_shift_to_center_of_mass(Bmolecule* mol)
646 {
647 Vector3<double> com = mol_center_of_mass(mol);
648
649 com = -com;
650
651 mol_coor_shift(mol, com);
652
653 return 0;
654 }
655
666 int molgroup_place_at_coordinates(Bmolgroup* molgroup, Vector3<double> location)
667 {
668 Vector3<double> com = molgroup_center_of_mass(molgroup);
669
670 molgroup_coor_shift(molgroup, (location - com));
671
672 return 0;
673 }
674
675
Bmolecule::id
Bstring id
Definition: rwmolecule.h:110
Bmolgroup::mol
Bmolecule * mol
Definition: rwmolecule.h:189
Matrix3::determinant
double determinant()
Definition: Matrix3.h:260
mol_coor_transform
int mol_coor_transform(Bmolecule *mol, Transform t)
Rotates and translates a molecule.
Definition: mol_transform.cpp:378
Vector3::length
double length()
Definition: Vector3.h:222
vector3_set_PBC
Vector3< T1 > vector3_set_PBC(Vector3< T1 > coord, Vector3< T2 > box)
Definition: Vector3.h:682
utilities.h
Header file for general utilities.
molgroup_rotate_to_view
Bmolgroup * molgroup_rotate_to_view(Bmolgroup *molgroup, View view, Vector3< double > origin, Vector3< double > trans)
Rotates a molecule group to a specified view and translates it afterwards.
Definition: mol_transform.cpp:180
VERB_DEBUG
#define VERB_DEBUG
Definition: utilities.h:112
Bmolecule::res
Bresidue * res
Definition: rwmolecule.h:122
mol_coor_shift
int mol_coor_shift(Bmolecule *mol, Vector3< double > shift)
Translates a molecule.
Definition: mol_transform.cpp:56
Transform::angle
double angle
Definition: Transform.h:29
mol_rotate
Bmolecule * mol_rotate(Bmolecule *mol, Matrix3 mat, Vector3< double > origin, Vector3< double > trans)
Definition: mol_transform.cpp:294
molgroup_pack_in_periodic_box
int molgroup_pack_in_periodic_box(Bmolgroup *molgroup)
Distributes coordinates across periodic box boundaries.
Definition: mol_transform.cpp:513
molgroup_coor_invert
int molgroup_coor_invert(Bmolgroup *molgroup, Vector3< double > point)
Inverts the coordinates of a molecule through a given point.
Definition: mol_transform.cpp:419
Matrix3
Definition: Matrix3.h:17
mol_transform.h
Library routines used for atomic coordinate transformations.
VERB_PROCESS
#define VERB_PROCESS
Definition: utilities.h:107
molecule_copy
Bmolecule * molecule_copy(Bmolecule *mol)
Copies a molecule.
Definition: rwmolecule.cpp:599
verbose
int verbose
molgroup_coor_shift_PBC
int molgroup_coor_shift_PBC(Bmolgroup *molgroup, Vector3< double > shift)
Translates a molecule within a periodic box.
Definition: mol_transform.cpp:544
Bmolgroup::box
Vector3< double > box
Definition: rwmolecule.h:184
molgroup_center_of_mass
Vector3< double > molgroup_center_of_mass(Bmolgroup *molgroup)
Calculates the center of mass of a molecule group.
Definition: mol_util.cpp:307
mol_util.h
Library routines used for atomic coordinates.
Transform
Definition: Transform.h:24
M_PI
#define M_PI
Definition: utilities.h:59
linked_list.h
Header file for generalized linked list functions.
rwmolecule.h
Header file for reading reflection files.
Bmolgroup
Definition: rwmolecule.h:170
molgroup_copy
Bmolgroup * molgroup_copy(Bmolgroup *molgroup)
Copies a molecule group.
Definition: rwmolecule.cpp:547
vector3_difference_PBC
Vector3< T1 > vector3_difference_PBC(Vector3< T1 > &v1, Vector3< T1 > &v2, Vector3< T2 > &box)
Definition: Vector3.h:695
Bmolecule::next
Bmolecule * next
Definition: rwmolecule.h:108
molgroup_resolve_pbc
int molgroup_resolve_pbc(Bmolgroup *molgroup)
Recombines coordinates split across periodic box boundaries.
Definition: mol_transform.cpp:450
molgroup_coor_transform
int molgroup_coor_transform(Bmolgroup *molgroup, Transform t)
Rotates and translates a molecule group.
Definition: mol_transform.cpp:332
Transform::scale
Vector3< double > scale
Definition: Transform.h:31
mol_rotate_from_view
Bmolecule * mol_rotate_from_view(Bmolecule *mol, View view, Vector3< double > origin, Vector3< double > trans)
Rotates a molecule from a specified view and translates it afterwards.
Definition: mol_transform.cpp:281
Transform::trans
Vector3< double > trans
Definition: Transform.h:30
Vector3::length2
double length2()
Definition: Vector3.h:221
Bresidue::atom
Batom * atom
Definition: rwmolecule.h:54
Bmolecule
Definition: rwmolecule.h:107
molgroup_place_at_coordinates
int molgroup_place_at_coordinates(Bmolgroup *molgroup, Vector3< double > location)
Translates a set of coordinates to a defined center-of-mass.
Definition: mol_transform.cpp:666
Bresidue::next
Bresidue * next
Definition: rwmolecule.h:50
Transform::origin
Vector3< double > origin
Definition: Transform.h:27
Bresidue
Definition: rwmolecule.h:49
View::matrix
Matrix3 matrix()
Definition: View.h:150
Batom
Definition: rwmolecule.h:24
Matrix3::transpose
Matrix3 transpose() const
Definition: Matrix3.h:268
molgroup_rotate
Bmolgroup * molgroup_rotate(Bmolgroup *molgroup, Matrix3 mat, Vector3< double > origin, Vector3< double > trans)
Definition: mol_transform.cpp:216
Vector3< double >
molgroup_coor_shift
int molgroup_coor_shift(Bmolgroup *molgroup, Vector3< double > shift)
Translates a molecule group.
Definition: mol_transform.cpp:28
View
Definition: View.h:26
Batom::coord
Vector3< double > coord
Definition: rwmolecule.h:30
mol_coor_rotate
int mol_coor_rotate(Bmolecule *mol, Transform t)
Rotates and translates a molecule.
Definition: mol_transform.cpp:131
Transform::axis
Vector3< double > axis
Definition: Transform.h:28
molgroup_shift_to_center_of_mass
int molgroup_shift_to_center_of_mass(Bmolgroup *molgroup)
Translates a set of coordinates to the center of mass.
Definition: mol_transform.cpp:625
mol_shift_to_center_of_mass
int mol_shift_to_center_of_mass(Bmolecule *mol)
Translates a set of coordinates to the center of mass.
Definition: mol_transform.cpp:645
VERB_FULL
#define VERB_FULL
Definition: utilities.h:109
mol_center_of_mass
Vector3< double > mol_center_of_mass(Bmolecule *mol)
Calculates the center of mass of a molecule.
Definition: mol_util.cpp:401
Batom::next
Batom * next
Definition: rwmolecule.h:25
Batom::mass
double mass
Definition: rwmolecule.h:32
molgroup_coor_shift_rotate_PBC
int molgroup_coor_shift_rotate_PBC(Bmolgroup *molgroup, Vector3< double > origin, Matrix3 mat, Vector3< double > shift)
Translates and rotates a molecule within a periodic box.
Definition: mol_transform.cpp:581
mol_rotate_to_view
Bmolecule * mol_rotate_to_view(Bmolecule *mol, View view, Vector3< double > origin, Vector3< double > trans)
Rotates a molecule to a specified view and translates it afterwards.
Definition: mol_transform.cpp:258
molgroup_coor_rotate
int molgroup_coor_rotate(Bmolgroup *molgroup, Transform t)
Rotates and translates a molecule group.
Definition: mol_transform.cpp:87
molgroup_rotate_from_view
Bmolgroup * molgroup_rotate_from_view(Bmolgroup *molgroup, View view, Vector3< double > origin, Vector3< double > trans)
Rotates a molecule group from a specified view and translates it afterwards.
Definition: mol_transform.cpp:203