[][src]Struct pdbtbx::OrigX

pub struct OrigX { /* fields omitted */ }

A transformation of the orthogonal coordinates to submitted

Implementations

impl OrigX[src]

pub fn new() -> OrigX[src]

Create an empty transformation (identity)

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

Get the transformation from orthogonal to submitted coordinates

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

Set the transformation from orthogonal to submitted 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 origx was valid before otherwise it validates the row given. To have a valid origx 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::OrigX;
let mut example = OrigX::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 OrigX 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 OrigX[src]

impl Debug for OrigX[src]

impl Default for OrigX[src]

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