Skip to main content

Crate ifc_model

Crate ifc_model 

Source
Expand description

ifc-model — the IFC entity graph, free of both domain semantics and serialization.

§The two separations this crate exists to enforce

1. Model vs. domain meaning. Model stores entities. It does not know what a cost item, a task, a wall, or a material is. Domain crates (ifc-cost, ifc-schedule, ifc-properties, …) borrow a &Model and interpret it. Consequences:

  • a thin application compiles only the domains it uses;
  • data we do not understand still round-trips perfectly, because it is stored structurally rather than as a domain struct. A file full of cost entities parses and re-exports intact in a build with no cost crate at all. This is verified by tests/roundtrip.rs.

2. Model vs. serialization. Model is not “the STEP model”. STEP, ifcXML and a prospective IFC-JSON are encodings of the same graph, and each is a separate crate implementing codec::Codec. Nothing here depends on any of them — which is why format conversion is just “read with one, write with another”.

  ifc-step ──┐                        ┌── ifc-cost
  ifc-xml  ──┼── Codec ──> Model <────┼── ifc-schedule      (views)
  ifc-json ──┘   (this crate)         └── ifc-properties

§Modules

ModuleRole
valueThe serialization-independent value model
entityType name plus positional attributes
modelStorage, ordering, type index, reference integrity
headerFile metadata and the declared schema token
codecThe read/write trait every serialization implements
guidIFC’s base-64 GlobalId encoding
diagnosticNon-fatal findings a codec attaches after a recovered read
indexDerived indices: inverse references
mutationTransactional authoring: staged edits, preflight, commit
relationStructural relationship traversal (no domain meaning)
spatialThe spatial containment tree
traverseGraph walks over references
errorFailure modes

Re-exports§

pub use codec::Codec;
pub use diagnostic::Diagnostic;
pub use diagnostic::Severity;
pub use entity::Entity;
pub use error::ModelError;
pub use error::ModelResult;
pub use header::Header;
pub use index::Referrer;
pub use index::ReverseIndex;
pub use model::Model;
pub use mutation::Applied;
pub use mutation::Conflict;
pub use mutation::Edit;
pub use mutation::Transaction;
pub use traverse::breadth_first;
pub use traverse::depth_first;
pub use traverse::find_cycle;
pub use traverse::Budget;
pub use traverse::Stop;
pub use traverse::Walk;
pub use value::EntityId;
pub use value::Value;

Modules§

codec
The serialization seam.
diagnostic
Codec-neutral, non-fatal problems found while reading a model.
entity
The entity record — a type name plus positional attributes.
error
Why a model operation failed.
guid
IFC GlobalId: the 22-character compressed GUID.
header
File-level metadata, independent of serialization.
index
Type buckets and reverse-reference indices.
model
The entity graph — storage, lookup, and nothing else.
mutation
Mutation: checked edits to entities already in the model.
traverse
Graph walks with cycle protection.
value
The IFC value model — serialization-independent.

Traits§

EntitySource
Decodes the entities of a lazily loaded Model.