 |
Bsoft
2.1.0
Bernard's software package
|
Go to the documentation of this file.
49 cout <<
"Shifting " <<
model->
id <<
" by " << shift << endl;
89 if ( scale == 1 )
return 0;
96 cout <<
"Scaling " <<
model->
id <<
" by " << scale << endl;
102 comp->
loc = (comp->
loc - origin) * scale + origin;
119 if ( scale == 1 )
return 0;
125 cout <<
"Scaling: " << scale << endl << endl;
152 cout <<
"Reflecting " <<
model->
id <<
" through " << normal << endl;
154 for ( comp =
model->
comp; comp; comp = comp->
next, ncomp++ ) {
157 comp->
loc += normal * d;
199 double d, dmin, R = 0;
205 if ( !complist ) complist = comp2;
206 comp2->
loc = comp->
loc - origin;;
208 comp2->
loc += normal * d;
209 comp2->
loc += origin;
214 for ( comp2 = complist; comp2; comp2 = comp2->
next ) {
216 if ( dmin > d ) dmin = d;
277 cout <<
"Rotating " <<
model->
id << endl;
278 cout <<
"Rotation matrix:" << endl;
280 cout <<
"Origin: " << origin << endl;
281 cout <<
"Translation: " << shift << endl << endl;
286 for ( comp =
model->
comp; comp; comp = comp->
next, ncomp++ ) {
287 comp->
loc = comp->
loc - origin;
288 comp->
loc = mat * comp->
loc;
289 comp->
loc = comp->
loc + shift;
345 cout <<
"Rotating:" << endl;
346 cout <<
"Axis: " << t.
axis << endl;
347 cout <<
"Angle: " << t.
angle*180.0/
M_PI << endl;
348 cout <<
"Origin: " << t.
origin << endl;
349 cout <<
"Translation: " << t.
trans << endl << endl;
376 double d, dmin, R = 0;
383 if ( !complist ) complist = comp2;
385 comp2->
loc = mat * comp2->
loc;
386 comp2->
loc = comp2->
loc + shift;
391 for ( comp2 = complist; comp2; comp2 = comp2->
next ) {
393 if ( dmin > d ) dmin = d;
418 if ( bin[0]*bin[1]*bin[2] < 2 )
return 0;
425 cout <<
"Unbinning: " << binf << endl << endl;
449 Matrix3 mat(eigenvec[0][0], eigenvec[0][1], eigenvec[0][2],
450 eigenvec[1][0], eigenvec[1][1], eigenvec[1][2],
451 eigenvec[2][0], eigenvec[2][1], eigenvec[2][2]);
477 cout <<
"Mapping model " <<
model->
id <<
" to reference " << refmod->
id << endl;
482 vector<double> bx(4), by(4), bz(4), v(4,0);
487 for ( i=0; i<4; i++ ) bx[i] = by[i] = bz[i] = 0;
493 for ( comp =
model->
comp, compr = refmod->
comp; comp && compr; comp = comp->
next, compr = compr->
next ) {
495 cout <<
"Mapping component " << comp->
id <<
" to reference " << compr->
id << endl;
496 loc = comp->
loc - com;
497 locr = compr->
loc - comr;
498 cout << loc[2] <<
tab << locr[2] <<
tab << loc[2] - locr[2] << endl;
502 for ( i=0; i<4; i++ ) {
503 bx[i] += v[i]*locr[0];
504 by[i] += v[i]*locr[1];
505 bz[i] += v[i]*locr[2];
506 for ( j=0; j<=i; j++ ) a[i][j] += v[i]*v[j];
511 t.
trans = comr - com;
long kill_list(char *list, unsigned long size)
Frees all the items in a linked list.
char * add_item(char **list, unsigned long size)
Adds an item to a linked list.
Matrix3 transpose() const
Vector3< double > model_principal_axes(Bmodel *model, Vector3< double > *eigenvec)
Calculates the principal axes of a model.
Vector3< double > model_center_of_mass(Bmodel *model)
double scalar(const Vector3 &v) const
Functions to compare models and components.
double distance(const Vector3 &v)
Header file for general utilities.
ostream & tab(ostream &out)
Header file for generalized linked list functions.
Library routines used for model processing.
long model_component_number_difference(Bmodel *model1, Bmodel *model2)
Compares the numbers of components in two models.