Example #1
0
        private static Vector2 TransformOrientationPosition(int Width, int Height, OriginX originX, OriginY originY)
        {
            int x = 0;
            int y = 0;

            if (originX == OriginX.Left)
            {
                x = -(Width / 2);
            }
            else if (originX == OriginX.Right)
            {
                x = (Width / 2);
            }

            if (originY == OriginY.Top)
            {
                y = Height / 2;
            }
            else if (originY == OriginY.Bottom)
            {
                y = -(Height / 2);
            }

            return(new Vector2(x, y));
        }
Example #2
0
        public override void WriteGroupCodes()
        {
            WriteGroupCodeValue(2, UCSName.Trim());

            WriteGroupCodeValue(10, OriginX.ToString().Trim());
            WriteGroupCodeValue(11, OriginY.ToString().Trim());
            WriteGroupCodeValue(12, OriginZ.ToString().Trim());

            WriteGroupCodeValue(20, XAxisX.ToString().Trim());
            WriteGroupCodeValue(21, XAxisY.ToString().Trim());
            WriteGroupCodeValue(22, XAxisZ.ToString().Trim());

            WriteGroupCodeValue(30, YAxisX.ToString().Trim());
            WriteGroupCodeValue(31, YAxisY.ToString().Trim());
            WriteGroupCodeValue(32, YAxisZ.ToString().Trim());

            WriteGroupCodeValue(70, GetStandardFlags().ToString().Trim());
        }
Example #3
0
        private static Vector4 TransformOrientation(int Width, int Height, OriginX originX, OriginY originY)
        {
            int left   = 0;
            int right  = 0;
            int top    = 0;
            int bottom = 0;

            if (originX == OriginX.Left)
            {
                right = Width;
            }
            else if (originX == OriginX.Right)
            {
                left = -Width;
            }
            else //To center
            {
                left  = -Width / 2;
                right = Width / 2;
            }

            if (originY == OriginY.Top)
            {
                bottom = Height;
            }
            else if (originY == OriginY.Bottom)
            {
                top = -Height;
            }
            else //To center
            {
                top    = -Height / 2;
                bottom = Height / 2;
            }

            return(new Vector4(left, right, top, bottom));
        }