Skip to content

Commit

Permalink
refactor: clean up lib exports
Browse files Browse the repository at this point in the history
  • Loading branch information
pnodet committed Aug 22, 2023
1 parent 2bfe276 commit a88686a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 26 deletions.
3 changes: 2 additions & 1 deletion src/convert_file.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
extern crate rayon;
use rayon::prelude::*;

use crate::{convert_pointcloud, create_station_file, StationPoint};
use crate::convert_pointcloud::convert_pointcloud;
use crate::stations::{create_station_file, StationPoint};
use anyhow::{Context, Result};
use std::{collections::HashMap, sync::Mutex};

Expand Down
3 changes: 1 addition & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,5 @@ mod stations;
mod utils;

pub use self::convert_file::convert_file;
pub use self::convert_point::convert_point;
pub use self::convert_pointcloud::convert_pointcloud;
pub use self::stations::StationPoint;
pub use self::stations::{create_station_file, create_station_point, get_sum_coordinates};
6 changes: 3 additions & 3 deletions src/stations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ pub struct StationPoint {
pub z: f64,
}

pub fn create_station_point(sum_coordinate: (f64, f64, f64), count: f64) -> StationPoint {
pub(crate) fn create_station_point(sum_coordinate: (f64, f64, f64), count: f64) -> StationPoint {
StationPoint {
x: sum_coordinate.0 / count,
y: sum_coordinate.1 / count,
z: sum_coordinate.2 / count,
}
}

pub fn create_station_file(
pub(crate) fn create_station_file(
output_path: String,
stations: Mutex<HashMap<usize, StationPoint>>,
) -> Result<()> {
Expand All @@ -38,7 +38,7 @@ pub fn create_station_file(
Ok(())
}

pub fn get_sum_coordinates(
pub(crate) fn get_sum_coordinates(
sum_coordinates: (f64, f64, f64),
point: &e57::Point,
) -> (f64, f64, f64) {
Expand Down
20 changes: 0 additions & 20 deletions src/utils.rs
Original file line number Diff line number Diff line change
@@ -1,26 +1,6 @@
use anyhow::{Context, Result};
use clap::Parser;
use std::path::{Path, PathBuf};

#[derive(Parser)]
#[command(author, version, about, long_about = None)]
struct Args {
#[arg(short, long)]
path: String,

#[arg(short, long, default_value_t = String::from("./"))]
output: String,

#[arg(short = 'P', long, default_value_t = false)]
progress: bool,

#[arg(short = 'D', long, default_value_t = false)]
debug: bool,

#[arg(short = 'T', long, default_value_t = 0)]
threads: usize,
}

pub(crate) fn construct_las_path(output_path: &String, index: usize) -> Result<PathBuf> {
let output_sub_dir_path = Path::new(&output_path).join("las");

Expand Down

0 comments on commit a88686a

Please sign in to comment.