コード例 #1
0
ファイル: Form1.cs プロジェクト: dmalpica/meshmixer-api
        private void smooth_groups_test()
        {
            mm.RemoteControl rc = new mm.RemoteControl();
            rc.Initialize();

            List <int> o  = get_selected_objects(rc);
            int        id = o[0];

            StoredCommands sc   = new StoredCommands();
            uint           key1 = sc.AppendSceneCommand_ListFaceGroups(id);

            rc.ExecuteCommands(sc);
            vectori groupv = new vectori();

            sc.GetSceneCommandResult_ListFaceGroups(key1, groupv);
            var vGroups = groupv.ToList();

            foreach (int g in vGroups)
            {
                StoredCommands cmd = new StoredCommands();
                vectori        v   = new vectori()
                {
                    g
                };
                cmd.AppendSelectCommand_ByFaceGroups(v);
                cmd.AppendBeginToolCommand("smoothBoundary");
                cmd.AppendToolParameterCommand("preserveGroupBorders", false);
                cmd.AppendToolParameterCommand("preserveBoundary", true);
                cmd.AppendCompleteToolCommand("accept");
                cmd.AppendCompleteToolCommand("cancel");
                rc.ExecuteCommands(cmd);
            }

            rc.Shutdown();
        }
コード例 #2
0
        public void SelectObjects(List <int> vObjects)
        {
            StoredCommands sc   = new StoredCommands();
            vectori        objs = new vectori(vObjects);

            sc.AppendSceneCommand_SelectObjects(objs);
            ExecuteCommands(sc);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: dmalpica/meshmixer-api
        private List <int> get_selected_objects(mm.RemoteControl rc)
        {
            StoredCommands sc  = new StoredCommands();
            uint           key = sc.AppendSceneCommand_ListSelectedObjects();

            rc.ExecuteCommands(sc);
            vectori v   = new vectori();
            bool    bOK = sc.GetSceneCommandResult_ListSelectedObjects(key, v);

            return(v.ToList());
        }
コード例 #4
0
        public List <int> ListSelectedFaceGroups()
        {
            StoredCommands sc  = new StoredCommands();
            uint           key = sc.AppendSelectCommand_ListSelectedFaceGroups();

            ExecuteCommands(sc);
            vectori tmp = new vectori();

            sc.GetSelectCommandResult_ListSelectedFaceGroups(key, tmp);
            return(tmp.ToList());
        }
コード例 #5
0
        public List <int> ListNewFaceGroups()
        {
            StoredCommands sc  = new StoredCommands();
            uint           key = sc.AppendToolQuery_NewGroups();

            ExecuteCommands(sc);
            vectori newobjs = new vectori();

            sc.GetToolQueryResult_NewGroups(key, newobjs);
            return(newobjs.ToList());
        }
コード例 #6
0
        public List <int> ListSelectedObjects()
        {
            StoredCommands sc  = new StoredCommands();
            uint           key = sc.AppendSceneCommand_ListSelectedObjects();

            ExecuteCommands(sc);
            vectori newobjs = new vectori();

            sc.GetSceneCommandResult_ListSelectedObjects(key, newobjs);
            return(newobjs.ToList());
        }
コード例 #7
0
        public List <int> ImportFile(string sPath)
        {
            StoredCommands sc  = new StoredCommands();
            uint           key = sc.AppendSceneCommand_AppendMeshFile(sPath);

            ExecuteCommands(sc);
            vectori objs = new vectori();

            sc.GetSceneCommandResult_AppendMeshFile(key, objs);
            return(objs.ToList());
        }