Skip to main content

ModelCommand

Enum ModelCommand 

Source
pub enum ModelCommand {
Show 13 variants CreateElement { element: Box<ElementRecord>, }, DeleteElement { global_id: GlobalId, }, SetName { global_id: GlobalId, name: Option<String>, }, SetProperty { global_id: GlobalId, set: String, name: String, value: Option<PropertyValue>, }, MoveElement { global_id: GlobalId, delta: DVec3, }, SetPlacement { global_id: GlobalId, placement: Placement, }, AssignContainer { global_id: GlobalId, container: Option<GlobalId>, }, SetRepresentation { global_id: GlobalId, representation: Option<Box<Representation>>, }, AssignType { global_id: GlobalId, type_ref: Option<GlobalId>, }, AddVoid { host: GlobalId, opening: GlobalId, }, RemoveVoid { host: GlobalId, opening: GlobalId, }, AddFill { opening: GlobalId, filler: GlobalId, }, RemoveFill { opening: GlobalId, filler: GlobalId, },
}
Expand description

A single durable edit.

Variants§

§

CreateElement

Insert an element. Boxed because this variant is far larger than the others and would otherwise inflate every command in the log.

Fields

§

DeleteElement

Fields

§global_id: GlobalId
§

SetName

Fields

§global_id: GlobalId
§

SetProperty

Fields

§global_id: GlobalId
§name: String
§value: Option<PropertyValue>

None clears the property.

§

MoveElement

Translate an element. Kept distinct from SetPlacement because its inverse is exact without reading the current state.

Fields

§global_id: GlobalId
§delta: DVec3
§

SetPlacement

Fields

§global_id: GlobalId
§placement: Placement
§

AssignContainer

IfcRelContainedInSpatialStructure.

Fields

§global_id: GlobalId
§container: Option<GlobalId>
§

SetRepresentation

Attach evaluated geometry. None clears it.

A command rather than a cache write, unlike bounds: the representation is what gets exported to IFC, so it is part of the model and belongs in the audit trail.

Fields

§global_id: GlobalId
§representation: Option<Box<Representation>>
§

AssignType

IfcRelDefinesByType — bind an instance to a family type.

Fields

§global_id: GlobalId
§type_ref: Option<GlobalId>
§

AddVoid

IfcRelVoidsElement — an opening cuts its host.

Fields

§opening: GlobalId
§

RemoveVoid

Fields

§opening: GlobalId
§

AddFill

IfcRelFillsElement — a door or window fills an opening.

Fields

§opening: GlobalId
§filler: GlobalId
§

RemoveFill

Fields

§opening: GlobalId
§filler: GlobalId

Implementations§

Source§

impl ModelCommand

Source

pub fn primary_target(&self) -> &GlobalId

The element this command is about, for permission checks and change reporting.

Source

pub fn invalidates_geometry(&self) -> bool

Whether applying this command requires geometry to be rebuilt.

A rename must not invalidate a mesh — that distinction is the whole point of tracking semantic_revision separately from representation_revision.

Trait Implementations§

Source§

impl Clone for ModelCommand

Source§

fn clone(&self) -> ModelCommand

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 ModelCommand

Source§

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

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

impl<'de> Deserialize<'de> for ModelCommand

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 PartialEq for ModelCommand

Source§

fn eq(&self, other: &ModelCommand) -> 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 ModelCommand

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 ModelCommand

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