Struct de_pathing::node::SearchNode
source · pub(crate) struct SearchNode {
prefix: Rc<PointChain>,
point_set: PointSet,
triangle_id: u32,
min_distance: f32,
heuristic: f32,
}
Expand description
Polyanya search node.
The node consists of a path prefix (whose last point is root point of the node), an interval (a segment or the target point) and search heuristic.
Fields§
§prefix: Rc<PointChain>
§point_set: PointSet
§triangle_id: u32
§min_distance: f32
§heuristic: f32
Lower bound of the path length from the root via the interval the target.
Implementations§
source§impl SearchNode
impl SearchNode
sourcepub(crate) fn initial(
source: Point<f32>,
target: Point<f32>,
segment: Segment,
step: Step
) -> Self
pub(crate) fn initial( source: Point<f32>, target: Point<f32>, segment: Segment, step: Step ) -> Self
Creates an initial node, i.e. a node whose prefix consists of a single
point: source
.
§Arguments
-
source
- starting point. -
target
- path finding target point. -
segment
- first segment to be traversed. -
step
- first point-to-edge step in the triangle edge neighboring graph.
sourcefn from_segment_interval(
prefix: Rc<PointChain>,
interval: SegmentInterval,
triangle_id: u32,
target: Point<f32>
) -> Self
fn from_segment_interval( prefix: Rc<PointChain>, interval: SegmentInterval, triangle_id: u32, target: Point<f32> ) -> Self
Creates a new Polyanya node from a path prefix and an interval. Node heuristic is computed.
§Arguments
-
prefix
- node path prefix (up to the root of the node). -
interval
- part of a triangle edge corresponding the expansion of this node. I.e. set (line segment) of “furthest” explored points along this particular path expansion. -
triangle_id
- last traversed triangle (to reachinterval
). -
target
- searched path target.
pub(crate) fn root(&self) -> Point<f32>
pub(crate) fn edge_id(&self) -> Option<u32>
pub(crate) fn triangle_id(&self) -> u32
sourcepub(crate) fn min_distance(&self) -> f32
pub(crate) fn min_distance(&self) -> f32
Returns distance of the node’s interval and the target point.
sourcepub(crate) fn expand_to_edge(
&self,
segment: Segment,
step: Step,
target: Point<f32>
) -> [Option<Self>; 3]
pub(crate) fn expand_to_edge( &self, segment: Segment, step: Step, target: Point<f32> ) -> [Option<Self>; 3]
Constructs and returns expansion of self onto a next (adjacent) edge.
§Arguments
-
segment
- full line segment of the next edge. -
step
- single triangle traversal step. -
target
- path searching target point.
§Panics
Panics if the last crossed triangle on the path to this node corresponds to the triangle of the next step (i.e. if the expansion goes backwards).
sourcefn corner(
&self,
step: Step,
segment: Segment,
corner: Point<f32>,
projection: ParamPair,
target: Point<f32>
) -> Self
fn corner( &self, step: Step, segment: Segment, corner: Point<f32>, projection: ParamPair, target: Point<f32> ) -> Self
Creates a new node whose prefix is equal to the prefix of self with
potential addition of corner
(as the new node root) in the case it
differs from root of self.
§Arguments
-
step
- the one additional step from self to reach the to be created node. -
segment
- line segment corresponding to the full edge directly reached (i.e. via a single triangle) from self. -
corner
- last path bend / corner to reachprojection
ontosegment
. Id est root of the to be created node. -
projection
- part of the target edge. -
target
- searched path target.
pub(crate) fn expand_to_target( &self, target: Point<f32>, triangle_id: u32 ) -> Option<Self>
sourcepub(crate) fn close(self, target: Point<f32>) -> Path
pub(crate) fn close(self, target: Point<f32>) -> Path
Constructs path from the search node.
The resulting path is a full path from source to target if the node (self) corresponds to the target point. Otherwise, it corresponds to the path from source to the closest point to target in the point set of self (on the nodes line segment).
pub(crate) fn root_score(&self) -> f32
fn score(&self) -> f32
Trait Implementations§
source§impl Clone for SearchNode
impl Clone for SearchNode
source§fn clone(&self) -> SearchNode
fn clone(&self) -> SearchNode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Ord for SearchNode
impl Ord for SearchNode
source§impl PartialEq for SearchNode
impl PartialEq for SearchNode
source§impl PartialOrd for SearchNode
impl PartialOrd for SearchNode
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moreimpl Eq for SearchNode
Auto Trait Implementations§
impl Freeze for SearchNode
impl RefUnwindSafe for SearchNode
impl !Send for SearchNode
impl !Sync for SearchNode
impl Unpin for SearchNode
impl UnwindSafe for SearchNode
Blanket Implementations§
§impl<T, U> AsBindGroupShaderType<U> for T
impl<T, U> AsBindGroupShaderType<U> for T
§fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
fn as_bind_group_shader_type(&self, _images: &RenderAssets<Image>) -> U
T
[ShaderType
] for self
. When used in [AsBindGroup
]
derives, it is safe to assume that all images in self
exist.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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self
to the equivalent element of its superset.