Ejemplo n.º 1
0
    //------------------------------- DIALOG LAUNCHING ---------------------------------
    //
    //    Before invoking this application one needs to open any part/empty part in NX
    //    because of the behavior of the blocks.
    //
    //    Make sure the dlx file is in one of the following locations:
    //        1.) From where NX session is launched
    //        2.) $UGII_USER_DIR/application
    //        3.) For released applications, using UGII_CUSTOM_DIRECTORY_FILE is highly
    //            recommended. This variable is set to a full directory path to a file
    //            containing a list of root directories for all custom applications.
    //            e.g., UGII_CUSTOM_DIRECTORY_FILE=$UGII_BASE_DIR\ugii\menus\custom_dirs.dat
    //
    //    You can create the dialog using one of the following way:
    //
    //    1. Journal Replay
    //
    //        1) Replay this file through Tool->Journal->Play Menu.
    //
    //    2. USER EXIT
    //
    //        1) Create the Shared Library -- Refer "Block UI Styler programmer's guide"
    //        2) Invoke the Shared Library through File->Execute->NX Open menu.
    //
    //------------------------------------------------------------------------------
    public static void Main()
    {
        Postprocess thePostprocess = null;

        try
        {
            thePostprocess = new Postprocess();
            // The following method shows the dialog immediately

            thePostprocess.Show();
        }
        catch (Exception ex)
        {
            //---- Enter your exception handling code here -----
            theUI.NXMessageBox.Show("Block Styler", NXMessageBox.DialogType.Error, ex.ToString());
        }
        finally
        {
            if (thePostprocess != null)
            {
                thePostprocess.Dispose();
            }
            thePostprocess = null;
        }
    }
Ejemplo n.º 2
0
        //----------------------------------------

        #region Public Methods
        public override object[] Compute(params object[] input)
        {
            object[] output;


            try // Apply preprocessing (input filtering)
            {
                Preprocess.Apply(input);
            }
            catch (Exception exception)
            {
                throw new Exception(
                          "Exception ocurred while appling Input processing", exception);
            }


            // Prepare for network calculation
            double[] doubleInput = Array.ConvertAll <object, double>(input,
                                                                     delegate(object o) { return((double)o); });


            // Calculate Network Answers
            double[] doubleOutput = Network.Compute(doubleInput);


            // Prepare for output post processing
            output = Array.ConvertAll <double, object>(doubleOutput,
                                                       delegate(double o) { return((object)o); });


            try // Apply postprocessing (output filtering)
            {
                Postprocess.Apply(output);
            }
            catch (Exception exception)
            {
                throw new Exception(
                          "Exception ocurred while appling Output processing", exception);
            }


            // Return final result
            return(output);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// ページをリロードします。
        /// </summary>
        /// <param name="frame">フレームのインスタンス</param>
        /// <param name="page">ページのインスタンス</param>
        /// <param name="preprocess">リロードの前処理 (async)</param>
        /// <param name="postprocess">リロードの後処理 (async)</param>
        /// <returns></returns>
        public static void Reload(Windows.UI.Xaml.Controls.Frame frame, Windows.UI.Xaml.Controls.Page page, Preprocess preprocess = null, Postprocess postprocess = null)
        {
            Logging.SysLogWriteWaiting = true;

            // 前処理
            if (preprocess != null)
            {
                preprocess(frame, page);
            }

            // コンポーネント再構築
            Windows.UI.Xaml.Application.LoadComponent(page, page.BaseUri, Windows.UI.Xaml.Controls.Primitives.ComponentResourceLocation.Application);

            // 後処理
            if (postprocess != null)
            {
                postprocess(frame, page);
            }

            Logging.SysLogWriteWaiting = false;
        }
 /// <summary>
 /// Remove a postprocess method that have previously been assigned using the 'AddPostprocess' method.
 /// </summary>
 public void RemovePostprocess( Postprocess postprocess )
 {
     Postprocesses -= postprocess;
 }
 /// <summary>
 /// Add a method to receive and manipulate mesh data before it is applied. Useful for creating distortion effects or complex variations.
 /// </summary>
 public void AddPostprocess( Postprocess postprocess )
 {
     Postprocesses += postprocess;
 }