コード例 #1
0
        public void AddCentroid()
        {
            Centroid cent = PlotterUtil.Centroid(DB.GetSelectedFigList());

            if (cent.IsInvalid)
            {
                return;
            }

            CadFigure pointFig = mDB.NewFigure(CadFigure.Types.POINT);

            pointFig.AddPoint((CadVertex)cent.Point);

            pointFig.EndCreate(DC);

            CadOpe ope = new CadOpeAddFigure(CurrentLayer.ID, pointFig.ID);

            HistoryMan.foward(ope);
            CurrentLayer.AddFigure(pointFig);

            string s = string.Format("({0:0.000},{1:0.000},{2:0.000})",
                                     cent.Point.X, cent.Point.Y, cent.Point.Z);

            ItConsole.println("Centroid:" + s);
            ItConsole.println("Area:" + (cent.Area / 100).ToString() + "(㎠)");
        }