示例#1
0
    public override void OnExit()
    {
        base.OnExit();
        PopMenu menu = ScanSceneController.currentTrackableObject.GetComponent <PopMenu> ();

        menu.Hide();
    }
示例#2
0
        //判断目前是否含有当前版本的菜单信息
        public bool AddMenu()
        {
            bool rvalue = false;
            //判断是否有该插件的CUI信息 没有则创建
            PopMenu exitTopMenu = GetCurrentTopPopMenu();

            if (exitTopMenu == null)
            {
                RemoveHistoryMenu();
                System.Collections.Specialized.StringCollection topAliases = new System.Collections.Specialized.StringCollection();
                topAliases.Add("CmcuPlugin" + localPluginVersion);

                MacroGroup cmcuMacro = new MacroGroup("CmcuMacro" + localPluginVersion, mainCs.MenuGroup);
                MenuMacro  mSplit    = new MenuMacro(cmcuMacro, "连续取点", "MODElESSDIALOG", "");
                MenuMacro  mLogin    = new MenuMacro(cmcuMacro, "登录", "CMCULOGIN ", "");
                MenuMacro  mExit     = new MenuMacro(cmcuMacro, "退出", "CMCUEXIT ", "");
                MenuMacro  mUpdate   = new MenuMacro(cmcuMacro, "更新", "CMCUUPDATE ", "");

                PopMenu topMenu = new PopMenu("CMCU CAD" + localPluginVersion, topAliases, "CMCU CAD" + localPluginVersion, mainCs.MenuGroup);

                PopMenuItem menuSplit  = new PopMenuItem(mSplit, "连续取点", topMenu, -1);
                PopMenuItem menuLogin  = new PopMenuItem(mLogin, "登录", topMenu, -1);
                PopMenuItem menuExit   = new PopMenuItem(mExit, "退出", topMenu, -1);
                PopMenuItem menuUpdate = new PopMenuItem(mUpdate, "更新", topMenu, -1);
                AddMenuToWorkspaces(topMenu);
                rvalue = true;
            }
            return(rvalue);
        }
示例#3
0
 // Add the menu to all the workspaces
 private void addMenu2Workspaces(PopMenu pm)
 {
     foreach (Workspace wk in cs.Workspaces)
     {
         WorkspacePopMenu wkpm = new WorkspacePopMenu(wk, pm);
         wkpm.Display = 1;
     }
 }
示例#4
0
        //移除以前版本信息
        public void RemoveHistoryMenu()
        {
            try
            {
                PopMenu historyPopMenu = null;
                foreach (PopMenu tpm in mainCs.MenuGroup.PopMenus)
                {
                    AliasCollection acs = tpm.Aliases;
                    foreach (var ac in acs)
                    {
                        string acstr = ac as string;
                        if (!string.IsNullOrEmpty(acstr) && acstr.ToUpper().StartsWith("CMCUPLUGIN"))
                        {
                            historyPopMenu = tpm;
                        }
                        if (historyPopMenu != null)
                        {
                            foreach (Workspace wk in mainCs.Workspaces)
                            {
                                WorkspacePopMenu wkPm = wk.WorkspacePopMenus.FindWorkspacePopMenu(historyPopMenu.ElementID, historyPopMenu.Parent.Name);

                                if (wkPm != null)
                                {
                                    wk.WorkspacePopMenus.Remove(wkPm);
                                }
                            }

                            mainCs.MenuGroup.PopMenus.Remove(historyPopMenu);   // Deletes the Menu from ACAD Menu Group

                            MacroGroup           deleteMacroGroup = null;
                            MacroGroupCollection mgc       = mainCs.MenuGroup.MacroGroups;
                            List <int>           indexList = new List <int>();
                            foreach (MacroGroup mg in mgc)
                            {
                                if (mg.Name.ToUpper().StartsWith("CMCUMACRO"))
                                {
                                    deleteMacroGroup = mg;
                                }
                                if (deleteMacroGroup != null)
                                {
                                    indexList.Add(mgc.IndexOf(deleteMacroGroup));
                                }
                            }
                            indexList.Reverse();
                            foreach (int index in indexList)
                            {
                                mainCs.MenuGroup.MacroGroups.Remove(index);
                            }
                        }
                    }
                }
            }
            catch (System.Exception e)
            {
                ed.WriteMessage("\n异常:" + e.Message);
            }
        }
 // Use this for initialization
 void Start()
 {
     menu = GetComponent <PopMenu>();
     if (!menu)
     {
         menu = gameObject.AddComponent <PopMenu>();
     }
     _outline         = GetComponent <cakeslice.Outline>();
     _outline.enabled = false;
 }
示例#6
0
        // Add new Items to a PopMenu
        private void addItemsToPM(PopMenu pm)
        {
            PopMenuItem pmi = new PopMenuItem(pm, -1);

            pmi.MacroID = "ID_AUGI"; pmi.Name = "Autodesk User Group International";

            pmi = new PopMenuItem(pm, -1);

            pmi         = new PopMenuItem(pm, -1);
            pmi.MacroID = "ID_CustomSafe"; pmi.Name = "Online Developer Center";
        }
示例#7
0
        public void BuildCUI(string strMenuGroupName, string strCuiFile, System.Data.DataTable dtMacroGroup, System.Data.DataTable dtPopMenu)
        {
            try
            {
                // 为我们的局部菜单创建一个自定义区域(customization section)
                CustomizationSection pcs = new CustomizationSection();
                pcs.MenuGroupName = strMenuGroupName;

                // 添加菜单的命令组
                MacroGroup mg = new MacroGroup(dtMacroGroup.TableName, pcs.MenuGroup);
                //  pcs.MenuGroup.MacroGroups.Add(mg);
                MenuMacro mm = null;
                foreach (System.Data.DataRow r in dtMacroGroup.Rows)
                {
                    mm = mg.CreateMenuMacro(r["name"].ToString(), r["command"].ToString(), r["UID"].ToString());
                    mm.macro.HelpString = r["HelpString"].ToString();
                    // mg.AddMacro(mm);
                }
                //添加菜单项的设置
                StringCollection sc = new StringCollection();
                sc.Add("POP1");
                PopMenu pm = new PopMenu(dtPopMenu.TableName, sc, dtPopMenu.Namespace, pcs.MenuGroup);
                pcs.MenuGroup.PopMenus.Add(pm);
                PopMenuItem pmi = null;

                foreach (DataRow r in dtPopMenu.Rows)
                {
                    // 添加下拉菜单
                    if (Convert.ToBoolean(r["IsSeparator"]))
                    {
                        pmi = new PopMenuItem(pm);     //用此构造方法,即为分割条
                        pm.PopMenuItems.Add(pmi);
                    }
                    else
                    {
                        foreach (MenuMacro m in mg.MenuMacros)
                        {
                            if (m.ElementID == r["MenuMacroID"].ToString())
                            {
                                pmi = new PopMenuItem(m, r["NameRef"].ToString(), pm, -1);
                                pm.PopMenuItems.Add(pmi);
                                break;
                            }
                        }
                    }
                }
                // 最后保存文件
                pcs.SaveAs(strCuiFile);
            }
            catch (System.Exception ex)
            {
                throw new System.Exception("->BuildMenuCUI:" + ex.Message);
            }
        }
示例#8
0
        /// <summary>
        /// 添加下拉菜单
        /// </summary>
        /// <param name="menuGroup">包含菜单的菜单组</param>
        /// <param name="name">菜单名</param>
        /// <param name="aliasList">菜单的别名</param>
        /// <param name="tag">菜单的标识字符串</param>
        /// <returns>返回下拉菜单对象</returns>
        public static PopMenu AddPopMenu(this MenuGroup menuGroup, string name, StringCollection aliasList, string tag)
        {
            PopMenu pm = null;//声明下拉菜单对象

            //如果菜单组中没有名称为name的下拉菜单
            if (menuGroup.PopMenus.IsNameFree(name))
            {
                //为下拉菜单指定显示名称、别名、标识符和所属的菜单组
                pm = new PopMenu(name, aliasList, tag, menuGroup);
            }
            return(pm);//返回下拉菜单对象
        }
示例#9
0
    //-------------------------------------------------------------------------------------------------
    // unity methods
    //-------------------------------------------------------------------------------------------------
    void Awake()
    {
        UI.StoreSelectBoxSkin(mSelectBoxSkin);
        setPlayingArea();
        mSideBar = GetComponentInChildren <SideBar>();
        if (!mSideBar)
        {
            Debug.LogError("Can't find SideBar in HUD");
        }
        mSelectionBox = GetComponentInChildren <SelectionBox>();
        if (!mSelectionBox)
        {
            Debug.Log("Can't find SelectionBox in HUD. I disabled it.");
        }
        mPopMenu = GetComponentInChildren <PopMenu>();
        if (!mPopMenu)
        {
            Debug.LogError("Can't find PopMenu in HUD");
        }
        //mPopMenu.gameObject.SetActive(false);
        mExchangeMenu = GetComponentInChildren <ExchangeMenu>();
        if (!mExchangeMenu)
        {
            Debug.LogError("Can't find ExchangeMenu in HUD");
        }
        mExchangeMenu.gameObject.SetActive(false);
        mEquipMenu = GetComponentInChildren <EquipMenu>();
        if (!mEquipMenu)
        {
            Debug.LogError("Can't find EquipMenu in HUD");
        }
        mEquipMenu.gameObject.SetActive(false);
        //get the canvases
        List <Canvas> clist = new List <Canvas>(GetComponentsInChildren <Canvas>());

        foreach (Canvas c in clist)
        {
            if (c.gameObject.name == "ScreenBarsCanvas")
            {
                mScreenBarsCanvas = c;
            }
            else if (c.gameObject.name == "CameraSpaceCanvas")
            {
                mCameraSpaceCanvas = c;
            }
            else
            {
                Debug.LogWarning("Canvas with name " + c.gameObject.name + " not recognised");
            }
        }
    }
示例#10
0
 //加入工作区
 private void AddMenuToWorkspaces(PopMenu popMenu)
 {
     try
     {
         foreach (Workspace wk in mainCs.Workspaces)
         {
             WorkspacePopMenu wkpm = new WorkspacePopMenu(wk, popMenu);
             wkpm.Display = 1;
         }
     }
     catch
     {
     }
 }
示例#11
0
        /// <summary>
        /// 为下拉菜单添加子菜单
        /// </summary>
        /// <param name="parentMenu">下拉菜单</param>
        /// <param name="index">子菜单的位置</param>
        /// <param name="name">子菜单的显示名称</param>
        /// <param name="tag">子菜单的标识字符串</param>
        /// <returns>返回添加的子菜单</returns>
        public static PopMenu AddSubMenu(this PopMenu parentMenu, int index, string name, string tag)
        {
            PopMenu pm = null;//声明子菜单对象(属于下拉菜单类)

            //如果菜单组中没有名称为name的下拉菜单
            if (parentMenu.CustomizationSection.MenuGroup.PopMenus.IsNameFree(name))
            {
                //为子菜单指定显示名称、标识符和所属的菜单组,别名设为null
                pm = new PopMenu(name, null, tag, parentMenu.CustomizationSection.MenuGroup);
                //为子菜单指定其所属的菜单
                PopMenuRef menuRef = new PopMenuRef(pm, parentMenu, index);
            }
            return(pm);//返回子菜单对象
        }
示例#12
0
        /// <summary>
        /// 将自定义命令定义成菜单
        /// </summary>
        /// <param name="dic"></param>
        public void AddMenusToAutoCAD(List <myAutoCADNetDll> dicCmds)
        {
            string strCuiFileName       = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\KFWH_CMD.cuix";
            string strGpName            = "KFWH_CMDGroup";//defined a group name
            CustomizationSection myCsec = new CustomizationSection()
            {
                MenuGroupName = strGpName
            };
            MacroGroup       mg            = new MacroGroup("KFWH_CMD", myCsec.MenuGroup);
            StringCollection scMyMenuAlias = new StringCollection();

            scMyMenuAlias.Add("KFWH_CMD_POP");
            PopMenu pmParent = new PopMenu("KFWH_CMD", scMyMenuAlias, "KFWH_CMD", myCsec.MenuGroup);

            foreach (var dll in dicCmds)//each assembly commmands
            {
                PopMenu    pmCurDll = new PopMenu(dll.DllName, new StringCollection(), "", myCsec.MenuGroup);
                PopMenuRef pmrdll   = new PopMenuRef(pmCurDll, pmParent, -1);
                foreach (var cls in dll.ListsNetClass)
                {
                    if (cls.hasCmds)
                    {
                        PopMenu    pmCurcls = new PopMenu(cls.className, new StringCollection(), "", myCsec.MenuGroup);
                        PopMenuRef pmrcls   = new PopMenuRef(pmCurcls, pmCurDll, -1);
                        foreach (var cmd in cls.ListsNetcmds)
                        {
                            MenuMacro mm = new MenuMacro(mg, cmd.MethodName, cmd.cmdName, cmd.DllName + "_" + cmd.className + "_" + cmd.cmdName, MacroType.Any);
                            //指定命令宏的说明信息,在状态栏中显示
                            if (cmd.HelpString != string.Empty)
                            {
                                mm.macro.HelpString = cmd.HelpString;
                            }
                            if (cmd.IcoName != string.Empty)
                            {
                                mm.macro.LargeImage = mm.macro.SmallImage = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\KFWH_CMD_ICON\\" + cmd.IcoName;
                            }
                            //指定命令宏的大小图像的路径
                            PopMenuItem newPmi = new PopMenuItem(mm, cmd.MethodName, pmCurcls, -1);
                            //newPmi.MacroID = cmd.DllName + "_" + cmd.className + "_" + cmd.cmdName;
                        }
                    }
                }
            }
            //myCsec.MenuGroup.AddToolbar("kfwh_cmd");
            if (myCsec.SaveAs(strCuiFileName))
            {
                this.mycuiFileName = strCuiFileName;
            }
        }
示例#13
0
        public static void addMenu()
        {
            string myGroupName = "myGroup";
            string myCuiName   = "myMenu.cui";
            CustomizationSection myCsection = new CustomizationSection();

            myCsection.MenuGroupName = myGroupName;

            MacroGroup mg  = new MacroGroup("myMethod", myCsection.MenuGroup);
            MenuMacro  mm1 = new MenuMacro(mg, "新建文件", "createform ", "");
            MenuMacro  mm2 = new MenuMacro(mg, "打开文件", "openfile ", "");
            MenuMacro  mm3 = new MenuMacro(mg, "打开文件", "openribbon ", "");
            //声明菜单别名
            StringCollection scMyMenuAlias = new StringCollection();

            scMyMenuAlias.Add("MyPop1");
            scMyMenuAlias.Add("MyTestPop");

            //菜单项(将显示在项部菜单栏中)
            PopMenu pmParent = new PopMenu("矿山平台", scMyMenuAlias, "我的菜单", myCsection.MenuGroup);


            //子项的菜单(多级)
            PopMenu     pm1  = new PopMenu("文件", new StringCollection(), "", myCsection.MenuGroup);
            PopMenuRef  pmr1 = new PopMenuRef(pm1, pmParent, -1);
            PopMenuItem pmi1 = new PopMenuItem(mm1, "新建", pm1, -1);
            PopMenuItem pmi2 = new PopMenuItem(mm2, "打开", pm1, -1);

            ////子项的菜单(单级)
            PopMenuItem pmi3 = new PopMenuItem(mm3, "命令", pmParent, -1);

            bool k = myCsection.SaveAs(Global.sPath + @"\" + myCuiName);

            //AcadApplication app = (AcadApplication)Marshal.GetActiveObject("AutoCAD.Application.22");
            //AcadMenuBar menuBar = app.MenuBar;
            //AcadMenuGroup menuGroup = app.MenuGroups.Item(0);
            //AcadPopupMenus menus = menuGroup.Menus;
            //AcadPopupMenu mymenu = menus.Add("MyMenu");

            //mymenu.AddMenuItem(0, "Hello", "hello");
            //mymenu.AddSeparator(1);
            //mymenu.AddMenuItem(2, "Hello2", "hello");
            //AcadPopupMenu ext = mymenu.AddSubMenu(3, "Ext");
            //ext.AddMenuItem(0, "Hello", "hello");
            //ext.AddSeparator(1);
            //ext.AddMenuItem(2, "Hello2", "hello");
            //mymenu.InsertInMenuBar(menuBar.Count - 2);
        }
示例#14
0
        public void addMenu()
        {
            if (cs.MenuGroup.PopMenus.IsNameFree("Custom Menu"))
            {
                System.Collections.Specialized.StringCollection pmAliases = new System.Collections.Specialized.StringCollection();
                pmAliases.Add("POP12");

                PopMenu pm = new PopMenu("Custom Menu", pmAliases, "Custom Menu", cs.MenuGroup);

                addItemsToPM(pm);
                addMenu2Workspaces(pm);
            }
            else
            {
                ed.WriteMessage("Custom Menu already Exists\n");
            }
        }
示例#15
0
        /// <summary>
        /// Raises the <see cref="E:System.Web.UI.Control.Init" /> event.
        /// </summary>
        /// <param name="e">An <see cref="T:System.EventArgs" /> object that contains the event data.</param>
        protected override void OnInit([NotNull] EventArgs e)
        {
            base.OnInit(e);
            this._textCtl.Attributes.Add("class", "BBCodeEditor");

            // add popmenu BB Custom to this mix...
            this._popMenuBBCustom = new PopMenu();
            this.Controls.Add(this._popMenuBBCustom);

            // add popmenu BB Code to this mix...
            this._popMenuBBCode = new PopMenu();
            this.Controls.Add(this._popMenuBBCode);

            // add popmenu Albums to this mix...
            this._popMenuAlbums = new AlbumListPopMenu();
            this.Controls.Add(this._popMenuAlbums);
        }
示例#16
0
    public override void OnEnter(Hashtable args = null)
    {
        scene.title.text       = I18n.Translate(scene.prevSceneName + "_scan_title");
        scene.description.text = I18n.Translate(scene.prevSceneName + "_scan_desc");
        PopMenu menu = ScanSceneController.currentTrackableObject.GetComponent <PopMenu> ();

        VideoController.instant._videoSeekSlider.gameObject.SetActive(false);
        scene.description.gameObject.SetActive(true);
        bool showImmediate = args != null;

        if (showImmediate)
        {
            menu.ShowMenu();
        }
        else
        {
            menu.Show();
        }
    }
示例#17
0
        /// <summary>
        /// 为菜单添加菜单项
        /// </summary>
        /// <param name="parentMenu">菜单项所属的菜单</param>
        /// <param name="index">菜单项的位置</param>
        /// <param name="name">菜单项的显示名称</param>
        /// <param name="macroId">菜单项的命令宏的Id</param>
        /// <returns>返回添加的菜单项</returns>
        public static PopMenuItem AddMenuItem(this PopMenu parentMenu, int index, string name, string macroId)
        {
            PopMenuItem newPmi = null;

            //如果存在名为name的菜单项,则返回
            foreach (PopMenuItem pmi in parentMenu.PopMenuItems)
            {
                if (pmi.Name == name)
                {
                    return(newPmi);
                }
            }
            //定义一个菜单项对象,指定所属的菜单及位置
            newPmi = new PopMenuItem(parentMenu, index);
            ////如果name不为空,则指定菜单项的显示名为name,否则会使用命令宏的名称
            if (name != null)
            {
                newPmi.Name = name;
            }
            newPmi.MacroID = macroId; //菜单项的命令宏的ID
            return(newPmi);           //返回菜单项对象
        }
示例#18
0
        //取到当前PopMenu中Cmcu的菜单
        private PopMenu GetCurrentTopPopMenu()
        {
            PopMenu pm = null;

            foreach (PopMenu tpm in mainCs.MenuGroup.PopMenus)
            {
                AliasCollection acs = tpm.Aliases;
                foreach (var ac in acs)
                {
                    string acstr = ac as string;
                    if (!string.IsNullOrEmpty(acstr) && acstr.ToUpper().Equals("CMCUPLUGIN" + localPluginVersion))
                    {
                        pm = tpm; break;
                    }
                }
                if (pm != null)
                {
                    break;
                }
            }
            return(pm);
        }
示例#19
0
        public void remMenu()
        {
            // Find Index of the desired MenuItem
            // Remove it from all Workspaces that it exists in
            // Omitting this step leaves nasty left-overs in the Workspace files
            // Remove it from the Cui files' Menu List

            PopMenu pm = cs.MenuGroup.PopMenus.FindPopWithAlias("POP12");

            if (pm != null)
            {
                foreach (Workspace wk in cs.Workspaces)
                {
                    WorkspacePopMenu wkPm = wk.WorkspacePopMenus.FindWorkspacePopMenu(pm.ElementID, pm.Parent.Name);

                    if (wkPm != null)
                    {
                        wk.WorkspacePopMenus.Remove(wkPm);
                    }
                }
                cs.MenuGroup.PopMenus.Remove(pm);       // Deletes the Menu from ACAD Menu Group
            }
        }
示例#20
0
        public static void cuiMenu2()
        {
            //自定义的组名
            string strMyGroupName = "AgileGroup";
            //保存的CUI文件名(从CAD2010开始,后缀改为了cuix)
            string strCuiFileName = "AgileMenu.cuix";

            //创建一个自定义组(这个组中将包含我们自定义的命令、菜单、工具栏、面板等)
            CustomizationSection myCSection = new CustomizationSection();

            myCSection.MenuGroupName = strMyGroupName;

            //创建自定义命令组
            MacroGroup mg  = new MacroGroup("MyMethod", myCSection.MenuGroup);
            MenuMacro  mm1 = new MenuMacro(mg, "login", "^C^Clogin", "id_login");
            MenuMacro  mm2 = new MenuMacro(mg, "getattr", "^C^Cgetattr", "id_getattr");

            //声明菜单别名
            StringCollection scMyMenuAlias = new StringCollection();

            scMyMenuAlias.Add("POP1");
            //菜单项(将显示在项部菜单栏中)
            PopMenu pmParent = new PopMenu("Agile", scMyMenuAlias, "ID_Agile", myCSection.MenuGroup);

            //子项的菜单(多级)
            //PopMenu pm1 = new PopMenu("打开", new StringCollection(), "", myCSection.MenuGroup);
            //PopMenuRef pmr1 = new PopMenuRef(pm1, pmParent, -1);
            PopMenuItem pmi1 = new PopMenuItem(mm1, "登录", pmParent, -1);
            PopMenuItem pmi2 = new PopMenuItem(mm2, "上传", pmParent, -1);

            //子项的菜单(单级)
            //PopMenuItem pmi3 = new PopMenuItem(mm3, "保存(&S)", pmParent, -1);

            // 最后保存文件
            //myCSection.SaveAs(strCuiFileName);
            //Autodesk.AutoCAD.ApplicationServices.Application.LoadPartialMenu("");
        }
    protected virtual IEnumerator LoadDataSet()
    {
        ClearAndLoadDataSet();
        //int counter = 0;
        IEnumerable <TrackableBehaviour> tbs = Vuforia.TrackerManager.Instance.GetStateManager().GetTrackableBehaviours();
        GameObject buttonCanvasPrefab = null, buttonPrefab = null;        // = Resources.Load("Prefab/ScanButtonCanvas") as GameObject;

        foreach (TrackableBehaviour tb in tbs)
        {
            Logger.Log(tb.TrackableName, "purple");

            tb.gameObject.name = tb.TrackableName;

            XElement info = Xml.GetChildByAttribute(itemInfos, "id", tb.TrackableName);
            if (info == null)
            {
                continue;
            }
            string objType = Xml.Attribute(info, "type");
            tb.gameObject.AddComponent <DefaultTrackableEventHandler> ();
            tb.gameObject.AddComponent <CustomTrackableEventHandler> ();
            tb.gameObject.AddComponent <TurnOffBehaviour> ();
            CustomTrackableEventHandler cte = tb.gameObject.GetComponent <CustomTrackableEventHandler> ();
            cte.type         = objType;
            cte.subtitlePath = GetAssetsPath(Xml.Attribute(info, "subtitle"), true);
            UnityEngine.Object asset = null;
            if (objType == "object")
            {
//				string prefabName = Xml.Attribute (info, "prefab");
//				asset = loadedAssets.ContainsKey (prefabName) ? loadedAssets [prefabName] : new GameObject ();
//				var buttonNodes = info.Elements ();
//				GameObject bPanel = null;
//				foreach (XElement n in buttonNodes) {
//					if (buttonCanvasPrefab == null)
//						buttonCanvasPrefab = Resources.Load ("Prefabs/ScanButtonCanvas") as GameObject;
//					if (buttonPrefab == null)
//						buttonPrefab = Resources.Load ("Prefabs/ScanButton") as GameObject;
//					if (bPanel == null) {
//						bPanel = Instantiate (buttonCanvasPrefab) as GameObject;
//						bPanel.transform.SetParent (tb.gameObject.transform, false);
//					}
//					GameObject button = Instantiate (buttonPrefab) as GameObject;
//					button.AddComponent<ToggleButtonShowHide> ();
//					button.transform.SetParent (bPanel.transform.GetChild(0), false);
//				}
                InstantiateModelObject(info, tb, out asset);
            }
            else if (objType == "video")
            {
                InstantiateVideoObject(info, tb, out asset);

                //cte.mediaPlayer = mediaPlayer;
            }
            else if (objType == "menu4")
            {
                //asset = planePrefab;
                //Renderer render = (planePrefab).GetComponent<Renderer> ();
                //render.material = videoMaterial;
                //CustomTrackableEventHandler cte = tb.gameObject.GetComponent<CustomTrackableEventHandler> ();
                //cte.videoPath = GetAssetsPath (tb.TrackableName + ".mp4");
                //cte.mediaPlayer = mediaPlayer;
                tb.gameObject.AddComponent <PopMenu> ();
                PopMenu popmenu = tb.gameObject.GetComponent <PopMenu> ();
                popmenu.menuItems = new List <PopMenuItem> ();
                //popmenu.playerMateral = videoMaterial;

                var menuNodes = info.Elements();
                //XElement res = null;
                int index = 0;
                foreach (XElement n in menuNodes)
                {
                    GameObject  planeItem = GameObject.Instantiate(Resources.Load("Prefabs/PlaneItem4")) as GameObject;
                    PopMenuItem pmi       = planeItem.GetComponent <PopMenuItem> ();
                    popmenu.menuItems.Add(pmi);
                    pmi.floatSpeed       = 5f;
                    pmi.floatAmplitude   = 0.03f;
                    pmi.index            = index;
                    pmi.menu             = popmenu;
                    pmi.trackableHandler = cte;
                    Vector3 position = planeItem.transform.localPosition;
                    planeItem.transform.SetParent(tb.gameObject.transform, false);
                    if (index == 1)
                    {
                        planeItem.transform.localPosition = position.SetX(-position.x);
                    }
                    else if (index == 2)
                    {
                        planeItem.transform.localPosition = position.SetZ(-position.z);
                    }
                    else if (index == 3)
                    {
                        planeItem.transform.localPosition = new Vector3(-position.x, position.y, -position.z);
                    }
                    pmi.Initiate();
                    string itemSrc   = Xml.Attribute(n, "src");
                    string videoPath = Xml.Attribute(n, "videosrc");
                    planeItem.name   = pmi.name = tb.TrackableName + "_" + Xml.Attribute(n, "id");
                    pmi.subtitlePath = GetAssetsPath(Xml.Attribute(n, "subtitle"), true);
                    if (!string.IsNullOrEmpty(videoPath))
                    {
                        pmi.videoPath = GetAssetsPath(videoPath);
                        planeItem.RegisterClickEvent();
                    }
                    else
                    {
                        GameObject prefab = GetAsset(Xml.Attribute(n, "prefab"));
                        pmi.threeDObject = GameObject.Instantiate(prefab, prefab.transform.position, prefab.transform.rotation) as GameObject;
                        pmi.threeDObject.transform.SetParent(tb.gameObject.transform, false);
                        ApplyItemInfo(pmi.threeDObject, n);
                    }
                    WWW www = new WWW(GetAssetsPath(itemSrc, true));
                    yield return(www);

                    Logger.Log(GetAssetsPath(itemSrc, true) + " " + www.texture.ToString());
                    pmi.material.mainTexture = www.texture;
                    //Logger.Log (planeItem.transform.localPosition.x.ToString() + " " +planeItem.transform.localPosition.y+ " " + planeItem.transform.localPosition.z, "blue");
                    index++;
                }
                popmenu.Hide();
                InstantiateObject(tb, asset);
            }
            //GameObject obj = (GameObject)GameObject.Instantiate (asset);
//			if (asset != null) {
//				GameObject prefab = asset as GameObject;
//				GameObject obj = (GameObject)GameObject.Instantiate (prefab, prefab.transform.position, prefab.transform.rotation);
//
//				obj.transform.SetParent (tb.gameObject.transform, false);
//				ApplyItemInfo (obj, Xml.GetChildByAttribute (itemInfos, "id", tb.TrackableName));
//				obj.RegisterClickEvent ();
//			}
        }

        ObjectTracker objectTracker = Vuforia.TrackerManager.Instance.GetTracker <ObjectTracker> ();

        if (!objectTracker.Start())
        {
            Debug.Log("<color=yellow>Tracker Failed to Start.</color>");
        }
    }
示例#22
0
        public void GenerateUiFile()
        {
            string mainCui = Application.GetSystemVariable("MENUNAME") + ".cuix";

            string[] split   = mainCui.Split(new Char[] { '\\' });
            string   mainDir = "";

            for (int i = 0; i < split.Length - 2; i++)
            {
                mainDir += split[i]; mainDir += "\\";
            }

            string myCuiFile        = mainDir + "support\\KOJTO_3D.cuix";
            string myCuiSectionName = "KOJTO_3D";

            try
            {
                if (File.Exists(myCuiFile))
                {
                    File.Delete(myCuiFile);
                }
            }
            catch { }

            CustomizationSection pcs = new CustomizationSection();

            pcs.MenuGroupName = myCuiSectionName;

            #region macros
            MacroGroup mg            = new MacroGroup(myCuiSectionName, pcs.MenuGroup);
            MenuMacro  mmSettings    = new MenuMacro(mg, "KCAD_SETTINGS", "^C^CKCAD_SETTINGS", "ID_KCAD_SETTINGS");
            MenuMacro  mm0           = new MenuMacro(mg, "KCAD_NETLOAD", "^C^CNETLOAD", "ID_NETLOAD");
            MenuMacro  mm1           = new MenuMacro(mg, "KCAD_CREATEMESH", "^C^CKCAD_CREATEMESH", "ID_KCAD_CREATEMESH");
            MenuMacro  mm1C          = new MenuMacro(mg, "KCAD_READ_MESH_FROM_CSV", "^C^CKCAD_READ_MESH_FROM_CSV", "ID_KCAD_READ_MESH_FROM_CSV");
            MenuMacro  munC          = new MenuMacro(mg, "KCAD_DELETE_MESH_DATA", "^C^CKCAD_DELETE_MESH_DATA", "ID_KCAD_DELETE_MESH_DATA");
            MenuMacro  mm2           = new MenuMacro(mg, "KCAD_READMESH", "^C^CKCAD_READMESH", "ID_KCAD_READMESH");
            MenuMacro  mm3           = new MenuMacro(mg, "KCAD_SAVEMESH", "^C^CKCAD_SAVEMESH", "ID_KCAD_SAVEMESH");
            MenuMacro  mm4           = new MenuMacro(mg, "KCAD_DRAW", "^C^CKCAD_DRAW", "ID_KCAD_DRAW");
            MenuMacro  mm5           = new MenuMacro(mg, "KCAD_DRAW_NORMAL", "^C^CKCAD_DRAW_NORMALS", "ID_KCAD_DRAW_NORMAL");
            MenuMacro  mm5_          = new MenuMacro(mg, "KCAD_DRAW_NODE_UCS", "^C^CKCAD_DRAW_NODE_UCS", "ID_KCAD_DRAW_NODE_UCS");
            MenuMacro  mm67          = new MenuMacro(mg, "KCAD_SET_GLASS_DISTANCE_FOR_BEND", "^C^CKCAD_SET_GLASS_DISTANCE_FOR_BEND", "ID_KCAD_SET_GLASS_DISTANCE_FOR_BEND");
            MenuMacro  mm6           = new MenuMacro(mg, "KCAD_SET_GLASS_DISTANCE_FOR_ALL_BENDS", "^C^CKCAD_SET_GLASS_DISTANCE_FOR_ALL_BENDS", "ID_KCAD_SET_GLASS_DISTANCE_FOR_ALL_BENDS");
            MenuMacro  mm7           = new MenuMacro(mg, "KCAD_SHOW_GLASS", "^C^CKCAD_SHOW_GLASS", "ID_KCAD_SHOW_GLASS");
            MenuMacro  mm8           = new MenuMacro(mg, "KCAD_GLASS_EDGES", "^C^CKCAD_GLASS_EDGES_BY_FOLD_BASE", "ID_KCAD_GLASS_EDGES");
            MenuMacro  mm8A          = new MenuMacro(mg, "KCAD_GLASS_EDGES_", "^C^CKCAD_GLASS_EDGES_BY_UNFOLD_BASE", "ID_KCAD_GLASS_EDGES");
            MenuMacro  mm9           = new MenuMacro(mg, "KCAD_REVERSE", "^C^CKCAD_REVERSE", "ID_KCAD_REVERSE");
            MenuMacro  mm10          = new MenuMacro(mg, "KCAD_GlASS_CONTURS_BY_LEVEL", "^C^CGET_GlASS_CONTURS_BY_LEVEL", "ID_KCAD_GlASS_CONTURS_BY_LEVEL");
            MenuMacro  mm11          = new MenuMacro(mg, "KCAD_GlASS_CONTURS_UNFOLD_BY_LEVEL", "^C^CGET_GlASS_CONTURS_UNFOLD_BY_LEVEL", "ID_KCAD_GlASS_CONTURS_UNFOLD_BY_LEVEL");
            MenuMacro  mmAA          = new MenuMacro(mg, "KCAD_GET_BY_NUMER", "^C^CKCAD_GET_BY_NUMER", "ID_KCAD_GET_BY_NUMER");
            MenuMacro  mmAB          = new MenuMacro(mg, "KCAD_GET_BY_SELECTION", "^C^CKCAD_GET_BY_SELECTION", "ID_KCAD_GET_BY_SELECTION");
            MenuMacro  mmDIST        = new MenuMacro(mg, "KCAD_SET_GLASS_DISTANCE_TO_BEND_BY_NUMER", "^C^CKCAD_SET_GLASS_DISTANCE_TO_BEND_BY_NUMER", "ID_SET_GLASS_DISTANCE_TO_BEND_BY_NUMER");
            MenuMacro  mmGlasUnfolds = new MenuMacro(mg, "KCAD_GlASS_UNFOLDS_BY_LEVEL", "^C^CKCAD_GlASS_UNFOLDS_BY_LEVEL", "ID_KCAD_GlASS_UNFOLDS_BY_LEVEL");
            MenuMacro  mm08          = new MenuMacro(mg, "KCAD_DRAW_NODES_NORMALS_BY_NOFICTIVE", "^C^CKCAD_DRAW_NODES_NORMALS_BY_NOFICTIVE", "ID_KCAD_DRAW_NODES_NORMALS_BY_NOFICTIVE");
            MenuMacro  mm09          = new MenuMacro(mg, "KCAD_CHANGE_SELECTED_BENDS_NORMALS", "^C^CKCAD_CHANGE_SELECTED_BENDS_NORMALS", "ID_KCAD_CHANGE_SELECTED_BENDS_NORMALS");
            MenuMacro  mm091         = new MenuMacro(mg, "KCAD_SET_EXPLICIT_NODE_NORMAL_BY_POSITION", "^C^CKCAD_SET_EXPLICIT_NODE_NORMAL_BY_POSITION", "ID_KCAD_SET_EXPLICIT_NODE_NORMAL_BY_POSITION");

            MenuMacro mmPrf1   = new MenuMacro(mg, "KCAD_READ_PROFILE_DATA", "^C^CKCAD_DRAW_PROFILE_SOLID", "ID_KCAD_KCAD_DRAW_PROFILE_SOLID");
            MenuMacro mmPrf1_  = new MenuMacro(mg, "KCAD_READ_PROFILE_DATA_A", "^C^CKCAD_DRAW_PROFILE_SOLID_A", "ID_KCAD_KCAD_DRAW_PROFILE_SOLID_A");
            MenuMacro mmPrf1__ = new MenuMacro(mg, "KCAD_ADD_PROFILE_POINT_TO_FILE", "^C^CKCAD_ADD_PROFILE_POINT_TO_FILE", "ID_KCAD_ADD_PROFILE_POINT_TO_FILE");
            MenuMacro mmPrf2   = new MenuMacro(mg, "KCAD_PREPARE_PROFILE_UNFOLD", "^C^CKCAD_PREPARE_PROFILE_UNFOLD", "ID_KCAD_PREPARE_PROFILE_UNFOLD");


            MenuMacro mmCAM_CNC  = new MenuMacro(mg, "KCAD_NODE_TO_CNC", "^C^CKCAD_NODE_TO_CNC", "ID_KCAD_NODE_TO_CNC");
            MenuMacro mmCAM_CNC1 = new MenuMacro(mg, "KCAD_NODE_TO_CSV", "^C^CKCAD_NODE_TO_CSV", "ID_KCAD_NODE_TO_CSV");
            MenuMacro mmCAM_CN1  = new MenuMacro(mg, "KCAD_POLYGONS_CSV", "^C^CKCAD_POLYGONS_CSV", "ID_KCAD_POLIGONS_CSV");

            MenuMacro mmPlacement_3D_0    = new MenuMacro(mg, "KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION", "^C^CKCAD_PLACEMENT_OF_NODE_3D_IN_POSITION", "ID_KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION");
            MenuMacro mmPlacement_3D_00   = new MenuMacro(mg, "KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_DELETE", "^C^CKCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_DELETE", "ID_KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_DELETE");
            MenuMacro mmPlacement_3D_000  = new MenuMacro(mg, "KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_HIDE", "^C^CKCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_HIDE", "ID_KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_HIDE");
            MenuMacro mmPlacement_3D_0000 = new MenuMacro(mg, "KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_SHOW", "^C^CKCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_SHOW", "ID_KCAD_PLACEMENT_OF_NODE_3D_IN_POSITION_SHOW");
            MenuMacro mmPlacement_3D_1    = new MenuMacro(mg, "PLACEMENT_OF_BENDS_NOZZLE_BLOCKS_IN_NODES", "^C^CKCAD_PLACEMENT_OF_BENDS_NOZZLE_BLOCKS_IN_NODES", "ID_KCAD_PLACEMENT_OF_BENDS_NOZZLE_BLOCKS_IN_NODES");
            MenuMacro mmPlacement_3D_100  = new MenuMacro(mg, "KCAD_PLACEMENT_OF_BENDS_NOZZLE_3D_IN_POSITION_HIDE", "^C^CKCAD_PLACEMENT_OF_BENDS_NOZZLE_3D_IN_POSITION_HIDE", "ID_KCAD_PLACEMENT_OF_BENDS_NOZZLE_3D_IN_POSITION_HIDE");
            MenuMacro mmPlacement_3D_1000 = new MenuMacro(mg, "KCAD_PLACEMENT_OF_BENDS_NOZZLE_3D_IN_POSITION_SHOW", "^C^CKCAD_PLACEMENT_OF_BENDS_NOZZLE_3D_IN_POSITION_SHOW", "ID_KCAD_PLACEMENT_OF_BENDS_NOZZLE_3D_IN_POSITION_SHOW");
            MenuMacro mmPlacement_3D_10   = new MenuMacro(mg, "PLACEMENT_OF_BEND_NOZZLE_3D_DELETE", "^C^CKCAD_PLACEMENT_OF_BEND_NOZZLE_3D_DELETE", "ID_KCAD_PLACEMENT_OF_BEND_NOZZLE_3D_DELETE");
            MenuMacro mmPlacement_3D_2    = new MenuMacro(mg, "KCAD_PLACEMENT_BENDS_3D", "^C^CKCAD_PLACEMENT_BENDS_3D", "ID_KCAD_PLACEMENT_BENDS_3D");
            MenuMacro mmPlacement_3D_3    = new MenuMacro(mg, "KCAD_PLACEMENT_BEND_3D_DELETE", "^C^CKCAD_PLACEMENT_BEND_3D_DELETE", "ID_KCAD_PLACEMENT_BEND_3D_DELETE");
            MenuMacro mmPlacement_3D_4    = new MenuMacro(mg, "KCAD_PLACEMENT_OF_BENDS_3D_IN_POSITION_HIDE", "^C^CKCAD_PLACEMENT_OF_BENDS_3D_IN_POSITION_HIDE", "ID_KCAD_PLACEMENT_OF_BENDS_3D_IN_POSITION_HIDE");
            MenuMacro mmPlacement_3D_5    = new MenuMacro(mg, "KCAD_PLACEMENT_OF_BENDS_3D_IN_POSITION_SHOW", "^C^CKCAD_PLACEMENT_OF_BENDS_3D_IN_POSITION_SHOW", "ID_KCAD_PLACEMENT_OF_BENDS_3D_IN_POSITION_SHOW");
            MenuMacro mmCAM_Check         = new MenuMacro(mg, "KCAD_CALC_MIN_CAM_RADIUS", "^C^CKCAD_CALC_MIN_CAM_RADIUS", "ID_KCAD_CALC_MIN_CAM_RADIUS");

            MenuMacro mmFixing = new MenuMacro(mg, "KCAD_ADD_FIXING_ELEMENTS", "^C^CKCAD_ADD_FIXING_ELEMENTS", "ID_KCAD_ADD_FIXING_ELEMENTS");
            MenuMacro mmRB     = new MenuMacro(mg, "KCAD_RESTORE_BENDS_NORMALS", "^C^CKCAD_RESTORE_BENDS_NORMALS", "ID_KCAD_RESTORE_BENDS_NORMALS");
            MenuMacro mmRN     = new MenuMacro(mg, "KCAD_RESTORE_NODES_NORMALS", "^C^CKCAD_RESTORE_NODES_NORMALS", "ID_KCAD_RESTORE_NODES_NORMALS");
            MenuMacro mmTN     = new MenuMacro(mg, "KCAD_SET_ALL_NODES_NORMALS_EXPLICIT", "^C^CKCAD_SET_ALL_NODES_NORMALS_EXPLICIT", "ID_KCAD_SET_ALL_NODES_NORMALS_EXPLICIT");

            MenuMacro mmGlass_DOUBLE1 = new MenuMacro(mg, "KCAD_SHOW_DOUBLE_GLAS", "^C^CKCAD_SHOW_DOUBLE_GLAS", "ID_KCAD_SHOW_DOUBLE_GLAS");
            MenuMacro mmGlass_DOUBLE2 = new MenuMacro(mg, "KCAD_DOUBLE_GlASS_UNFOLDS_TRIANGLE", "^C^CKCAD_DOUBLE_GlASS_UNFOLDS_TRIANGLE", "ID_KCAD_DOUBLE_GlASS_UNFOLDS_TRIANGLE");
            MenuMacro mmGlass_DOUBLE3 = new MenuMacro(mg, "KCAD_BENDS_TO_SEPARATE_DRAWINGS", "^C^CKCAD_BENDS_TO_SEPARATE_DRAWINGS", "ID_KCAD_BENDS_TO_SEPARATE_DRAWINGS");

            MenuMacro mmRCN = new MenuMacro(mg, "KCAD_PLACEMENT_BENDS_3D_BY_NORMALS", "^C^CKCAD_PLACEMENT_BENDS_3D_BY_NORMALS", "ID_KCAD_PLACEMENT_BENDS_3D_BY_NORMALS");
            MenuMacro mmRPN = new MenuMacro(mg, "KCAD_BEND_SECTION_TO_SEPARATE_DRAWINGS", "^C^CKCAD_BEND_SECTION_TO_SEPARATE_DRAWINGS", "ID_KCAD_BEND_SECTION_TO_SEPARATE_DRAWINGS");
            MenuMacro mmDN  = new MenuMacro(mg, "KCAD_DRAW_NUMERS", "^C^CKCAD_DRAW_NUMERS", "ID_KCAD_DRAW_NUMERS");

            MenuMacro mmEN = new MenuMacro(mg, "KCAD_DRAW_SECOND_MESH", "^C^CKCAD_DRAW_SECOND_MESH", "ID_KCAD_DRAW_SECOND_MESH");

            MenuMacro mmRES = new MenuMacro(mg, "KCAD_RESTORE_NODE_NORMAL_BY_SELECTION", "^C^CKCAD_RESTORE_NODE_NORMAL_BY_SELECTION", "ID_KCAD_RESTORE_NODE_NORMAL_BY_SELECTION");
            MenuMacro mmCH  = new MenuMacro(mg, "KCAD_KCAD_CHANGE_EXPLICIT_NORMAL_LENGTH_SELECTION", "^C^CKCAD_CHANGE_EXPLICIT_NORMAL_LENGTH_SELECTION", "ID_KCAD_CHANGE_EXPLICIT_NORMAL_LENGTH_SELECTION");

            MenuMacro mmS = new MenuMacro(mg, "KCAD_KCAD_ATTACHING_A_SOLID3D_TO_BEND", "^C^CKCAD_ATTACHING_A_SOLID3D_TO_BEND", "ID_KCAD_ATTACHING_A_SOLID3D_TO_BEND");

            MenuMacro mmS1 = new MenuMacro(mg, "KCAD_KCAD_RESTORE_BEND_NORMAL", "^C^CKCAD_RESTORE_BEND_NORMAL", "ID_KCAD_RESTORE_BEND_NORMAL");

            MenuMacro mmS2 = new MenuMacro(mg, "KCAD_KCAD_EXPROF", "^C^CKCAD_EXPROF", "ID_KCAD_EXPROF");
            MenuMacro mmS3 = new MenuMacro(mg, "KCAD_EXTRIM", "^C^CKCAD_EXTRIM", "ID_KCAD_EXTRIM");

            MenuMacro mmS4 = new MenuMacro(mg, "KCAD_GlASS_POLYGON_UNFOLDS_BY_LEVEL", "^C^CKCAD_GlASS_POLYGON_UNFOLDS_BY_LEVEL", "ID_KCAD_GlASS_POLYGON_UNFOLDS_BY_LEVEL");
            MenuMacro mmS5 = new MenuMacro(mg, "KCAD_GlASS_TRIANGLE_UNFOLDS_BY_LEVEL", "^C^CKCAD_GlASS_TRIANGLE_UNFOLDS_BY_LEVEL", "ID_KCAD_GlASS_TRIANGLE_UNFOLDS_BY_LEVEL");

            MenuMacro mm0_help  = new MenuMacro(mg, "KCAD_READMESH_GET_HELP", "^C^CKCAD_READMESH_GET_HELP", "ID_KCAD_READMESH_GET_HELP");
            MenuMacro mm11_help = new MenuMacro(mg, "KCAD_SAVEMESH_GET_HELP", "^C^CKCAD_SAVEMESH_GET_HELP", "ID_KCAD_SAVEMESH_GET_HELP");
            MenuMacro mm2_help  = new MenuMacro(mg, "KCAD_DRAW_NODES_NORMALS_BY_NOFICTIVE_HELP", "^C^CKCAD_DRAW_NODES_NORMALS_BY_NOFICTIVE_HELP", "ID_KCAD_DRAW_NODES_NORMALS_BY_NOFICTIVE_HELP");

            MenuMacro mmHELP = new MenuMacro(mg, "KCAD_HELP", "^C^CKCAD_HELP", "ID_KCAD_HELP");
            // MenuMacro mmCCAM = new MenuMacro(mg, "CALC MIN CAM RADIUS", "^C^CKCAD_CALC_MIN_CAM_RADIUS", "ID_KCAD_CALC_MIN_CAM_RADIUS");

            MenuMacro mmHEeP = new MenuMacro(mg, "KCAD_CUTTING_BENDS_IN_NODES", "^C^CKCAD_CUTTING_BENDS_IN_NODES", "ID_KCAD_CUTTING_BENDS_IN_NODES");

            MenuMacro mm0CSV = new MenuMacro(mg, "KCAD_READ_NAMED_POINTS_FROM_CSV", "^C^CKCAD_READ_NAMED_POINTS_FROM_CSV", "ID_KCAD_READ_NAMED_POINTS_FROM_CSV");
            MenuMacro mm1CSV = new MenuMacro(mg, "KCAD_NAMED_POINTS_DRAW", "^C^CKCAD_NAMED_POINTS_DRAW", "ID_KCAD_NAMED_POINTS_DRAW");

            MenuMacro mmGHG  = new MenuMacro(mg, "HIDE GLASS", "^C^CKCAD_HIDE_GLASS", "ID_KCAD_HIDE_GLASS");
            MenuMacro mmGSHG = new MenuMacro(mg, "SHOW HIDEN GLASS", "^C^CKCAD_SHOW_HIDEN_GLASS", "ID_KCAD_SHOW_HIDEN_GLASS");

            MenuMacro mmdGHG  = new MenuMacro(mg, "HIDE DOUBLE GLASS", "^C^CKCAD_HIDE_DOUBLE_GLASS", "ID_KCAD_HIDE_DOUBLE_GLASS");
            MenuMacro mmdGSHG = new MenuMacro(mg, "SHOW HIDEN DOUBLE GLASS", "^C^CKCAD_SHOW_HIDEN_DOUBLE_GLASS", "ID_KCAD_SHOW_HIDEN_DOUBLE_GLASS");

            MenuMacro mmCG = new MenuMacro(mg, "CENTER of Gravity", "^C^CKCAD_GET_REAL_CENTROID", "ID_KCAD_GET_REAL_CENTROID");

            MenuMacro mmGCC = new MenuMacro(mg, "SPOTS from glass on the triangles - CENTER of Gravity", "^C^CKCAD_GET_GLASS_CONTURS_CENTROID", "ID_KCAD_GET_GLASS_CONTURS_CENTROID");
            MenuMacro mmTBC = new MenuMacro(mg, "TEORETICAL MESH CENTROID", "^C^CKCAD_GET_TEORETICAL_BENDS_CENTROID", "ID_KCAD_GET_TEORETICAL_BENDS_CENTROID");

            MenuMacro mmCPS  = new MenuMacro(mg, "SET_CUT_PROFILE_PARAM_GLOBAL", "^C^CKCAD_SET_CUT_SOLID_LK", "ID_KCAD_SET_CUT_SOLID_LK");
            MenuMacro mmCPS1 = new MenuMacro(mg, "SET_CUT_PROFILE_PARAM_GLOBAL", "^C^CKCAD_SET_CUT_SOLID_TH", "ID_KCAD_SET_CUT_SOLID_TH");
            MenuMacro mmCPS3 = new MenuMacro(mg, "SET_CUT_SOLID_ER_GLOBAL", "^C^CKCAD_SET_CUT_SOLID_ER", "ID_KCAD_SET_CUT_SOLID_ER");
            MenuMacro mmCPS2 = new MenuMacro(mg, "SET_CUT_PROFILE_PARAM_BY_BEND_NUMER", "^C^CKCAD_SET_BEND_EXPLICIT_PARAMETERS", "ID_KCAD_SET_BEND_EXPLICIT_PARAMETERS");

            MenuMacro mmCPS4 = new MenuMacro(mg, "TRIMING_VERTICES_VARIANT", "^C^CKCAD_CHANGE_PICK_TRIM_VARIANT", "ID_KCAD_CHANGE_PICK_TRIM_VARIANT");

            MenuMacro mmCPS5 = new MenuMacro(mg, "ERASE_GLASS_3D", "^C^CKCAD_PLACEMENT_3D_GLASS_DELETE", "ID_KCAD_PLACEMENT_3D_GLASS_DELETE");

            MenuMacro mmERS5  = new MenuMacro(mg, "EX_RATIO_BY_BEND", "^C^CKCAD_EX_RATIO_BY_BEND", "ID_KCAD_EX_RATIO_BY_BEND");
            MenuMacro mmERS4  = new MenuMacro(mg, "EXPLICIT_CUTTING_METHOD", "^C^CKCAD_EXPLICIT_CUTTING_METHOD_FOR_ENDS_IN_NODE", "ID_KCAD_EXPLICIT_CUTTING_METHOD_FOR_ENDS_IN_NODE");
            MenuMacro mmER5S5 = new MenuMacro(mg, "CLEAR_EXPLICIT_CUTTING_METHOD", "^C^CKCAD_CLEAR_EXPLICIT_CUTTING_METHOD_FOR_ALL", "ID_KCAD_CLEAR_EXPLICIT_CUTTING_METHOD_FOR_ALL");

            MenuMacro mmERP5 = new MenuMacro(mg, "PROJECT_POINT_TO_PLANE", "^C^CKCAD_PROJECT_POINT_TO_PLANE", "ID_KCAD_PROJECT_POINT_TO_PLANE");

            MenuMacro mmERT5 = new MenuMacro(mg, "ANGLE BETWEEN TRIANGLES", "^C^CKCAD_ANGLE_BETWEEN_TRIANGLES", "ID_KCAD_ANGLE_BETWEEN_TRIANGLES");

            MenuMacro mmMDN = new MenuMacro(mg, "MINIMUMU DISTANCE TO NODE", "^C^CKCAD_NEAREST_FROM_NODES", "ID_KCAD_NEAREST_FROM_NODES");
            MenuMacro mmMDB = new MenuMacro(mg, "MINIMUMU DISTANCE TO BEND MID", "^C^CKCAD_NEAREST_BEND_MIDPOINT", "ID_KCAD_NEAREST_BEND_MIDPOINT");
            MenuMacro mmMDT = new MenuMacro(mg, "MINIMUMU DISTANCE TO TRIANGLE MID", "^C^CKCAD_NEAREST_TRIANGLE_MIDPOINT", "ID_KCAD_NEAREST_TRIANGLE_MIDPOINT");

            MenuMacro mmRSM1 = new MenuMacro(mg, "READ MESH FROM EXTERNAL", "^C^CKCAD_READ_CONTAINER_FROM_EXTERNAL_FILE", "ID_KCAD_READ_CONTAINER_FROM_EXTERNAL_FILE");
            MenuMacro mmRSM2 = new MenuMacro(mg, "SAVE MESH TO EXTERNAL", "^C^CKCAD_SAVE_CONTAINER_IN_EXTERNAL_FILE", "ID_KCAD_SAVE_CONTAINER_IN_EXTERNAL_FILE");

            MenuMacro mmDSN = new MenuMacro(mg, "CREATE NEW MESH FROM CURRENT THROUGH END OF NORMALS", "^C^CKCAD_SMB", "ID_KCAD_NEAREST_FROM_NODES");

            MenuMacro mmMDBS = new MenuMacro(mg, "REURN MINIMAL DISTANCE BETWEEN SOLIDS", "^C^CKCAD_MIN_DISTANCE_BETWEEN_SOLID3D", "ID_KCAD_MIN_DISTANCE_BETWEEN_SOLID3D");

            MenuMacro mmITP = new MenuMacro(mg, "INTERSECTION LINE BETWEE TWO PLANES", "^C^CKCAD_INTERSECTION_LINE_BETWEEN_TWO_PLANES", "ID_KCAD_INTERSECTION_LINE_BETWEEN_TWO_PLANES");

            MenuMacro mmCALC = new MenuMacro(mg, "CALCULATE FORMULA", "^C^CKCAD_CALCULATE_FORMULA", "ID_KCAD_CALCULATE_FORMULA");
            #endregion ;

            StringCollection sc = new StringCollection();
            sc.Add("POP15");

            PopMenu     pm          = new PopMenu(myCuiSectionName, sc, "ID_MyPop1", pcs.MenuGroup);
            PopMenuItem pmi000      = new PopMenuItem(mmCALC, "CALCULATE FORMULA", pm, -1);
            PopMenuItem pmi_000     = new PopMenuItem(pm, -1);
            PopMenuItem pmi0        = new PopMenuItem(mm0, "NETLOAD", pm, -1);
            PopMenuItem pmi_h0      = new PopMenuItem(pm, -1);
            PopMenuItem pmiHELP     = new PopMenuItem(mmHELP, "HELP", pm, -1);
            PopMenuItem pmi_0       = new PopMenuItem(pm, -1);
            PopMenuItem pmiSettings = new PopMenuItem(mmSettings, "SETTINGS", pm, -1);


            PopMenuItem pmi_sie = new PopMenuItem(pm, -1);
            #region mesh
            StringCollection scMESH      = new StringCollection();
            PopMenu          pmMESH      = new PopMenu("MESH", scMESH, "ID_SubscMESH", pcs.MenuGroup);
            PopMenuItem      pmi1        = new PopMenuItem(mm1, "CREATE  MESH", pmMESH, -1);
            PopMenuItem      pmi1C       = new PopMenuItem(mm1C, "READ MESH FROM CSV file", pmMESH, -1);
            PopMenuItem      pmi_se      = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmi2        = new PopMenuItem(mm2, "READ  MESH from this DWG (from dictionary)", pmMESH, -1);
            PopMenuItem      pmij2       = new PopMenuItem(mmRSM1, "READ  MESH from External TXT file", pmMESH, -1);
            PopMenuItem      pmi2_help   = new PopMenuItem(mm0_help, "Read mesh HELP topic", pmMESH, -1);
            PopMenuItem      pmi_se_help = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmi4        = new PopMenuItem(mm3, "SAVE  MESH in this DWG (in dictionary)", pmMESH, -1);
            PopMenuItem      pmij4       = new PopMenuItem(mmRSM2, "SAVE  MESH to External TXT File", pmMESH, -1);
            PopMenuItem      pmi3_help   = new PopMenuItem(mm11_help, "Save mesh HELP topic", pmMESH, -1);
            PopMenuItem      pmi_se_     = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmdd_help   = new PopMenuItem(munC, "Delete Mesh Data from Dictionary", pmMESH, -1);
            PopMenuItem      pmi_dd_help = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmu3_help   = new PopMenuItem(mmTBC, "Teoretical mesh (No fictive Bends) - Center of Gravity", pmMESH, -1);
            PopMenuItem      pmi_ge_     = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmi5        = new PopMenuItem(mm4, "DRAW", pmMESH, -1);
            PopMenuItem      pmi6        = new PopMenuItem(mm5, "DRAW  NORMALS", pmMESH, -1);
            PopMenuItem      pmi_7       = new PopMenuItem(mmEN, "LINK the ENDS of NORMALS in the NODES", pmMESH, -1);
            PopMenuItem      pmi_8       = new PopMenuItem(mmDSN, "CREATE NEW MESH FROM CURRENT THROUGH END OF NORMALS", pmMESH, -1);
            PopMenuItem      pmi_ise_    = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmi06       = new PopMenuItem(mm08, "DRAW  NODE NORMALS BY NoFictive Bends", pmMESH, -1);
            PopMenuItem      pmi06_help  = new PopMenuItem(mm2_help, "HELP", pmMESH, -1);
            PopMenuItem      pmi_siie_   = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmi07_      = new PopMenuItem(mm5_, "DRAW  NODE UCS BY NoFictive Bends", pmMESH, -1);
            PopMenuItem      pmi07i_     = new PopMenuItem(mmDN, "DRAW  NUMERS", pmMESH, -1);
            PopMenuItem      pmi_se__    = new PopMenuItem(pmMESH, -1);
            PopMenuItem      pmui        = new PopMenuItem(mmAA, "GET_BY_NUMER", pmMESH, -1);
            PopMenuItem      pmuii       = new PopMenuItem(mmAB, "GET_BY_SELECTION", pmMESH, -1);
            PopMenuItem      pmSGff2     = new PopMenuItem(mmERT5, "Angle between the NORMALS of the adjacent Triangles", pmMESH, -1);
            PopMenuItem      pmi_gue_    = new PopMenuItem(pmMESH, -1);

            StringCollection scMESH_MINIMUM_DISTANCES = new StringCollection();
            PopMenu          pmMESH_MINIMUM_DISTANCES = new PopMenu("Minimum Distance to ..", scMESH_MINIMUM_DISTANCES, "ID_MINDIST", pcs.MenuGroup);
            PopMenuItem      pmMD1 = new PopMenuItem(mmMDN, "to Node", pmMESH_MINIMUM_DISTANCES, -1);
            PopMenuItem      pmMD2 = new PopMenuItem(mmMDB, "to Bend Mid Point", pmMESH_MINIMUM_DISTANCES, -1);
            PopMenuItem      pmMD3 = new PopMenuItem(mmMDT, "to Triangle Centroid", pmMESH_MINIMUM_DISTANCES, -1);
            PopMenuRef       pmMESH_MINIMUM_DISTANCES_Ref = new PopMenuRef(pmMESH_MINIMUM_DISTANCES, pmMESH, -1);
            pmMESH.PopMenuItems.Add(pmMESH_MINIMUM_DISTANCES_Ref);

            PopMenuItem pmi_seo__ = new PopMenuItem(pmMESH, -1);

            StringCollection scMESH_MODIFY_NORMALS = new StringCollection();
            PopMenu          pmMESH_MODIFY_NORMALS = new PopMenu("MODIFY NORMALS", scMESH_MODIFY_NORMALS, "ID_SubscMESH", pcs.MenuGroup);
            PopMenuItem      pmi10     = new PopMenuItem(mm9, "REVERSE NORMALS", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmt_seo__ = new PopMenuItem(pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmi010    = new PopMenuItem(mm09, "SET EXPLICIT BENDS NORMALS BY DIRECTION", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmr010    = new PopMenuItem(mmRB, "RESTORE BENDS NORMALS", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmi0100   = new PopMenuItem(mmS1, "RESTORE BEND NORMAL", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmt_seo_  = new PopMenuItem(pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmi011    = new PopMenuItem(mm091, "SET EXPLICIT NODE NORMAL", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmi012    = new PopMenuItem(mmTN, "SET ALL NOES NORMALS EXPLICIT (by bends midpoints centroid)", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmr011    = new PopMenuItem(mmRN, "RESTORE NODE NORMALS", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmr01_1   = new PopMenuItem(mmRES, "RESTORE NODE NORMAL BY SELECTION", pmMESH_MODIFY_NORMALS, -1);
            PopMenuItem      pmr01_2   = new PopMenuItem(mmCH, "CHENGE EXPLICIT NORMAL LENGTH SELECTION", pmMESH_MODIFY_NORMALS, -1);
            //PopMenuItem pmt_seo = new PopMenuItem(pmMESH_MODIFY_NORMALS, -1);
            PopMenuRef pmMESH__MODIFY_NORMALS_Ref = new PopMenuRef(pmMESH_MODIFY_NORMALS, pmMESH, -1);
            pmMESH.PopMenuItems.Add(pmMESH__MODIFY_NORMALS_Ref);
            PopMenuRef pmMESH_Ref = new PopMenuRef(pmMESH, pm, -1);
            pm.PopMenuItems.Add(pmMESH_Ref);
            #endregion

            PopMenuItem pmi_seu__ = new PopMenuItem(pm, -1);
            #region glass
            StringCollection scGLASS      = new StringCollection();
            PopMenu          pmGLASS      = new PopMenu("GLASS", scGLASS, "ID_GLASS", pcs.MenuGroup);
            PopMenuItem      pmi7         = new PopMenuItem(mm7, "MAKE and SHOW  GLASS", pmGLASS, -1);
            PopMenuItem      pmi7_        = new PopMenuItem(mmGHG, "HIDE  GLASS", pmGLASS, -1);
            PopMenuItem      pmi7__       = new PopMenuItem(mmGSHG, "SHOW HIDEN GLASS", pmGLASS, -1);
            PopMenuItem      pmi5__       = new PopMenuItem(mmCPS5, "ERASE GLASS 3D and from database", pmGLASS, -1);
            PopMenuItem      pmi_s_e_____ = new PopMenuItem(pmGLASS, -1);
            PopMenuItem      pmi8CG       = new PopMenuItem(mmGCC, "spots from glass on the triangles - Center of Gravity", pmGLASS, -1);
            PopMenuItem      pmi8         = new PopMenuItem(mm8, "SHOW GLASS EDGES (spots from glass on the triangles)", pmGLASS, -1);
            // PopMenuItem pmi8A = new PopMenuItem(mm8A, "SHOW GLASS EDGES_BY_UNFOLD_BASE", pmGLASS, -1);
            PopMenuItem      pmi8B              = new PopMenuItem(mm10, "SHOW GlASS_CONTURS_BY_LEVEL", pmGLASS, -1);
            PopMenuItem      pmi8C              = new PopMenuItem(mm11, "SHOW GlASS_CONTURS_UNFOLD_BY_LEVEL", pmGLASS, -1);
            PopMenuItem      pmi_s_e____        = new PopMenuItem(pmGLASS, -1);
            PopMenuItem      pmi8C_             = new PopMenuItem(mmGlasUnfolds, "SEPARATE ALL - GlASS UNFOLDS BY LEVEL", pmGLASS, -1);
            PopMenuItem      pmi8F_             = new PopMenuItem(mmS5, "SEPARATE BY NUMER - TRIANGLE GLASS UNFOLDS", pmGLASS, -1);
            PopMenuItem      pmi8FF_            = new PopMenuItem(mmS4, "SEPARATE BY NUMER- POLYGON GLASS UNFOLDS", pmGLASS, -1);
            PopMenuItem      pmi_se____         = new PopMenuItem(pmGLASS, -1);
            StringCollection scGLASS_DOUBLE     = new StringCollection();
            PopMenu          pmGLASS_DOUBLE     = new PopMenu("DOUBLE GLASS", scGLASS_DOUBLE, "ID_GLASS_DOUBLE", pcs.MenuGroup);
            PopMenuItem      pmu7               = new PopMenuItem(mmGlass_DOUBLE1, "SHOW", pmGLASS_DOUBLE, -1);
            PopMenuItem      pmx7               = new PopMenuItem(mmdGHG, "HIDE DOUBLE GLASS", pmGLASS_DOUBLE, -1);
            PopMenuItem      pmx7_              = new PopMenuItem(mmdGSHG, "SHOW HIDEN DOUBLE GLASS", pmGLASS_DOUBLE, -1);
            PopMenuItem      pmi8__             = new PopMenuItem(mmCPS5, "ERASE GLASS 3D and from database", pmGLASS_DOUBLE, -1);
            PopMenuItem      pmi_soe____        = new PopMenuItem(pmGLASS_DOUBLE, -1);
            PopMenuItem      pmu8               = new PopMenuItem(mmGlass_DOUBLE2, "UNFOLD TRIANGULAR GLASS", pmGLASS_DOUBLE, -1);
            PopMenuItem      pmu8a              = new PopMenuItem(mmGlass_DOUBLE3, "BENDS TO SEPARATE DRAWINGS", pmGLASS_DOUBLE, -1);
            PopMenuItem      pmu8aa             = new PopMenuItem(mmRPN, "BENDS SECTIONS TO SEPARATE DRAWINGS", pmGLASS_DOUBLE, -1);
            PopMenuRef       pmGlass_Double_Ref = new PopMenuRef(pmGLASS_DOUBLE, pmGLASS, -1);//***
            pmGLASS.PopMenuItems.Add(pmGlass_Double_Ref);
            PopMenuItem pmi_seu___  = new PopMenuItem(pmGLASS, -1);
            PopMenuItem pmi97       = new PopMenuItem(mm67, "GLASS  DISTANCE  FOR  BEND", pmGLASS, -1);
            PopMenuItem pmi9        = new PopMenuItem(mm6, "GLASS  DISTANCE  FOR  ALL BENDS", pmGLASS, -1);
            PopMenuItem pmi9_       = new PopMenuItem(mmDIST, "SET GLASS DISTANCE TO BEND BY NUMER", pmGLASS, -1);
            PopMenuRef  pmGlass_Ref = new PopMenuRef(pmGLASS, pm, -1);
            pm.PopMenuItems.Add(pmGlass_Ref);
            #endregion

            PopMenuItem      pmi_se_CAM__ = new PopMenuItem(pm, -1);
            StringCollection scCAM        = new StringCollection();
            PopMenu          pmCAM        = new PopMenu("CAM Tools", scCAM, "ID_CAM_Tools", pcs.MenuGroup);
            PopMenuItem      pm_cnc       = new PopMenuItem(mmCAM_CNC, "Node to CNC", pmCAM, -1);
            PopMenuItem      pm_cnc1      = new PopMenuItem(mmCAM_CNC1, "Node to CSV", pmCAM, -1);
            PopMenuRef       pmCAM_Ref    = new PopMenuRef(pmCAM, pm, -1);
            pm.PopMenuItems.Add(pmCAM_Ref);

            PopMenuItem pmi_se___ = new PopMenuItem(pm, -1);

            #region profiles
            StringCollection scPROFILES     = new StringCollection();
            PopMenu          pmPROFILES     = new PopMenu("PROFILES", scPROFILES, "ID_SubProfiles", pcs.MenuGroup);
            PopMenuItem      pmipi1         = new PopMenuItem(mmS2, "SOLID EXTRUDE FROM REGIONS IN BLOCK", pmPROFILES, -1);
            PopMenuItem      pmipi2         = new PopMenuItem(mmS3, "CUT WITH EXTRUDED SOLID", pmPROFILES, -1);
            PopMenuItem      pmi_sei_o__    = new PopMenuItem(pmPROFILES, -1);
            PopMenuItem      pmip1          = new PopMenuItem(mmPrf1, "DRAW PROFILE SOLID by CSV", pmPROFILES, -1);
            PopMenuItem      pmip1_         = new PopMenuItem(mmPrf1_, "DRAW PROFILE by CSV and ERASE PROFILE LINE", pmPROFILES, -1);
            PopMenuItem      pmi_sei1       = new PopMenuItem(pmPROFILES, -1);
            PopMenuItem      pmip2_         = new PopMenuItem(mmPrf2, "KCAD PREPARE PROFILE UNFOLD", pmPROFILES, -1);
            PopMenuItem      pmi_sei___     = new PopMenuItem(pmPROFILES, -1);
            PopMenuItem      pmip1i_        = new PopMenuItem(mmPrf1__, "ADD PROFILE POINTS TO_FILE", pmPROFILES, -1);
            PopMenuRef       pmProfiles_Ref = new PopMenuRef(pmPROFILES, pm, -1);
            pm.PopMenuItems.Add(pmProfiles_Ref);
            #endregion

            PopMenuItem pmi_se___Placement = new PopMenuItem(pm, -1);

            #region placement
            StringCollection scPlacement_3D = new StringCollection();
            PopMenu          pmPlacement_3D = new PopMenu("SHOW PLACEMENT IN 3D", scPlacement_3D, "ID_Placement_3D", pcs.MenuGroup);

            PopMenuItem pmPlacemen__22_00 = new PopMenuItem(mmCG, "Real Center of Gravity", pmPlacement_3D, -1);
            PopMenuItem pmi_seiuuyhu1     = new PopMenuItem(pmPlacement_3D, -1);

            StringCollection scPlacement_3D_NODES     = new StringCollection();
            PopMenu          pmPlacement_3D_NODES     = new PopMenu("NODES 3D", scPlacement_3D_NODES, "ID_Bends_3D", pcs.MenuGroup);
            PopMenuItem      pmPlacemen_0             = new PopMenuItem(mmPlacement_3D_0, "PLACEMENT OF NODE 3D IN POSITION", pmPlacement_3D_NODES, -1);
            PopMenuItem      pmPlacemen_000           = new PopMenuItem(mmPlacement_3D_000, "PLACEMENT HIDE from Display", pmPlacement_3D_NODES, -1);
            PopMenuItem      pmPlacemen_0000          = new PopMenuItem(mmPlacement_3D_0000, "PLACEMENT SHOW to Display", pmPlacement_3D_NODES, -1);
            PopMenuItem      pmPlacemen_00            = new PopMenuItem(mmPlacement_3D_00, "PLACEMENT DELETE and from Data Base", pmPlacement_3D_NODES, -1);
            PopMenuRef       pmPlacement_3D_NODES_Ref = new PopMenuRef(pmPlacement_3D_NODES, pmPlacement_3D, -1);
            pmPlacement_3D.PopMenuItems.Add(pmPlacement_3D_NODES_Ref);


            PopMenuItem pmi_seiuu1 = new PopMenuItem(pmPlacement_3D, -1);

            StringCollection scPlacement_3D_NOZZLE     = new StringCollection();
            PopMenu          pmPlacement_3D_NOZZLE     = new PopMenu("BENDS NOZZLE 3D", scPlacement_3D_NOZZLE, "ID_Bends_3D", pcs.MenuGroup);
            PopMenuItem      pmPlacemen_1              = new PopMenuItem(mmPlacement_3D_1, "PLACEMENT OF BENDS NOZZLE BLOCKS IN NODES", pmPlacement_3D_NOZZLE, -1);
            PopMenuItem      pmPlacemen_100            = new PopMenuItem(mmPlacement_3D_100, "PLACEMENT HIDE from Display", pmPlacement_3D_NOZZLE, -1);
            PopMenuItem      pmPlacemen_1000           = new PopMenuItem(mmPlacement_3D_1000, "PLACEMENT SHOW to Display", pmPlacement_3D_NOZZLE, -1);
            PopMenuItem      pmPlacemen_10             = new PopMenuItem(mmPlacement_3D_10, "PLACEMENT DELETE and from Data Base", pmPlacement_3D_NOZZLE, -1);
            PopMenuRef       pmPlacement_3D_NOZZLE_Ref = new PopMenuRef(pmPlacement_3D_NOZZLE, pmPlacement_3D, -1);
            pmPlacement_3D.PopMenuItems.Add(pmPlacement_3D_NOZZLE_Ref);

            PopMenuItem pmi_seiiu1 = new PopMenuItem(pmPlacement_3D, -1);
            // PopMenuItem pmPlacemen_2 = new PopMenuItem(mmPlacement_3D_2, "PLACEMENT BENDS 3D and from Data Base", pmPlacement_3D, -1);
            PopMenuRef pmPlacement_3D_Ref = new PopMenuRef(pmPlacement_3D, pm, -1);
            pm.PopMenuItems.Add(pmPlacement_3D_Ref);

            StringCollection scPlacement_3D_0     = new StringCollection();
            PopMenu          pmPlacement_3D_0     = new PopMenu("BENDS 3D", scPlacement_3D_0, "ID_Bends_3D", pcs.MenuGroup);
            PopMenuItem      pmPlacemen_2_0       = new PopMenuItem(mmPlacement_3D_2, "PLACEMENT BENDS 3D", pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen_2_a0      = new PopMenuItem(mmRCN, "PLACEMENT BENDS 3D  ( at the end of normals )", pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen_2_o0      = new PopMenuItem(mmS, "KCAD ATTACHING AN SOLID3D TO BEND", pmPlacement_3D_0, -1);
            PopMenuItem      pmi_seiuuu1          = new PopMenuItem(pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen_2_10      = new PopMenuItem(mmPlacement_3D_4, "BENDS 3D HIDE", pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen_2_11      = new PopMenuItem(mmPlacement_3D_5, "BENDS 3D SHOW", pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen_2_00      = new PopMenuItem(mmPlacement_3D_3, "BENDS 3D DELETE  and from Data Base", pmPlacement_3D_0, -1);
            PopMenuItem      pmi_seiuuyu1         = new PopMenuItem(pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen__2_00     = new PopMenuItem(mmHEeP, "KCAD CUTTING BENDS IN NODES", pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen__1_00     = new PopMenuItem(mmERS4, "* Explicit Cutting Method for Ends of 3D Bends In given Node", pmPlacement_3D_0, -1);
            PopMenuItem      pmPlacemen__1_01     = new PopMenuItem(mmER5S5, "*Clear Explicit Cutting Method for All Bend", pmPlacement_3D_0, -1);
            PopMenuRef       pmPlacement_3D_0_Ref = new PopMenuRef(pmPlacement_3D_0, pmPlacement_3D, -1);
            pmPlacement_3D.PopMenuItems.Add(pmPlacement_3D_0_Ref);
            #endregion

            PopMenuItem pmi_se___Placem = new PopMenuItem(pmPlacement_3D, -1);
            PopMenuItem pmPlacemen_10i  = new PopMenuItem(mmCAM_Check, "CALC MIN CAM RADIUS", pmPlacement_3D, -1);

            #region fixing elements
            StringCollection scPlacement_3D_Fixing_Elements = new StringCollection();
            PopMenu          pmPlacement_3D_Fixing_Elements = new PopMenu("Fixing Elements", scPlacement_3D_Fixing_Elements, "ID_Fixing_Elements", pcs.MenuGroup);
            PopMenuItem      pmFixing_0 = new PopMenuItem(mmFixing, "ADD FIXING ELEMENTS", pmPlacement_3D_Fixing_Elements, -1);
            PopMenuRef       pmPlacement_3D_Fixing_Elements_Ref = new PopMenuRef(pmPlacement_3D_Fixing_Elements, pmPlacement_3D, -1);
            pmPlacement_3D.PopMenuItems.Add(pmPlacement_3D_Fixing_Elements_Ref);
            #endregion


            PopMenuItem pmi___sie = new PopMenuItem(pm, -1);
            #region csv
            MenuMacro mmCSV_Node_Numer_Position = new MenuMacro(mg, "KCAD_NODE_NUMER_POSITION_CSV", "^C^CKCAD_NODE_NUMER_POSITION_CSV", "ID_KCAD_NODE_NUMER_POSITION_CSV");
            MenuMacro mmCSV_Bend_Joints_Numers  = new MenuMacro(mg, "KCAD_BEND_JOINTS_NUMERS_CSV", "^C^CKCAD_BEND_JOINTS_NUMERS_CSV", "ID_KCAD_BEND_JOINTS_NUMERS_CSV");
            MenuMacro mmCSV_Triangles           = new MenuMacro(mg, "KCAD_TRIANGLES_CSV", "^C^CKCAD_TRIANGLES_CSV", "ID_KCAD_TRIANGLES_CSV");

            //{
            StringCollection scPlacement_3D_CSV_Elements = new StringCollection();
            PopMenu          pmPlacement_3D_CSV_Elements = new PopMenu("CSV files", scPlacement_3D_CSV_Elements, "ID_CSV_Elements", pcs.MenuGroup);

            StringCollection scCSV_NODES     = new StringCollection();
            PopMenu          pmCSV_NODES     = new PopMenu("NODES  ", scCSV_NODES, "ID_NODES_CSV", pcs.MenuGroup);
            PopMenuItem      pmCSV_00        = new PopMenuItem(mmCSV_Node_Numer_Position, "NODE NUMER and POSITION to file", pmCSV_NODES, -1);
            PopMenuRef       pmCSV_NODES_Ref = new PopMenuRef(pmCSV_NODES, pmPlacement_3D_CSV_Elements, -1);
            pmPlacement_3D_CSV_Elements.PopMenuItems.Add(pmCSV_NODES_Ref);

            StringCollection scCSV_BENDS     = new StringCollection();
            PopMenu          pmCSV_BENDS     = new PopMenu("BENDS  ", scCSV_BENDS, "ID_BENDS_CSV", pcs.MenuGroup);
            PopMenuItem      pmCSV_0b        = new PopMenuItem(mmCSV_Bend_Joints_Numers, "BEND JOINTS NUMERS", pmCSV_BENDS, -1);
            PopMenuRef       pmCSV_BENDS_Ref = new PopMenuRef(pmCSV_BENDS, pmPlacement_3D_CSV_Elements, -1);
            pmPlacement_3D_CSV_Elements.PopMenuItems.Add(pmCSV_BENDS_Ref);

            StringCollection scCSV_TRIANGLES     = new StringCollection();
            PopMenu          pmCSV_TRIANGLES     = new PopMenu("TRIANGLES  ", scCSV_BENDS, "ID_TRIANGLE_CSV", pcs.MenuGroup);
            PopMenuItem      pmCSV_t0b           = new PopMenuItem(mmCSV_Triangles, "TRIANGLES ", pmCSV_TRIANGLES, -1);
            PopMenuRef       pmCSV_TRIANGLES_Ref = new PopMenuRef(pmCSV_TRIANGLES, pmPlacement_3D_CSV_Elements, -1);
            pmPlacement_3D_CSV_Elements.PopMenuItems.Add(pmCSV_TRIANGLES_Ref);

            PopMenuItem pmSQL_      = new PopMenuItem(mmCAM_CN1, "POLYGONS", pmPlacement_3D_CSV_Elements, -1);
            PopMenuItem pmiui___sie = new PopMenuItem(pmPlacement_3D_CSV_Elements, -1);
            PopMenuItem pmCSVV_     = new PopMenuItem(mm0CSV, "READ NAMED POINTS FROM CSV", pmPlacement_3D_CSV_Elements, -1);
            PopMenuItem pmCSVV1_    = new PopMenuItem(mm1CSV, "DRAW NAMED POINTS BY ARRAY NAME", pmPlacement_3D_CSV_Elements, -1);

            //}
            PopMenuRef pmPlacement_3D_CSV_Elements_Ref = new PopMenuRef(pmPlacement_3D_CSV_Elements, pm, -1);
            pm.PopMenuItems.Add(pmPlacement_3D_CSV_Elements_Ref);

            #endregion

            PopMenuItem pmii___sie = new PopMenuItem(pm, -1);

            #region deviation

            MenuMacro mmTR_An  = new MenuMacro(mg, "KCAD_AGT", "^C^CKCAD_AGT", "ID_KCAD_AGT");
            MenuMacro mmTR_Dr  = new MenuMacro(mg, "KCAD_AGT_DRAW", "^C^CKCAD_AGT_DRAW", "ID_KCAD_AGT_DRAW");
            MenuMacro mmTR_Anp = new MenuMacro(mg, "KCAD_AGP", "^C^CKCAD_AGP", "ID_KCAD_AGP");

            StringCollection scDeviation = new StringCollection();
            PopMenu          pmDeviation = new PopMenu("Deviation tools", scPlacement_3D_Fixing_Elements, "ID_Deviation_tools", pcs.MenuGroup);

            StringCollection scTR               = new StringCollection();
            PopMenu          pmTR               = new PopMenu("TRIANGLES  ", scTR, "ID_DEVIATION_TR_CSV", pcs.MenuGroup);
            PopMenuItem      pmCSV_00_          = new PopMenuItem(mmTR_An, "Analise and DRAW Lines", pmTR, -1);
            PopMenuItem      pmCSV_0_0_         = new PopMenuItem(mmTR_An, "DRAW TEXT in TRIANGLES", pmTR, -1);
            PopMenuRef       pmDEVIATION_TR_Ref = new PopMenuRef(pmTR, pmDeviation, -1);
            pmDeviation.PopMenuItems.Add(pmDEVIATION_TR_Ref);
            PopMenuItem pmFixing_00 = new PopMenuItem(mmTR_Anp, "POLIGONs DEVIATION", pmDeviation, -1);

            PopMenuRef pmDeviation_Ref = new PopMenuRef(pmDeviation, pm, -1);
            pm.PopMenuItems.Add(pmDeviation_Ref);
            #endregion

            PopMenuItem pmiii_sie = new PopMenuItem(pm, -1);

            #region stereometry
            MenuMacro mmSG  = new MenuMacro(mg, "Line and Plane - Intersection", "^C^CKCAD_ILP", "ID_KCAD_ILP");
            MenuMacro mmSG1 = new MenuMacro(mg, "TWO_LINES", "^C^CKCAD_DBP", "ID_KCAD_DBP");

            StringCollection scSolid_Geometry = new StringCollection();
            PopMenu          pmSolid_Geometry = new PopMenu("Solid Geometry", scSolid_Geometry, "ID_Solid_Geometry", pcs.MenuGroup);

            PopMenuItem pmSG_3      = new PopMenuItem(mmMDBS, "Minimal Distance between Solids3D", pmSolid_Geometry, -1);
            PopMenuItem pmi_seiu1u1 = new PopMenuItem(pmSolid_Geometry, -1);
            PopMenuItem pmSG_4      = new PopMenuItem(mmITP, "Intersction Line between two Planes", pmSolid_Geometry, -1);
            PopMenuItem pmSG_0      = new PopMenuItem(mmSG, "Line and Plane - Intersection", pmSolid_Geometry, -1);
            PopMenuItem pmSG_1      = new PopMenuItem(mmSG1, "Two Lines - Crossing", pmSolid_Geometry, -1);
            PopMenuItem pmSG_2      = new PopMenuItem(mmERP5, "Projection of the Point on the Plane", pmSolid_Geometry, -1);

            PopMenuItem pmi_seiuu11 = new PopMenuItem(pmSolid_Geometry, -1);

            StringCollection scCutSolids = new StringCollection();
            PopMenu          pmCutSolids = new PopMenu("CUT PARAMETERS", scCutSolids, "ID_Cut_Solids", pcs.MenuGroup);
            PopMenuItem      pmCut_0     = new PopMenuItem(mmCPS, "Global - Ratio of Length of the Extensions", pmCutSolids, -1);
            PopMenuItem      pmCut_1     = new PopMenuItem(mmCPS1, "Global - Thicnes of the CutProfile", pmCutSolids, -1);
            PopMenuItem      pmCut_3     = new PopMenuItem(mmCPS3, "Global - Extrude Ratio", pmCutSolids, -1);
            PopMenuItem      pmi_seiu1   = new PopMenuItem(pmCutSolids, -1);
            PopMenuItem      pmCutg_2    = new PopMenuItem(mmERS5, "By Bend Selection - Solid Extrude Ratio", pmCutSolids, -1);
            PopMenuItem      pmCut_2     = new PopMenuItem(mmCPS2, "By Bend Numer - Ratio of Length /  Thicnes of the CutProfile", pmCutSolids, -1);
            PopMenuItem      pmi_sesiu1  = new PopMenuItem(pmCutSolids, -1);
            PopMenuItem      pmCut_4     = new PopMenuItem(mmCPS4, "Trimming Vertices on/off", pmCutSolids, -1);

            PopMenuRef pmCutSolids_Ref = new PopMenuRef(pmCutSolids, pmSolid_Geometry, -1);
            pmSolid_Geometry.PopMenuItems.Add(pmCutSolids_Ref);

            //
            PopMenuItem      pmi_seiuu02 = new PopMenuItem(pmSolid_Geometry, -1);
            StringCollection scMESH_MINIMUM_DISTANCES_ = new StringCollection();
            PopMenu          pmMESH_MINIMUM_DISTANCES_ = new PopMenu("Minimum Distance to ...", scMESH_MINIMUM_DISTANCES_, "ID_MINDISTT", pcs.MenuGroup);
            PopMenuItem      pmMD1_ = new PopMenuItem(mmMDN, "to Node", pmMESH_MINIMUM_DISTANCES_, -1);
            PopMenuItem      pmMD2_ = new PopMenuItem(mmMDB, "to Bend Mid Point", pmMESH_MINIMUM_DISTANCES_, -1);
            PopMenuItem      pmMD3_ = new PopMenuItem(mmMDT, "to Triangle Centroid", pmMESH_MINIMUM_DISTANCES_, -1);
            PopMenuRef       pmMESH_MINIMUM_DISTANCES_Ref_ = new PopMenuRef(pmMESH_MINIMUM_DISTANCES_, pmSolid_Geometry, -1);
            pmSolid_Geometry.PopMenuItems.Add(pmMESH_MINIMUM_DISTANCES_Ref_);
            //

            PopMenuItem pmi_seiuu12 = new PopMenuItem(pmSolid_Geometry, -1);
            PopMenuItem pmSGf2      = new PopMenuItem(mmERT5, "Angle between the NORMALS of the adjacent Triangles", pmSolid_Geometry, -1);

            PopMenuRef pmSolid_Geometry_Ref = new PopMenuRef(pmSolid_Geometry, pm, -1);
            pm.PopMenuItems.Add(pmSolid_Geometry_Ref);


            #endregion

            //PopMenuItem pmiii_siye = new PopMenuItem(pm, -1);

            pcs.SaveAs(myCuiFile);
            //LoadMyCui(myCuiFileToSend);
            MessageBox.Show("Menu has been successfully created in\n\n" +
                            myCuiFile + "\n\nFor display in the main Menu Bar, use the Command: CUILOAD ", "New Menu:", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
示例#23
0
 /// <summary>
 /// 为菜单添加分隔条
 /// </summary>
 /// <param name="parentMenu">下拉菜单</param>
 /// <param name="index">分隔条的位置</param>
 /// <returns>返回添加的分隔条</returns>
 public static PopMenuItem AddSeparator(this PopMenu parentMenu, int index)
 {
     //定义一个分隔条并返回
     return(new PopMenuItem(parentMenu, index));
 }
示例#24
0
    IEnumerator LoadDataSet()
    {
        ObjectTracker objectTracker = TrackerManager.Instance.GetTracker <ObjectTracker> ();

        objectTracker.DestroyAllDataSets(false);
        objectTracker.Stop();           // stop tracker so that we can add new dataset

        var tNodes = data.Element("trackings").Nodes();

        foreach (XElement node in tNodes)
        {
            string  dataSetName = Xml.Attribute(node, "src");
            DataSet dataSet     = objectTracker.CreateDataSet();
            if (dataSet.Load(GetAssetsPath(dataSetName), VuforiaUnity.StorageType.STORAGE_ABSOLUTE))
            {
                if (!objectTracker.ActivateDataSet(dataSet))
                {
                    // Note: ImageTracker cannot have more than 100 total targets activated
                    Debug.Log("<color=yellow>Failed to Activate DataSet: " + dataSetName + "</color>");
                }
            }
        }

        //int counter = 0;
        IEnumerable <TrackableBehaviour> tbs = TrackerManager.Instance.GetStateManager().GetTrackableBehaviours();

        foreach (TrackableBehaviour tb in tbs)
        {
            Logger.Log(tb.TrackableName, "purple");
            tb.gameObject.name = "AR-" + tb.TrackableName;

            XElement info = Xml.GetChildByAttribute(itemInfos, "id", tb.TrackableName);
            if (info == null)
            {
                continue;
            }
            string objType = Xml.Attribute(info, "type");
            tb.gameObject.AddComponent <DefaultTrackableEventHandler> ();
            tb.gameObject.AddComponent <CustomTrackableEventHandler> ();
            tb.gameObject.AddComponent <TurnOffBehaviour> ();
            CustomTrackableEventHandler cte = tb.gameObject.GetComponent <CustomTrackableEventHandler> ();
            cte.type         = objType;
            cte.subtitlePath = GetAssetsPath(Xml.Attribute(info, "subtitle"), true);
            UnityEngine.Object asset = null;
            if (objType == "object")
            {
                asset = loadedAssets.ContainsKey(tb.TrackableName) ? loadedAssets [tb.TrackableName] : new GameObject();
            }
            else if (objType == "video")
            {
                asset = planePrefab;
                //Renderer render = (planePrefab).GetComponent<Renderer> ();
                //render.material = videoMaterial;

                cte.videoPath = GetAssetsPath(Xml.Attribute(info, "videosrc"), true);
                //cte.mediaPlayer = mediaPlayer;
            }
            else if (objType == "menu4")
            {
                //asset = planePrefab;
                //Renderer render = (planePrefab).GetComponent<Renderer> ();
                //render.material = videoMaterial;
                //CustomTrackableEventHandler cte = tb.gameObject.GetComponent<CustomTrackableEventHandler> ();
                //cte.videoPath = GetAssetsPath (tb.TrackableName + ".mp4");
                //cte.mediaPlayer = mediaPlayer;
                tb.gameObject.AddComponent <PopMenu> ();
                PopMenu popmenu = tb.gameObject.GetComponent <PopMenu> ();
                popmenu.menuItems = new List <PopMenuItem> ();
                //popmenu.playerMateral = videoMaterial;

                var menuNodes = info.Elements();
                //XElement res = null;
                int index = 0;
                foreach (XElement n in menuNodes)
                {
                    GameObject  planeItem = GameObject.Instantiate(Resources.Load("Prefabs/PlaneItem4")) as GameObject;
                    PopMenuItem pmi       = planeItem.GetComponent <PopMenuItem> ();
                    popmenu.menuItems.Add(pmi);
                    pmi.floatSpeed       = 5f;
                    pmi.floatAmplitude   = 0.03f;
                    pmi.index            = index;
                    pmi.menu             = popmenu;
                    pmi.trackableHandler = cte;
                    planeItem.transform.SetParent(tb.gameObject.transform, false);
                    Vector3 position = planeItem.transform.localPosition;
                    if (index == 1)
                    {
                        planeItem.transform.localPosition = position.SetX(-position.x);
                    }
                    else if (index == 2)
                    {
                        planeItem.transform.localPosition = position.SetZ(-position.z);
                    }
                    else if (index == 3)
                    {
                        planeItem.transform.localPosition = new Vector3(-position.x, position.y, -position.z);
                    }
                    pmi.Initiate();
                    string itemSrc   = Xml.Attribute(n, "src");
                    string videoPath = Xml.Attribute(n, "videosrc");
                    pmi.subtitlePath = GetAssetsPath(Xml.Attribute(n, "subtitle"), true);
                    if (!string.IsNullOrEmpty(videoPath))
                    {
                        pmi.videoPath = GetAssetsPath(videoPath);
                    }
                    else
                    {
                        GameObject prefab = loadedAssets [Xml.Attribute(n, "prefab")] as GameObject;
                        pmi.threeDObject = GameObject.Instantiate(prefab, prefab.transform.position, prefab.transform.rotation) as GameObject;
                        pmi.threeDObject.transform.SetParent(tb.gameObject.transform, false);
                        ApplyItemInfo(pmi.threeDObject, n);
                    }
                    WWW www = new WWW(GetAssetsPath(itemSrc, true));
                    yield return(www);

                    Logger.Log(GetAssetsPath(itemSrc, true) + " " + www.texture.ToString());
                    pmi.material.mainTexture = www.texture;
                    //Logger.Log (planeItem.transform.localPosition.x.ToString() + " " +planeItem.transform.localPosition.y+ " " + planeItem.transform.localPosition.z, "blue");
                    index++;
                }
                popmenu.Hide();
            }
            //GameObject obj = (GameObject)GameObject.Instantiate (asset);
            if (asset != null)
            {
                GameObject prefab = asset as GameObject;
                GameObject obj    = (GameObject)GameObject.Instantiate(prefab, prefab.transform.position, prefab.transform.rotation);

                obj.transform.SetParent(tb.gameObject.transform, false);
                ApplyItemInfo(obj, Xml.GetChildByAttribute(itemInfos, "id", tb.TrackableName));
            }
            //obj.gameObject.SetActive (true);
        }


        if (!objectTracker.Start())
        {
            Debug.Log("<color=yellow>Tracker Failed to Start.</color>");
        }
    }