프로젝트

일반

사용자정보

개정판 243668f5

ID243668f54580a1b2f45897ea0c1c3553c7b109dd
상위 6025ea51
하위 c33fbd9b

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

dev issue #503 : fix modeling

Change-Id: I56135d909d496d632d5c44b21ea546b0f6a7b24b

차이점 보기:

DTI_PID/SPPIDConverter/AutoModeling.cs
1717 1717
            }
1718 1718
        }
1719 1719

  
1720
        private void GetSPPIDSymbolRange(List<Symbol> symbols, ref double[] range)
1720
        private void GetSPPIDSymbolRange(List<Symbol> symbols, ref double[] range, bool bOnlySymbol = false, bool bForGraphic = false)
1721 1721
        {
1722 1722
            double[] tempRange = new double[] { double.MaxValue, double.MaxValue, double.MinValue, double.MinValue };
1723 1723
            foreach (var symbol in symbols)
1724 1724
            {
1725
                LMSymbol _TargetItem = dataSource.GetSymbol(symbol.SPPID.RepresentationId);
1726
                Ingr.RAD2D.Symbol2d symbol2d = radApp.ActiveDocument.ActiveSheet.DrawingObjects[_TargetItem.get_GraphicOID().ToString()];
1727
                double x1 = 0;
1728
                double y1 = 0;
1729
                double x2 = 0;
1730
                double y2 = 0;
1731
                symbol2d.Range(out x1, out y1, out x2, out y2);
1725
                double[] symbolRange = null;
1726
                GetSPPIDSymbolRange(symbol, ref symbolRange, bOnlySymbol, bForGraphic);
1732 1727

  
1733
                tempRange[0] = Math.Min(tempRange[0], x1);
1734
                tempRange[1] = Math.Min(tempRange[1], y1);
1735
                tempRange[2] = Math.Max(tempRange[2], x2);
1736
                tempRange[3] = Math.Max(tempRange[3], y2);
1728
                tempRange[0] = Math.Min(tempRange[0], symbolRange[0]);
1729
                tempRange[1] = Math.Min(tempRange[1], symbolRange[1]);
1730
                tempRange[2] = Math.Max(tempRange[2], symbolRange[2]);
1731
                tempRange[3] = Math.Max(tempRange[3], symbolRange[3]);
1737 1732

  
1738 1733
                foreach (var childSymbol in symbol.ChildSymbols)
1739 1734
                    GetSPPIDChildSymbolRange(childSymbol, ref tempRange);
1740

  
1741
                ReleaseCOMObjects(_TargetItem);
1742 1735
            }
1743 1736

  
1744 1737
            range = tempRange;
......
2118 2111

  
2119 2112
                                    // Range 겹치는지 확인해야함
2120 2113
                                    double[] prevRange = null;
2121
                                    GetSPPIDSymbolRange(prevSymbol, ref prevRange);
2114
                                    GetSPPIDSymbolRange(prevSymbol, ref prevRange, bForGraphic: true);
2122 2115
                                    double[] groupRange = null;
2123
                                    GetSPPIDSymbolRange(group, ref groupRange);
2116
                                    GetSPPIDSymbolRange(group, ref groupRange, bForGraphic: true);
2124 2117

  
2125 2118
                                    double distanceX = 0;
2126 2119
                                    double distanceY = 0;
......
2165 2158
                                    SymbolModeling(connSymbol, null);
2166 2159
                                    // Range 겹치는지 확인해야함
2167 2160
                                    double[] prevRange = null;
2168
                                    GetSPPIDSymbolRange(prevSymbol, ref prevRange);
2161
                                    GetSPPIDSymbolRange(prevSymbol, ref prevRange, bForGraphic: true);
2169 2162
                                    double[] connRange = null;
2170
                                    GetSPPIDSymbolRange(connSymbol, ref connRange);
2163
                                    GetSPPIDSymbolRange(connSymbol, ref connRange, bForGraphic: true);
2171 2164

  
2172 2165
                                    double distanceX = 0;
2173 2166
                                    double distanceY = 0;
DTI_PID/SPPIDConverter/ConverterDocking.cs
1858 1858

  
1859 1859
        #endregion
1860 1860

  
1861
        
1861

  
1862 1862
        #region TEST
1863
        private void GetSPPIDSymbolRange(Ingr.RAD2D.Symbol2d symbol2d, ref double[] range)
1864
        {
1865
            {
1866
                double x1 = 0;
1867
                double y1 = 0;
1868
                double x2 = 0;
1869
                double y2 = 0;
1870

  
1871
                x1 = double.MaxValue;
1872
                y1 = double.MaxValue;
1873
                x2 = double.MinValue;
1874
                y2 = double.MinValue;
1875
                range = new double[] { x1, y1, x2, y2 };
1876

  
1877
                foreach (var item in symbol2d.DrawingObjects)
1878
                {
1879
                    if (item.GetType() == typeof(Ingr.RAD2D.Line2d))
1880
                    {
1881
                        Ingr.RAD2D.Line2d rangeObject = item as Ingr.RAD2D.Line2d;
1882
                        if (rangeObject.Layer == "Default")
1883
                        {
1884
                            rangeObject.Range(out x1, out y1, out x2, out y2);
1885
                            range = new double[] {
1886
                                Math.Min(x1, range[0]),
1887
                                Math.Min(y1, range[1]),
1888
                                Math.Max(x2, range[2]),
1889
                                Math.Max(y2, range[3])
1890
                            };
1891
                        }
1892
                    }
1893
                    else if (item.GetType() == typeof(Ingr.RAD2D.Circle2d))
1894
                    {
1895
                        Ingr.RAD2D.Circle2d rangeObject = item as Ingr.RAD2D.Circle2d;
1896
                        if (rangeObject.Layer == "Default")
1897
                        {
1898
                            rangeObject.Range(out x1, out y1, out x2, out y2);
1899
                            range = new double[] {
1900
                                Math.Min(x1, range[0]),
1901
                                Math.Min(y1, range[1]),
1902
                                Math.Max(x2, range[2]),
1903
                                Math.Max(y2, range[3])
1904
                            };
1905
                        }
1906
                    }
1907
                    else if (item.GetType() == typeof(Ingr.RAD2D.Rectangle2d))
1908
                    {
1909
                        Ingr.RAD2D.Rectangle2d rangeObject = item as Ingr.RAD2D.Rectangle2d;
1910
                        if (rangeObject.Layer == "Default")
1911
                        {
1912
                            rangeObject.Range(out x1, out y1, out x2, out y2);
1913
                            range = new double[] {
1914
                                Math.Min(x1, range[0]),
1915
                                Math.Min(y1, range[1]),
1916
                                Math.Max(x2, range[2]),
1917
                                Math.Max(y2, range[3])
1918
                            };
1919
                        }
1920
                    }
1921
                    else if (item.GetType() == typeof(Ingr.RAD2D.Arc2d))
1922
                    {
1923
                        Ingr.RAD2D.Arc2d rangeObject = item as Ingr.RAD2D.Arc2d;
1924
                        if (rangeObject.Layer == "Default")
1925
                        {
1926
                            rangeObject.Range(out x1, out y1, out x2, out y2);
1927
                            range = new double[] {
1928
                                Math.Min(x1, range[0]),
1929
                                Math.Min(y1, range[1]),
1930
                                Math.Max(x2, range[2]),
1931
                                Math.Max(y2, range[3])
1932
                            };
1933
                        }
1934
                    }
1935
                }
1936
            }
1937
        }
1863 1938
        private void simpleButton1_Click(object sender, EventArgs e)
1864 1939
        {
1865 1940
            double x1 = double.MaxValue;
......
1868 1943
            double y2 = double.MinValue;
1869 1944
            foreach (DrawingObjectBase item in application.ActiveSelectSet)
1870 1945
            {
1871
                double tx1, ty1, tx2, ty2;
1872
                item.Range(out tx1, out ty1, out tx2, out ty2);
1873
                x1 = Math.Min(x1, tx1);
1874
                y1 = Math.Min(y1, ty1);
1875
                x2 = Math.Max(x2, tx2);
1876
                y2 = Math.Max(y2, ty2);
1946
                double[] range = new double[] { };
1947
                GetSPPIDSymbolRange(item as Symbol2d, ref range);
1877 1948
            }
1878 1949
            return;
1879 1950

  

내보내기 Unified diff

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