| standard library package Items { |
| doc |
| |
| |
| |
| |
|
|
| private import Objects::Object; |
| private import Objects::objects; |
| private import Parts::Part; |
| private import Parts::parts; |
| private import Occurrences::HappensWhile; |
| private import Occurrences::JustOutsideOf; |
| private import Objects::StructuredSpaceObject; |
| private import Constraints::ConstraintCheck; |
| private import Constraints::constraintChecks; |
| private import CollectionFunctions::contains; |
| private import SequenceFunctions::isEmpty; |
| private import SequenceFunctions::notEmpty; |
| private import SequenceFunctions::includes; |
| private import SequenceFunctions::union; |
| private import ControlFunctions::forAll; |
| |
| abstract item def Item :> Object { |
| doc |
| |
| |
| |
| |
| |
| ref self: Item :>> Object::self; |
| |
| item start: Item :>> startShot; |
| item done: Item :>> endShot; |
| |
| item shape : Item :>> spaceBoundary { |
| doc |
| |
| |
| |
| } |
| |
| item envelopingShapes : Item[0..*] { |
| doc |
| |
| |
| |
| |
|
|
| |
| attribute :>> innerSpaceDimension = |
| if (that as Item).innerSpaceDimension == 3 | (that as Item).outerSpaceDimension == 3? 2 |
| else (that as Item).outerSpaceDimension - 1 { |
| doc |
| |
| |
| |
| } |
| assert constraint { (that as Item).innerSpaceDimension < 3 implies notEmpty(outerSpaceDimension) } |
|
|
| item envelopingItem [1]; |
|
|
| assert constraint { |
| doc |
| |
| |
| |
| |
| envelopingItem.shape.spaceTimeCoincidentOccurrences->includes(that) and |
| envelopingItem.spaceTimeEnclosedOccurrences->includes(that.that) |
| } |
| } |
| |
| item boundingShapes : StructuredSpaceObject [0..*] :> envelopingShapes { |
| doc |
| |
| |
| |
| |
|
|
| item boundingShape: Item :>> self; |
|
|
| item :>> faces { |
| item face :>> self; |
| item inter [1]; |
| assert constraint { contains(inter.intersectionsOf, union(face, boundingShape)) } |
| } |
| item :>> edges { |
| item edge :>> self; |
| item inter [1]; |
| assert constraint { isEmpty(faces) implies |
| contains(inter.intersectionsOf, union(edge, boundingShape)) } |
| } |
| } |
| |
| item voids :>> innerSpaceOccurrences [0..*] { |
| doc |
| |
| |
| |
| } |
|
|
| attribute isSolid = isEmpty(voids) { |
| doc |
| |
| |
| |
| } |
| |
| abstract item subitems: Item[0..*] :> items, subobjects { |
| doc |
| |
| |
| |
| } |
| |
| abstract part subparts: Part[0..*] :> subitems, parts { |
| doc |
| |
| |
| |
| } |
| |
| abstract constraint checkedConstraints: ConstraintCheck[0..*] :> constraintChecks, ownedPerformances { |
| doc |
| |
| |
| |
| } |
| } |
| |
| connection def Touches :> JustOutsideOf, HappensWhile { |
| doc |
| |
| |
| |
| |
| end item touchedItemToo [0..*] :>> separateSpaceToo, thisOccurrence; |
| end item touchedItem [0..*] :>> separateSpace, thatOccurrence; |
| } |
|
|
| abstract item items : Item[0..*] nonunique :> objects { |
| doc |
| |
| |
| |
| } |
| |
| } |