Esempio n. 1
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.IfcParse(propIndex, value);
                break;

            case 2:
                _parentProfile = (IfcProfileDef)value.EntityVal;
                break;

            case 3:
                _operator = (IfcCartesianTransformationOperator2D)value.EntityVal;
                break;

            case 4:
                _label = value.StringVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
            case 1:
                base.Parse(propIndex, value, nestedIndex);
                return;

            case 2:
                _parentProfile = (IfcProfileDef)(value.EntityVal);
                return;

            case 3:
                _operator = (IfcCartesianTransformationOperator2D)(value.EntityVal);
                return;

            case 4:
                _label = value.StringVal;
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlackBox.Aisc.EM11.DerivedProfile"/> class.
        /// </summary>
        /// <param name='parentProfile'>
        /// Parent profile.
        /// </param>
        /// <param name='mirrorXAxis'>
        /// If set to <c>true</c> mirror X axis.
        /// </param>
        /// <param name='mirrorYAxis'>
        /// If set to <c>true</c> mirror Y axis.
        /// </param>
        public BbDerivedProfile(BbProfile parentProfile, bool mirrorXAxis, bool mirrorYAxis)
            : this(parentProfile)
        {
            IfcDirection axis1 = null;
            IfcDirection axis2 = null;

            if (mirrorXAxis && mirrorYAxis)
            {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;
            }
            else if (mirrorXAxis && !mirrorYAxis)
            {
                axis1 = BbHeaderSetting.Setting3D.XAxis2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;
            }
            else if (!mirrorXAxis && mirrorYAxis)
            {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxis2D.IfcDirection;
            }


            var ifcCartesianTransformationOperator2D
                = new IfcCartesianTransformationOperator2D {
                Axis1       = axis1,
                Axis2       = axis2,
                LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
                Scale       = 1,
                };
            _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
        }
Esempio n. 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BlackBox.Aisc.EM11.DerivedProfile"/> class.
        /// </summary>
        /// <param name='parentProfile'>
        /// Parent profile.
        /// </param>
        /// <param name='mirrorXAxis'>
        /// If set to <c>true</c> mirror X axis.
        /// </param>
        /// <param name='mirrorYAxis'>
        /// If set to <c>true</c> mirror Y axis.
        /// </param>
        public BbDerivedProfile(BbProfile parentProfile, bool mirrorXAxis, bool mirrorYAxis)
            : this(parentProfile)
        {
            IfcDirection axis1 = null;
            IfcDirection axis2 = null;

            if (mirrorXAxis && mirrorYAxis) {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;

            } else if (mirrorXAxis && !mirrorYAxis) {
                axis1 = BbHeaderSetting.Setting3D.XAxis2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxisMinus2D.IfcDirection;
            } else if (!mirrorXAxis && mirrorYAxis) {
                axis1 = BbHeaderSetting.Setting3D.XAxisMinus2D.IfcDirection;
                axis2 = BbHeaderSetting.Setting3D.YAxis2D.IfcDirection;
            }

            var ifcCartesianTransformationOperator2D
            = new IfcCartesianTransformationOperator2D{
                Axis1 = axis1,
                Axis2 = axis2,
                LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
                Scale = 1,
            };
            _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
        }
Esempio n. 5
0
 public IfcDerivedProfileDef(IfcProfileTypeEnum __ProfileType, IfcLabel?__ProfileName, IfcProfileDef __ParentProfile, IfcCartesianTransformationOperator2D __Operator, IfcLabel?__Label)
     : base(__ProfileType, __ProfileName)
 {
     this._ParentProfile = __ParentProfile;
     this._Operator      = __Operator;
     this._Label         = __Label;
 }
Esempio n. 6
0
 public IfcSurfaceTexture(Boolean __RepeatS, Boolean __RepeatT, IfcSurfaceTextureEnum __TextureType, IfcCartesianTransformationOperator2D __TextureTransform)
 {
     this._RepeatS          = __RepeatS;
     this._RepeatT          = __RepeatT;
     this._TextureType      = __TextureType;
     this._TextureTransform = __TextureTransform;
 }
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _repeatS = value.BooleanVal;
                return;

            case 1:
                _repeatT = value.BooleanVal;
                return;

            case 2:
                _mode = value.StringVal;
                return;

            case 3:
                _textureTransform = (IfcCartesianTransformationOperator2D)(value.EntityVal);
                return;

            case 4:
                _parameter.InternalAdd(value.StringVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
        public virtual void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _repeatS = value.BooleanVal;
                break;

            case 1:
                _repeatT = value.BooleanVal;
                break;

            case 2:
                _textureType =
                    (IfcSurfaceTextureEnum)Enum.Parse(typeof(IfcSurfaceTextureEnum), value.EnumVal, true);
                break;

            case 3:
                _textureTransform = (IfcCartesianTransformationOperator2D)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Esempio n. 9
0
        protected virtual Transform vecsTransform()
        {
            Vector3d  vx = Vector3d.XAxis, vy = Vector3d.YAxis;
            Transform tr = Rhino.Geometry.Transform.Identity;

            if (mAxis1 != null)
            {
                vx     = Axis1.Vector3d;
                tr.M00 = vx.X;
                tr.M10 = vx.Y;
                tr.M20 = vx.Z;
            }
            if (mAxis2 != null)
            {
                vy = Axis2.Vector3d;
            }
            else
            {
                IfcCartesianTransformationOperator2D placement2D = this as IfcCartesianTransformationOperator2D;
                if (placement2D != null)
                {
                    vy = Vector3d.CrossProduct(Vector3d.ZAxis, vx);
                }
            }
            tr.M01 = vy.X;
            tr.M11 = vy.Y;
            tr.M21 = vy.Z;
            return(tr);
        }
Esempio n. 10
0
 public IfcSurfaceTexture(IfcBoolean __RepeatS, IfcBoolean __RepeatT, IfcIdentifier?__Mode, IfcCartesianTransformationOperator2D __TextureTransform, IfcIdentifier[] __Parameter)
 {
     this._RepeatS          = __RepeatS;
     this._RepeatT          = __RepeatT;
     this._Mode             = __Mode;
     this._TextureTransform = __TextureTransform;
     this._Parameter        = new List <IfcIdentifier>(__Parameter);
 }
Esempio n. 11
0
        /// <summary>
        /// Compares two objects for geomtric equality
        /// </summary>
        /// <param name="a"></param>
        /// <param name="b">object to compare with</param>
        /// <returns></returns>
        public static bool GeometricEquals(this IfcCartesianTransformationOperator2D a, IfcCartesianTransformationOperator2D b)
        {
            bool originEqual = a.LocalOrigin.GeometricEquals(b.LocalOrigin);
            bool axis1Equal  = (a.Axis1 != null && b.Axis1 != null && a.Axis1.GeometricEquals(b.Axis1)) || (a.Axis1 == null && b.Axis1 == null);
            bool axis2Equal  = (a.Axis2 != null && b.Axis2 != null && a.Axis2.GeometricEquals(b.Axis2)) || (a.Axis2 == null && b.Axis2 == null);
            bool scaleEqual  = a.Scale.Value == b.Scale.Value;

            return(originEqual && axis1Equal && axis2Equal && scaleEqual);
        }
Esempio n. 12
0
 public BbDerivedProfile(BbProfile parentProfile, double rotationRadian)
     : this(parentProfile)
 {
     var ifcCartesianTransformationOperator2D
         = new IfcCartesianTransformationOperator2D {
         Axis1       = new IfcDirection(Math.Cos(rotationRadian), Math.Sin(rotationRadian)),
         Axis2       = new IfcDirection(-Math.Sin(rotationRadian), Math.Cos(rotationRadian)),
         LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
         Scale       = 1,
         };
     _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
 }
Esempio n. 13
0
        public BbDerivedProfile(BbProfile parentProfile, double rotationRadian)
            : this(parentProfile)
        {
            var ifcCartesianTransformationOperator2D
            = new IfcCartesianTransformationOperator2D{

                Axis1 = new IfcDirection(Math.Cos(rotationRadian), Math.Sin(rotationRadian)),
                Axis2 = new IfcDirection(-Math.Sin(rotationRadian), Math.Cos(rotationRadian)),
                LocalOrigin = BbHeaderSetting.Setting3D.Origin2D.IfcCartesianPoint,
                Scale = 1,
            };
            _ifcDerivedProfileDef.Operator = ifcCartesianTransformationOperator2D;
        }
Esempio n. 14
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _definition = (IfcDefinedSymbolSelect)(value.EntityVal);
                return;

            case 1:
                _target = (IfcCartesianTransformationOperator2D)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Esempio n. 15
0
        public override void IfcParse(int propIndex, IPropertyValue value)
        {
            switch (propIndex)
            {
            case 0:
                _definition = (IfcDefinedSymbolSelect)value.EntityVal;
                break;

            case 1:
                _target = (IfcCartesianTransformationOperator2D)value.EntityVal;
                break;

            default:
                this.HandleUnexpectedAttribute(propIndex, value); break;
            }
        }
Esempio n. 16
0
        /// <summary>
        /// returns a Hash for the geometric behaviour of this object
        /// </summary>
        /// <param name="solid"></param>
        /// <returns></returns>
        public static int GetGeometryHashCode(this IfcCartesianTransformationOperator2D transform)
        {
            int hash = transform.LocalOrigin.GetGeometryHashCode();

            if (transform.Axis1 != null)
            {
                hash ^= transform.Axis1.GetGeometryHashCode();
            }
            if (transform.Axis2 != null)
            {
                hash ^= transform.Axis2.GetGeometryHashCode();
            }
            if (transform.Scale.HasValue)
            {
                hash ^= transform.Scale.Value.GetHashCode();
            }
            return(hash);
        }
Esempio n. 17
0
        public override void Parse(int propIndex, IPropertyValue value, int[] nestedIndex)
        {
            switch (propIndex)
            {
            case 0:
                _repeatS = value.BooleanVal;
                return;

            case 1:
                _repeatT = value.BooleanVal;
                return;

            case 2:
                _textureType = (IfcSurfaceTextureEnum)System.Enum.Parse(typeof(IfcSurfaceTextureEnum), value.EnumVal, true);
                return;

            case 3:
                _textureTransform = (IfcCartesianTransformationOperator2D)(value.EntityVal);
                return;

            default:
                throw new XbimParserException(string.Format("Attribute index {0} is out of range for {1}", propIndex + 1, GetType().Name.ToUpper()));
            }
        }
Esempio n. 18
0
 public IfcPixelTexture(IfcBoolean __RepeatS, IfcBoolean __RepeatT, IfcIdentifier?__Mode, IfcCartesianTransformationOperator2D __TextureTransform, IfcIdentifier[] __Parameter, IfcInteger __Width, IfcInteger __Height, IfcInteger __ColourComponents, IfcBinary[] __Pixel)
     : base(__RepeatS, __RepeatT, __Mode, __TextureTransform, __Parameter)
 {
     this._Width            = __Width;
     this._Height           = __Height;
     this._ColourComponents = __ColourComponents;
     this._Pixel            = new List <IfcBinary>(__Pixel);
 }
Esempio n. 19
0
 public IfcImageTexture(IfcBoolean __RepeatS, IfcBoolean __RepeatT, IfcIdentifier?__Mode, IfcCartesianTransformationOperator2D __TextureTransform, IfcIdentifier[] __Parameter, IfcURIReference __URLReference)
     : base(__RepeatS, __RepeatT, __Mode, __TextureTransform, __Parameter)
 {
     this.URLReference = __URLReference;
 }
Esempio n. 20
0
 public IfcDefinedSymbol(IfcDefinedSymbolSelect __Definition, IfcCartesianTransformationOperator2D __Target)
 {
     this._Definition = __Definition;
     this._Target     = __Target;
 }
Esempio n. 21
0
 public IfcBlobTexture(Boolean __RepeatS, Boolean __RepeatT, IfcSurfaceTextureEnum __TextureType, IfcCartesianTransformationOperator2D __TextureTransform, IfcIdentifier __RasterFormat, Boolean __RasterCode)
     : base(__RepeatS, __RepeatT, __TextureType, __TextureTransform)
 {
     this._RasterFormat = __RasterFormat;
     this._RasterCode   = __RasterCode;
 }
Esempio n. 22
0
 public IfcBlobTexture(IfcBoolean __RepeatS, IfcBoolean __RepeatT, IfcIdentifier?__Mode, IfcCartesianTransformationOperator2D __TextureTransform, IfcIdentifier[] __Parameter, IfcIdentifier __RasterFormat, IfcBinary __RasterCode)
     : base(__RepeatS, __RepeatT, __Mode, __TextureTransform, __Parameter)
 {
     this.RasterFormat = __RasterFormat;
     this.RasterCode   = __RasterCode;
 }
Esempio n. 23
0
 public IfcImageTexture(Boolean __RepeatS, Boolean __RepeatT, IfcSurfaceTextureEnum __TextureType, IfcCartesianTransformationOperator2D __TextureTransform, IfcIdentifier __UrlReference)
     : base(__RepeatS, __RepeatT, __TextureType, __TextureTransform)
 {
     this._UrlReference = __UrlReference;
 }
Esempio n. 24
0
 public IfcMirroredProfileDef(IfcProfileTypeEnum __ProfileType, IfcLabel?__ProfileName, IfcProfileDef __ParentProfile, IfcCartesianTransformationOperator2D __Operator, IfcLabel?__Label)
     : base(__ProfileType, __ProfileName, __ParentProfile, __Operator, __Label)
 {
 }
Esempio n. 25
0
 public IfcPixelTexture(Boolean __RepeatS, Boolean __RepeatT, IfcSurfaceTextureEnum __TextureType, IfcCartesianTransformationOperator2D __TextureTransform, IfcInteger __Width, IfcInteger __Height, IfcInteger __ColourComponents, IList <int> __Pixel)
     : base(__RepeatS, __RepeatT, __TextureType, __TextureTransform)
 {
     this._Width            = __Width;
     this._Height           = __Height;
     this._ColourComponents = __ColourComponents;
     this._Pixel            = new List <int>(__Pixel);
 }
Esempio n. 26
0
 protected IfcSurfaceTexture(IfcBoolean __RepeatS, IfcBoolean __RepeatT, IfcIdentifier?__Mode, IfcCartesianTransformationOperator2D __TextureTransform, IfcIdentifier[] __Parameter)
 {
     this.RepeatS          = __RepeatS;
     this.RepeatT          = __RepeatT;
     this.Mode             = __Mode;
     this.TextureTransform = __TextureTransform;
     this.Parameter        = new List <IfcIdentifier>(__Parameter);
     this.IsMappedBy       = new HashSet <IfcTextureCoordinate>();
     this.UsedInStyles     = new HashSet <IfcSurfaceStyleWithTextures>();
 }