예제 #1
0
        internal IfcGeometricRepresentationSubContext(DatabaseIfc db, IfcGeometricRepresentationSubContext s, DuplicateOptions options) : base(db, s, options)
        {
            IfcGeometricRepresentationContext parent = s.ParentContext;

            if (parent != null)
            {
                IfcGeometricRepresentationContext.GeometricContextIdentifier contextId = IfcGeometricRepresentationContext.GeometricContextIdentifier.Model;
                if (Enum.TryParse <IfcGeometricRepresentationSubContext.GeometricContextIdentifier>(s.ContextType, out contextId))
                {
                    IfcGeometricRepresentationContext existing = null;
                    if (db.Factory.mContexts.TryGetValue(contextId, out existing))
                    {
                        ParentContext = existing;
                    }
                }
            }
            if (ParentContext == null)
            {
                ParentContext = db.Factory.Duplicate(s.ParentContext, options) as IfcGeometricRepresentationContext;
            }

            mTargetScale           = s.mTargetScale;
            mTargetView            = s.mTargetView;
            mUserDefinedTargetView = s.mUserDefinedTargetView;
            IfcGeometricRepresentationSubContext.SubContextIdentifier id = IfcGeometricRepresentationSubContext.SubContextIdentifier.Axis;
            if (Enum.TryParse <IfcGeometricRepresentationSubContext.SubContextIdentifier>(ContextIdentifier, out id))
            {
                db.Factory.mSubContexts[id] = this;
            }
        }
예제 #2
0
        internal IfcGeometricRepresentationContext(DatabaseIfc db, IfcGeometricRepresentationContext c, DuplicateOptions options) : base(db, c, options)
        {
            mCoordinateSpaceDimension = c.mCoordinateSpaceDimension;
            mPrecision = c.mPrecision;
            if (c.mWorldCoordinateSystem != null)
            {
                WorldCoordinateSystem = db.Factory.Duplicate <IfcAxis2Placement>(c.mWorldCoordinateSystem);
            }
            if (c.mTrueNorth != null)
            {
                TrueNorth = db.Factory.Duplicate(c.TrueNorth) as IfcDirection;
            }

            if (options.DuplicateDownstream)
            {
                foreach (IfcGeometricRepresentationSubContext sc in c.mHasSubContexts)
                {
                    db.Factory.Duplicate(sc, options);
                }
            }

            if (c.mHasCoordinateOperation != null)
            {
                db.Factory.Duplicate(c.mHasCoordinateOperation, options);
            }

            IfcGeometricRepresentationSubContext subContext = this as IfcGeometricRepresentationSubContext;

            if (subContext == null)
            {
                IfcGeometricRepresentationContext.GeometricContextIdentifier id = IfcGeometricRepresentationContext.GeometricContextIdentifier.Model;
                if (Enum.TryParse <IfcGeometricRepresentationContext.GeometricContextIdentifier>(ContextType, out id))
                {
                    db.Factory.mContexts[id] = this;
                }
                if (db.Context != null)
                {
                    db.Context.RepresentationContexts.Add(this);
                }
            }
        }