private void btnArea_Click(object sender, EventArgs e)
        {
            string strType = "";
            var    cptlt   = GetCptLt(rtbInput.Text, out strType);

            cptlt.Add(cptlt[0]);
            CPolygon cpg = new CPolygon(0, cptlt);

            cpg.SetAreaSimple();
            txtArea.Text = cpg.dblAreaSimple.ToString();
        }
Exemplo n.º 2
0
        private double ComputeCpgAreaAndRemoveSmallHoles(CPolygon cpg, double dblHoleAreaLimit)
        {
            cpg.SetAreaSimple();

            if (cpg.HoleCpgLt != null)
            {
                var holecpglt = new List <CPolygon>(cpg.HoleCpgLt.Count);
                foreach (var holecpg in cpg.HoleCpgLt)
                {
                    if (holecpg.dblAreaSimple >= dblHoleAreaLimit)
                    {
                        holecpglt.Add(holecpg);
                    }
                }
                cpg.HoleCpgLt = holecpglt;
            }
            return(cpg.dblAreaSimple);
        }