pub struct MaterialProfileWithOffsets<'m> { /* private fields */ }Expand description
Borrowed projection of IFCMATERIALPROFILEWITHOFFSETS.
Projections handed out by a crate::MaterialView read against the
release the model declares; one built with try_new has no model and
reads against IFC4, as in 0.2.0.
Implementations§
Source§impl<'m> MaterialProfileWithOffsets<'m>
impl<'m> MaterialProfileWithOffsets<'m>
Sourcepub fn try_new(id: EntityId, entity: &'m Entity) -> MaterialResult<Self>
pub fn try_new(id: EntityId, entity: &'m Entity) -> MaterialResult<Self>
Wraps entity as this view after checking it is an instance
of the expected IFC entity type; fails with
crate::MaterialError::WrongEntityType otherwise.
Without a model there is no header to bind, so the projection
reads against IFC4. Use Self::try_from_view to read the
release a model declares.
Sourcepub fn try_from_view(
view: MaterialView<'m>,
id: EntityId,
) -> MaterialResult<Self>
pub fn try_from_view( view: MaterialView<'m>, id: EntityId, ) -> MaterialResult<Self>
Looks up id in the view’s model and projects it against the
release the model declares.
§Errors
crate::MaterialError::UnknownEntity when id is not in
the model, and crate::MaterialError::WrongEntityType when
it is another entity type.
Sourcepub fn schema(self) -> MaterialResult<SchemaVersion>
pub fn schema(self) -> MaterialResult<SchemaVersion>
The release this projection reads against.
§Errors
crate::MaterialError::MultipleSchemas or
crate::MaterialError::UnsupportedSchema when the model’s
header binds none.
Source§impl<'m> MaterialProfileWithOffsets<'m>
impl<'m> MaterialProfileWithOffsets<'m>
Sourcepub fn name(self) -> MaterialResult<Option<&'m str>>
pub fn name(self) -> MaterialResult<Option<&'m str>>
Name, if given.
Sourcepub fn description(self) -> MaterialResult<Option<&'m str>>
pub fn description(self) -> MaterialResult<Option<&'m str>>
Description, if given.
Sourcepub fn material_id(self) -> MaterialResult<Option<EntityId>>
pub fn material_id(self) -> MaterialResult<Option<EntityId>>
Material, the associated IfcMaterial, if given.
Sourcepub fn profile_id(self) -> MaterialResult<EntityId>
pub fn profile_id(self) -> MaterialResult<EntityId>
Profile, the associated IfcProfileDef. Required.
Sourcepub fn priority(self) -> MaterialResult<Option<i64>>
pub fn priority(self) -> MaterialResult<Option<i64>>
Priority, if given. Must be in 0..=100.
Sourcepub fn category(self) -> MaterialResult<Option<&'m str>>
pub fn category(self) -> MaterialResult<Option<&'m str>>
Category, if given.
Source§impl MaterialProfileWithOffsets<'_>
impl MaterialProfileWithOffsets<'_>
Sourcepub fn offset_values(self) -> MaterialResult<[f64; 2]>
pub fn offset_values(self) -> MaterialResult<[f64; 2]>
IfcMaterialProfileWithOffsets.OffsetValues. Required, a 2-element
list.