pub struct C3d {
pub parameters: Parameters,
pub points: Points,
pub analog: Analog,
pub events: Events,
pub manufacturer: Manufacturer,
pub seg: Seg,
pub forces: Forces,
/* private fields */
}Expand description
Represents a parsed C3D file. The file can be read from disk or from memory.
Examples
use c3dio::prelude::*;
let c3d = C3d::load("tests/data/short.c3d");
assert!(c3d.is_ok());Fields§
§parameters: Parameters§points: Points§analog: Analog§events: Events§manufacturer: Manufacturer§seg: Seg§forces: ForcesImplementations§
source§impl C3d
impl C3d
sourcepub fn from_bytes(bytes: &[u8]) -> Result<C3d, C3dParseError>
pub fn from_bytes(bytes: &[u8]) -> Result<C3d, C3dParseError>
Parses a C3D file from a byte slice.
sourcepub fn load_header(file_name: &str) -> Result<C3d, C3dParseError>
pub fn load_header(file_name: &str) -> Result<C3d, C3dParseError>
Parses a C3D file with just the header data.
sourcepub fn load_parameters(file_name: &str) -> Result<C3d, C3dParseError>
pub fn load_parameters(file_name: &str) -> Result<C3d, C3dParseError>
Parses a C3D file with just the header and parameter data.
The parameter data cannot be parsed without the header data.
The parameter data is parsed into a Parameters struct.
The Parameters struct can be accessed via the parameters field.
pub fn new() -> C3d
pub fn force(&self, force_plate: usize, frame: usize) -> Option<[f32; 3]>
pub fn center_of_pressure( &self, force_plate: usize, frame: usize ) -> Option<[f32; 2]>
sourcepub fn write(self, file_name: &str) -> Result<Self, C3dIoError>
pub fn write(self, file_name: &str) -> Result<Self, C3dIoError>
A function to write a C3D file to a file path. This function will overwrite any existing file. If the file path does not exist, it will be created. If the file path is a directory, an error will be returned. If the file path is not writable, an error will be returned. If the file path is not a valid UTF-8 string, an error will be returned.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for C3d
impl Send for C3d
impl Sync for C3d
impl Unpin for C3d
impl UnwindSafe for C3d
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more