Skip to content

Commit edb5a26

Browse files
committed
Update doc strings
1 parent 5962776 commit edb5a26

4 files changed

Lines changed: 17 additions & 11 deletions

File tree

splashsurf_lib/src/lib.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
//! In particular it adds `From` impls for the [mesh](crate::mesh) types used by this crate to convert them to
1313
//! [`vtkio::model::UnstructuredGridPiece`](https://docs.rs/vtkio/0.6.*/vtkio/model/struct.UnstructuredGridPiece.html) and [`vtkio::model::DataSet`](https://docs.rs/vtkio/0.6.*/vtkio/model/enum.DataSet.html)
1414
//! types. If the feature is enabled, The crate exposes its `vtkio` dependency as `splashsurflib::vtkio`.
15+
//! - **`io`**: Enables the [`io`] module, containing functions to load and store particle and mesh files
16+
//! from various file formats, e.g. `VTK`, `OBJ`, `BGEO` etc. This feature implies the `vtk_extras` feature.
17+
//! It is disabled by default because a pure "online" surface reconstruction might not need any file IO.
18+
//! The feature adds several dependencies to support the file formats.
1519
//! - **`profiling`**: Enables profiling of internal functions. The resulting data can be displayed using the functions
1620
//! from the [`profiling`] module. Furthermore, it exposes the [`profile`] macro that can be used e.g.
1721
//! by binary crates calling into this library to add their own profiling scopes to the measurements.
@@ -160,7 +164,7 @@ pub enum ParticleDensityComputationStrategy {
160164
}
161165

162166
impl<R: Real> SpatialDecompositionParameters<R> {
163-
/// Tries to convert the parameters from one [Real] type to another [Real] type, returns None if conversion fails
167+
/// Tries to convert the parameters from one [`Real`] type to another [`Real`] type, returns `None` if conversion fails
164168
pub fn try_convert<T: Real>(&self) -> Option<SpatialDecompositionParameters<T>> {
165169
Some(SpatialDecompositionParameters {
166170
subdivision_criterion: self.subdivision_criterion.clone(),
@@ -265,7 +269,7 @@ impl<I: Index, R: Real> SurfaceReconstruction<I, R> {
265269
self.particle_densities.as_ref()
266270
}
267271

268-
/// Returns a reference to the virtual background grid that was used as a basis for discretization of the density map for marching cubes, can be used to convert the density map to a hex mesh (using [sparse_density_map_to_hex_mesh](density_map::sparse_density_map_to_hex_mesh))
272+
/// Returns a reference to the virtual background grid that was used as a basis for discretization of the density map for marching cubes, can be used to convert the density map to a hex mesh (using [`density_map::sparse_density_map_to_hex_mesh`])
269273
pub fn grid(&self) -> &UniformGrid<I, R> {
270274
&self.grid
271275
}

splashsurf_lib/src/octree.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,7 @@ impl<I: Index, R: Real> NodeData<I, R> {
833833
}
834834
}
835835

836-
/// Returns the [PointIndex] of the octree subdivision point for an [OctreeNode] with the given lower and upper points
836+
/// Returns the [`PointIndex`] of the octree subdivision point for an [`OctreeNode`] with the given lower and upper points
837837
fn get_split_point<I: Index, R: Real>(
838838
grid: &UniformGrid<I, R>,
839839
lower: &PointIndex<I>,

splashsurf_lib/src/traits.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,17 @@ pub trait Index:
3131
+ ThreadSafe
3232
+ 'static
3333
{
34-
/// Converts the value to the specified [Real] type. If the value cannot be represented by the target type, `None` is returned.
34+
/// Converts this value to the specified [`Real`] type `T` by converting first to `f64` followed by `T::from_f64`. If the value cannot be represented by the target type, `None` is returned.
3535
fn to_real<R: Real>(self) -> Option<R> {
3636
R::from_f64(self.to_f64()?)
3737
}
3838

39-
/// Converts the value to the specified [Real] type, panics if the value cannot be represented by the target type.
39+
/// Converts this value to the specified [`Real`] type, panics if the value cannot be represented by the target type.
4040
fn to_real_unchecked<R: Real>(self) -> R {
4141
R::from_f64(self.to_f64().unwrap()).unwrap()
4242
}
4343

44-
/// Multiplies the value by the specified `i32` coefficient. Panics if the coefficient cannot be converted into the target type.
44+
/// Multiplies this value by the specified `i32` coefficient. Panics if the coefficient cannot be converted into the target type.
4545
fn times(self, n: i32) -> Self {
4646
self.mul(Self::from_i32(n).unwrap())
4747
}
@@ -51,10 +51,12 @@ pub trait Index:
5151
pub trait Real:
5252
RealField + FromPrimitive + ToPrimitive + Debug + Default + Pod + ThreadSafe
5353
{
54+
/// Tries to convert this value to another [`Real`] type `T` by converting first to `f64` followed by `T::from_f64`. If the value cannot be represented by the target type, `None` is returned.
5455
fn try_convert<T: Real>(self) -> Option<T> {
5556
Some(T::from_f64(self.to_f64()?)?)
5657
}
5758

59+
/// Tries to convert the values of a statically sized `nalgebra::SVector` to another type, same behavior as [`Real::try_convert`]
5860
fn try_convert_vec_from<R, const D: usize>(vec: &SVector<R, D>) -> Option<SVector<Self, D>>
5961
where
6062
R: Real,
@@ -66,22 +68,22 @@ pub trait Real:
6668
Some(converted)
6769
}
6870

69-
/// Converts the value to the specified [Index] type. If the value cannot be represented by the target type, `None` is returned.
71+
/// Converts this value to the specified [`Index`] type. If the value cannot be represented by the target type, `None` is returned.
7072
fn to_index<I: Index>(self) -> Option<I> {
7173
I::from_f64(self.to_f64()?)
7274
}
7375

74-
/// Converts the value to the specified [Index] type, panics if the value cannot be represented by the target type.
76+
/// Converts this value to the specified [`Index`] type, panics if the value cannot be represented by the target type.
7577
fn to_index_unchecked<I: Index>(self) -> I {
7678
I::from_f64(self.to_f64().unwrap()).unwrap()
7779
}
7880

79-
/// Multiplies the value by the specified `i32` coefficient. Panics if the coefficient cannot be converted into the target type.
81+
/// Multiplies this value by the specified `i32` coefficient. Panics if the coefficient cannot be converted into the target type.
8082
fn times(self, n: i32) -> Self {
8183
self.mul(Self::from_i32(n).unwrap())
8284
}
8385

84-
/// Multiplies the value by the specified `f64` coefficient. Panics if the coefficient cannot be converted into the target type.
86+
/// Multiplies this value by the specified `f64` coefficient. Panics if the coefficient cannot be converted into the target type.
8587
fn times_f64(self, x: f64) -> Self {
8688
self.mul(Self::from_f64(x).unwrap())
8789
}

splashsurf_lib/src/workspace.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ impl<I: Index, R: Real> Debug for ReconstructionWorkspace<I, R> {
6262
}
6363
}
6464

65-
/// Workspace used by [crate::reconstruct_surface_inplace] internally to re-use allocated memory
65+
/// Workspace used by [`reconstruct_surface_inplace`] internally to re-use allocated memory
6666
pub(crate) struct LocalReconstructionWorkspace<I: Index, R: Real> {
6767
/// Storage for the particle positions (only used in octree based approach)
6868
pub particle_positions: Vec<Vector3<R>>,

0 commit comments

Comments
 (0)