[][src]Struct pdbtbx::MtriX

pub struct MtriX {
    pub serial_number: usize,
    pub contained: bool,
    // some fields omitted
}

A transformation expressing non-crystallographic symmetry, used when transformations are required to generate the whole asymmetric subunit

Fields

serial_number: usize

The serial number of this transformation

contained: bool

If the coordinates of the molecule are contained in the entry this is true

Implementations

impl MtriX[src]

pub fn new() -> Self[src]

Create an empty transformation (identity), not contained, and with a serial number of 0.

pub fn serial_number(&self) -> usize[src]

The serial number of this transformation

pub fn set_serial_number(&mut self, new_value: usize)[src]

Set the serial number of this transformation

pub fn contained(&self) -> bool[src]

The 'contained' status, see wwPDB 3.30 MTRIXn p. 184. If the coordinates of the molecule are contained in the entry this is true.

pub fn set_contained(&mut self, new_value: bool)[src]

Set the contained status

pub fn transformation(&self) -> &TransformationMatrix[src]

The transformation

pub fn set_transformation(&mut self, transformation: TransformationMatrix)[src]

Set the transformation

pub fn set_row(&mut self, row: usize, data: [f64; 4])[src]

Set a row to the given data, this invalidates all other rows if the MtriX was valid before otherwise it validates the row given. To have a valid MtriX all rows have to be set.

Arguments

  • row - 0-based row to fill the data into
  • data - the row of data

Example

use pdbtbx::TransformationMatrix;
use pdbtbx::MtriX;
let mut example = MtriX::new();
example.set_row(1, [0.0, 1.0, 0.0, 0.0]);
example.set_row(2, [0.0, 0.0, 1.0, 0.0]);
example.set_row(0, [1.0, 0.0, 0.0, 0.0]); // The order does not matter
assert_eq!(example.transformation(), &TransformationMatrix::identity());
assert!(example.valid());

pub fn valid(&self) -> bool[src]

Checks if this MtriX is valid, for this all rows have to be set (also see set_row). Mainly used to validate a structure after parsing.

Trait Implementations

impl Clone for MtriX[src]

impl Debug for MtriX[src]

impl Default for MtriX[src]

impl PartialEq<MtriX> for MtriX[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.