pub struct ResourceView<'m, 's> { /* private fields */ }Expand description
Borrowed, schema-resolved entry point for the bounded IFC4 resource slice: 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.
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.
IfcTypeObject.Types is an inverse SET [0:1]: an occurrence may be
typed by at most one relation. A second authored relation naming the
same occurrence is a modeling defect, reported as a typed refusal
rather than silently picking the first or last match.
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 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 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 (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.