Example #1
0
        /// <summary>
        /// Registers the mesh trianlge with the specified index with the tree.
        /// </summary>
        private bool RegisterTriangle(int triangleIndex)
        {
            Triangle3D triangle = _editorMesh.GetTriangle(triangleIndex);

            if (!IsTriangleValid(triangle))
            {
                return(false);
            }

            // Create the triangle node data and instruct the tree to add this node
            var meshSphereTreeTriangle = new MeshSphereTreeTriangle(triangleIndex);

            _sphereTree.AddTerminalNode(triangle.GetEncapsulatingSphere(), meshSphereTreeTriangle);

            return(true);
        }
Example #2
0
        protected override void DoJob()
        {
            for (int triIndex = 0; triIndex < _meshTriangles.Count; ++triIndex)
            {
                Triangle3D triangle = _meshTriangles[triIndex];
                if (ValidateTriangle != null && !ValidateTriangle(triangle))
                {
                    continue;
                }

                var meshSphereTreeTriangle = new MeshSphereTreeTriangle(triIndex);
                _sphereTree.AddTerminalNode(triangle.GetEncapsulatingSphere(), meshSphereTreeTriangle);
            }

            if (SilentBuildFinished != null)
            {
                SilentBuildFinished();
            }
        }