#[non_exhaustive]pub struct NewObject {Show 17 fields
pub global_id: GlobalId,
pub class: ClassSpec,
pub name: Option<String>,
pub long_name: Option<String>,
pub tag: Option<String>,
pub object_type: Option<String>,
pub placement: NewPlacement,
pub container: Option<ObjectRef>,
pub nest_in: Option<ObjectRef>,
pub type_link: Option<TypeLink>,
pub representation: Representation,
pub style: Option<SurfaceColour>,
pub psets: Vec<NewPropertySet>,
pub opening: Option<NewOpening>,
pub material: Option<MaterialLink>,
pub classifications: Vec<ClassificationLink>,
pub elevation: Option<f64>,
}Expand description
Everything super::Disposition::Add builds.
The plan key paired with an Add names the new object in refusals. It must
not resolve to anything already in the source, and when it is an
ObjectRef::Guid it must equal global_id.encode().
An Add is atomic: any part of the description that cannot be built refuses the whole object, so the output never carries half of one.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.global_id: GlobalId§class: ClassSpec§name: Option<String>§long_name: Option<String>LongName, such as a space’s room name beside the number in name.
Refused where the class has no LongName in the file’s schema.
tag: Option<String>Tag, an identifier such as the authoring tool’s id. Refused where
the class has no Tag in the file’s schema.
object_type: Option<String>ObjectType: what kind of object it is, required with a
USERDEFINED PredefinedType.
placement: NewPlacement§container: Option<ObjectRef>The spatial element the object belongs to. An element is contained
through IfcRelContainedInSpatialStructure; a spatial element (a new
storey or space) is aggregated into it through IfcRelAggregates.
nest_in: Option<ObjectRef>The product this object is nested in, such as a pipe for its port:
one in the source or added earlier in the plan. IFC4 and IFC4X3 nest
it through IfcRelNests. IFC2X3 connects a port to an element
through IfcRelConnectsPortToElement instead, and nests anything
else only under a product of its own class, as IfcRelNests
requires there. A port is nested only in an element and takes no
container. With no placement.relative_to, the object is placed
relative to this product.
type_link: Option<TypeLink>§representation: Representation§style: Option<SurfaceColour>§psets: Vec<NewPropertySet>§opening: Option<NewOpening>§material: Option<MaterialLink>§classifications: Vec<ClassificationLink>Written in the order given; one reference may not appear twice.
elevation: Option<f64>A storey’s Elevation, in the project’s length unit, written as
given. Only an IfcBuildingStorey takes one. It does not move the
storey: its placement is placement.
Implementations§
Source§impl NewObject
impl NewObject
Sourcepub fn new(
global_id: GlobalId,
class: impl Into<ClassSpec>,
placement: NewPlacement,
) -> Self
pub fn new( global_id: GlobalId, class: impl Into<ClassSpec>, placement: NewPlacement, ) -> Self
An object with nothing but its identity, class and placement: no name, container, type, geometry, colour, sets, opening or associations until a setter adds them.
pub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_long_name(self, long_name: impl Into<String>) -> Self
pub fn with_tag(self, tag: impl Into<String>) -> Self
pub fn with_object_type(self, object_type: impl Into<String>) -> Self
pub fn with_container(self, container: ObjectRef) -> Self
pub fn with_nest_in(self, host: ObjectRef) -> Self
pub fn with_type(self, type_link: TypeLink) -> Self
pub fn with_representation(self, representation: Representation) -> Self
pub fn with_style(self, style: SurfaceColour) -> Self
pub fn with_psets(self, psets: Vec<NewPropertySet>) -> Self
pub fn with_opening(self, opening: NewOpening) -> Self
pub fn with_material(self, material: MaterialLink) -> Self
pub fn with_classifications( self, classifications: Vec<ClassificationLink>, ) -> Self
Sourcepub fn with_elevation(self, elevation: f64) -> Self
pub fn with_elevation(self, elevation: f64) -> Self
A storey’s Elevation, in the project’s length unit.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NewObject
impl RefUnwindSafe for NewObject
impl Send for NewObject
impl Sync for NewObject
impl Unpin for NewObject
impl UnwindSafe for NewObject
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere
T: CastFrom<U>,
self to type T. The semantics of numeric casting with the as operator are followed, so <T as As>::as_::<U> can be used in the same way as T as U for numeric conversions. Read moreSource§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.