pub enum GateGeometry {
Polygon {
nodes: Vec<GateNode>,
closed: bool,
},
Rectangle {
min: GateNode,
max: GateNode,
},
Ellipse {
center: GateNode,
radius_x: f32,
radius_y: f32,
angle: f32,
},
Boolean {
operation: BooleanOperation,
operands: Vec<Arc<str>>,
},
}Expand description
The geometry of a gate, defining its shape in 2D parameter space.
Gates can be one of four geometric types:
- Polygon: A closed or open polygonal region defined by vertices
- Rectangle: An axis-aligned rectangular region
- Ellipse: An elliptical region with optional rotation
- Boolean: A combination of other gates using boolean operations (AND, OR, NOT)
All geometries operate in raw data coordinate space and are parameterized by two channel names (x and y parameters).
§Example
use flow_gates::{GateGeometry, GateNode};
// Create a rectangle gate
let min = GateNode::new("min")
.with_coordinate("FSC-A", 100.0)
.with_coordinate("SSC-A", 200.0);
let max = GateNode::new("max")
.with_coordinate("FSC-A", 500.0)
.with_coordinate("SSC-A", 600.0);
let geometry = GateGeometry::Rectangle { min, max };
// Check if a point is inside
let inside = geometry.contains_point(300.0, 400.0, "FSC-A", "SSC-A")?;Variants§
Polygon
Rectangle
Ellipse
Boolean
Boolean gate combining other gates with logical operations
Boolean gates reference other gates by ID and combine their results using AND, OR, or NOT operations. The referenced gates must be resolved externally when filtering events.
Implementations§
Source§impl GateGeometry
impl GateGeometry
Sourcepub fn bounding_box(
&self,
x_param: &str,
y_param: &str,
) -> Option<(f32, f32, f32, f32)>
pub fn bounding_box( &self, x_param: &str, y_param: &str, ) -> Option<(f32, f32, f32, f32)>
Calculate the bounding box for this geometry in the specified parameter space
Sourcepub fn calculate_center(
&self,
x_param: &str,
y_param: &str,
) -> Result<(f32, f32)>
pub fn calculate_center( &self, x_param: &str, y_param: &str, ) -> Result<(f32, f32)>
Calculate the center point in raw data coordinates
Sourcepub fn contains_point(
&self,
x: f32,
y: f32,
x_param: &str,
y_param: &str,
) -> Result<bool>
pub fn contains_point( &self, x: f32, y: f32, x_param: &str, y_param: &str, ) -> Result<bool>
Check if a point (in raw coordinates) is inside the gate
Sourcepub fn contains_points_batch(
&self,
points: &[(f32, f32)],
x_param: &str,
y_param: &str,
) -> Result<Vec<bool>>
pub fn contains_points_batch( &self, points: &[(f32, f32)], x_param: &str, y_param: &str, ) -> Result<Vec<bool>>
Batch check if points (in raw coordinates) are inside the gate
Uses optimized CPU-based batch filtering with Rayon parallelization.
Sourcepub fn is_valid(&self, x_param: &str, y_param: &str) -> Result<bool>
pub fn is_valid(&self, x_param: &str, y_param: &str) -> Result<bool>
Check if the gate has valid geometry and coordinates
Sourcepub fn gate_type_name(&self) -> &'static str
pub fn gate_type_name(&self) -> &'static str
Get a descriptive name for this gate type
Trait Implementations§
Source§impl Clone for GateGeometry
impl Clone for GateGeometry
Source§fn clone(&self) -> GateGeometry
fn clone(&self) -> GateGeometry
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for GateGeometry
impl Debug for GateGeometry
Source§impl<'de> Deserialize<'de> for GateGeometry
impl<'de> Deserialize<'de> for GateGeometry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl GateBounds for GateGeometry
impl GateBounds for GateGeometry
Source§impl GateCenter for GateGeometry
impl GateCenter for GateGeometry
Source§impl GateContainment for GateGeometry
impl GateContainment for GateGeometry
Source§impl GateGeometryOps for GateGeometry
impl GateGeometryOps for GateGeometry
Source§fn gate_type_name(&self) -> &'static str
fn gate_type_name(&self) -> &'static str
Source§impl GateValidation for GateGeometry
impl GateValidation for GateGeometry
Auto Trait Implementations§
impl Freeze for GateGeometry
impl RefUnwindSafe for GateGeometry
impl Send for GateGeometry
impl Sync for GateGeometry
impl Unpin for GateGeometry
impl UnwindSafe for GateGeometry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more