Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): move OrbitPolicy to the components submodule #250

Merged
merged 1 commit into from
Dec 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading