예제 #1
0
        public TBaseShape CloneShape(TBaseShape ADest)
        {
            TBaseShape mShape = null;

            if (ADest == null)
            {
                return(null);
            }
            switch (ADest.TypeShape)
            {
            case 5:
                mShape = new TTfeRectShape(0, 0, 0, 0);
                break;

            case 6:
                mShape = new TTfeRhombShape(0, 0, 0, 0);
                break;

            case 7:
                mShape = new TTfeEllShape(0, 0, 0, 0);
                break;

            case 8:
                mShape = new TTfeHexahedronShape(0, 0, 0, 0);
                break;
            }
            if (mShape == null)
            {
                return(null);
            }
            mShape.Clon = ADest;
            ADest.CopyObject(mShape);
            return(mShape);
        }
예제 #2
0
        override public void Init()
        {
            Point P1 = new Point(), P2 = new Point();

            FreeWorkLines();
            FreeWorkShapes();
            TTfeRectShape       Rct;
            TTfeHexahedronShape Hexa;

            F_LastShapeId = F_NumberShapeId;
            P1.X          = StartPoint.X + 2 * F_Step;
            P1.Y          = StartPoint.Y;

            F_LastShapeId++;
            F_NumberShapeId = F_LastShapeId;
            Hexa            = new TTfeHexahedronShape(P1.X, P1.Y, F_Step, F_LastShapeId + 2);
            Hexa.TailLeft   = true;
            Hexa.TailTop    = true;
            Hexa.TailBottom = true;
            AddShape(Hexa);

            Hexa.GetTailPoint(1, ref P1);
            P1.X = P1.X + 4 * F_Step;
            P1.Y = P1.Y - 2 * F_Step;
            F_LastShapeId++;
            Rct = new TTfeRectShape(P1.X, P1.Y, F_Step, F_LastShapeId - 1);
            AddShape(Rct);

            Hexa.GetTailPoint(3, ref P1);
            P1.X = P1.X + 4 * F_Step;
            P1.Y = P1.Y + 2 * F_Step;
            F_LastShapeId++;
            Rct = new TTfeRectShape(P1.X, P1.Y, F_Step, F_LastShapeId - 1);
            AddShape(Rct);
            CreateLines();
            CalcWidthWork();
            F_Indent = FirstLine.xEnd - FirstLine.xStart;
        }