Expand description
ifc-cost — cost semantics as a view over the model.
§This crate owns no data
It borrows a &Model and interprets entities that happen to be cost
entities. That is the whole design: the model stores structure, this crate
supplies meaning, and the two are separable.
The consequences are the point:
- Optional. An application that never touches cost compiles none of
this. It is a cargo feature of the
ifcfacade crate. - Non-destructive. Because the model holds the same entities with or
without this crate, a file with cost data round-trips identically in
either build. Verified in
ifc/tests/costing_roundtrip.rs, which runs with no domain crate compiled at all. - Replaceable. A different interpretation of the same entities is another crate, not a fork of the model.
§Modules
| Module | Role |
|---|---|
view | CostView: the entry point, borrows a &Model |
item | IfcCostItem: the individual line |
schedule | IfcCostSchedule: the containing document |
value | IfcCostValue and applied monetary values |
quantity | Quantities a cost is computed against |
relation | Nesting and control assignment |
mutation | Transaction-staged bounded IFC4 authoring; release-bound quantities |
currency | Monetary unit agreement |
rollup | Summing a cost tree |
error | Why a cost lookup failed |
use ifc_cost::CostView;
use ifc_model::{Entity, EntityId, Model, Value};
let mut model = Model::new();
model.insert(
EntityId(1),
Entity::new("IFCCOSTITEM", vec![
Value::Text("guid".into()), Value::Null, Value::Text("Excavation".into()),
]),
);
let view = CostView::new(&model);
assert_eq!(view.items().next().unwrap().name(), Some("Excavation"));Re-exports§
pub use currency::monetary_units;pub use currency::project_currency;pub use currency::CurrencyError;pub use error::CostError;pub use item::CostItem;pub use mutation::assign_schedule_items;pub use mutation::assign_schedule_items_with_owner_history;pub use mutation::create_cost_item;pub use mutation::create_cost_item_with_owner_history;pub use mutation::create_cost_schedule;pub use mutation::create_cost_schedule_with_owner_history;pub use mutation::create_cost_value;pub use mutation::create_currency_relationship;pub use mutation::create_monetary_unit;pub use mutation::nest_cost_items;pub use mutation::nest_cost_items_with_owner_history;pub use mutation::CostAuthoringError;pub use mutation::CostAuthoringResult;pub use mutation::CostItemDraft;pub use mutation::CostItemType;pub use mutation::CostScheduleDraft;pub use mutation::CostScheduleType;pub use mutation::CostValueDraft;pub use mutation::CostValueKind;pub use mutation::NestingDraft;pub use mutation::ScheduleAssignmentDraft;pub use quantity::CostQuantity;pub use relation::children_of;pub use relation::controlled_by;pub use relation::controls_of;pub use relation::descendants_of;pub use relation::nesting_anomalies;pub use relation::parent_of;pub use relation::parents_of;pub use relation::CostAnomaly;pub use relation::CostRelationError;pub use relation::MAX_NESTING_DEPTH;pub use rollup::consistency;pub use rollup::direct_total;pub use rollup::grand_total;pub use rollup::rolled_up_total;pub use rollup::roots;pub use rollup::Consistency;pub use schedule::CostSchedule;pub use value::ArithmeticOperator;pub use value::CostValue;pub use value::UnitBasis;pub use view::CostView;
Modules§
- currency
- Currency and dimensional agreement for cost arithmetic.
- error
- Why a cost lookup failed.
- item
IfcCostItem— one line in a cost schedule.- mutation
- Transaction-staged cost authoring.
- quantity
- Quantities a cost is computed against.
- relation
- Cost item nesting and control assignment.
- rollup
- Totalling a cost tree.
- schedule
IfcCostSchedule— the document containing cost items.- value
IfcCostValueand the applied-value tree beneath it.- view
- The cost view: the entry point for reading cost data out of a model.
Enums§
- Schema
Version - The IFC release a release-bound authoring error names (re-exported from
ifc-schema). Which IFC schema version a table describes.