예제 #1
0
        private void InitCurvatureInfoGrid()
        {
            this.dataGridViewCurvature.Rows.Clear();
            double[] curvature = TriMeshUtil.ComputeGaussianCurvature(Mesh);

            double[]             meanCurv = TriMeshUtil.ComputeMeanCurvature(Mesh);
            PrincipalCurvature[] basic    = TriMeshUtil.ComputePricipalCurvature(Mesh);

            PrincipalCurvature[] pg = TriMeshUtil.ComputePricipalCurvaturePG07(Mesh);
            CurvatureLib.Init(Mesh);
            PrincipalCurvature[] ccc = CurvatureLib.ComputeCurvature();

            for (int i = 0; i < curvature.Length; i++)
            {
                this.dataGridViewCurvature.Rows.Add(i,
                                                    curvature[i],
                                                    meanCurv[i],
                                                    ccc[i].max,
                                                    ccc[i].min,
                                                    pg[i].max,
                                                    pg[i].min);
            }
        }
예제 #2
0
 private void curvatureToolStripMenuItem_Click(object sender, EventArgs e)
 {
     CurvatureLib.Init(Mesh);
     PrincipalCurvature[] cur = CurvatureLib.ComputeCurvature();
     TriMeshUtil.SetUpCurvature(Mesh, cur);
 }
예제 #3
0
        public double[] ComputeFunction(TriMesh mesh)
        {
            double[] function = null;
            switch (FunctionType)
            {
            case EnumFunction.X:
                function = ComputeX(mesh);
                break;

            case EnumFunction.Y:
                function = ComputeY(mesh);
                break;

            case EnumFunction.Z:
                function = ComputeZ(mesh);
                break;

            case EnumFunction.CosX:

                function = ComputeCosX(mesh, ConfigFunction.Instance.Cos);
                break;

            case EnumFunction.CosY:

                function = ComputeCosY(mesh, ConfigFunction.Instance.Cos);
                break;

            case EnumFunction.CosZ:

                function = ComputeCosZ(mesh, ConfigFunction.Instance.Cos);
                break;

            case EnumFunction.Harmonic:

                function = ComputeHarmonic(mesh);
                break;

            case EnumFunction.SmoothedCurvature:

                function = ComputeSmoothedCurvature(mesh);
                break;

            case EnumFunction.DiffusionDistance:

                function = ComputeDistanceDiffusion(mesh, ConfigFunction.Instance.Diffustion);
                break;

            case EnumFunction.CommuteTime:

                function = ComputeDistanceCommuteTime(mesh);
                break;


            case EnumFunction.BiharmonicDistance:

                function = ComputeDistanceBiharmonic(mesh);
                break;

            case EnumFunction.ADFDistance:

                function = ComputeDistanceADF(mesh, ConfigFunction.Instance.ADF);
                break;

            case EnumFunction.Gaussian:

                function = TriMeshUtil.ComputeGaussianCurvatureIntegrated(mesh);
                break;

            case EnumFunction.MeanCurvature:

                function = TriMeshUtil.ComputeMeanCurvature(mesh);
                break;

            case EnumFunction.GaussianVertex:
                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputeGaussianCurvature();

                break;

            case EnumFunction.MeanCurvatureVertex:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputeMeanCurvature();
                break;

            case EnumFunction.PrincipalMaxAbs:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMaxAbs();
                break;

            case EnumFunction.PrincipalMinAbs:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMinAbs();
                break;

            case EnumFunction.PrincipalMax:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMax();
                break;

            case EnumFunction.PrincipalMin:

                CurvatureLib.Init(mesh);
                function = CurvatureLib.ComputePrincipalMin();
                break;

            case EnumFunction.EigenVector:

                function = ComputeEigenVector(mesh, ConfigFunction.Instance.EigenIndex);
                break;

            case EnumFunction.External:

                function = Function;
                break;
            }

            this.Function = function;

            return(function);
        }