Struct LineMesh

Source
pub struct LineMesh<T>
where T: Real,
{ pub vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>, pub indices: IntrinsicAttribute<[usize; 2], FaceIndex>, pub vertex_attributes: HashMap<String, Attribute<VertexIndex>>, pub face_attributes: HashMap<String, Attribute<FaceIndex>>, pub face_vertex_attributes: HashMap<String, Attribute<FaceVertexIndex>>, pub face_edge_attributes: HashMap<String, Attribute<FaceEdgeIndex>>, pub attribute_value_cache: HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>, }

Fields§

§vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>

Vertex positions.

§indices: IntrinsicAttribute<[usize; 2], FaceIndex>

Pairs of indices into vertices representing line segments.

§vertex_attributes: HashMap<String, Attribute<VertexIndex>>

Vertex attributes.

§face_attributes: HashMap<String, Attribute<FaceIndex>>

Line segment attributes.

§face_vertex_attributes: HashMap<String, Attribute<FaceVertexIndex>>

Line segment vertex attributes.

§face_edge_attributes: HashMap<String, Attribute<FaceEdgeIndex>>

Line segment edge attributes.

A line segment can be seen as having two directed edges.

§attribute_value_cache: HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>

Indirect attribute value cache

Implementations§

Source§

impl<T> LineMesh<T>
where T: Real,

Source

pub fn new(verts: Vec<[T; 3]>, indices: Vec<[usize; 2]>) -> LineMesh<T>

Source

pub fn face_iter(&self) -> Iter<'_, [usize; 2]>

Iterate over each face.

Source

pub fn face_iter_mut(&mut self) -> IterMut<'_, [usize; 2]>

Iterate mutably over each face.

Source

pub fn face<FI>(&self, fidx: FI) -> &[usize; 2]
where FI: Into<FaceIndex>,

Face accessor. These are vertex indices.

Source

pub fn faces(&self) -> &[[usize; 2]]

Return a slice of individual faces.

Source

pub fn reverse(&mut self)

Reverse the order of each polygon in this mesh.

Source

pub fn reversed(self) -> LineMesh<T>

Reverse the order of each polygon in this mesh. This is the consuming version of the reverse method.

Source

pub fn sort_vertices_by_key<K, F>(&mut self, f: F)
where F: FnMut(usize) -> K, K: Ord,

Sort vertices by the given key values.

Trait Implementations§

Source§

impl<T> Attrib for LineMesh<T>
where T: Real,

Source§

fn attrib_size<I>(&self) -> usize
where I: AttribIndex<LineMesh<T>>,

Get the size of the attribute at the appropriate mesh location determined by I.
Source§

fn attrib_dict<I>(&self) -> &HashMap<String, Attribute<I>>
where I: AttribIndex<LineMesh<T>>,

Read only access to the attribute dictionary.
Source§

fn attrib_dict_mut<I>(&mut self) -> &mut HashMap<String, Attribute<I>>
where I: AttribIndex<LineMesh<T>>,

Read and write access to the attribute dictionary.
Source§

fn attrib_dict_and_cache_mut<I>( &mut self, ) -> (&mut HashMap<String, Attribute<I>>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>>)
where I: AttribIndex<LineMesh<T>>,

Read and write access to the attribute dictionary along with a cache for indirect attribute values.
Source§

fn add_attrib<'a, T, I>( &mut self, name: &'a str, def: T, ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>, T: AttributeValue,

Add an attribute at the appropriate location with a given default.
Source§

fn add_attrib_data<'a, T, I>( &mut self, name: &'a str, data: Vec<T>, ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>, T: AttributeValue + Default,

Construct an attribute from a given data Vec<T>. data must have exactly the right size for the attribute to be added successfully.
Source§

fn set_attrib<'a, T, I>( &mut self, name: &'a str, def: T, ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>, T: AttributeValue,

Sets the attribute to the specified default value whether or not it already exists.
Source§

fn set_attrib_data<'a, T, I>( &mut self, name: &'a str, data: &[T], ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>, T: AttributeValue + Default,

Set an attribute to the given data slice. data must have exactly the right size for the attribute to be set successfully.
Source§

fn add_indirect_attrib<'a, T, I>( &mut self, name: &'a str, def: T, ) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>), Error>
where I: AttribIndex<Self>, T: AttributeValueHash,

Add an indirect attribute at the appropriate location with a given default.
Source§

fn set_indirect_attrib<'a, T, I>( &mut self, name: &'a str, def: T, ) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>), Error>
where I: AttribIndex<Self>, T: AttributeValueHash,

Sets the indirect attribute to the specified default value whether or not it already exists.
Source§

fn add_indirect_attrib_data<'a, I>( &mut self, name: &'a str, data: IndirectData, ) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>), Error>
where I: AttribIndex<Self>,

Construct an indirect attribute from a given IndirectData. data must have exactly the right size for the attribute to be added successfully.
Source§

fn set_indirect_attrib_data<'a, I>( &mut self, name: &'a str, data: IndirectData, ) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>), Error>
where I: AttribIndex<Self>,

Set an indirect attribute to the given IndirectData instance. data must have exactly the right size for the attribute to be set successfully.
Source§

fn duplicate_attrib<'a, 'b, T, I>( &mut self, name: &'a str, new_name: &'b str, ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>, T: Any + Clone,

Makes a copy of an existing attribute. Read more
Source§

fn remove_attrib<I>(&mut self, name: &str) -> Result<Attribute<I>, Error>
where I: AttribIndex<Self>,

Remove an attribute from the attribute dictionary. Read more
Source§

fn insert_attrib<I>( &mut self, name: &str, attrib: Attribute<I>, ) -> Result<Option<Attribute<I>>, Error>
where I: AttribIndex<Self>,

Inserts an attribute into the dictionary with the usual HashMap semantics. Read more
Source§

fn attrib_or_add<'a, T, I>( &mut self, name: &'a str, def: T, ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>, T: AttributeValue,

Retrieve the attribute with the given name and if it doesn’t exist, add a new one and set it to a given default value. In either case the mutable reference to the attribute is returned.
Source§

fn attrib_or_add_data<'a, T, I>( &mut self, name: &'a str, data: &[T], ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>, T: AttributeValue + Default,

Retrieve the attribute with the given name and if it doesn’t exist, set its data to what’s in the given slice. In either case the mutable reference to the attribute is returned.
Source§

fn attrib_or_add_indirect<'a, T, I>( &mut self, name: &'a str, def: T, ) -> Result<(&mut Attribute<I>, &mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>), Error>
where I: AttribIndex<Self>, T: AttributeValueHash,

Retrieve the indirect attribute with the given name and if it doesn’t exist, add a new one and set it to a given default value. In either case the mutable reference to the attribute is returned.
Source§

fn direct_attrib_iter<'a, 'b, T, I>( &'b self, name: &'a str, ) -> Result<Iter<'b, T>, Error>
where I: 'b + AttribIndex<Self>, T: Any + Clone,

Get the attribute iterator for a direct attribute.
Source§

fn attrib_iter_mut<'a, 'b, T, I>( &'b mut self, name: &'a str, ) -> Result<IterMut<'b, T>, Error>
where I: 'b + AttribIndex<Self>, T: Any + Clone,

Get the attribute mutable iterator for a direct attribute. Read more
Source§

fn attrib_iter<'b, T, I>( &'b self, name: &str, ) -> Result<Box<dyn Iterator<Item = &'b T> + 'b>, Error>
where I: 'b + AttribIndex<Self>, T: Any + Clone,

Get the iterator for an attribute no matter what kind.
Source§

fn indirect_attrib_update_with<'a, 'b, T, I, F>( &'b mut self, name: &'a str, f: F, ) -> Result<(&'b mut Attribute<I>, &'b mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>), Error>
where T: AttributeValueHash, I: 'b + AttribIndex<Self>, F: FnMut(usize, &Arc<T>) -> Option<Arc<T>>,

Update indirect attribute entries with the given closure. Read more
Source§

fn attrib_exists<I>(&self, name: &str) -> bool
where I: AttribIndex<Self>,

Return true if the given attribute exists at the given location, and false otherwise, even if the specified attribute location is invalid for the mesh.
Source§

fn attrib_check<'a, T, I>(&self, name: &'a str) -> Result<&Attribute<I>, Error>
where T: Any, I: AttribIndex<Self>,

Determine if the given attribute is valid and exists at the given location.
Source§

fn attrib_as_slice<'a, 'b, T, I>( &'b self, name: &'a str, ) -> Result<&'b [T], Error>
where T: 'static, I: 'b + AttribIndex<Self>,

Expose the underlying direct attribute as a slice.
Source§

fn attrib_as_mut_slice<'a, 'b, T, I>( &'b mut self, name: &'a str, ) -> Result<&'b mut [T], Error>
where T: 'static, I: 'b + AttribIndex<Self>,

Expose the underlying direct attribute as a mutable slice.
Source§

fn attrib_clone_into_vec<'a, 'b, T, I>( &'b self, name: &'a str, ) -> Result<Vec<T>, Error>
where I: 'b + AttribIndex<Self>, T: AttributeValueHash,

Clone attribute data into a Vec<T>. Read more
Source§

fn direct_attrib_clone_into_vec<'a, 'b, T, I>( &'b self, name: &'a str, ) -> Result<Vec<T>, Error>
where I: 'b + AttribIndex<Self>, T: AttributeValue,

Clone direct attribute data into a Vec<T>.
Source§

fn attrib<'a, I>(&self, name: &'a str) -> Result<&Attribute<I>, Error>
where I: AttribIndex<Self>,

Borrow the raw attribute from the attribute dictionary. From there you can use methods defined on the attribute itself.
Source§

fn attrib_mut<'a, I>( &mut self, name: &'a str, ) -> Result<&mut Attribute<I>, Error>
where I: AttribIndex<Self>,

Get the raw mutable attribute from the attribute dictionary. From there you can use methods defined on the attribute itself.
Source§

impl<T> Clone for LineMesh<T>
where T: Clone + Real,

Source§

fn clone(&self) -> LineMesh<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> Debug for LineMesh<T>
where T: Debug + Real,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<T> Default for LineMesh<T>
where T: Real,

Source§

fn default() -> LineMesh<T>

Produce an empty mesh. This is not particularly useful on its own, however it can be used as a null case for various mesh algorithms.

Source§

impl<T> FaceAttrib for LineMesh<T>
where T: Real,

Source§

fn topo_attrib_size(&self) -> usize

Mesh implementation of the attribute size getter.
Source§

fn topo_attrib_dict(&self) -> &HashMap<String, Attribute<FaceIndex>>

Mesh implementation of the attribute dictionary getter.
Source§

fn topo_attrib_dict_mut(&mut self) -> &mut HashMap<String, Attribute<FaceIndex>>

Mesh implementation of the attribute dictionary mutable getter.
Source§

fn topo_attrib_dict_and_cache_mut( &mut self, ) -> (&mut HashMap<String, Attribute<FaceIndex>>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>>)

Mesh implementation of the attribute dictionary and cache mutable getter.
Source§

impl<T> FaceEdge for LineMesh<T>
where T: Real,

Source§

fn edge<FEI>(&self, fe_idx: FEI) -> EdgeIndex
where FEI: Copy + Into<FaceEdgeIndex>,

Index of the destination element given the topology index.
Source§

fn face_edge<FI>(&self, fidx: FI, which: usize) -> Option<FaceEdgeIndex>
where FI: Copy + Into<FaceIndex>,

Toplogy index: where the data lives in an attribute array.
Source§

fn num_face_edges(&self) -> usize

Topology quantifier. Number of connectors in total.
Source§

fn num_edges_at_face<FI>(&self, _: FI) -> usize
where FI: Copy + Into<FaceIndex>,

Topology quantifier. Number of connectors at a particular element.
Source§

fn face_to_edge<I>(&self, i: I, k: usize) -> Option<EdgeIndex>
where I: Copy + Into<FaceIndex>,

Index of the destination element from the source index.
Source§

impl<T> FaceEdgeAttrib for LineMesh<T>
where T: Real,

Source§

fn topo_attrib_size(&self) -> usize

Mesh implementation of the attribute size getter.
Source§

fn topo_attrib_dict(&self) -> &HashMap<String, Attribute<FaceEdgeIndex>>

Mesh implementation of the attribute dictionary getter.
Source§

fn topo_attrib_dict_mut( &mut self, ) -> &mut HashMap<String, Attribute<FaceEdgeIndex>>

Mesh implementation of the attribute dictionary mutable getter.
Source§

fn topo_attrib_dict_and_cache_mut( &mut self, ) -> (&mut HashMap<String, Attribute<FaceEdgeIndex>>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>>)

Mesh implementation of the attribute dictionary and cache mutable getter.
Source§

impl<T> FaceVertex for LineMesh<T>
where T: Real,

Source§

fn vertex<FVI>(&self, fv_idx: FVI) -> VertexIndex
where FVI: Copy + Into<FaceVertexIndex>,

Index of the destination element given the topology index.
Source§

fn face_vertex<FI>(&self, fidx: FI, which: usize) -> Option<FaceVertexIndex>
where FI: Copy + Into<FaceIndex>,

Toplogy index: where the data lives in an attribute array.
Source§

fn num_face_vertices(&self) -> usize

Topology quantifier. Number of connectors in total.
Source§

fn num_vertices_at_face<FI>(&self, _: FI) -> usize
where FI: Copy + Into<FaceIndex>,

Topology quantifier. Number of connectors at a particular element.
Source§

fn face_to_vertex<I>(&self, i: I, k: usize) -> Option<VertexIndex>
where I: Copy + Into<FaceIndex>,

Index of the destination element from the source index.
Source§

fn reverse_topo(&self) -> (Vec<usize>, Vec<usize>)
where Self: NumFaces + NumVertices,

Generate the reverse topology structure.
Source§

fn reverse_source_topo(&self) -> (Vec<usize>, Vec<usize>)
where Self: NumVertices,

Generate the reverse topology structure from the destination element to the source topology element. Read more
Source§

impl<T> FaceVertexAttrib for LineMesh<T>
where T: Real,

Source§

fn topo_attrib_size(&self) -> usize

Mesh implementation of the attribute size getter.
Source§

fn topo_attrib_dict(&self) -> &HashMap<String, Attribute<FaceVertexIndex>>

Mesh implementation of the attribute dictionary getter.
Source§

fn topo_attrib_dict_mut( &mut self, ) -> &mut HashMap<String, Attribute<FaceVertexIndex>>

Mesh implementation of the attribute dictionary mutable getter.
Source§

fn topo_attrib_dict_and_cache_mut( &mut self, ) -> (&mut HashMap<String, Attribute<FaceVertexIndex>>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>>)

Mesh implementation of the attribute dictionary and cache mutable getter.
Source§

impl<T> From<PolyMesh<T>> for LineMesh<T>
where T: Real,

Source§

fn from(mesh: PolyMesh<T>) -> LineMesh<T>

Convert a PolyMesh into a LineMesh. This is effectively a wireframe construction.

Note that this conversion does not merge any attributes, each face will generate its own edge. This means that two neighbouring faces will generate two overlapping edges. This is done to preserve all attribute data during the conversion, which means that some of it is duplicated.

Source§

impl<T> NumFaces for LineMesh<T>
where T: Real,

Source§

impl<T> NumVertices for LineMesh<T>
where T: Real,

Source§

impl<T> PartialEq for LineMesh<T>
where T: PartialEq + Real,

Source§

fn eq(&self, other: &LineMesh<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T> VertexAttrib for LineMesh<T>
where T: Real,

Source§

fn topo_attrib_size(&self) -> usize

Mesh implementation of the attribute size getter.
Source§

fn topo_attrib_dict(&self) -> &HashMap<String, Attribute<VertexIndex>>

Mesh implementation of the attribute dictionary getter.
Source§

fn topo_attrib_dict_mut( &mut self, ) -> &mut HashMap<String, Attribute<VertexIndex>>

Mesh implementation of the attribute dictionary mutable getter.
Source§

fn topo_attrib_dict_and_cache_mut( &mut self, ) -> (&mut HashMap<String, Attribute<VertexIndex>>, Option<&mut HashSet<Value<MaybeUninit<usize>, AttributeValueHashVTable>>>)

Mesh implementation of the attribute dictionary and cache mutable getter.
Source§

impl<T> VertexPositions for LineMesh<T>
where T: Real,

Source§

type Element = [T; 3]

Source§

fn vertex_positions(&self) -> &[<LineMesh<T> as VertexPositions>::Element]

Vertex positions as a slice of triplets.
Source§

fn vertex_positions_mut( &mut self, ) -> &mut [<LineMesh<T> as VertexPositions>::Element]

Vertex positions as a mutable slice of triplets.
Source§

fn vertex_position_iter(&self) -> Iter<'_, Self::Element>

Vertex iterator.
Source§

fn vertex_position_iter_mut(&mut self) -> IterMut<'_, Self::Element>

Mutable vertex iterator.
Source§

fn vertex_position<VI>(&self, vidx: VI) -> Self::Element
where VI: Into<VertexIndex>, Self::Element: Clone,

Vertex accessor.
Source§

impl<T> StructuralPartialEq for LineMesh<T>
where T: Real,

Auto Trait Implementations§

§

impl<T> Freeze for LineMesh<T>

§

impl<T> RefUnwindSafe for LineMesh<T>
where T: RefUnwindSafe,

§

impl<T> Send for LineMesh<T>

§

impl<T> Sync for LineMesh<T>

§

impl<T> Unpin for LineMesh<T>
where T: Unpin,

§

impl<T> UnwindSafe for LineMesh<T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<M, T> BoundingBox<T> for M
where T: Real, M: VertexPositions<Element = [T; 3]>,

Source§

fn bounding_box(&self) -> BBox<T>

Compute the bounding box of this object.

Source§

impl<T> Bytes for T

Source§

fn as_bytes(&self) -> &[u8]

Get a slice of bytes representing Self.
Source§

fn interpret_bytes(bytes: &[u8]) -> &Self

Panics if the size of the given bytes slice is not equal to the size of Self.
Source§

impl<T> CloneBytes for T
where T: Clone + 'static,

Source§

unsafe fn clone_bytes(src: &[MaybeUninit<u8>]) -> Box<[MaybeUninit<u8>]>

Source§

unsafe fn clone_from_bytes(dst: &mut [MaybeUninit<u8>], src: &[MaybeUninit<u8>])

Source§

unsafe fn clone_into_raw_bytes( src: &[MaybeUninit<u8>], dst: &mut [MaybeUninit<u8>], )

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<M> Connectivity<FaceVertexIndex, VertexIndex> for M

Source§

type Topo = (Vec<usize>, Vec<usize>)

Additional topology that may aid in computing connectivity. Read more
Source§

fn precompute_topo( &self, ) -> <M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo

Precompute additional topology information prior to determining connectivity. Read more
Source§

fn num_elements(&self) -> usize

Get the number of elements which are considered for connectivity Read more
Source§

fn push_neighbours<T>( &self, index: FaceVertexIndex, stack: &mut Vec<FaceVertexIndex>, topo: &<M as Connectivity<FaceVertexIndex, VertexIndex>>::Topo, attrib: Option<&[T]>, )
where T: Default + PartialEq,

Push all neighbours of the element at the given index to the given stack. Read more
Source§

fn connectivity(&self) -> (Vec<usize>, usize)

Determine the connectivity of a set of meshes. Read more
Source§

fn connectivity_via_attrib<T>( &self, attrib: Option<&str>, ) -> (Vec<usize>, usize)
where Self: Attrib, Src: AttribIndex<Self>, T: Default + PartialEq + 'static,

Determine the connectivity of a set of meshes. Read more
Source§

fn connectivity_via_attrib_fn<'a, T, F>(&self, f: F) -> (Vec<usize>, usize)
where T: Default + PartialEq + 'a, F: FnOnce() -> Option<&'a [T]>,

Determine the connectivity of a set of meshes. Read more
Source§

impl<M> Connectivity<VertexIndex, FaceIndex> for M

Source§

type Topo = (Vec<usize>, Vec<usize>)

Additional topology that may aid in computing connectivity. Read more
Source§

fn precompute_topo(&self) -> <M as Connectivity<VertexIndex, FaceIndex>>::Topo

Precompute additional topology information prior to determining connectivity. Read more
Source§

fn num_elements(&self) -> usize

Get the number of elements which are considered for connectivity Read more
Source§

fn push_neighbours<T>( &self, index: VertexIndex, stack: &mut Vec<VertexIndex>, topo: &<M as Connectivity<VertexIndex, FaceIndex>>::Topo, _: Option<&[T]>, )
where T: Default + PartialEq,

Push all neighbours of the element at the given index to the given stack. Read more
Source§

fn connectivity(&self) -> (Vec<usize>, usize)

Determine the connectivity of a set of meshes. Read more
Source§

fn connectivity_via_attrib<T>( &self, attrib: Option<&str>, ) -> (Vec<usize>, usize)
where Self: Attrib, Src: AttribIndex<Self>, T: Default + PartialEq + 'static,

Determine the connectivity of a set of meshes. Read more
Source§

fn connectivity_via_attrib_fn<'a, T, F>(&self, f: F) -> (Vec<usize>, usize)
where T: Default + PartialEq + 'a, F: FnOnce() -> Option<&'a [T]>,

Determine the connectivity of a set of meshes. Read more
Source§

impl<T> DebugBytes for T
where T: Debug + 'static,

Source§

unsafe fn fmt_bytes( bytes: &[MaybeUninit<u8>], f: &mut Formatter<'_>, ) -> Result<(), Error>

Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DropBytes for T
where T: 'static,

Source§

unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, S, I> Get<'a, I> for S
where I: GetIndex<'a, S>,

Source§

type Output = <I as GetIndex<'a, S>>::Output

Source§

fn get(&self, idx: I) -> Option<<I as GetIndex<'a, S>>::Output>

Source§

fn at(&self, idx: I) -> Self::Output

Return a value at the given index. This is provided as the checked version of get that will panic if the equivalent get call is None, which typically means that the given index is out of bounds. Read more
Source§

unsafe fn at_unchecked(&self, idx: I) -> Self::Output

Return a value at the given index. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<S, I> Isolate<I> for S
where I: IsolateIndex<S>,

Source§

type Output = <I as IsolateIndex<S>>::Output

Source§

unsafe fn isolate_unchecked(self, idx: I) -> <S as Isolate<I>>::Output

Unchecked version of isolate. Read more
Source§

fn try_isolate(self, idx: I) -> Option<<S as Isolate<I>>::Output>

Source§

fn isolate(self, idx: I) -> Self::Output
where Self: Sized,

Return a value at the given index. This is provided as the checked version of try_isolate that will panic if the equivalent try_isolate call is None, which typically means that the given index is out of bounds. Read more
Source§

impl<T> PartialEqBytes for T
where T: PartialEq + 'static,

Source§

unsafe fn eq_bytes(a: &[MaybeUninit<u8>], b: &[MaybeUninit<u8>]) -> bool

Source§

impl<M> Partition for M
where M: Attrib,

Source§

fn partition_by_attrib<T, Src>(&self, attrib: &str) -> (Vec<usize>, usize)
where T: AttributeValueHash, Src: AttribIndex<M>,

Returns a partitioning by unique values of the given attribute. Read more
Source§

fn partition_by_attrib_by_sort<T, Src>( &self, attrib: &str, ) -> (Vec<usize>, usize)

Returns a partitioning by unique values of the given attribute. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, N> PushArrayToVec<N> for T
where T: Clone, N: Array<T>,

Source§

fn push_to_vec(element: <N as Array<T>>::Array, set: &mut Vec<T>)

This method tells this type how it can be pushed to a Vec as an array.
Source§

impl<T, M> Rotate<T> for M
where T: RealField + Float, M: VertexPositions<Element = [T; 3]>,

Source§

fn rotate_by_matrix(&mut self, mtx: [[T; 3]; 3])

Rotate the mesh using the given column-major rotation matrix.

Source§

fn rotate(&mut self, axis: [T; 3], theta: T)

Rotate the object around the given unit vector u by the given angle theta (in radians). Read more
Source§

fn rotate_by_vector(&mut self, e: [T; 3])
where T: Zero,

Rotate the object using the given Euler vector (or rotation vector) e. The direction of e specifies the axis of rotation and its magnitude is the angle in radians.
Source§

impl<S, T> Rotated<T> for S
where T: RealField, S: Rotate<T>,

Source§

fn rotated(self, u: [T; 3], theta: T) -> S

Return a version of self rotated about the unit vector u by the given angle theta (in radians). Read more
Source§

fn rotated_by_matrix(self, mtx: [[T; 3]; 3]) -> S

Return a version of self rotated using the given column-major rotation matrix
Source§

fn rotated_by_vector(self, e: [T; 3]) -> S

Return a version of self rotated about the Euler vector e.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, M> Scale<T> for M
where T: RealField, M: VertexPositions<Element = [T; 3]>,

Source§

fn scale(&mut self, _: [T; 3])

Scale a mesh in 3D by a given vector of scale factors. s = [1.0; 3] corresponds to a noop.

Source§

fn uniform_scale(&mut self, s: T)

Uniformly scale the given object by the given factor in all dimensions.
Source§

impl<S, T> Scaled<T> for S
where T: Copy, S: Scale<T>,

Source§

fn scaled(self, s: [T; 3]) -> S

Return a scaled version of self.
Source§

fn uniformly_scaled(self, s: T) -> S

Return a uniformly scaled version of self.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, M> Translate<T> for M
where T: RealField, M: VertexPositions<Element = [T; 3]>,

Source§

fn translate(&mut self, _: [T; 3])

Translate the mesh by the given translation vector (displacement) t.

Source§

impl<S, T> Translated<T> for S
where S: Translate<T>,

Source§

fn translated(self, t: [T; 3]) -> S

Return a version of self translated by the given translation vector t.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AttributeValue for T
where T: Clone + PartialEq + Debug + Send + Sync + 'static,

Source§

impl<T> Elem for T
where T: Any + DropBytes,

Source§

impl<T> Scalar for T
where T: 'static + Clone + PartialEq + Debug,

Source§

impl<M, T> VertexMesh<T> for M