| Bsoft 2.0.5 Bernard's software package

Functions | Variables
model_views.cpp File Reference

Library routines used for analyzing the views of components in models. More...

`#include "rwimg.h"`
`#include "model_views.h"`
`#include "model_util.h"`
`#include "model_neighbors.h"`
`#include "mol_compare.h"`
`#include "Matrix3.h"`
`#include "linked_list.h"`
`#include "utilities.h"`

Go to the source code of this file.

## Functions
View * | views_from_model (Bmodel *model)
| Returns a list of component views. More...
View * | views_from_models (Bmodel *model)
| Returns a list of component views. More...
long | model_set_views (Bmodel *model, View view)
| Sets views. More...
long | model_invert_views (Bmodel *model)
| Invert views. More...
long | model_find_views (Bmodel *model, Bstring &reffile, Bstring &paramfile)
| Finds the molecule views with respect to a reference. More...
Vector3< double > | component_normal (Bcomponent *comp)
View | component_view (Bcomponent *comp)
long | model_calculate_views (Bmodel *model, Bstring &mode)
| Calculates the views associated with each component. More...
long | model_calculate_local_views (Bmodel *model)
| Calculates the views associated with each component based on neighbors. More...
long | model_view_directions (Bmodel *model, int bin_width, int ref_flag)
| Analyzes view directions in a model. More...
int | component_hand (Bstring &s)
| Determines the hand of a component. More...

## Variables
int | verbose

## Detailed Description

Library routines used for analyzing the views of components in models.

Author
  Bernard Heymann

Date
  Created: 20081120
  Modified: 20141029

Definition in file model_views.cpp.

## Function Documentation

## ◆ component_hand()

int component_hand | ( | Bstring & | s | ) |

Determines the hand of a component.

Parameters

  &s | string with encoded order.

Returns
  int the hand.

      Requirement: The string must be either a 3 or 6-digit code.
      The reverse of the string is generated and the canonical version
      compared to the canonical version of the original string.
      The handedness is then returned as the sign of the comparison.
      The reverse of the 6-digit code is defined as reversing the
      first and last 3 digits separately.

Definition at line 466 of file model_views.cpp.

## ◆ component_normal()

Vector3<double> component_normal | ( | Bcomponent * | comp | ) |

Definition at line 172 of file model_views.cpp.

## ◆ component_view()

View component_view | ( | Bcomponent * | comp | ) |

Definition at line 199 of file model_views.cpp.

## ◆ model_calculate_local_views()

long model_calculate_local_views | ( | Bmodel * | model | ) |

Calculates the views associated with each component based on neighbors.

Parameters

  *model | model structure (views modified).

Returns
  long number of selected components.

      The view for a vertex is calculated from the vertex vector and the first link.
      The vertex vector points away from the origin and is calculated as follows:
      Angles defined for the vertex:
          vv = normalized sum of the cross products for each pair of links
              constituting an angle
      Angles not defined:
          vv = component coordinates - origin
      The origin is defined as the current zero coordinates, the center-of-mass,
      or from the map.

Definition at line 318 of file model_views.cpp.

## ◆ model_calculate_views()

long model_calculate_views | ( | Bmodel * | model,
|  | Bstring & | mode
| ) |  |

Calculates the views associated with each component.

Parameters

  *model | model structure (views modified).
  &mode | none=current, com, map, local.

Returns
  long number of selected components.

      The view for a vertex is calculated from the vertex vector and the first link.
      The vertex vector points away from the origin and is calculated as follows:
      Angles defined for the vertex:
          vv = normalized sum of the cross products for each pair of links
              constituting an angle
      Angles not defined:
          vv = component coordinates - origin
      The origin is defined as the current zero coordinates, the center-of-mass,
      or from the map.

Definition at line 263 of file model_views.cpp.

## ◆ model_find_views()

long model_find_views | ( | Bmodel * | model,
|  | Bstring & | reffile,
|  | Bstring & | paramfile
| ) |  |

Finds the molecule views with respect to a reference.

Parameters

  *model | model parameters.
  &reffile | reference molecule file name.
  &paramfile | atomic parameter file.

Returns
  long number of molecules selected.

      The positioning of each molecule is based on the center of mass of the reference.

Definition at line 136 of file model_views.cpp.

## ◆ model_invert_views()

long model_invert_views | ( | Bmodel * | model | ) |

Invert views.

Parameters

  *model | model parameters.

Returns
  long number of selected components.

      It calculates the inverse of each component view.
      Only the first model is processed.

Definition at line 109 of file model_views.cpp.

## ◆ model_set_views()

long model_set_views | ( | Bmodel * | model,
|  | View | view
| ) |  |

Sets views.

Parameters

  *model | model parameters.
  view | set view.

Returns
  long number of selected components.

      Each component view is set tot the given view.

Definition at line 81 of file model_views.cpp.

## ◆ model_view_directions()

long model_view_directions | ( | Bmodel * | model,
|  | int | bin_width,
|  | int | ref_flag
| ) |  |

Analyzes view directions in a model.

Parameters

  *model | model parameters.
  bin_width | bin width in degrees.
  ref_flag | flag to select the reference vector (0=z-axis, 1=component location)

Returns
  long number of molecules selected.

      The angle between the component view and a reference vector is calculated.
      A histogram of the angles is constructed and reported.
      The reference vector can be the z-axis, or the component location.

Definition at line 359 of file model_views.cpp.

## ◆ views_from_model()

View* views_from_model | ( | Bmodel * | model | ) |

Returns a list of component views.

Parameters

  *model | model parameters.

Returns
  View* list of views.

      Only the first model is processed.

Definition at line 29 of file model_views.cpp.

## ◆ views_from_models()

View* views_from_models | ( | Bmodel * | model | ) |

Returns a list of component views.

Parameters

  *model | model parameters.

Returns
  View* list of views.

      All models are processed.

Definition at line 53 of file model_views.cpp.

## Variable Documentation

## ◆ verbose

int verbose