Bsoft 2.1.4
Bernard's software package
model_transform.h File Reference

Library routines used for model transformation. More...

#include "rwmodel.h"
#include "Transform.h"
#include <vector>

Functions

long model_center (Bmodel *model)
 Shifts one models to its center of mass. More...
 
long model_shift (Bmodel *model, Vector3< double > shift)
 Shifts a model. More...
 
long models_shift (Bmodel *model, Vector3< double > shift)
 Shifts all models. More...
 
long models_trim (Bmodel *model, Vector3< double > trim)
 Trims models to a new enclosing box size. More...
 
long model_scale (Bmodel *model, Vector3< double > scale, Vector3< double > origin)
 Scales a model. More...
 
long models_scale (Bmodel *model, Vector3< double > scale, Vector3< double > origin)
 Scales a model. More...
 
long model_reflect (Bmodel *model, Vector3< double > normal, Vector3< double > origin)
 Reflects the model through a mirror plane. More...
 
long models_reflect (Bmodel *model, Vector3< double > normal, Vector3< double > origin)
 Reflects the model through a mirror plane. More...
 
double model_reflect_and_compare (Bmodel *model, Vector3< double > normal, Vector3< double > origin)
 Copies and reflects the model and compares it with the original. More...
 
long model_rotate (Bmodel *model, Matrix3 mat, Vector3< double > origin, Vector3< double > shift)
 Rotates the model. More...
 
long models_rotate (Bmodel *model, Matrix3 mat, Vector3< double > origin, Vector3< double > shift)
 Rotates the models. More...
 
long model_rotate (Bmodel *model, Matrix3 mat)
 Rotates the model. More...
 
long models_rotate (Bmodel *model, Matrix3 mat)
 Rotates the models. More...
 
long model_rotate (Bmodel *model, Matrix3 mat, Vector3< double > origin)
 Rotates the model. More...
 
long models_rotate (Bmodel *model, Matrix3 mat, Vector3< double > origin)
 Rotates the models. More...
 
long model_rotate (Bmodel *model, View2< float > view)
 Rotates the model. More...
 
long models_rotate (Bmodel *model, View2< float > view)
 Rotates the models. More...
 
long model_rotate (Bmodel *model, View2< float > view, Vector3< double > origin, Vector3< double > shift)
 Rotates the model. More...
 
long models_rotate (Bmodel *model, View2< float > view, Vector3< double > origin, Vector3< double > shift)
 Rotates the models. More...
 
long model_rotate (Bmodel *model, Transform t)
 Rotates the model. More...
 
long models_rotate (Bmodel *model, Transform t)
 Rotates the models. More...
 
double model_rotate_and_compare (Bmodel *model, Transform t)
 Copies and rotates the model and compares it with the original. More...
 
long model_adjust_for_binning (Bmodel *model, Vector3< long > bin)
 A binned model list is converted back to the unbinned version. More...
 
long model_align_to_guide (Bmodel *model, Bmodel *guide)
 A model is oriented to coincide with a guide model. More...
 
Transform model_find_transform (Bmodel *model, Bmodel *refmod)
 A model is fitted to a reference model. More...
 
int model_random_displace_number (Bmodel *model, long number, double stdev)
 Applies random displacements to a selected number of coordinates. More...
 

Detailed Description

Library routines used for model transformation.

Author
Bernard Heymann
Date
Created: 20060908
Modified: 20230120

Function Documentation

◆ model_adjust_for_binning()

long model_adjust_for_binning ( Bmodel model,
Vector3< long >  bin 
)

A binned model list is converted back to the unbinned version.

Parameters
*modelthe model list.
bin3-value bin vector.
Returns
long number of components processed.
All component coordinates are converted back to the unbinned values.
Only the first model is adjusted.

◆ model_align_to_guide()

long model_align_to_guide ( Bmodel model,
Bmodel guide 
)

A model is oriented to coincide with a guide model.

Parameters
*modelmodel (rotated).
*guideguide model.
Returns
long number of components processed.
The principal axes of the guide model is calculated and the model rotated.
Only the first model is aligned.

◆ model_center()

long model_center ( Bmodel model)

Shifts one models to its center of mass.

Parameters
*modelmodel parameters.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_find_transform()

Transform model_find_transform ( Bmodel model,
Bmodel refmod 
)

A model is fitted to a reference model.

Parameters
*modelmodel.
*refmodtemplate model.
Returns
Transform transform.
The components in the model and the reference must match exactly.
Only the first model and template in the lists are processed.

◆ model_random_displace_number()

int model_random_displace_number ( Bmodel model,
long  number,
double  stdev 
)

Applies random displacements to a selected number of coordinates.

Parameters
*modelmodel to be modified.
numbernumber of coordinates to displace.
stdevstandard deviation of displacement.
Returns
int 0.

◆ model_reflect()

long model_reflect ( Bmodel model,
Vector3< double >  normal,
Vector3< double >  origin 
)

Reflects the model through a mirror plane.

Parameters
*modelmodel structure.
normalplane normal.
originmodel origin.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_reflect_and_compare()

double model_reflect_and_compare ( Bmodel model,
Vector3< double >  normal,
Vector3< double >  origin 
)

Copies and reflects the model and compares it with the original.

Parameters
*modelmodel structure.
normalplane normal.
originmodel origin.
Returns
double RMSD.
Only the first model in the list is processed.

◆ model_rotate() [1/6]

long model_rotate ( Bmodel model,
Matrix3  mat 
)

Rotates the model.

Parameters
*modelmodel structure.
matrotation matrix.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_rotate() [2/6]

long model_rotate ( Bmodel model,
Matrix3  mat,
Vector3< double >  origin 
)

Rotates the model.

Parameters
*modelmodel structure.
matrotation matrix.
originrotation origin.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_rotate() [3/6]

long model_rotate ( Bmodel model,
Matrix3  mat,
Vector3< double >  origin,
Vector3< double >  shift 
)

Rotates the model.

Parameters
*modelmodel structure.
matrotation matrix.
originrotation origin.
shifttranslation after rotation.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_rotate() [4/6]

long model_rotate ( Bmodel model,
Transform  t 
)

Rotates the model.

Parameters
*modelmodel structure.
trotation operation.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_rotate() [5/6]

long model_rotate ( Bmodel model,
View2< float >  view 
)

Rotates the model.

Parameters
*modelmodel structure.
viewview to rotate to.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_rotate() [6/6]

long model_rotate ( Bmodel model,
View2< float >  view,
Vector3< double >  origin,
Vector3< double >  shift 
)

Rotates the model.

Parameters
*modelmodel structure.
viewview to rotate to.
originrotation origin.
shifttranslation after rotation.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_rotate_and_compare()

double model_rotate_and_compare ( Bmodel model,
Transform  t 
)

Copies and rotates the model and compares it with the original.

Parameters
*modelmodel structure.
trotation operation.
Returns
double RMSD.
Only the first model in the list is processed.

◆ model_scale()

long model_scale ( Bmodel model,
Vector3< double >  scale,
Vector3< double >  origin 
)

Scales a model.

Parameters
*modelmodel parameters.
scalescale.
originmodel origin.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ model_shift()

long model_shift ( Bmodel model,
Vector3< double >  shift 
)

Shifts a model.

Parameters
*modelmodel parameters.
shifttranslation vector.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ models_reflect()

long models_reflect ( Bmodel model,
Vector3< double >  normal,
Vector3< double >  origin 
)

Reflects the model through a mirror plane.

Parameters
*modelmodel structure.
normalplane normal.
originmodel origin.
Returns
long number of components processed.

◆ models_rotate() [1/6]

long models_rotate ( Bmodel model,
Matrix3  mat 
)

Rotates the models.

Parameters
*modelmodel structure.
matrotation matrix.
Returns
long number of components processed.

◆ models_rotate() [2/6]

long models_rotate ( Bmodel model,
Matrix3  mat,
Vector3< double >  origin 
)

Rotates the models.

Parameters
*modelmodel structure.
matrotation matrix.
originrotation origin.
Returns
long number of components processed.

◆ models_rotate() [3/6]

long models_rotate ( Bmodel model,
Matrix3  mat,
Vector3< double >  origin,
Vector3< double >  shift 
)

Rotates the models.

Parameters
*modelmodel structure.
matrotation matrix.
originrotation origin.
shifttranslation after rotation.
Returns
long number of components processed.

◆ models_rotate() [4/6]

long models_rotate ( Bmodel model,
Transform  t 
)

Rotates the models.

Parameters
*modelmodel structure.
trotation operation.
Returns
long number of components processed.
Only the first model in the list is processed.

◆ models_rotate() [5/6]

long models_rotate ( Bmodel model,
View2< float >  view 
)

Rotates the models.

Parameters
*modelmodel structure.
viewview to rotate to.
Returns
long number of components processed.

◆ models_rotate() [6/6]

long models_rotate ( Bmodel model,
View2< float >  view,
Vector3< double >  origin,
Vector3< double >  shift 
)

Rotates the models.

Parameters
*modelmodel structure.
viewview to rotate to.
originrotation origin.
shifttranslation after rotation.
Returns
long number of components processed.

◆ models_scale()

long models_scale ( Bmodel model,
Vector3< double >  scale,
Vector3< double >  origin 
)

Scales a model.

Parameters
*modelmodel parameters.
scalescale.
originmodel origin.
Returns
long number of components processed.

◆ models_shift()

long models_shift ( Bmodel model,
Vector3< double >  shift 
)

Shifts all models.

Parameters
*modelmodel parameters.
shifttranslation vector.
Returns
long number of components processed.
All models in the list are processed.

◆ models_trim()

long models_trim ( Bmodel model,
Vector3< double >  trim 
)

Trims models to a new enclosing box size.

Parameters
*modelmodel parameters.
trimnew enclosing box size
Returns
long number of components retained.
All models in the list are processed.