FUNCTION check_associative_shape_aspects
(sdr : shape_definition_representation) : BOOLEAN;
LOCAL sr1, sr2 : SET OF representation; dm, pv : SET OF representation; END_LOCAL; -- Check IF the representation contains only two items IF (SIZEOF (sdr.used_representation.items) <> 2) THEN RETURN (FALSE); END_IF; -- Find the representations that USE each item sr1 := using_representations(sdr.used_representation.items[1]); sr2 := using_representations(sdr.used_representation.items[2]); -- Find the representations IN which item 1 representations are mapped REPEAT i := 1 TO HIINDEX(sr1); dm := representations_mapped_into(sr1[i]); REPEAT j := 1 TO HIINDEX(dm); IF ('AIC_ASSOCIATIVE_DRAUGHTING_ELEMENTS.DRAUGHTING_MODEL' IN TYPEOF(dm[j])) THEN IF (dm[j] IN sr2) THEN RETURN (TRUE); END_IF; -- Find the views that the draughting model is mapped into pv := representations_mapped_into(dm[j]); REPEAT k := 1 TO HIINDEX(pv); IF ('AIC_ASSOCIATIVE_DRAUGHTING_ELEMENTS.PRESENTATION_VIEW' IN TYPEOF(pv[k])) THEN IF (pv[k] IN sr2) THEN RETURN (TRUE); END_IF; END_IF; END_REPEAT; END_IF; END_REPEAT; END_REPEAT; -- Find the representations IN which item 2 representations are mapped REPEAT i := 1 TO HIINDEX(sr2); dm := representations_mapped_into(sr2[i]); REPEAT j := 1 TO HIINDEX(dm); IF ('AIC_ASSOCIATIVE_DRAUGHTING_ELEMENTS.DRAUGHTING_MODEL' IN TYPEOF(dm[j])) THEN IF (dm[j] IN sr1) THEN RETURN (TRUE); END_IF; -- Find the views that the draughting model is mapped into pv := representations_mapped_into(dm[j]); REPEAT k := 1 TO HIINDEX(pv); IF ('AIC_ASSOCIATIVE_DRAUGHTING_ELEMENTS.PRESENTATION_VIEW' IN TYPEOF(pv[k])) THEN IF (pv[k] IN sr1) THEN RETURN (TRUE); END_IF; END_IF; END_REPEAT; END_IF; END_REPEAT; END_REPEAT; RETURN(FALSE); END_FUNCTION; -- check_associative_shape_aspects
|