Пример #1
0
        public static void SetSceneUnderstandingConfig(SceneUnderstandingConfig config)
        {
            IntPtr pointer = Marshal.AllocCoTaskMem(Marshal.SizeOf(config));

            Marshal.StructureToPtr(config, pointer, true);
            ViveSR_Framework.SetParameterStruct(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.SCENE_UNDERSTANDING_CONFIG, pointer);
            Marshal.FreeCoTaskMem(pointer);
        }
Пример #2
0
        public static void GetSceneUnderstandingConfig(ref SceneUnderstandingConfig config)
        {
            IntPtr pointer = Marshal.AllocCoTaskMem(Marshal.SizeOf(config));

            ViveSR_Framework.GetParameterStruct(ViveSR_Framework.MODULE_ID_RIGID_RECONSTRUCTION, (int)ReconstructionParam.SCENE_UNDERSTANDING_CONFIG, ref pointer);
            config = (SceneUnderstandingConfig)Marshal.PtrToStructure(pointer, typeof(SceneUnderstandingConfig));
            Marshal.FreeCoTaskMem(pointer);
        }
Пример #3
0
        public static void SetCustomSceneUnderstandingConfig(SceneUnderstandingObjectType objectType, int objectMaxNum, bool isOn)
        {
            SceneUnderstandingConfig config = new SceneUnderstandingConfig();

            GetSceneUnderstandingConfig(ref config);

            switch (objectType)
            {
            case SceneUnderstandingObjectType.BED:
                if (isOn)
                {
                    config.nBedMaxInst = objectMaxNum;
                }
                else
                {
                    config.nBedMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.CEILING:
                if (isOn)
                {
                    config.nCeilingMaxInst = objectMaxNum;
                }
                else
                {
                    config.nCeilingMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.CHAIR:
                if (isOn)
                {
                    config.nChairMaxInst = objectMaxNum;
                }
                else
                {
                    config.nChairMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.FLOOR:
                if (isOn)
                {
                    config.nFloorMaxInst = objectMaxNum;
                }
                else
                {
                    config.nFloorMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.TABLE:
                if (isOn)
                {
                    config.nTableMaxInst = objectMaxNum;
                }
                else
                {
                    config.nTableMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.WALL:
                if (isOn)
                {
                    config.nWallMaxInst = objectMaxNum;
                }
                else
                {
                    config.nWallMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.WINDOW:
                if (isOn)
                {
                    config.nWindowMaxInst = objectMaxNum;
                }
                else
                {
                    config.nWindowMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.MONITOR:
                if (isOn)
                {
                    config.nMonitorMaxInst = objectMaxNum;
                }
                else
                {
                    config.nMonitorMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.FURNITURE:
                if (isOn)
                {
                    config.nFurnitureMaxInst = objectMaxNum;
                }
                else
                {
                    config.nFurnitureMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.DOOR:
                if (isOn)
                {
                    config.nDoorMaxInst = objectMaxNum;
                }
                else
                {
                    config.nDoorMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.PICTURE:
                if (isOn)
                {
                    config.nPictureMaxInst = objectMaxNum;
                }
                else
                {
                    config.nPictureMaxInst = 0;
                }
                break;

            case SceneUnderstandingObjectType.PERSON:
                if (isOn)
                {
                    config.nPersonMaxInst = objectMaxNum;
                }
                else
                {
                    config.nPersonMaxInst = 0;
                }
                break;
            }
            SetSceneUnderstandingConfig(config);
        }
Пример #4
0
 public static void SetSceneUnderstandingConfig(SceneUnderstandingConfig config)
 {
     SRWorkModule_API.SetSceneUnderstandingConfig(config);
 }
Пример #5
0
 public static void GetSceneUnderstandingConfig(ref SceneUnderstandingConfig config)
 {
     SRWorkModule_API.GetSceneUnderstandingConfig(ref config);
 }
Пример #6
0
        public static void SetCustomSceneUnderstandingConfig(int objectType, int objectMaxNum, bool isOn)
        {
            SceneUnderstandingConfig config = new SceneUnderstandingConfig();

            GetSceneUnderstandingConfig(ref config);

            switch (objectType)
            {
            case (int)SceneUnderstandingObjectType.BED:
                if (isOn)
                {
                    config.nBedMaxInst = objectMaxNum;
                }
                else
                {
                    config.nBedMaxInst = 0;
                }
                break;

            case (int)SceneUnderstandingObjectType.CEILING:
                if (isOn)
                {
                    config.nCeilingMaxInst = objectMaxNum;
                }
                else
                {
                    config.nCeilingMaxInst = 0;
                }
                break;

            case (int)SceneUnderstandingObjectType.CHAIR:
                if (isOn)
                {
                    config.nChairMaxInst = objectMaxNum;
                }
                else
                {
                    config.nChairMaxInst = 0;
                }
                break;

            case (int)SceneUnderstandingObjectType.FLOOR:
                if (isOn)
                {
                    config.nFloorMaxInst = objectMaxNum;
                }
                else
                {
                    config.nFloorMaxInst = 0;
                }
                break;

            case (int)SceneUnderstandingObjectType.TABLE:
                if (isOn)
                {
                    config.nTableMaxInst = objectMaxNum;
                }
                else
                {
                    config.nTableMaxInst = 0;
                }
                break;

            case (int)SceneUnderstandingObjectType.WALL:
                if (isOn)
                {
                    config.nWallMaxInst = objectMaxNum;
                }
                else
                {
                    config.nWallMaxInst = 0;
                }
                break;
            }
            SetSceneUnderstandingConfig(config);
        }
Пример #7
0
 public static extern int SetSceneUnderstandingConfig(SceneUnderstandingConfig value);
Пример #8
0
 public static extern int GetSceneUnderstandingConfig(ref SceneUnderstandingConfig value);