Exemple #1
0
        public void AdjustParameters(int sign, double Radius_max, double Radius_min, MultidimensionalArray LevelSet, MultidimensionalArray LevelSetGradient)
        {
            // Set Radius
            if (sign * LevelSet[0, 0] < Radius_min)
            {
                Radius = Radius_min;
            }
            else if (sign * LevelSet[0, 0] > Radius_max)
            {
                Radius = Radius_max;
            }
            else
            {
                Radius = sign * LevelSet[0, 0];
            }

            MultidimensionalArray Normal_old = Normal.CloneAs();

            base.AdjustParameters(LevelSet, LevelSetGradient);
            int Direction = Math.Sign(SemiLagrangianLevelSetMethod
                                      <MarkersofCell, SingleLvlSetMarker, MarkerCorrectionMask> .
                                      DotProduct(Normal, Normal_old));

            if (Direction <= 0)
            {
                Active = false;
            }

            // Manage Escaped
            if (Escaped == false && -1 * sign * LevelSet[0, 0] >= Radius)
            {
                Escaped = true;
            }
            if (Escaped == true && -1 * sign * LevelSet[0, 0] < Radius)
            {
                Escaped = false;
            }
        }