프로젝트

일반

사용자정보

개정판 3ac248e3

ID3ac248e3765ce774acc0b87817ecba83584a9fd8
상위 9f104970
하위 69b7387a

gaqhf 이(가) 5년 이상 전에 추가함

dev issue #000 : 안쓰는 메서드 제거

Change-Id: I1a133439b5106e66a8e80942baee82c315379014

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
195 195
                            JoinRunLine(run);
196 196

  
197 197
                    // Input LineNumber Attribute
198
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set Lines Attribute");
198
                    SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetStep, "Set LineNumbers Attribute");
199 199
                    foreach (var item in document.LINENUMBERS)
200 200
                        InputLineNumberAttribute(item);
201 201

  
......
1653 1653
            SplashScreenManager.Default.SendCommand(SPPIDSplashScreen.SplashScreenCommand.SetProgress, ++CurrentCount);
1654 1654
        }
1655 1655

  
1656
        /// <summary>
1657
        /// EndBreak 모델링이 실패시 다시 시도하는 메서드
1658
        /// </summary>
1659
        /// <param name="endBreak"></param>
1660
        /// <param name="targetLMConnector"></param>
1661
        private void RetryEndBreakModeling(EndBreak endBreak, LMConnector targetLMConnector)
1662
        {
1663
            string symbolPath = string.Empty;
1664
            #region get symbol path
1665
            LMModelItem modelItem = dataSource.GetModelItem(targetLMConnector.ModelItemID);
1666
            foreach (LMRepresentation rep in modelItem.Representations)
1667
            {
1668
                if (!DBNull.Value.Equals(rep.get_FileName()) && !string.IsNullOrEmpty(rep.get_FileName()))
1669
                {
1670
                    symbolPath = rep.get_FileName();
1671
                    break;
1672
                }
1673
            }
1674
            #endregion
1675
            bool isZeroLength = Convert.ToBoolean(targetLMConnector.get_IsZeroLength());
1676
            Array array = null;
1677
            LMLabelPersist _LMLabelPersist = null;
1678
            LMConnector _LMConnector = null;
1679
            dynamic OID = targetLMConnector.get_GraphicOID();
1680
            DependencyObject drawingObject = radApp.ActiveDocument.ActiveSheet.DrawingObjects[OID];
1681
            Ingr.RAD2D.LineStringGeometry2d lineStringGeometry = drawingObject.GetGeometry() as Ingr.RAD2D.LineStringGeometry2d;
1682
            int verticesCount = lineStringGeometry.VertexCount;
1683
            PlaceRunInputs placeRunInputs = new PlaceRunInputs();
1684
            _LMAItem _LMAItem = _placement.PIDCreateItem(symbolPath);
1685

  
1686
            if (isZeroLength)
1687
            {
1688
                double[] vertices = null;
1689
                lineStringGeometry.GetVertices(ref verticesCount, ref vertices);
1690
                double x = 0;
1691
                double y = 0;
1692
                lineStringGeometry.GetVertex(1, ref x, ref y);
1693

  
1694
                placeRunInputs.AddSymbolTarget(targetLMConnector.ConnectItem1SymbolObject, x, y);
1695
                placeRunInputs.AddSymbolTarget(targetLMConnector.ConnectItem2SymbolObject, x, y);
1696

  
1697
                _placement.PIDRemovePlacement(targetLMConnector.AsLMRepresentation());
1698
                _LMConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
1699

  
1700
                array = new double[] { 0, x, y };
1701
                _LMLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, ref array, Rotation: 0, LabeledItem: _LMConnector.AsLMRepresentation(), IsLeaderVisible: true);
1702

  
1703
                AutoJoinPipeRun(_LMConnector.ModelItemID);
1704
            }
1705
            else
1706
            {
1707
                List<double[]> vertices = new List<double[]>();
1708
                for (int i = 1; i <= verticesCount; i++)
1709
                {
1710
                    double x = 0;
1711
                    double y = 0;
1712
                    lineStringGeometry.GetVertex(i, ref x, ref y);
1713
                    vertices.Add(new double[] { x, y });
1714
                }
1715

  
1716
                for (int i = 0; i < vertices.Count; i++)
1717
                {
1718
                    double[] points = vertices[i];
1719
                    if (i == 0)
1720
                    {
1721
                        if (targetLMConnector.ConnectItem1SymbolObject != null)
1722
                            placeRunInputs.AddSymbolTarget(targetLMConnector.ConnectItem1SymbolObject, points[0], points[1]);
1723
                        else
1724
                            placeRunInputs.AddPoint(points[0], points[1]);
1725
                    }
1726
                    else if (i == vertices.Count - 1)
1727
                    {
1728
                        if (targetLMConnector.ConnectItem2SymbolObject != null)
1729
                            placeRunInputs.AddSymbolTarget(targetLMConnector.ConnectItem2SymbolObject, points[0], points[1]);
1730
                        else
1731
                            placeRunInputs.AddPoint(points[0], points[1]);
1732
                    }
1733
                    else
1734
                        placeRunInputs.AddPoint(points[0], points[1]);
1735
                }
1736

  
1737
                List<Line> lines = SPPIDUtil.FindLinesByModelId(document, targetLMConnector.ModelItemID);
1738
                
1739
                _placement.PIDRemovePlacement(targetLMConnector.AsLMRepresentation());
1740
                _LMConnector = _placement.PIDPlaceRun(_LMAItem, placeRunInputs);
1741

  
1742
                array = new double[] { 0, endBreak.SPPID.ORIGINAL_X, endBreak.SPPID.ORIGINAL_Y };
1743
                _LMLabelPersist = _placement.PIDPlaceLabel(endBreak.SPPID.MAPPINGNAME, ref array, Rotation: 0, LabeledItem: _LMConnector.AsLMRepresentation(), IsLeaderVisible: true);
1744

  
1745
                AutoJoinPipeRun(_LMConnector.ModelItemID);
1746
                foreach (var line in lines)
1747
                    line.SPPID.ModelItemId = _LMConnector.ModelItemID;
1748
            }
1749

  
1750

  
1751
            if (_LMLabelPersist != null)
1752
            {
1753
                _LMLabelPersist.Commit();
1754
                ReleaseCOMObjects(_LMLabelPersist);
1755
            }
1756
            else
1757
            {
1758
                
1759
            }
1760

  
1761
            ReleaseCOMObjects(_LMConnector);
1762
            ReleaseCOMObjects(placeRunInputs);
1763
            ReleaseCOMObjects(_LMAItem);
1764
        }
1765

  
1766 1656
        private LMConnector ReModelingLMConnector(LMConnector connector)
1767 1657
        {
1768 1658
            string symbolPath = string.Empty;

내보내기 Unified diff

클립보드 이미지 추가 (최대 크기: 500 MB)