Exemple #1
0
        override protected void Process(IFCAnyHandle item)
        {
            base.Process(item);

            // We will not fail if the transform is not given, but instead assume it to be the identity.
            IFCAnyHandle mappingTarget = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "MappingTarget", false);

            if (mappingTarget != null)
            {
                MappingTarget = IFCCartesianTransformOperator.ProcessIFCCartesianTransformOperator(mappingTarget);
            }
            else
            {
                MappingTarget = IFCCartesianTransformOperator.ProcessIFCCartesianTransformOperator();
            }

            IFCAnyHandle mappingSource = IFCImportHandleUtil.GetRequiredInstanceAttribute(item, "MappingSource", false);

            if (mappingSource == null)
            {
                return;
            }

            MappingSource = IFCRepresentationMap.ProcessIFCRepresentationMap(mappingSource);
        }
        override protected void Process(IFCAnyHandle ifcDerivedProfileDef)
        {
            base.Process(ifcDerivedProfileDef);

            IFCAnyHandle ifcParentProfile = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcDerivedProfileDef, "ParentProfile", true);

            ParentProfile = IFCProfileDef.ProcessIFCProfileDef(ifcParentProfile);

            IFCAnyHandle ifcOperator = IFCImportHandleUtil.GetRequiredInstanceAttribute(ifcDerivedProfileDef, "Operator", true);

            Operator = IFCCartesianTransformOperator.ProcessIFCCartesianTransformOperator(ifcOperator);

            Label = IFCAnyHandleUtil.GetStringAttribute(ifcDerivedProfileDef, "Label");
        }
        /// <summary>
        /// Creates an IFCCartesianTransformOperator corresponding to an IFC handle.
        /// </summary>
        /// <param name="item">The handle.</param>
        /// <returns>The IFCCartesianTransformOperator.</returns>
        public static IFCCartesianTransformOperator ProcessIFCCartesianTransformOperator(IFCAnyHandle ifcTransformOperator)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcTransformOperator))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcCartesianTransformationOperator);
                return(null);
            }

            IFCEntity transformOperator;

            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcTransformOperator.StepId, out transformOperator))
            {
                transformOperator = new IFCCartesianTransformOperator(ifcTransformOperator);
            }
            return(transformOperator as IFCCartesianTransformOperator);
        }
        /// <summary>
        /// Creates an IFCCartesianTransformOperator corresponding to an IFC handle.
        /// </summary>
        /// <param name="item">The handle.</param>
        /// <returns>The IFCCartesianTransformOperator.</returns>
        public static IFCCartesianTransformOperator ProcessIFCCartesianTransformOperator(IFCAnyHandle ifcTransformOperator)
        {
            if (IFCAnyHandleUtil.IsNullOrHasNoValue(ifcTransformOperator))
            {
                Importer.TheLog.LogNullError(IFCEntityType.IfcCartesianTransformationOperator);
                return null;
            }

            IFCEntity transformOperator;
            if (!IFCImportFile.TheFile.EntityMap.TryGetValue(ifcTransformOperator.StepId, out transformOperator))
                transformOperator = new IFCCartesianTransformOperator(ifcTransformOperator);
            return (transformOperator as IFCCartesianTransformOperator); 
        }