Exemple #1
0
        public void reCreateMark(_Mark input)
        {
            _mark.Attributes = input._mark.Attributes;
            _mark.Modify();

            if (input._mark.Placing is TSD.LeaderLinePlacing)
            {
                TSD.LeaderLinePlacing attr       = input._mark.Placing as TSD.LeaderLinePlacing;
                T3D.Point             start      = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                TSD.LeaderLinePlacing newPlacing = new TSD.LeaderLinePlacing(start);
                _mark.Placing = newPlacing;
            }

            else if (input._mark.Placing is TSD.AlongLinePlacing)
            {
                TSD.AlongLinePlacing attr       = input._mark.Placing as TSD.AlongLinePlacing;
                T3D.Point            start      = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                T3D.Point            end        = __GeometryOperations.applyGlobalOffset(attr.EndPoint);
                TSD.AlongLinePlacing newPlacing = new TSD.AlongLinePlacing(start, end);
                _mark.Placing = newPlacing;
            }

            else if (input._mark.Placing is TSD.BaseLinePlacing)
            {
                //TSD.BaseLinePlacing attr = input._mark.Placing as TSD.BaseLinePlacing;

                //T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                //T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint);

                //TSD.BaseLinePlacing newPlacing = new TSD.BaseLinePlacing(start, end);
                //_mark.Placing = newPlacing;
            }

            else if (input._mark.Placing is TSD.PointPlacing)
            {
                TSD.PointPlacing newPlacing = new TSD.PointPlacing();
                _mark.Placing = newPlacing;
            }

            _mark.InsertionPoint = __GeometryOperations.applyGlobalOffset(input._mark.InsertionPoint);
            _mark.Modify();
            _mark.Modify();
        }
Exemple #2
0
        private void reCreateMarkSmarts(_Mark other)
        {
            _mark.Attributes             = other._mark.Attributes;
            _mark.Attributes.Frame.Color = TSD.DrawingColors.Green;
            _mark.Modify();

            T3D.Point inputStart = __GeometryOperations.factor1Point((other._part as TSM.Beam).StartPoint, other._view as TSD.View);
            inputStart = __GeometryOperations.applyGlobalOffset(inputStart);
            T3D.Point inputEnd = __GeometryOperations.factor1Point((other._part as TSM.Beam).EndPoint, other._view as TSD.View);
            inputEnd = __GeometryOperations.applyGlobalOffset(inputEnd);

            T3D.Point outputStart = __GeometryOperations.factor1Point((this._part as TSM.Beam).StartPoint, this._view as TSD.View);
            T3D.Point outputEnd   = __GeometryOperations.factor1Point((this._part as TSM.Beam).EndPoint, this._view as TSD.View);

            T3D.Point markOffset = __GeometryOperations.getLocalOffset(inputStart, outputStart);
            double    alfa       = __GeometryOperations.getAlfa(inputStart, inputEnd, outputStart, outputEnd);

            T3D.Point insertion = __GeometryOperations.applyGlobalOffset(other._mark.InsertionPoint);
            insertion = __GeometryOperations.applyLocalOffset(insertion, markOffset);

            if (other._mark.Placing is TSD.LeaderLinePlacing)
            {
                TSD.LeaderLinePlacing attr = other._mark.Placing as TSD.LeaderLinePlacing;

                T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                start = __GeometryOperations.applyLocalOffset(start, markOffset);
                T3D.Point placingOffset   = __GeometryOperations.getPlacingOffset(start, outputStart, alfa);
                T3D.Point insertionOffset = __GeometryOperations.getLocalOffset(start, insertion);
                start     = __GeometryOperations.applyLocalOffset(outputStart, placingOffset);
                insertion = __GeometryOperations.applyLocalOffset(start, insertionOffset);

                TSD.LeaderLinePlacing newPlacing = new TSD.LeaderLinePlacing(start);
                _mark.Placing = newPlacing;
            }

            else if (other._mark.Placing is TSD.AlongLinePlacing)
            {
                TSD.AlongLinePlacing attr = other._mark.Placing as TSD.AlongLinePlacing;

                T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                start = __GeometryOperations.applyLocalOffset(start, markOffset);
                T3D.Point placingOffset   = __GeometryOperations.getPlacingOffset(outputStart, start, alfa);
                T3D.Point insertionOffset = __GeometryOperations.getLocalOffset(start, insertion);
                start     = __GeometryOperations.applyLocalOffset(start, placingOffset);
                insertion = __GeometryOperations.applyLocalOffset(start, insertionOffset);

                T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint);
                end = __GeometryOperations.applyLocalOffset(end, markOffset);
                end = __GeometryOperations.applyLocalOffset(end, placingOffset);

                TSD.AlongLinePlacing newPlacing = new TSD.AlongLinePlacing(start, end);
                _mark.Placing = newPlacing;
            }

            else if (other._mark.Placing is TSD.BaseLinePlacing)
            {
                //TSD.BaseLinePlacing attr = input._mark.Placing as TSD.BaseLinePlacing;

                //T3D.Point start = __GeometryOperations.applyGlobalOffset(attr.StartPoint);
                //start = __GeometryOperations.applyLocalOffset(start, markOffset);
                //T3D.Point placingOffset = __GeometryOperations.getPlacingOffset(startPointRefactor, start, alfa);
                //T3D.Point insertionOffset = __GeometryOperations.getLocalOffset(start, insertion);
                //start = __GeometryOperations.applyLocalOffset(start, placingOffset);
                //insertion = __GeometryOperations.applyLocalOffset(start, insertionOffset);

                //T3D.Point end = __GeometryOperations.applyGlobalOffset(attr.EndPoint);
                //end = __GeometryOperations.applyLocalOffset(end, markOffset);
                //end = __GeometryOperations.applyLocalOffset(end, placingOffset);

                //TSD.BaseLinePlacing newPlacing = new TSD.BaseLinePlacing(start, end);
                //_mark.Placing = newPlacing;
            }

            else if (other._mark.Placing is TSD.PointPlacing)
            {
                TSD.PointPlacing newPlacing = new TSD.PointPlacing();
                _mark.Placing = newPlacing;
            }

            _mark.InsertionPoint = insertion;

            _mark.Modify();
            _mark.Modify();
        }