Esempio n. 1
0
            /// <summary>
            /// Create new horizontal cotation
            /// </summary>
            /// <param name="grp">Group</param>
            /// <param name="layer">Layer</param>
            /// <param name="pt0">First extremity</param>
            /// <param name="pt1">Second extremity</param>
            /// <param name="offset">Offset</param>
            /// <returns></returns>
            public PicCotation AddCotation(PicCotation.CotType cotationType, short grp, short layer, Vector2D pt0, Vector2D pt1, double offset, string text, short noDecimals)
            {
                PicCotation cotation;

                switch (cotationType)
                {
                case PicCotation.CotType.COT_DISTANCE:
                    cotation = PicCotationDistance.CreateNewCotation(GetNewEntityId(), pt0, pt1, offset, noDecimals);
                    break;

                case PicCotation.CotType.COT_HORIZONTAL:
                    cotation = PicCotationHorizontal.CreateNewCotation(GetNewEntityId(), pt0, pt1, offset, noDecimals);
                    break;

                case PicCotation.CotType.COT_VERTICAL:
                    cotation = PicCotationVertical.CreateNewCotation(GetNewEntityId(), pt0, pt1, offset, noDecimals);
                    break;

                default:
                    throw new Exception("Invalid cotation type");
                }
                cotation.Group = grp;
                cotation.Layer = layer;
                cotation.Text  = text;
                AddEntity(cotation);
                return(cotation);
            }