AECgeeks / infra-repo-issue-test-2

0 stars 0 forks source link

Remove IfcObjectTypeEnum #15

Open aothms opened 2 years ago

aothms commented 2 years ago

Remove type only accesible to long deprecated usage. Also remove accompanying function, and change IfcRelAssigns. As discussed in https://github.com/bSI-InfraRoom/IFC-Specification/pull/465

aothms commented 2 years ago
--- tmp/a/IFC.exp   2022-08-27 15:33:10.020098500 +0200
+++ tmp/b/IFC.exp   2022-09-05 20:19:55.183657600 +0200
@@ -2100,31 +2100,20 @@
    ,NOTDEFINED);
 END_TYPE;

 TYPE IfcNavigationElementTypeEnum = ENUMERATION OF
    (BEACON
    ,BUOY
    ,USERDEFINED
    ,NOTDEFINED);
 END_TYPE;

-TYPE IfcObjectTypeEnum = ENUMERATION OF
-   (ACTOR
-   ,CONTROL
-   ,GROUP
-   ,PROCESS
-   ,PRODUCT
-   ,PROJECT
-   ,RESOURCE
-   ,NOTDEFINED);
-END_TYPE;
-
 TYPE IfcObjectiveEnum = ENUMERATION OF
    (CODECOMPLIANCE
    ,CODEWAIVER
    ,DESIGNINTENT
    ,EXTERNAL
    ,HEALTHANDSAFETY
    ,MERGECONFLICT
    ,MODELVIEW
    ,PARAMETER
    ,REQUIREMENT
@@ -9546,23 +9535,21 @@
 ENTITY IfcRelAssigns
  ABSTRACT SUPERTYPE OF (ONEOF
    (IfcRelAssignsToActor
    ,IfcRelAssignsToControl
    ,IfcRelAssignsToGroup
    ,IfcRelAssignsToProcess
    ,IfcRelAssignsToProduct
    ,IfcRelAssignsToResource))
  SUBTYPE OF (IfcRelationship);
    RelatedObjects : SET [1:?] OF IfcObjectDefinition;
-   RelatedObjectsType : OPTIONAL IfcObjectTypeEnum;
- WHERE
-   WR1 : IfcCorrectObjectAssignment(RelatedObjectsType, RelatedObjects);
+   RelatedObjectsType : OPTIONAL IfcStrippedOptional;
 END_ENTITY;

 ENTITY IfcRelAssignsToActor
  SUBTYPE OF (IfcRelAssigns);
    RelatingActor : IfcActor;
    ActingRole : OPTIONAL IfcActorRole;
  WHERE
    NoSelfReference : SIZEOF(QUERY(Temp <* SELF\IfcRelAssigns.RelatedObjects | RelatingActor :=: Temp)) = 0;
 END_ENTITY;

@@ -12672,74 +12659,20 @@
         END_IF;
       END_IF;
     END_IF;
   ELSE
     RETURN(TRUE);  
   END_IF;
   RETURN(?);

 END_FUNCTION;

-FUNCTION IfcCorrectObjectAssignment
-  (Constraint: IfcObjectTypeEnum; Objects : SET[1:?] OF IfcObjectDefinition)
-  : LOGICAL ;
-  
-LOCAL
-  Count : INTEGER := 0;
-END_LOCAL;
-
-    IF NOT(EXISTS(Constraint)) THEN 
-      RETURN(TRUE);
-    END_IF;
-  
-    CASE Constraint OF
-      IfcObjectTypeEnum.NOTDEFINED : RETURN(TRUE);
-      IfcObjectTypeEnum.PRODUCT :
-        BEGIN
-          Count := SIZEOF(QUERY(temp <* Objects | NOT('IFC4X3_DEV.IFCPRODUCT' IN TYPEOF(temp))));
-          RETURN(Count = 0);
-        END;
-      IfcObjectTypeEnum.PROCESS :
-        BEGIN
-          Count := SIZEOF(QUERY(temp <* Objects | NOT('IFC4X3_DEV.IFCPROCESS' IN TYPEOF(temp))));
-          RETURN(Count = 0);
-        END;
-      IfcObjectTypeEnum.CONTROL :
-        BEGIN
-          Count := SIZEOF(QUERY(temp <* Objects | NOT('IFC4X3_DEV.IFCCONTROL' IN TYPEOF(temp))));
-          RETURN(Count = 0);
-        END;
-      IfcObjectTypeEnum.RESOURCE :
-        BEGIN
-          Count := SIZEOF(QUERY(temp <* Objects | NOT('IFC4X3_DEV.IFCRESOURCE' IN TYPEOF(temp))));
-          RETURN(Count = 0);
-        END;
-      IfcObjectTypeEnum.ACTOR :
-        BEGIN
-          Count := SIZEOF(QUERY(temp <* Objects | NOT('IFC4X3_DEV.IFCACTOR' IN TYPEOF(temp))));
-          RETURN(Count = 0);
-        END;
-      IfcObjectTypeEnum.GROUP :
-        BEGIN
-          Count := SIZEOF(QUERY(temp <* Objects | NOT('IFC4X3_DEV.IFCGROUP' IN TYPEOF(temp))));
-          RETURN(Count = 0);
-        END;
-      IfcObjectTypeEnum.PROJECT :
-        BEGIN
-          Count := SIZEOF(QUERY(temp <* Objects | NOT('IFC4X3_DEV.IFCPROJECT' IN TYPEOF(temp))));
-          RETURN(Count = 0);
-        END;
-      OTHERWISE : RETURN(?);
-    END_CASE;
-
-END_FUNCTION;
-
 FUNCTION IfcCorrectUnitAssignment
   (Units : SET [1:?] OF IfcUnit)
    : LOGICAL;

   LOCAL
     NamedUnitNumber    : INTEGER := 0;
     DerivedUnitNumber  : INTEGER := 0;
     MonetaryUnitNumber : INTEGER := 0;
     NamedUnitNames     : SET OF IfcUnitEnum := [];
     DerivedUnitNames   : SET OF IfcDerivedUnitEnum := [];