pub struct Vertex {}Expand description
A vertex, defined in global (3D) coordinates
This struct exists to distinguish between vertices and points at the type level. This is a relevant distinction, as vertices are part of a shape that help define its topology.
Points, on the other hand, might be used to approximate a shape for various purposes, without presenting any deeper truth about the shape’s structure.
§Validation
Vertices must be unique within a shape, meaning an identical vertex must not
exist in the same shape. In the context of vertex uniqueness, points that
are close to each other are considered identical. The minimum distance
between distinct vertices can be configured using the respective field in
ValidationConfig.
§Equality
Vertex contains no data and exists purely to be used within a Handle,
where Handle::id can be used to compare different instances of Vertex.
If Vertex had Eq/PartialEq implementations, it containing no data
would mean that all instances of Vertex would be considered equal. This
would be very error-prone.
If you need to reference a Vertex from a struct that needs to derive
Eq/Ord/…, you can use HandleWrapper<Vertex> to do that. It will
use Handle::id to provide those Eq/Ord/… implementations.
Implementations§
Trait Implementations§
Source§impl TransformObject for Vertex
impl TransformObject for Vertex
Source§fn transform_with_cache(
self,
_: &Transform,
_: &mut Services,
_: &mut TransformCache,
) -> Self
fn transform_with_cache( self, _: &Transform, _: &mut Services, _: &mut TransformCache, ) -> Self
Source§fn transform(self, transform: &Transform, services: &mut Services) -> Self
fn transform(self, transform: &Transform, services: &mut Services) -> Self
Source§impl Validate for Vertex
impl Validate for Vertex
Source§fn validate_with_config(
&self,
_: &ValidationConfig,
_: &mut Vec<ValidationError>,
)
fn validate_with_config( &self, _: &ValidationConfig, _: &mut Vec<ValidationError>, )
Source§fn validate_and_return_first_error(&self) -> Result<(), ValidationError>
fn validate_and_return_first_error(&self) -> Result<(), ValidationError>
Source§fn validate(&self, errors: &mut Vec<ValidationError>)
fn validate(&self, errors: &mut Vec<ValidationError>)
impl Copy for Vertex
Auto Trait Implementations§
impl Freeze for Vertex
impl RefUnwindSafe for Vertex
impl Send for Vertex
impl Sync for Vertex
impl Unpin for Vertex
impl UnwindSafe for Vertex
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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 moreSource§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§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).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.