pub struct MaterialView<'m> { /* private fields */ }Expand description
Borrowed MaterialResource interpretation of a model.
Every projection the view hands out reads against the release the
model’s header declares (see crate::material_schema): slot positions
come from that release’s bundled table, never from IFC4 by assumption.
Implementations§
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn constituents(self) -> impl Iterator<Item = MaterialConstituent<'m>> + 'm
pub fn constituents(self) -> impl Iterator<Item = MaterialConstituent<'m>> + 'm
Iterates every IfcMaterialConstituent instance in the model.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn constituent_sets(
self,
) -> impl Iterator<Item = MaterialConstituentSet<'m>> + 'm
pub fn constituent_sets( self, ) -> impl Iterator<Item = MaterialConstituentSet<'m>> + 'm
Iterates every IfcMaterialConstituentSet instance in the model.
IFC2X3 declares no constituent set: a record of this type in an
IFC2X3 model is still yielded, and every accessor on it fails with
MaterialError::EntityNotInSchema rather than being skipped.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn constituent_fraction_diagnostic(
self,
set: MaterialConstituentSet<'m>,
tolerance: f64,
) -> MaterialResult<Option<ConstituentFractionDiagnostic>>
pub fn constituent_fraction_diagnostic( self, set: MaterialConstituentSet<'m>, tolerance: f64, ) -> MaterialResult<Option<ConstituentFractionDiagnostic>>
Opt-in policy check that a constituent set’s fractions make one whole.
Returns Ok(None) when every constituent states a fraction and the
sum is within tolerance of 1, when no constituent states one, and
when the set lists no constituents. A sum outside the tolerance is
ConstituentFractionDiagnostic::SumNotOne; a mix of stated and
missing fractions is
ConstituentFractionDiagnostic::PartiallyStated. The file is never
corrected: fractions are reported as authored.
A negative or NaN tolerance admits no sum, so every fully stated
set is reported.
§Errors
The decode errors of the underlying accessors: a malformed member
list, a member id absent from the model or not an
IfcMaterialConstituent, or a fraction outside 0..=1. The
diagnostic itself is never an error.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn layers(self) -> impl Iterator<Item = MaterialLayer<'m>> + 'm
pub fn layers(self) -> impl Iterator<Item = MaterialLayer<'m>> + 'm
Iterates every IfcMaterialLayer instance in the model.
Sourcepub fn layers_with_offsets(
self,
) -> impl Iterator<Item = MaterialLayerWithOffsets<'m>> + 'm
pub fn layers_with_offsets( self, ) -> impl Iterator<Item = MaterialLayerWithOffsets<'m>> + 'm
Iterates every IfcMaterialLayerWithOffsets instance in the model.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn layer_sets(self) -> impl Iterator<Item = MaterialLayerSet<'m>> + 'm
pub fn layer_sets(self) -> impl Iterator<Item = MaterialLayerSet<'m>> + 'm
Iterates every IfcMaterialLayerSet instance in the model.
Sourcepub fn total_thickness(self, set: MaterialLayerSet<'m>) -> MaterialResult<f64>
pub fn total_thickness(self, set: MaterialLayerSet<'m>) -> MaterialResult<f64>
Evaluate the normative IfcMlsTotalThickness function.
Each member is read against the set’s release: an
IfcMaterialLayerWithOffsets member of an IFC2X3 set is
EntityNotInSchema, and a zero IFC2X3 thickness is invalid.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn layer_set_usages(
self,
) -> impl Iterator<Item = MaterialLayerSetUsage<'m>> + 'm
pub fn layer_set_usages( self, ) -> impl Iterator<Item = MaterialLayerSetUsage<'m>> + 'm
Iterates every IfcMaterialLayerSetUsage instance in the model.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn material_properties(
self,
) -> impl Iterator<Item = MaterialProperties<'m>> + 'm
pub fn material_properties( self, ) -> impl Iterator<Item = MaterialProperties<'m>> + 'm
Iterates every IfcMaterialProperties instance in the model.
Sourcepub fn properties_for(
self,
material: EntityId,
) -> impl Iterator<Item = MaterialResult<MaterialProperties<'m>>> + 'm
pub fn properties_for( self, material: EntityId, ) -> impl Iterator<Item = MaterialResult<MaterialProperties<'m>>> + 'm
Iterates every IfcMaterialProperties whose Material attribute
resolves to material, surfacing malformed records as errors rather
than skipping them.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn classification_relationships(
self,
) -> impl Iterator<Item = MaterialClassificationRelationship<'m>> + 'm
pub fn classification_relationships( self, ) -> impl Iterator<Item = MaterialClassificationRelationship<'m>> + 'm
Iterates every IfcMaterialClassificationRelationship in the model.
Sourcepub fn material_lists(self) -> impl Iterator<Item = MaterialList<'m>> + 'm
pub fn material_lists(self) -> impl Iterator<Item = MaterialList<'m>> + 'm
Iterates every IfcMaterialList instance in the model.
Sourcepub fn material_relationships(
self,
) -> impl Iterator<Item = MaterialRelationship<'m>> + 'm
pub fn material_relationships( self, ) -> impl Iterator<Item = MaterialRelationship<'m>> + 'm
Iterates every IfcMaterialRelationship instance in the model.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn profiles(self) -> impl Iterator<Item = MaterialProfile<'m>> + 'm
pub fn profiles(self) -> impl Iterator<Item = MaterialProfile<'m>> + 'm
Iterates every IfcMaterialProfile instance in the model.
Sourcepub fn profiles_with_offsets(
self,
) -> impl Iterator<Item = MaterialProfileWithOffsets<'m>> + 'm
pub fn profiles_with_offsets( self, ) -> impl Iterator<Item = MaterialProfileWithOffsets<'m>> + 'm
Iterates every IfcMaterialProfileWithOffsets instance in the model.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn profile_sets(self) -> impl Iterator<Item = MaterialProfileSet<'m>> + 'm
pub fn profile_sets(self) -> impl Iterator<Item = MaterialProfileSet<'m>> + 'm
Iterates every IfcMaterialProfileSet instance in the model.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn profile_set_usages(
self,
) -> impl Iterator<Item = MaterialProfileSetUsage<'m>> + 'm
pub fn profile_set_usages( self, ) -> impl Iterator<Item = MaterialProfileSetUsage<'m>> + 'm
Iterates every IfcMaterialProfileSetUsage instance in the model.
Sourcepub fn tapering_profile_set_usages(
self,
) -> impl Iterator<Item = MaterialProfileSetUsageTapering<'m>> + 'm
pub fn tapering_profile_set_usages( self, ) -> impl Iterator<Item = MaterialProfileSetUsageTapering<'m>> + 'm
Iterates every IfcMaterialProfileSetUsageTapering instance in the
model.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn assignments(self) -> impl Iterator<Item = MaterialAssignment<'m>> + 'm
pub fn assignments(self) -> impl Iterator<Item = MaterialAssignment<'m>> + 'm
Iterates every IfcRelAssociatesMaterial instance in the model.
Sourcepub fn assignments_for(
self,
object: EntityId,
) -> MaterialResult<Vec<MaterialAssignment<'m>>>
pub fn assignments_for( self, object: EntityId, ) -> MaterialResult<Vec<MaterialAssignment<'m>>>
Collects every IfcRelAssociatesMaterial whose RelatedObjects
includes object. Multiple hits indicate an ambiguous direct
assignment; callers that need a single answer should check the
result length themselves or use assigned_material.
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn material_definitions(
self,
) -> impl Iterator<Item = MaterialDefinition<'m>> + 'm
pub fn material_definitions( self, ) -> impl Iterator<Item = MaterialDefinition<'m>> + 'm
Every concrete subtype of the abstract IfcMaterialDefinition.
Yields by type name; a record the model’s release does not declare
(an IFC2X3 constituent set, say) is still yielded, and its accessors
fail with MaterialError::EntityNotInSchema.
Sourcepub fn material_usage_definitions(
self,
) -> impl Iterator<Item = MaterialUsageDefinition<'m>> + 'm
pub fn material_usage_definitions( self, ) -> impl Iterator<Item = MaterialUsageDefinition<'m>> + 'm
Every concrete subtype of the abstract IfcMaterialUsageDefinition.
Yields by type name, as Self::material_definitions does.
Sourcepub fn resolve_material_select(
self,
id: EntityId,
) -> MaterialResult<ResolvedMaterialSelect<'m>>
pub fn resolve_material_select( self, id: EntityId, ) -> MaterialResult<ResolvedMaterialSelect<'m>>
Resolves id as an IfcMaterialSelect branch of the model’s release
by dispatching on its concrete IFC entity type.
§Errors
MaterialError::WrongEntityType if id names an entity that is no
MaterialResource select member;
MaterialError::EntityNotInSchema if it is a member of another
release only, such as an IfcMaterialConstituentSet or
IfcMaterialProfileSet in an IFC2X3 model; and the release-binding
errors when the header binds no release.
Sourcepub fn assigned_material(
self,
object: EntityId,
) -> MaterialResult<Option<ResolvedAssignment<'m>>>
pub fn assigned_material( self, object: EntityId, ) -> MaterialResult<Option<ResolvedAssignment<'m>>>
Resolves the single material that applies to object, preferring a
direct IfcRelAssociatesMaterial on the object itself and falling
back to the material assigned to its IfcTypeObject via
IfcRelDefinesByType. Returns Ok(None) if neither exists. Fails
with crate::MaterialError::AmbiguousAssignment or
crate::MaterialError::AmbiguousType if more than one candidate is
found at either level, and with
crate::MaterialError::UnknownEntity if object is not in the
model.
Every record is read against the model’s release, so an IFC2X3 model resolves with IFC2X3 slots and type objects.
The type fallback is exactly one IfcRelDefinesByType hop, and two
such relations are ambiguous even when they name the same type: the
file states the typing twice, and this lookup does not guess which
statement was meant. (ifc-resource deliberately accepts a repeated
relation naming the same type.)
Source§impl<'m> MaterialView<'m>
impl<'m> MaterialView<'m>
Sourcepub fn new(model: &'m Model) -> Self
pub fn new(model: &'m Model) -> Self
Wraps a model reference for MaterialResource projection, bound to the release its header declares.
Sourcepub fn schema(self) -> MaterialResult<SchemaVersion>
pub fn schema(self) -> MaterialResult<SchemaVersion>
The release this view’s projections read against.
§Errors
MaterialError::MultipleSchemas or
MaterialError::UnsupportedSchema when the header binds none.