Skip to main content

PartView

Struct PartView 

Source
pub struct PartView<S: Scalar> {
    pub vertices: Vec<ViewVertex<S>>,
    pub edges: Vec<ViewEdge<S>>,
    pub faces: Vec<ViewFace<S>>,
    pub sketches: Vec<ViewSketch<S>>,
    pub datums: Vec<ViewDatum<S>>,
    pub solids: Vec<String>,
    pub extent: Extent<S>,
}
Expand description

A part as the viewport draws it, every entity by name — and, serialized, what a viewer draws.

Fields§

§vertices: Vec<ViewVertex<S>>§edges: Vec<ViewEdge<S>>§faces: Vec<ViewFace<S>>§sketches: Vec<ViewSketch<S>>§datums: Vec<ViewDatum<S>>§solids: Vec<String>

The part’s solids, oldest first.

§extent: Extent<S>

Implementations§

Source§

impl<S: Scalar> PartView<S>

Source

pub fn of(part: &Part<S>) -> GeopResult<Self>

part as drawn.

Source

pub fn pick( &self, pointer: &Pointer<S>, roles: &[Role], scope: Option<&EntityRef>, ) -> Option<PartHit<S>>

Whatever the pointer is over that can fill one of roles — and, with a scope, is part of it: a line of one sketch. Frame datums are drawn on top of everything, so they are picked first. Otherwise a vertex or a sketch point, else an edge or a sketch curve, near the pointer — and not hidden behind a face — wins: the smallest entity under the pointer is the one meant. Else the nearest along the ray of the faces, solids, sketches and other datums hit.

Source

pub fn can_fill(&self, entity: &EntityRef, roles: &[Role]) -> bool

Whether entity — a sketch or a datum — or a part of it can fill one of roles: whether a pick for them could take something of it.

Trait Implementations§

Source§

impl<S: Clone + Scalar> Clone for PartView<S>

Source§

fn clone(&self) -> PartView<S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<S: Debug + Scalar> Debug for PartView<S>

Source§

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

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

impl<S> Serialize for PartView<S>
where S: Scalar,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<S> Freeze for PartView<S>
where S: Freeze,

§

impl<S> RefUnwindSafe for PartView<S>
where S: RefUnwindSafe,

§

impl<S> Send for PartView<S>

§

impl<S> Sync for PartView<S>

§

impl<S> Unpin for PartView<S>
where S: Unpin,

§

impl<S> UnsafeUnpin for PartView<S>
where S: UnsafeUnpin,

§

impl<S> UnwindSafe for PartView<S>
where S: 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<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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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, 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.