Struct gut::mesh::pointcloud::PointCloud [−][src]
A collection of disconnected points, possibly but not necessarily representing some geometry. The points may have arbitrary attributes assigned to them such as orientation.
Fields
vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>
Vertex positions.
vertex_attributes: AttribDict<VertexIndex>
Vertex attribute data.
Implementations
impl<T: Real> PointCloud<T>
[src]
pub fn new(verts: Vec<[T; 3]>) -> PointCloud<T>
[src]
Construct a PointCloud
from an array of vertices.
Examples
use gut::mesh::{PointCloud, VertexPositions}; let points = vec![ [0.0, 0.0, 0.0], [1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [1.0, 1.0, 0.0], [0.0, 0.0, 1.0], [1.0, 0.0, 1.0]]; let ptcloud = PointCloud::new(points.clone()); let positions = ptcloud.vertex_positions().to_vec(); assert_eq!(positions, points);
Trait Implementations
impl<T: Real> Attrib for PointCloud<T>
[src]
fn attrib_size<I: AttribIndex<Self>>(&self) -> usize
[src]
fn attrib_dict<I: AttribIndex<Self>>(&self) -> &AttribDict<I>
[src]
fn attrib_dict_mut<I: AttribIndex<Self>>(&mut self) -> &mut AttribDict<I>
[src]
fn attrib_dict_and_cache_mut<I: AttribIndex<Self>>(
&mut self
) -> (&mut AttribDict<I>, Option<&mut AttribValueCache>)
[src]
&mut self
) -> (&mut AttribDict<I>, Option<&mut AttribValueCache>)
fn add_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue,
fn add_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue + Default,
[src]
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue + Default,
fn set_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue,
fn set_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue + Default,
[src]
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue + Default,
fn add_indirect_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error> where
T: AttributeValueHash,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error> where
T: AttributeValueHash,
fn set_indirect_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error> where
T: AttributeValueHash,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error> where
T: AttributeValueHash,
fn add_indirect_attrib_data<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
[src]
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
fn set_indirect_attrib_data<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
[src]
&mut self,
name: &'a str,
data: IndirectData
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error>
fn duplicate_attrib<'a, 'b, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
new_name: &'b str
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
[src]
&mut self,
name: &'a str,
new_name: &'b str
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn remove_attrib<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str
) -> Result<Attribute<I>, Error>
[src]
&mut self,
name: &'a str
) -> Result<Attribute<I>, Error>
fn insert_attrib<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
attrib: Attribute<I>
) -> Result<Option<Attribute<I>>, Error>
[src]
&mut self,
name: &'a str,
attrib: Attribute<I>
) -> Result<Option<Attribute<I>>, Error>
fn attrib_or_add<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue,
fn attrib_or_add_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue + Default,
[src]
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: AttributeValue + Default,
fn attrib_or_add_indirect<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error> where
T: AttributeValueHash,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<(&mut Attribute<I>, &mut AttribValueCache), Error> where
T: AttributeValueHash,
fn direct_attrib_iter<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Iter<'_, T>, Error> where
T: Any + Clone,
[src]
&'b self,
name: &'a str
) -> Result<Iter<'_, T>, Error> where
T: Any + Clone,
fn attrib_iter_mut<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b mut self,
name: &'a str
) -> Result<IterMut<'_, T>, Error> where
T: Any + Clone,
[src]
&'b mut self,
name: &'a str
) -> Result<IterMut<'_, T>, Error> where
T: Any + Clone,
fn attrib_iter<'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &str
) -> Result<Box<dyn Iterator<Item = &'b T> + 'b>, Error> where
T: Any + Clone,
[src]
&'b self,
name: &str
) -> Result<Box<dyn Iterator<Item = &'b T> + 'b>, Error> where
T: Any + Clone,
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 AttribValueCache), Error> where
T: AttributeValueHash,
I: 'b + AttribIndex<Self>,
F: FnMut(usize, &Irc<T>) -> Option<Irc<T>>,
[src]
&'b mut self,
name: &'a str,
f: F
) -> Result<(&'b mut Attribute<I>, &'b mut AttribValueCache), Error> where
T: AttributeValueHash,
I: 'b + AttribIndex<Self>,
F: FnMut(usize, &Irc<T>) -> Option<Irc<T>>,
fn attrib_exists<'a, I: AttribIndex<Self>>(&self, name: &'a str) -> bool
[src]
fn attrib_check<'a, T: Any, I: AttribIndex<Self>>(
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
[src]
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
fn attrib_as_slice<'a, 'b, T: 'static, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<&'b [T], Error>
[src]
&'b self,
name: &'a str
) -> Result<&'b [T], Error>
fn attrib_as_mut_slice<'a, 'b, T: 'static, I: 'b + AttribIndex<Self>>(
&'b mut self,
name: &'a str
) -> Result<&'b mut [T], Error>
[src]
&'b mut self,
name: &'a str
) -> Result<&'b mut [T], Error>
fn attrib_clone_into_vec<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Vec<T>, Error> where
T: AttributeValueHash,
[src]
&'b self,
name: &'a str
) -> Result<Vec<T>, Error> where
T: AttributeValueHash,
fn direct_attrib_clone_into_vec<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Vec<T>, Error> where
T: AttributeValue,
[src]
&'b self,
name: &'a str
) -> Result<Vec<T>, Error> where
T: AttributeValue,
fn attrib<'a, I: AttribIndex<Self>>(
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
[src]
&self,
name: &'a str
) -> Result<&Attribute<I>, Error>
fn attrib_mut<'a, I: AttribIndex<Self>>(
&mut self,
name: &'a str
) -> Result<&mut Attribute<I>, Error>
[src]
&mut self,
name: &'a str
) -> Result<&mut Attribute<I>, Error>
impl<T: Clone + Real> Clone for PointCloud<T>
[src]
fn clone(&self) -> PointCloud<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug + Real> Debug for PointCloud<T>
[src]
impl<T: Real> Default for PointCloud<T>
[src]
fn default() -> Self
[src]
Produce an empty PointCloud
.
This is not particularly useful on its own, however it can be used as a null case for various mesh algorithms.
impl<T: Real, M: VertexMesh<T>> From<&'_ M> for PointCloud<T>
[src]
Convert a borrow of any VertexMesh
into a PointCloud
.
Since we can't destructure a generic type, it's sufficient to do the conversion from a
reference to a mesh.
fn from(mesh: &M) -> PointCloud<T>
[src]
impl<T: Real> From<PointCloud<T>> for PolyMesh<T>
[src]
Convert a point cloud into a polygon mesh.
fn from(mesh: PointCloud<T>) -> PolyMesh<T>
[src]
impl<T: Real> From<PolyMesh<T>> for PointCloud<T>
[src]
Convert a polygon mesh to a point cloud by erasing all polygon data.
fn from(polymesh: PolyMesh<T>) -> PointCloud<T>
[src]
impl<T: Real> From<QuadMesh<T>> for PointCloud<T>
[src]
Convert a quad mesh to a point cloud by erasing all quad data.
fn from(mesh: QuadMesh<T>) -> PointCloud<T>
[src]
impl<T: Real> From<TetMesh<T>> for PointCloud<T>
[src]
Convert a tet mesh to a point cloud by erasing all tet data.
fn from(mesh: TetMesh<T>) -> PointCloud<T>
[src]
impl<T: Real> From<TriMesh<T>> for PointCloud<T>
[src]
Convert a triangle mesh to a point cloud by erasing all triangle data.
fn from(mesh: TriMesh<T>) -> PointCloud<T>
[src]
impl<T: Real> Merge for PointCloud<T>
[src]
fn merge(&mut self, other: Self) -> &mut Self
[src]
fn merge_iter(iterable: impl IntoIterator<Item = Self>) -> Self where
Self: Default,
[src]
Self: Default,
fn merge_vec(vec: Vec<Self>) -> Self where
Self: Default,
[src]
Self: Default,
fn merge_slice(slice: &[Self]) -> Self where
Self: Clone + Default,
[src]
Self: Clone + Default,
impl<T: Real> NumVertices for PointCloud<T>
[src]
fn num_vertices(&self) -> usize
[src]
impl<T: PartialEq + Real> PartialEq<PointCloud<T>> for PointCloud<T>
[src]
fn eq(&self, other: &PointCloud<T>) -> bool
[src]
fn ne(&self, other: &PointCloud<T>) -> bool
[src]
impl<T: Real> StructuralPartialEq for PointCloud<T>
[src]
impl<T: Real> VertexAttrib for PointCloud<T>
[src]
fn topo_attrib_size(&self) -> usize
[src]
fn topo_attrib_dict(&self) -> &AttribDict<VertexIndex>
[src]
fn topo_attrib_dict_mut(&mut self) -> &mut AttribDict<VertexIndex>
[src]
fn topo_attrib_dict_and_cache_mut(
&mut self
) -> (&mut AttribDict<VertexIndex>, Option<&mut AttribValueCache>)
[src]
&mut self
) -> (&mut AttribDict<VertexIndex>, Option<&mut AttribValueCache>)
impl<T: Real> VertexPositions for PointCloud<T>
[src]
type Element = [T; 3]
fn vertex_positions(&self) -> &[Self::Element]
[src]
fn vertex_positions_mut(&mut self) -> &mut [Self::Element]
[src]
fn vertex_position_iter(&self) -> Iter<'_, Self::Element>
[src]
fn vertex_position_iter_mut(&mut self) -> IterMut<'_, Self::Element>
[src]
fn vertex_position<VI>(&self, vidx: VI) -> Self::Element where
VI: Into<VertexIndex>,
[src]
VI: Into<VertexIndex>,
Auto Trait Implementations
impl<T> RefUnwindSafe for PointCloud<T> where
T: RefUnwindSafe,
[src]
T: RefUnwindSafe,
impl<T> Send for PointCloud<T>
[src]
impl<T> Sync for PointCloud<T>
[src]
impl<T> Unpin for PointCloud<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for PointCloud<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsSlice<T> for T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<M, T> BoundingBox<T> for M where
T: Real,
M: VertexPositions<Element = [T; 3]>,
[src]
T: Real,
M: VertexPositions<Element = [T; 3]>,
pub fn bounding_box(&Self) -> BBox<T>
[src]
Compute the bounding box of this object.
impl<T> CloneBytes for T where
T: 'static + Clone,
[src]
T: 'static + Clone,
pub unsafe fn clone_bytes(
src: &[MaybeUninit<u8>]
) -> Box<[MaybeUninit<u8>], Global>
[src]
src: &[MaybeUninit<u8>]
) -> Box<[MaybeUninit<u8>], Global>
pub unsafe fn clone_from_bytes(
dst: &mut [MaybeUninit<u8>],
src: &[MaybeUninit<u8>]
)
[src]
dst: &mut [MaybeUninit<u8>],
src: &[MaybeUninit<u8>]
)
pub unsafe fn clone_into_raw_bytes(
src: &[MaybeUninit<u8>],
dst: &mut [MaybeUninit<u8>]
)
[src]
src: &[MaybeUninit<u8>],
dst: &mut [MaybeUninit<u8>]
)
impl<T> DebugBytes for T where
T: 'static + Debug,
[src]
T: 'static + Debug,
pub unsafe fn fmt_bytes(
bytes: &[MaybeUninit<u8>],
f: &mut Formatter<'_>
) -> Result<(), Error>
[src]
bytes: &[MaybeUninit<u8>],
f: &mut Formatter<'_>
) -> Result<(), Error>
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Send + Sync + Any,
T: Send + Sync + Any,
impl<T> DropBytes for T where
T: 'static,
[src]
T: 'static,
pub unsafe fn drop_bytes(bytes: &mut [MaybeUninit<u8>])
[src]
impl<T> Elem for T where
T: Any + DropBytes,
[src]
T: Any + DropBytes,
impl<T> From<T> for T
[src]
impl<'a, S, I> Get<'a, I> for S where
I: GetIndex<'a, S>,
[src]
I: GetIndex<'a, S>,
type Output = <I as GetIndex<'a, S>>::Output
pub fn get(&self, idx: I) -> Option<<I as GetIndex<'a, S>>::Output>
[src]
pub fn at(&self, idx: I) -> Self::Output
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<S, I> Isolate<I> for S where
I: IsolateIndex<S>,
[src]
I: IsolateIndex<S>,
type Output = <I as IsolateIndex<S>>::Output
pub unsafe fn isolate_unchecked(self, idx: I) -> <S as Isolate<I>>::Output
[src]
pub fn try_isolate(self, idx: I) -> Option<<S as Isolate<I>>::Output>
[src]
pub fn isolate(self, idx: I) -> Self::Output
[src]
impl<T> PartialEqBytes for T where
T: 'static + PartialEq<T>,
[src]
T: 'static + PartialEq<T>,
impl<M> Partition for M where
M: Attrib,
[src]
M: Attrib,
pub fn partition_by_attrib<T, Src>(&Self, &str) -> (Vec<usize, Global>, usize) where
T: AttributeValueHash,
Src: AttribIndex<M>,
[src]
T: AttributeValueHash,
Src: AttribIndex<M>,
pub fn partition_by_attrib_by_sort<T, Src>(
&Self,
&str
) -> (Vec<usize, Global>, usize) where
T: AttributeValue + PartialOrd<T>,
Src: AttribIndex<M>,
[src]
&Self,
&str
) -> (Vec<usize, Global>, usize) where
T: AttributeValue + PartialOrd<T>,
Src: AttribIndex<M>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T, N> PushArrayToVec<N> for T where
T: Clone,
N: Array<T>,
[src]
T: Clone,
N: Array<T>,
impl<T, M> Rotate<T> for M where
T: BaseFloat,
M: VertexPositions<Element = [T; 3]>,
[src]
T: BaseFloat,
M: VertexPositions<Element = [T; 3]>,
pub fn rotate_by_matrix(&mut Self, [[T; 3]; 3])
[src]
Rotate the mesh using the given column-major rotation matrix.
fn rotate(&mut self, axis: [T; 3], theta: T)
[src]
fn rotate_by_vector(&mut self, e: [T; 3]) where
T: Zero,
[src]
T: Zero,
impl<S, T> Rotated<T> for S where
T: BaseFloat,
S: Rotate<T>,
[src]
T: BaseFloat,
S: Rotate<T>,
pub fn rotated(Self, [T; 3], T) -> S
[src]
pub fn rotated_by_matrix(Self, [[T; 3]; 3]) -> S
[src]
pub fn rotated_by_vector(Self, [T; 3]) -> S
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, M> Scale<T> for M where
T: BaseFloat,
M: VertexPositions<Element = [T; 3]>,
[src]
T: BaseFloat,
M: VertexPositions<Element = [T; 3]>,
pub fn scale(&mut Self, [T; 3])
[src]
Scale a mesh in 3D by a given vector of scale factors.
s = [1.0; 3]
corresponds to a noop.
fn uniform_scale(&mut self, s: T)
[src]
impl<S, T> Scaled<T> for S where
T: Copy,
S: Scale<T>,
[src]
T: Copy,
S: Scale<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, M> Translate<T> for M where
T: BaseFloat,
M: VertexPositions<Element = [T; 3]>,
[src]
T: BaseFloat,
M: VertexPositions<Element = [T; 3]>,
pub fn translate(&mut Self, [T; 3])
[src]
Translate the mesh by the given translation vector (displacement) t
.
impl<S, T> Translated<T> for S where
S: Translate<T>,
[src]
S: Translate<T>,
pub fn translated(Self, [T; 3]) -> S
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<M, T> VertexMesh<T> for M where
T: Real,
M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,
[src]
T: Real,
M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,