[][src]Struct pdbtbx::Scale

pub struct Scale { /* fields omitted */ }

A scale transformation of a crystal, to get from standard orthogonal coordinates to fractional coordinates

Implementations

impl Scale[src]

pub fn new() -> Self[src]

Create an empty transformation (identity)

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

Get the transformation from standard orthogonal coordinates to fractional coordinates

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

Set the transformation from standard orthogonal coordinates to fractional coordinates

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 scale was valid before otherwise it validates the row given. To have a valid Scale all rows have to be set.

Arguments

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

Example

use rust_pdb::TransformationMatrix;
use rust_pdb::Scale;
let mut example = Scale::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 Scale 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 Scale[src]

impl Debug for Scale[src]

impl Default for Scale[src]

impl PartialEq<Scale> for Scale[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.