(* ISO 10303 TC184/SC4/WG12 N8482 EXPRESS Source: ISO 10303-105 ed2 Kinematics - Kinematic topology schema The following permission notice and disclaimer shall be included in all copies of this EXPRESS schema ("the Schema"), and derivations of the Schema: Copyright ISO 2014 All rights reserved Permission is hereby granted, free of charge in perpetuity, to any person obtaining a copy of the Schema, to use, copy, modify, merge and distribute free of charge, copies of the Schema for the purposes of developing, implementing, installing and using software based on the Schema, and to permit persons to whom the Schema is furnished to do so, subject to the following conditions: THE SCHEMA IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SCHEMA OR THE USE OR OTHER DEALINGS IN THE SCHEMA. In addition, any modified copy of the Schema shall include the following notice: THIS SCHEMA HAS BEEN MODIFIED FROM THE SCHEMA DEFINED IN ISO 10303-105 ed2 Kinematics - Kinematic topology schema AND SHOULD NOT BE INTERPRETED AS COMPLYING WITH THAT STANDARD *) SCHEMA kinematic_topology_schema '{iso standard 10303 part(105) version(4) object(1) kinematic_topology_schema(2)}'; REFERENCE FROM representation_schema ( representation ); REFERENCE FROM topology_schema -- LK (connected_edge_set, edge, edge_loop, oriented_edge, path, vertex); TYPE kinematic_topology_representation_select = SELECT ( kinematic_topology_structure, kinematic_topology_directed_structure, kinematic_topology_network_structure ); END_TYPE; ENTITY kinematic_topology_structure SUBTYPE OF (representation); SELF\representation.items : SET[1:?] OF kinematic_joint; WHERE WR1: SIZEOF (QUERY (item <* items | 'TOPOLOGY_SCHEMA.ORIENTED_EDGE' in TYPEOF(item))) = 0; END_ENTITY; (* WR1: None of the items shall be an oriented_edge *) ENTITY kinematic_topology_substructure SUBTYPE OF (kinematic_topology_structure); parent : kinematic_topology_structure; WHERE WR1: context_of_items :=: parent.context_of_items; WR2: SELF\kinematic_topology_structure.items <= parent\kinematic_topology_structure.items; END_ENTITY; (* WR1: A kinematic_topology_substructure shall have the same context as the parent *) (* WR2: The items of a kinematic_topology_substructure shall also be items of the parent *) ENTITY kinematic_topology_directed_structure SUBTYPE OF (representation); SELF\representation.items : SET[1:?] OF oriented_joint; parent : kinematic_topology_structure; WHERE WR1: context_of_items :=: parent.context_of_items; WR2: get_kinematic_joints_from_oriented_joints(items) <= parent.items; END_ENTITY; (* WR1: A kinematic_topology_substructure shall have the same context as the parent *) ENTITY kinematic_topology_tree_structure SUBTYPE OF (kinematic_topology_directed_structure); END_ENTITY; ENTITY kinematic_topology_network_structure SUBTYPE OF (representation); SELF\representation.items : SET[1:?] OF kinematic_loop; parent : kinematic_topology_structure; WHERE WR1: context_of_items :=: parent.context_of_items; WR2: get_kinematic_joints_from_kinematic_loops(items) <= parent.items; END_ENTITY; ENTITY kinematic_joint SUBTYPE OF (edge); SELF\edge.edge_start : kinematic_link; SELF\edge.edge_end : kinematic_link; UNIQUE UR1: edge_start, edge_end; WHERE WR1: edge_start :<>: edge_end; END_ENTITY; (* WR1: Edge_start and edge_end shall be different instances. *) (* UR1: There shall be at most one kinematic_joint for any two kinematic_links *) ENTITY kinematic_link SUBTYPE OF (vertex); END_ENTITY; ENTITY kinematic_loop SUBTYPE OF (edge_loop); SELF\path.edge_list : LIST [1:?] OF UNIQUE oriented_joint; END_ENTITY; ENTITY oriented_joint SUBTYPE OF (oriented_edge); SELF\oriented_edge.edge_element : kinematic_joint; END_ENTITY; FUNCTION get_kinematic_joints_from_oriented_joints(ors : SET OF oriented_joint) : SET OF kinematic_joint; LOCAL result : SET OF kinematic_joint := []; END_LOCAL; IF SIZEOF(ors) > 0 THEN REPEAT i := 1 TO HIINDEX(ors); result := result + ors[i].edge_element; END_REPEAT; END_IF; RETURN (result); END_FUNCTION; FUNCTION get_kinematic_joints_from_kinematic_loops(kls : SET OF kinematic_loop) : SET OF kinematic_joint; LOCAL result : SET OF oriented_joint := []; END_LOCAL; IF SIZEOF(kls) > 0 THEN REPEAT i := 1 TO HIINDEX(kls); result := result + kls[i].edge_list; END_REPEAT; END_IF; RETURN (get_kinematic_joints_from_oriented_joints(result)); END_FUNCTION; SUBTYPE_CONSTRAINT kts_representation_subtypes FOR representation; ONEOF ( kinematic_topology_structure, kinematic_topology_directed_structure, kinematic_topology_network_structure ); END_SUBTYPE_CONSTRAINT; END_SCHEMA;