コード例 #1
0
ファイル: Contour.cs プロジェクト: jfeng94/Thesis
        public void AllocateBuffers(int trianglesNum)
        {
            if (lsHash == null)
            {
//                MeshUtils.Log("Allocating contour: " + trianglesNum);

                midPoints = new ArrayDictionary<MidPoint>(trianglesNum * 2);
                contour = new List<Dictionary<HashType, int>>();
                lsHash = new LSHash(0.001f, trianglesNum * 2);
            }
            else
            {
                lsHash.Clear();
                foreach (var item in contour)
                {
                    item.Clear();
                }
                contour.Clear();
                
                if (midPoints.Size < trianglesNum*2)
                {
//                    MeshUtils.Log("Re-allocating midPoint: " + trianglesNum);

                    midPoints = new ArrayDictionary<MidPoint>(trianglesNum * 2);
                }
                else
                {
                    midPoints.Clear();
                }
            }
        }
コード例 #2
0
        public void AllocateBuffers(int trianglesNum)
        {
            if (lsHash == null)
            {
//                MeshUtils.Log("Allocating contour: " + trianglesNum);

                midPoints = new ArrayDictionary <MidPoint>(trianglesNum * 2);
                contour   = new List <Dictionary <HashType, int> >();
                lsHash    = new LSHash(0.001f, trianglesNum * 2);
            }
            else
            {
                lsHash.Clear();
                foreach (var item in contour)
                {
                    item.Clear();
                }
                contour.Clear();

                if (midPoints.Size < trianglesNum * 2)
                {
//                    MeshUtils.Log("Re-allocating midPoint: " + trianglesNum);

                    midPoints = new ArrayDictionary <MidPoint>(trianglesNum * 2);
                }
                else
                {
                    midPoints.Clear();
                }
            }
        }