[−][src]Struct gut::mesh::pointcloud::PointCloud
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.
Methods
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> NumVertices for PointCloud<T>
[src]
fn num_vertices(&self) -> usize
[src]
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 add_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn add_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
[src]
&mut self,
name: &'a str,
data: Vec<T>
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
fn set_attrib<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn set_attrib_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
[src]
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
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: Any + Clone,
[src]
&mut self,
name: &'a str,
def: T
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone,
fn attrib_or_add_data<'a, T, I: AttribIndex<Self>>(
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
[src]
&mut self,
name: &'a str,
data: &[T]
) -> Result<&mut Attribute<I>, Error> where
T: Any + Clone + Default,
fn attrib_iter<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b self,
name: &'a str
) -> Result<Iter<T>, Error> where
T: 'static + Clone,
[src]
&'b self,
name: &'a str
) -> Result<Iter<T>, Error> where
T: 'static + Clone,
fn attrib_iter_mut<'a, 'b, T, I: 'b + AttribIndex<Self>>(
&'b mut self,
name: &'a str
) -> Result<IterMut<T>, Error> where
T: 'static + Clone,
[src]
&'b mut self,
name: &'a str
) -> Result<IterMut<T>, Error> where
T: 'static + Clone,
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<(), Error>
[src]
&self,
name: &'a str
) -> Result<(), 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: 'static + Clone,
[src]
&'b self,
name: &'a str
) -> Result<Vec<T>, Error> where
T: 'static + Clone,
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: 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>,
impl<T: Real> VertexAttrib for PointCloud<T>
[src]
fn impl_attrib_size(&self) -> usize
[src]
fn impl_attrib_dict(&self) -> &AttribDict<VertexIndex>
[src]
fn impl_attrib_dict_mut(&mut self) -> &mut AttribDict<VertexIndex>
[src]
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<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<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> 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<PointCloud<T>> for PolyMesh<T>
[src]
Convert a point cloud into a polygon mesh.
fn from(mesh: PointCloud<T>) -> PolyMesh<T>
[src]
impl<T: Clone + Real> Clone for PointCloud<T>
[src]
fn clone(&self) -> PointCloud<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[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: Debug + Real> Debug for PointCloud<T>
[src]
impl<T: Real> StructuralPartialEq for PointCloud<T>
[src]
Auto Trait Implementations
impl<T> Send for PointCloud<T>
impl<T> Sync for PointCloud<T>
impl<T> Unpin for PointCloud<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for PointCloud<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for PointCloud<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T, M> Scale<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
[src]
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
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<T, M> Rotate<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
[src]
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
fn rotate_by_matrix(&mut Self, [[T; 3]; 3])
[src]
Rotate the mesh using the given column-major rotation matrix.
fn rotate(&mut self, [x, y, z]: [T; 3], theta: T)
[src]
fn rotate_by_vector(&mut self, e: [T; 3]) where
T: Zero,
[src]
T: Zero,
impl<T, M> Translate<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
[src]
M: VertexPositions<Element = [T; 3]>,
T: BaseFloat,
fn translate(&mut Self, [T; 3])
[src]
Translate the mesh by the given translation vector (displacement) t
.
impl<S, T> Scaled<T> for S where
S: Scale<T>,
T: Copy,
[src]
S: Scale<T>,
T: Copy,
impl<S, T> Rotated<T> for S where
S: Rotate<T>,
T: BaseFloat,
[src]
S: Rotate<T>,
T: BaseFloat,
fn rotated(Self, [T; 3], T) -> S
[src]
fn rotated_by_matrix(Self, [[T; 3]; 3]) -> S
[src]
fn rotated_by_vector(Self, [T; 3]) -> S
[src]
impl<S, T> Translated<T> for S where
S: Translate<T>,
[src]
S: Translate<T>,
fn translated(Self, [T; 3]) -> S
[src]
impl<M, T> BoundingBox<T> for M where
M: VertexPositions<Element = [T; 3]>,
T: Real,
[src]
M: VertexPositions<Element = [T; 3]>,
T: Real,
fn bounding_box(&Self) -> BBox<T>
[src]
Compute the bounding box of this object.
impl<T> Bytes for T
[src]
impl<M, T> VertexMesh<T> for M where
M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,
T: Real,
[src]
M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>,
T: Real,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
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.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,