Skip to content

Commit

Permalink
refactor(core): move OrbitPolicy to the components submodule (#250)
Browse files Browse the repository at this point in the history
  • Loading branch information
imrn99 authored Dec 10, 2024
1 parent 1fa2d98 commit 7bdd9e6
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 25 deletions.
1 change: 1 addition & 0 deletions honeycomb-core/src/cmap/components/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
pub mod betas;
pub mod collections;
pub mod identifiers;
pub mod orbits;
pub mod unused;
19 changes: 19 additions & 0 deletions honeycomb-core/src/cmap/components/orbits.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/// Orbit search policy enum.
///
/// This is used to define special cases of orbits that are often used in
/// algorithms. These special cases correspond to *i-cells*.
#[derive(Debug, PartialEq)]
pub enum OrbitPolicy {
/// 0-cell orbit.
Vertex,
/// 0-cell orbit, without using beta 0. This requires the cell to be complete / closed.
VertexLinear,
/// 1-cell orbit.
Edge,
/// 2-cell orbit.
Face,
/// 2-cell orbit, without using beta 0. This requires the cell to be complete / closed.
FaceLinear,
/// Ordered array of beta functions that define the orbit.
Custom(&'static [u8]),
}
22 changes: 1 addition & 21 deletions honeycomb-core/src/cmap/dim2/orbits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,12 @@
// ------ IMPORTS

use crate::geometry::CoordsFloat;
use crate::prelude::{CMap2, DartIdType, NULL_DART_ID};
use crate::prelude::{CMap2, DartIdType, OrbitPolicy, NULL_DART_ID};

use std::collections::{BTreeSet, VecDeque};

// ------ CONTENT

/// Orbit search policy enum.
///
/// This is used to define special cases of orbits that are often used in
/// algorithms. These special cases correspond to *i-cells*.
#[derive(Debug, PartialEq)]
pub enum OrbitPolicy {
/// 0-cell orbit.
Vertex,
/// 0-cell orbit, without using beta 0. This requires the cell to be complete / closed.
VertexLinear,
/// 1-cell orbit.
Edge,
/// 2-cell orbit.
Face,
/// 2-cell orbit, without using beta 0. This requires the cell to be complete / closed.
FaceLinear,
/// Ordered array of beta functions that define the orbit.
Custom(&'static [u8]),
}

/// Generic 2D orbit implementation
///
/// This structure only contains meta-data about the orbit in its initial state. All the darts
Expand Down
6 changes: 2 additions & 4 deletions honeycomb-core/src/cmap/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ pub use components::{
DartIdType, EdgeIdType, FaceIdType, VertexIdType, VolumeIdType, NULL_DART_ID, NULL_EDGE_ID,
NULL_FACE_ID, NULL_VERTEX_ID, NULL_VOLUME_ID,
},
orbits::OrbitPolicy,
};
pub use dim2::{
orbits::{Orbit2, OrbitPolicy},
structure::CMap2,
};
pub use dim2::{orbits::Orbit2, structure::CMap2};
pub use error::{CMapError, CMapResult};

#[cfg(feature = "utils")]
Expand Down

0 comments on commit 7bdd9e6

Please sign in to comment.