pub enum Object<F: Form> {
    Curve(F::Form<Curve>),
    Cycle(F::Form<Cycle>),
    Face(F::Form<Face>),
    GlobalCurve(F::Form<GlobalCurve>),
    GlobalEdge(F::Form<GlobalEdge>),
    GlobalVertex(F::Form<GlobalVertex>),
    HalfEdge(F::Form<HalfEdge>),
    Shell(F::Form<Shell>),
    Sketch(F::Form<Sketch>),
    Solid(F::Form<Solid>),
    Surface(F::Form<Surface>),
    SurfaceVertex(F::Form<SurfaceVertex>),
}
Expand description

An object

This enum is generic over the form that the object takes. An Object<Bare> contains bare objects, like Curve. An Object<BehindHandle> contains handles, like Handle<Curve>.

Variants§

§

Curve(F::Form<Curve>)

A curve

§

Cycle(F::Form<Cycle>)

A cycle

§

Face(F::Form<Face>)

A face

§

GlobalCurve(F::Form<GlobalCurve>)

A global curve

§

GlobalEdge(F::Form<GlobalEdge>)

A global edge

§

GlobalVertex(F::Form<GlobalVertex>)

A global vertex

§

HalfEdge(F::Form<HalfEdge>)

A half-edge

§

Shell(F::Form<Shell>)

A shell

§

Sketch(F::Form<Sketch>)

A sketch

§

Solid(F::Form<Solid>)

A solid

§

Surface(F::Form<Surface>)

A surface

§

SurfaceVertex(F::Form<SurfaceVertex>)

A surface vertex

Implementations§

source§

impl<F: Form> Object<F>

source

pub fn as_inner<T>(&self) -> Option<&F::Form<T>>where
    Self: 'static,
    F::Form<T>: Any,

Convert the Object into the requested inner type

source§

impl Object<BehindHandle>

source

pub fn id(&self) -> ObjectId

Access the ID of the object

source§

impl Object<WithHandle>

source

pub fn insert(self, objects: &mut Objects) -> Object<BehindHandle>

Insert the object into its respective store

source

pub fn validate(&self, errors: &mut Vec<ValidationError>)

Validate the object

Trait Implementations§

source§

impl<F: Clone + Form> Clone for Object<F>where
    F::Form<Curve>: Clone,
    F::Form<Cycle>: Clone,
    F::Form<Face>: Clone,
    F::Form<GlobalCurve>: Clone,
    F::Form<GlobalEdge>: Clone,
    F::Form<GlobalVertex>: Clone,
    F::Form<HalfEdge>: Clone,
    F::Form<Shell>: Clone,
    F::Form<Sketch>: Clone,
    F::Form<Solid>: Clone,
    F::Form<Surface>: Clone,
    F::Form<SurfaceVertex>: Clone,

source§

fn clone(&self) -> Object<F>

Returns a copy 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<F: Debug + Form> Debug for Object<F>where
    F::Form<Curve>: Debug,
    F::Form<Cycle>: Debug,
    F::Form<Face>: Debug,
    F::Form<GlobalCurve>: Debug,
    F::Form<GlobalEdge>: Debug,
    F::Form<GlobalVertex>: Debug,
    F::Form<HalfEdge>: Debug,
    F::Form<Shell>: Debug,
    F::Form<Sketch>: Debug,
    F::Form<Solid>: Debug,
    F::Form<Surface>: Debug,
    F::Form<SurfaceVertex>: Debug,

source§

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

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

impl From<(Handle<Curve>, Curve)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<Curve>, Curve)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Cycle>, Cycle)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<Cycle>, Cycle)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Face>, Face)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<Face>, Face)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<GlobalCurve>, GlobalCurve)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<GlobalCurve>, GlobalCurve)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<GlobalEdge>, GlobalEdge)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<GlobalEdge>, GlobalEdge)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<GlobalVertex>, GlobalVertex)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<GlobalVertex>, GlobalVertex)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<HalfEdge>, HalfEdge)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<HalfEdge>, HalfEdge)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Shell>, Shell)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<Shell>, Shell)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Sketch>, Sketch)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<Sketch>, Sketch)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Solid>, Solid)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<Solid>, Solid)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<Surface>, Surface)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<Surface>, Surface)) -> Self

Converts to this type from the input type.
source§

impl From<(Handle<SurfaceVertex>, SurfaceVertex)> for Object<WithHandle>

source§

fn from((handle, object): (Handle<SurfaceVertex>, SurfaceVertex)) -> Self

Converts to this type from the input type.
source§

impl From<Curve> for Object<Bare>

source§

fn from(object: Curve) -> Self

Converts to this type from the input type.
source§

impl From<Cycle> for Object<Bare>

source§

fn from(object: Cycle) -> Self

Converts to this type from the input type.
source§

impl From<Face> for Object<Bare>

source§

fn from(object: Face) -> Self

Converts to this type from the input type.
source§

impl From<GlobalCurve> for Object<Bare>

source§

fn from(object: GlobalCurve) -> Self

Converts to this type from the input type.
source§

impl From<GlobalEdge> for Object<Bare>

source§

fn from(object: GlobalEdge) -> Self

Converts to this type from the input type.
source§

impl From<GlobalVertex> for Object<Bare>

source§

fn from(object: GlobalVertex) -> Self

Converts to this type from the input type.
source§

impl From<HalfEdge> for Object<Bare>

source§

fn from(object: HalfEdge) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Curve>> for Object<BehindHandle>

source§

fn from(object: Handle<Curve>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Cycle>> for Object<BehindHandle>

source§

fn from(object: Handle<Cycle>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Face>> for Object<BehindHandle>

source§

fn from(object: Handle<Face>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<GlobalCurve>> for Object<BehindHandle>

source§

fn from(object: Handle<GlobalCurve>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<GlobalEdge>> for Object<BehindHandle>

source§

fn from(object: Handle<GlobalEdge>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<GlobalVertex>> for Object<BehindHandle>

source§

fn from(object: Handle<GlobalVertex>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<HalfEdge>> for Object<BehindHandle>

source§

fn from(object: Handle<HalfEdge>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Shell>> for Object<BehindHandle>

source§

fn from(object: Handle<Shell>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Sketch>> for Object<BehindHandle>

source§

fn from(object: Handle<Sketch>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Solid>> for Object<BehindHandle>

source§

fn from(object: Handle<Solid>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<Surface>> for Object<BehindHandle>

source§

fn from(object: Handle<Surface>) -> Self

Converts to this type from the input type.
source§

impl From<Handle<SurfaceVertex>> for Object<BehindHandle>

source§

fn from(object: Handle<SurfaceVertex>) -> Self

Converts to this type from the input type.
source§

impl From<Object<WithHandle>> for Object<BehindHandle>

source§

fn from(object: Object<WithHandle>) -> Self

Converts to this type from the input type.
source§

impl From<Shell> for Object<Bare>

source§

fn from(object: Shell) -> Self

Converts to this type from the input type.
source§

impl From<Sketch> for Object<Bare>

source§

fn from(object: Sketch) -> Self

Converts to this type from the input type.
source§

impl From<Solid> for Object<Bare>

source§

fn from(object: Solid) -> Self

Converts to this type from the input type.
source§

impl From<Surface> for Object<Bare>

source§

fn from(object: Surface) -> Self

Converts to this type from the input type.
source§

impl From<SurfaceVertex> for Object<Bare>

source§

fn from(object: SurfaceVertex) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for Object<F>where
    <F as Form>::Form<Curve>: RefUnwindSafe,
    <F as Form>::Form<GlobalCurve>: RefUnwindSafe,
    <F as Form>::Form<Cycle>: RefUnwindSafe,
    <F as Form>::Form<HalfEdge>: RefUnwindSafe,
    <F as Form>::Form<GlobalEdge>: RefUnwindSafe,
    <F as Form>::Form<Face>: RefUnwindSafe,
    <F as Form>::Form<Shell>: RefUnwindSafe,
    <F as Form>::Form<Sketch>: RefUnwindSafe,
    <F as Form>::Form<Solid>: RefUnwindSafe,
    <F as Form>::Form<Surface>: RefUnwindSafe,
    <F as Form>::Form<SurfaceVertex>: RefUnwindSafe,
    <F as Form>::Form<GlobalVertex>: RefUnwindSafe,

§

impl<F> Send for Object<F>where
    <F as Form>::Form<Curve>: Send,
    <F as Form>::Form<GlobalCurve>: Send,
    <F as Form>::Form<Cycle>: Send,
    <F as Form>::Form<HalfEdge>: Send,
    <F as Form>::Form<GlobalEdge>: Send,
    <F as Form>::Form<Face>: Send,
    <F as Form>::Form<Shell>: Send,
    <F as Form>::Form<Sketch>: Send,
    <F as Form>::Form<Solid>: Send,
    <F as Form>::Form<Surface>: Send,
    <F as Form>::Form<SurfaceVertex>: Send,
    <F as Form>::Form<GlobalVertex>: Send,

§

impl<F> Sync for Object<F>where
    <F as Form>::Form<Curve>: Sync,
    <F as Form>::Form<GlobalCurve>: Sync,
    <F as Form>::Form<Cycle>: Sync,
    <F as Form>::Form<HalfEdge>: Sync,
    <F as Form>::Form<GlobalEdge>: Sync,
    <F as Form>::Form<Face>: Sync,
    <F as Form>::Form<Shell>: Sync,
    <F as Form>::Form<Sketch>: Sync,
    <F as Form>::Form<Solid>: Sync,
    <F as Form>::Form<Surface>: Sync,
    <F as Form>::Form<SurfaceVertex>: Sync,
    <F as Form>::Form<GlobalVertex>: Sync,

§

impl<F> Unpin for Object<F>where
    <F as Form>::Form<Curve>: Unpin,
    <F as Form>::Form<GlobalCurve>: Unpin,
    <F as Form>::Form<Cycle>: Unpin,
    <F as Form>::Form<HalfEdge>: Unpin,
    <F as Form>::Form<GlobalEdge>: Unpin,
    <F as Form>::Form<Face>: Unpin,
    <F as Form>::Form<Shell>: Unpin,
    <F as Form>::Form<Sketch>: Unpin,
    <F as Form>::Form<Solid>: Unpin,
    <F as Form>::Form<Surface>: Unpin,
    <F as Form>::Form<SurfaceVertex>: Unpin,
    <F as Form>::Form<GlobalVertex>: Unpin,

§

impl<F> UnwindSafe for Object<F>where
    <F as Form>::Form<Curve>: UnwindSafe,
    <F as Form>::Form<GlobalCurve>: UnwindSafe,
    <F as Form>::Form<Cycle>: UnwindSafe,
    <F as Form>::Form<HalfEdge>: UnwindSafe,
    <F as Form>::Form<GlobalEdge>: UnwindSafe,
    <F as Form>::Form<Face>: UnwindSafe,
    <F as Form>::Form<Shell>: UnwindSafe,
    <F as Form>::Form<Sketch>: UnwindSafe,
    <F as Form>::Form<Solid>: UnwindSafe,
    <F as Form>::Form<Surface>: UnwindSafe,
    <F as Form>::Form<SurfaceVertex>: UnwindSafe,
    <F as Form>::Form<GlobalVertex>: UnwindSafe,

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Downcast for Twhere
    T: Any,

§

fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>

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

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>

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

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

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

impl<T> DowncastSync for Twhere
    T: Any + Send + Sync,

§

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

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> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> Same<T> for T

§

type Output = T

Should always be Self
§

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

§

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

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

fn is_in_subset(&self) -> bool

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

fn to_subset_unchecked(&self) -> SS

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

fn from_subset(element: &SS) -> SP

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

impl<T> ToOwned for Twhere
    T: Clone,

§

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 Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.