pub struct ResourceView<'m, 's> { /* private fields */ }Expand description
Borrowed, schema-resolved entry point for the bounded resource slice (IFC2X3 TC1, IFC4 ADD2 TC1, IFC4X3 ADD2): pairs a model with the schema selected for it and exposes per-entity projection and query methods.
Implementations§
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn allocation(&self, id: EntityId) -> ResourceResult<ResourceAllocation>
pub fn allocation(&self, id: EntityId) -> ResourceResult<ResourceAllocation>
Projects an IfcRelAssignsToResource relation by entity id.
Sourcepub fn allocations_for(
&self,
resource: EntityId,
) -> ResourceResult<Vec<ResourceAllocation>>
pub fn allocations_for( &self, resource: EntityId, ) -> ResourceResult<Vec<ResourceAllocation>>
Every IfcRelAssignsToResource relation naming this resource as
RelatingResource, in ancestor order.
Under IFC2X3 an IfcConstructionMaterialResource or
IfcConstructionProductResource also carries the release’s WR1
(at most one such relation) and WR2 (its RelatedObjectsType, when
authored, is PRODUCT); a violation is a typed refusal.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn parent_resource(
&self,
child: EntityId,
) -> ResourceResult<Option<EntityId>>
pub fn parent_resource( &self, child: EntityId, ) -> ResourceResult<Option<EntityId>>
Return the authored construction-resource parent, if any.
Sourcepub fn direct_members(&self, parent: EntityId) -> ResourceResult<Vec<EntityId>>
pub fn direct_members(&self, parent: EntityId) -> ResourceResult<Vec<EntityId>>
Return direct authored members in relation/LIST order.
Sourcepub fn descendants(
&self,
root: EntityId,
budget: Budget,
) -> ResourceResult<Vec<EntityId>>
pub fn descendants( &self, root: EntityId, budget: Budget, ) -> ResourceResult<Vec<EntityId>>
Return depth-first authored descendants within explicit limits.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn resource_type(
&self,
id: EntityId,
) -> ResourceResult<ConstructionResourceType<'m, 's>>
pub fn resource_type( &self, id: EntityId, ) -> ResourceResult<ConstructionResourceType<'m, 's>>
Projects a resource-type catalog entry by entity id.
Sourcepub fn assigned_resource_type(
&self,
occurrence: EntityId,
) -> ResourceResult<Option<EntityId>>
pub fn assigned_resource_type( &self, occurrence: EntityId, ) -> ResourceResult<Option<EntityId>>
Resolves the IfcConstructionResourceType assigned to a construction
resource occurrence through IfcRelDefinesByType, if any.
An occurrence may be typed by at most one type. A second authored
relation assigning a different type is a modeling defect, reported
as a typed refusal rather than silently picking the first or last
match. A repeated relation naming the same type states the same fact
twice and is accepted. (ifc-material treats even that as ambiguous
for its material lookup.)
IFC2X3 declares no IfcConstructionResourceType, so this refuses
with ResourceError::NotInSchema there instead of answering None.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn simple_quantity(
&self,
id: EntityId,
) -> ResourceResult<SimpleQuantity<'m, 's>>
pub fn simple_quantity( &self, id: EntityId, ) -> ResourceResult<SimpleQuantity<'m, 's>>
Projects an IfcPhysicalSimpleQuantity by entity id.
Sourcepub fn measure_with_unit(
&self,
id: EntityId,
) -> ResourceResult<MeasureWithUnit<'m, 's>>
pub fn measure_with_unit( &self, id: EntityId, ) -> ResourceResult<MeasureWithUnit<'m, 's>>
Projects an IfcMeasureWithUnit by entity id: the IFC2X3
BaseQuantity form (see
ConstructionResource::base_quantity_measure).
Sourcepub fn complex_quantity(
&self,
id: EntityId,
) -> ResourceResult<ComplexQuantity<'m, 's>>
pub fn complex_quantity( &self, id: EntityId, ) -> ResourceResult<ComplexQuantity<'m, 's>>
Projects an IfcPhysicalComplexQuantity by entity id.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn new(model: &'m Model, schema: &'s Schema) -> ResourceResult<Self>
pub fn new(model: &'m Model, schema: &'s Schema) -> ResourceResult<Self>
Builds a view over model using an explicit schema, failing if
schema is not IFC2X3, IFC4 or IFC4X3, or does not match the model’s
declared FILE_SCHEMA token.
Sourcepub fn resource(
&self,
id: EntityId,
) -> ResourceResult<ConstructionResource<'m, 's>>
pub fn resource( &self, id: EntityId, ) -> ResourceResult<ConstructionResource<'m, 's>>
Projects a concrete IfcConstructionResource occurrence by entity
id.
Sourcepub fn resource_time(
&self,
id: EntityId,
) -> ResourceResult<ResourceTime<'m, 's>>
pub fn resource_time( &self, id: EntityId, ) -> ResourceResult<ResourceTime<'m, 's>>
Projects an IfcResourceTime by entity id.
Source§impl<'m> ResourceView<'m, 'static>
impl<'m> ResourceView<'m, 'static>
Sourcepub fn for_model(model: &'m Model) -> ResourceResult<Self>
pub fn for_model(model: &'m Model) -> ResourceResult<Self>
Selects the bundled schema matching the model’s declared
FILE_SCHEMA token (IFC2X3 TC1, IFC4 ADD2 TC1 or IFC4X3 ADD2),
failing if the header names no schema, more than one, or an
unsupported one.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn organization_relationship(
&self,
id: EntityId,
) -> ResourceResult<OrganizationRelationship<'m, 's>>
pub fn organization_relationship( &self, id: EntityId, ) -> ResourceResult<OrganizationRelationship<'m, 's>>
Projects an IfcOrganizationRelationship by entity id.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn person(&self, id: EntityId) -> ResourceResult<Person<'m, 's>>
pub fn person(&self, id: EntityId) -> ResourceResult<Person<'m, 's>>
Projects an IfcPerson by entity id.
Sourcepub fn organization(&self, id: EntityId) -> ResourceResult<Organization<'m, 's>>
pub fn organization(&self, id: EntityId) -> ResourceResult<Organization<'m, 's>>
Projects an IfcOrganization by entity id.
Sourcepub fn actor_role(&self, id: EntityId) -> ResourceResult<ActorRole<'m, 's>>
pub fn actor_role(&self, id: EntityId) -> ResourceResult<ActorRole<'m, 's>>
Projects an IfcActorRole by entity id.
Sourcepub fn person_and_organization(
&self,
id: EntityId,
) -> ResourceResult<PersonAndOrganization<'m, 's>>
pub fn person_and_organization( &self, id: EntityId, ) -> ResourceResult<PersonAndOrganization<'m, 's>>
Projects an IfcPersonAndOrganization by entity id.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn inventory_items(
&self,
inventory: EntityId,
) -> ResourceResult<Vec<EntityId>>
pub fn inventory_items( &self, inventory: EntityId, ) -> ResourceResult<Vec<EntityId>>
Members of an IfcInventory group, authored order, via
IfcRelAssignsToGroup.RelatingGroup.
IfcGroup.IsGroupedBy is SET [0:?]: an inventory may be named by
several assignment relations. Members from every authored relation
are concatenated in relation-then-list order; duplicates across
relations are preserved verbatim rather than deduplicated, since the
schema does not require assignment relations to be disjoint.
Source§impl<'m, 's> ResourceView<'m, 's>
impl<'m, 's> ResourceView<'m, 's>
Sourcepub fn inventory(&self, id: EntityId) -> ResourceResult<Inventory<'m, 's>>
pub fn inventory(&self, id: EntityId) -> ResourceResult<Inventory<'m, 's>>
Projects an IfcInventory by entity id.
Trait Implementations§
Source§impl<'m, 's> Clone for ResourceView<'m, 's>
impl<'m, 's> Clone for ResourceView<'m, 's>
Source§fn clone(&self) -> ResourceView<'m, 's>
fn clone(&self) -> ResourceView<'m, 's>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more