use std::path::PathBuf;
use std::{error::Error, fmt};
pub mod analog;
pub mod c3d;
pub mod data;
pub mod events;
pub mod forces;
pub mod manufacturer;
pub mod parameters;
pub mod points;
mod processor;
pub mod seg;
pub mod builder;
#[path = "file_formats/mod.rs"]
pub mod file_formats;
pub use analog::Analog;
pub use analog::AnalogFormat;
pub use analog::AnalogOffset;
pub use builder::C3dBuilder;
pub use c3d::C3d;
pub use data::DataFormat;
pub use data::MarkerPoint;
pub use events::Event;
pub use events::EventContext;
pub use events::Events;
pub use forces::ForcePlatform;
pub use forces::ForcePlatformCorners;
pub use forces::ForcePlatformOrigin;
pub use forces::ForcePlatformType;
pub use forces::ForcePlatforms;
pub use manufacturer::Manufacturer;
pub use manufacturer::ManufacturerVersion;
pub use parameters::{Parameter, ParameterData, Parameters};
pub use points::Points;
pub use processor::Processor;
pub use seg::Seg;
pub use file_formats::trc::Trc;
pub use file_formats::sto::Sto;
pub mod prelude {
pub use crate::{
Analog, AnalogFormat, AnalogOffset, C3d, C3dParseError, C3dWriteError, Events,
ForcePlatform, ForcePlatformType, ForcePlatforms, Manufacturer, ManufacturerVersion,
MarkerPoint, Parameter, ParameterData, Parameters, Points, Processor, Seg, Sto, Trc
};
}
#[derive(Debug)]
pub enum C3dParseError {
ReadError(std::io::Error),
InsufficientBlocks(String),
InvalidHeaderStartBlock,
InvalidParameterStartBlock,
InvalidParameterData,
InvalidDataStartBlock,
InvalidProcessorType,
InvalidDataType,
InvalidParametersOffset,
InvalidDescription,
MissingGroup(String),
MissingParameter(String),
InvalidGroupId,
MissingPointScale,
FileNotOpen,
NotEnoughData,
InvalidNextParameter,
TooManyEvents(i16),
NumFramesMismatch(usize, usize),
GroupNotFound(String),
ParameterNotFound(String, String),
RequiredParameterNotFound(String),
InvalidData(Parameter, String),
InvalidParameterFormat(String),
AnalogOffsetScaleMismatch,
InsufficientAnalogOffsets,
InvalidParameterDimensions(String),
InvalidParameterType(String),
InvalidEventLabel(String, String),
MissingEventTime(usize),
MissingEventLabel(usize),
NoParameterTimeEvents,
HeaderNotParsed,
AnalogBytesPerFrameMismatch,
FrameRateMismatch(f32, f32),
ScaleFactorMismatch(f32, f32),
}
impl Error for C3dParseError {}
impl fmt::Display for C3dParseError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "C3dParseError: {:?}", self)
}
}
#[derive(Debug)]
pub enum C3dWriteError {
WriteError(PathBuf, std::io::Error),
InvalidFileExtension(String),
InvalidFilePath(PathBuf),
WriteHeaderError(std::io::Error),
WriteParametersError(std::io::Error),
WriteDataError(std::io::Error),
GroupNameTooLong(String),
GroupNameNotAscii(String),
GroupDescriptionTooLong(String),
ParameterNameTooLong(String),
ParameterNameNotAscii(String),
InvalidParameterDimensions(String),
ParameterDescriptionTooLong(String),
InvalidForcePlatformInfo(String),
}
impl Error for C3dWriteError {}
impl fmt::Display for C3dWriteError {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
write!(f, "C3dWriteError: {:?}", self)
}
}