Skip to main content

EntityRef

Enum EntityRef 

Source
pub enum EntityRef {
    Vertex {
        name: String,
    },
    Edge {
        name: String,
    },
    Face {
        name: String,
    },
    Datum {
        name: String,
        component: Option<DatumComponent>,
    },
    Solid {
        name: String,
    },
    Sketch {
        name: String,
    },
    SketchCurve {
        sketch: String,
        curve: CurveId,
    },
    SketchPoint {
        sketch: String,
        point: PointId,
    },
}
Expand description

Something picked in the viewport, to build on or to use.

Variants§

§

Vertex

Fields

§name: String
§

Edge

Fields

§name: String
§

Face

A face: planar, its plane — normal pointing out of its solid, sketch origin the world origin’s projection onto it and sketch x the world axis most parallel to it, projected, so sketches on parallel faces line up. Round, its axis.

Fields

§name: String
§

Datum

A datum — or, of a frame, one of its axes or planes (see geop_core_math::primitives::Datum::component). Every part has the frame ORIGIN.

Fields

§name: String
§

Solid

A solid, as a whole.

Fields

§name: String
§

Sketch

A sketch: its plane.

Fields

§name: String
§

SketchCurve

A curve of a sketch, by its id in the sketch.

Fields

§sketch: String
§curve: CurveId
§

SketchPoint

A point of a sketch, by its id in the sketch.

Fields

§sketch: String
§point: PointId

Implementations§

Source§

impl EntityRef

Source

pub fn datum(name: impl Into<String>) -> Self

A datum, as a whole.

Source

pub fn datum_component( name: impl Into<String>, component: DatumComponent, ) -> Self

A component of the frame datum name.

Source

pub fn label(&self) -> String

How the entity is shown: its name, and which component of a frame.

Source§

impl EntityRef

Source

pub fn lies_in(&self, scope: &EntityRef) -> bool

Whether it is scope or part of it: a curve or a point of a sketch.

Source§

impl EntityRef

Source

pub fn resolve_datum<S: Scalar>(&self, part: &Part<S>) -> GeopResult<Datum<S>>

The datum it refers to in part — for a component of a frame, that component as a datum of its own. Fails if it is no datum of the part.

Source

pub fn resolve_plane<S: Scalar>( &self, part: &Part<S>, ) -> GeopResult<CoordinateSystem<S>>

The plane it lies in, as a frame with u/v a sketch’s x/y on it and w = u x v its normal: a planar face’s — normal pointing out of its solid, origin the world origin’s projection onto it and u the world axis most parallel to it, so sketches on parallel faces line up — a datum plane’s, a frame’s plane’s, or a sketch’s. Fails for anything else.

Trait Implementations§

Source§

impl Clone for EntityRef

Source§

fn clone(&self) -> EntityRef

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 Debug for EntityRef

Source§

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

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

impl<'de> Deserialize<'de> for EntityRef

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for EntityRef

Source§

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

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

impl PartialEq for EntityRef

Source§

fn eq(&self, other: &EntityRef) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 Serialize for EntityRef

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

impl StructuralPartialEq for EntityRef

Auto Trait Implementations§

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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.