Skip to content

Commit

Permalink
fix example
Browse files Browse the repository at this point in the history
  • Loading branch information
cvhammond committed Dec 31, 2023
1 parent c15be65 commit b273113
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 45 deletions.
17 changes: 0 additions & 17 deletions examples/read-write.rs
Original file line number Diff line number Diff line change
@@ -1,28 +1,11 @@
use std::assert_eq;

use c3dio::file_formats::Sto;
use c3dio::file_formats::Trc;
use c3dio::prelude::*;

fn main() {
let c3d = C3d::load("tests/c3d_org_samples/sample_30/admarche2.c3d").unwrap();

// Sto::from_c3d(&c3d).write("examples/short-copy2.sto").unwrap();
let c3d = c3d.write("examples/short-copy.c3d").unwrap();
let c3d2 = C3d::load("examples/short-copy.c3d").unwrap();
// let c3d2 = C3d::load("tests/c3d_org_samples/sample_01/Eb015pr.c3d").unwrap();
assert_eq!(c3d, c3d2);
dbg!(c3d.points.descriptions);
dbg!(c3d2.points.descriptions);
// assert_eq!(c3d.points.size(), c3d2.points.size());
// for i in 0..c3d.points.size().0 {
// for j in 0..c3d.points.size().1 {
// if c3d.points[i][j] != c3d2.points[i][j] {
// dbg!(i, j);
// dbg!(c3d.points[i][j]);
// dbg!(c3d2.points[i][j]);
// dbg!(c3d2.points.scale_factor);
// }
// }
// }
}
Binary file removed examples/short-copy.c3d
Binary file not shown.
28 changes: 0 additions & 28 deletions src/file_formats/mod.rs
Original file line number Diff line number Diff line change
@@ -1,33 +1,5 @@
//! Structures to represent auxiliary data types that C3D files can be written to.
use crate::data::MarkerPoint;
use grid::Grid;
use std::path::PathBuf;

pub mod trc;

#[derive(Debug, Clone)]
pub struct Trc {
pub path_file_type: u8,
pub path_file_type_description: String,
pub file_name: Option<PathBuf>,
pub data_rate: f32,
pub camera_rate: f32,
pub num_frames: usize,
pub units: [char; 4],
pub marker_names: Vec<String>,
pub first_frame: usize,
pub data: Grid<MarkerPoint>,
}

pub mod sto;

#[derive(Debug, Clone)]
pub struct Sto {
pub file_description: Option<String>,
pub version: u8,
pub in_degrees: bool,
pub first_frame: usize,
pub data_rate: f32,
pub column_names: Vec<String>,
pub data: Grid<f64>,
}

0 comments on commit b273113

Please sign in to comment.