コード例 #1
0
 public BinaryObj(int byteArrayLength, PresetType t = PresetType.Unknown)
 {
     type  = t;
     bytes = new byte[byteArrayLength];
     ms    = new MemoryStream(bytes);
     bw    = new BinaryWriter(ms);
     lenMs = new MemoryStream(lenInBytes);
     lenBw = new BinaryWriter(lenMs);
 }
コード例 #2
0
        /// <summary>
        /// Initializes a new instance of this <c>AdvancedAlertView</c> class.
        /// </summary>
        /// <param name="buttons">Buttons.</param>
        /// <param name="accentColor">Color of the circle.</param>
        /// <param name="title">Title.</param>
        /// <param name="titleFont">Title's font.</param>
        /// <param name="content">Content.</param>
        /// <param name="contentFont">Content's font.</param>
        /// <param name="alertType">Alert type.</param>
        /// <param name="customImage">Image to be displayed in the circle.</param>
        /// <param name="presetType">Preset type of the alert.</param>
        public AdvancedAlertView(List <View> buttons, Color accentColor, string title = "", ExtendedFont titleFont = null,
                                 string content        = "", ExtendedFont contentFont = null, AlertType alertType = AlertType.AccentOnly, ImageSource customImage = null,
                                 PresetType presetType = PresetType.Positive)
        {
            _alertType  = alertType;
            _presetType = presetType;

            BindingContext = this;

            HasSystemPadding             = false;
            CloseWhenBackgroundIsClicked = false;

            CustomImageSource = customImage;
            AccentColor       = accentColor;

            Animation = new AdvancedAlertViewAnimation();

            InitializeComponent();

            switch (alertType)
            {
            case AlertType.Preset:
                AddImage(false);
                break;

            case AlertType.Waiting:
                AddSpinner();
                break;

            case AlertType.CustomImageAndAccent:
                AddImage(true);
                break;
            }

            if (buttons != null && buttons.Count > 0)
            {
                buttons.ForEach(AddButton);
            }

            TitleString   = title;
            ContentString = content;

            TitleFont   = titleFont;
            ContentFont = contentFont;

            SetRelativeLayoutConstraints();

            OnPropertyChanged(nameof(TitleString));
            OnPropertyChanged(nameof(ContentString));
            OnPropertyChanged(nameof(TitleFont));
            OnPropertyChanged(nameof(ContentFont));
            OnPropertyChanged(nameof(AccentColor));
            OnPropertyChanged(nameof(CustomImageSource));
        }
コード例 #3
0
ファイル: Preset.cs プロジェクト: rakjin/gesticulation
 public Preset(PresetType type = PresetType.Empty, Pose pose = null, string title = "", string author = "", int fileIndex = -1)
 {
     Type = type;
     if (pose != null)
     {
         Motion = new List <Pose>();
         Motion.Add(pose);
     }
     Title     = title;
     Author    = author;
     FileIndex = fileIndex;
 }
コード例 #4
0
    public static ModuleBase GetPreset(PresetType preset)
    {
        switch (preset)
        {
        case PresetType.mountains: return(TerrainPresets.Mountains());

        case PresetType.caves: return(TerrainPresets.Caves());

        case PresetType.cavesAndMountains: return(TerrainPresets.CavesAndMountains());

        case PresetType.fractal: return(TerrainPresets.FractalExample());
        }
        return(TerrainPresets.CavesAndMountains());
    }
コード例 #5
0
        static void MenuItem_AssetsCreate2DSpriteShapeProfile(MenuCommand menuCommand)
        {
            var asset    = AssetDatabase.LoadAssetAtPath <UnityEngine.U2D.SpriteShape>("Packages/com.unity.2d.spriteshape/Editor/ObjectMenuCreation/DefaultAssets/Sprite Shape Profiles/Sprite Shape Profile.asset");
            var preset   = new PresetType(asset);
            var defaults = Preset.GetDefaultPresetsForType(preset).Count(x => x.enabled);

            if (defaults == 0)
            {
                CreateAssetObject(asset);
            }
            else
            {
                CreateAssetObject <UnityEngine.U2D.SpriteShape>(null);
            }
        }
コード例 #6
0
        static void MenuItem_GameObject2DObjectSpriteShapeClosedShape(MenuCommand menuCommand)
        {
            var asset    = AssetDatabase.LoadAssetAtPath <GameObject>("Packages/com.unity.2d.spriteshape/Editor/ObjectMenuCreation/DefaultAssets/Sprite Shapes/Closed Sprite Shape.prefab") as GameObject;
            var preset   = new PresetType(asset.GetComponent <SpriteShapeController>());
            var defaults = Preset.GetDefaultPresetsForType(preset).Count(x => x.enabled);

            if (defaults == 0)
            {
                CreateGameObjectFromTemplate(asset, menuCommand);
            }
            else
            {
                var go = CreateGameObject("Closed Sprite Shape", menuCommand, new [] { typeof(SpriteShapeController) });
                go.GetComponent <SpriteShapeController>().spline.isOpenEnded = false;
            }
        }
コード例 #7
0
ファイル: PresetItem.cs プロジェクト: ruanjian668/priv10
        public static PresetItem New(PresetType Type)
        {
            PresetItem item = null;

            switch (Type)
            {
            case PresetType.Tweak:     item = new TweakPreset(); break;

            case PresetType.Firewall:  item = new FirewallPreset(); break;

            case PresetType.Custom:    item = new CustomPreset(); break;

            default: return(null);
            }
            item.Type = Type;
            return(item);
        }
コード例 #8
0
ファイル: ViewSettings.cs プロジェクト: EdutechSRL/Adevico
        public static TreeViewOption GetDefaultTree(PresetType type)
        {
            switch (type)
            {
            case PresetType.Simple:
                return(TreeViewOption.None);

            case PresetType.Standard:
                return(TreeViewOption.OnlyWithFolders);

            case PresetType.Advanced:
                return(TreeViewOption.OnlyWithFolders);

            default:
                return(TreeViewOption.None);
            }
        }
コード例 #9
0
ファイル: Algorithm.cs プロジェクト: nobuyukinyuu/PhaseEngine
        public static Algorithm FromPreset(byte preset, PresetType type)
        {
            byte length;

            byte[][] presets;

            switch (type)
            {
            case PresetType.DX:
                presets = dx_presets;
                length  = 6;
                break;

            case PresetType.Reface:
                presets = reface_presets;
                length  = 4;
                break;

            case PresetType.OPL:
                presets = opl_4op_presets;
                length  = 4;
                break;

            default:
                presets = ym2xxx_presets;
                length  = 4;
                break;
            }

            System.Diagnostics.Debug.Assert(preset >= 0 && preset < presets.Length,
                                            String.Format("Algorithm preset {0} outside expected range of {2}'s {1} presets!", preset, presets.Length, type.ToString()));

            var output = new Algorithm(length);

            for (byte i = 0; i < length; i++)
            {
                output.processOrder[i] = i;
            }
            Array.Copy(presets[preset], output.connections, length);
            Array.Fill(output.intent, OpBase.Intents.FM_OP);
            output.wiringGrid = output.FabricateGrid();

            output.compatiblePreset = (sbyte)preset;
            return(output);
        }
コード例 #10
0
        public static ViewOption DefaultAvaliableOptions(PresetType type)
        {
            ViewOption result = ViewOption.FolderPath | ViewOption.NarrowWideView | ViewOption.AvailableSpace;

            switch (type)
            {
            case PresetType.Simple:
                result |= ViewOption.Date | ViewOption.Extrainfo;
                break;

            case PresetType.Standard:
                result |= ViewOption.Tree | ViewOption.Date | ViewOption.Extrainfo;
                break;

            case PresetType.Advanced:
                result |= ViewOption.Tree | ViewOption.Date | ViewOption.Statistics | ViewOption.Extrainfo;
                break;
            }
            return(result);
        }
コード例 #11
0
        public void SetUp()
        {
            var settings = (ExportSettings)s_InstanceField.GetValue(null);

            m_originalSettings = settings;

            // Clear out the current instance and create a new one (but keep the original around).
            s_InstanceField.SetValue(null, null);
            s_InstanceField.SetValue(null, ScriptableObject.CreateInstance <ExportSettings> ());

            // keep track of any existing default presets to reset them once tests finish
            var exportPresetType  = new PresetType(ExportSettings.instance.ExportModelSettings);
            var convertPresetType = new PresetType(ExportSettings.instance.ConvertToPrefabSettings);

            m_exportSettingsDefaultPresets  = Preset.GetDefaultPresetsForType(exportPresetType);
            m_convertSettingsDefaultPresets = Preset.GetDefaultPresetsForType(convertPresetType);

            // clear default presets
            Preset.SetDefaultPresetsForType(exportPresetType, new DefaultPreset[] { });
            Preset.SetDefaultPresetsForType(convertPresetType, new DefaultPreset[] { });
        }
コード例 #12
0
 private static extern IntPtr GpuStereoBMCreate(PresetType preset, int ndisparities, int winSize);
コード例 #13
0
 /// <summary>
 /// Create a stereoBM 
 /// </summary>
 /// <param name="preset">Preset type</param>
 /// <param name="numberOfDisparities">The number of disparities. Must be multiple of 8. Use 64 for default </param>
 /// <param name="winSize">The SAD window size</param>
 public GpuStereoBM(PresetType preset, int numberOfDisparities, int winSize)
 {
     _ptr = GpuStereoBMCreate(preset, numberOfDisparities, winSize);
 }
コード例 #14
0
 /// <summary>
 /// Create a stereoBM
 /// </summary>
 /// <param name="preset">Preset type</param>
 /// <param name="numberOfDisparities">The number of disparities. Must be multiple of 8. Use 64 for default </param>
 /// <param name="winSize">The SAD window size. Use 19 for default</param>
 public OclStereoBM(PresetType preset, int numberOfDisparities, int winSize)
 {
     _ptr = OclInvoke.oclStereoBMCreate(preset, numberOfDisparities, winSize);
 }
コード例 #15
0
 /// <summary>
 /// Create a stereoBM
 /// </summary>
 /// <param name="preset">Preset type</param>
 /// <param name="numberOfDisparities">The number of disparities. Must be multiple of 8. Use 64 for default </param>
 /// <param name="winSize">The SAD window size</param>
 public GpuStereoBM(PresetType preset, int numberOfDisparities, int winSize)
 {
     _ptr = GpuStereoBMCreate(preset, numberOfDisparities, winSize);
 }
コード例 #16
0
        void OnGUI()
        {
            presetType = (PresetType)EditorGUILayout.EnumPopup("Preset Type:", presetType);
            switch (presetType)
            {
            case PresetType.ScriptablePreset:
                Repaint();
                scriptableObject = EditorGUILayout.ObjectField(scriptableObject, typeof(ScriptableObject), true) as ScriptableObject;
                break;

            case PresetType.Prefab:
                Repaint();
                currentNPC = EditorGUILayout.ObjectField(currentNPC, typeof(GameObject), true) as GameObject;
                break;

            default:
                break;
            }
            EditorGUILayout.LabelField("NPC:", EditorStyles.boldLabel);


            if (scriptableObject != null)
            {
                var editor = Editor.CreateEditor(scriptableObject);
                if (editor != null)
                {
                    editor.OnInspectorGUI();
                }
                currentNPC = EditorGUILayout.ObjectField(currentNPC, typeof(GameObject), true) as GameObject;
                if (GUILayout.Button("Create This NPC"))
                {
                    //Create the npc with the selected settings
                    //We need to save the selected settings to maby some json file and we need to load the settings on the prefab.
                    CreateNPC(scriptableObject as ScriptableNPC);
                }
            }

            if (currentNPC != null)
            {
                if (settingTypes == null || settingTypes.Count < 1)
                {
                    DrawNPCSettings(scriptableObject as ScriptableNPC);
                }
                foreach (var type in settingTypes)
                {
                    if (!checker.ContainsKey(type.FullName))
                    {
                        bool show = false;
                        checker.Add(type.FullName, show);
                    }
                    if (GUILayout.Button(type.FullName))
                    {
                        foreach (var key in checker.Keys.ToList())
                        {
                            checker[key] = false;
                        }
                        checker[type.FullName] = true;
                    }
                    if (checker[type.FullName])
                    {
                        var component     = currentNPC.GetComponent(type);
                        var settingEditor = Editor.CreateEditor(component);
                        if (settingEditor != null)
                        {
                            settingEditor.OnInspectorGUI();
                        }
                        // create style for the line
                        GUIStyle horizontalLine;
                        horizontalLine = new GUIStyle();
                        horizontalLine.normal.background = EditorGUIUtility.whiteTexture;
                        horizontalLine.margin            = new RectOffset(0, 0, 4, 4);
                        horizontalLine.fixedHeight       = 1;

                        // draw the line
                        HorizontalLine(Color.grey, horizontalLine);
                    }
                }
            }
        }
コード例 #17
0
ファイル: Device.cs プロジェクト: kaorun55/librealsense.net
 public void EnableStream( StreamType stream, PresetType preset )
 {
     IntPtr error = IntPtr.Zero;
     NativeMethod.Device.rs_enable_stream_preset( device, stream, preset, out error );
     RealSenseException.Handle( error );
 }
コード例 #18
0
        protected override void DrawInspector()
        {
            cachedRect = tgt.rectTransform.rect;

            DrawEdit();
            Draw("m_Color", "This allows you to set the color of this element.");
            Draw("m_Material", "This allows you to specify a custom material for this element.");
            Draw("m_RaycastTarget", "Should UI pointers interact with this element?");
            Draw("blur", "This allows you to set the blur radius in local space.");
            Draw("thickness", "This allows you to set the thickness of the border in local space.");
            Draw("points", "");

            if (tgt.Points.Count == 0)
            {
                EditorGUILayout.Separator();

                EditorGUILayout.HelpBox("This polygon has no points, so it will be invisible. You can manually add points, or use a preset below. Keep in mind the points must be in clockwise order.", MessageType.Info);

                preset = (PresetType)EditorGUILayout.EnumPopup("Preset:", preset);

                EditorGUI.indentLevel++;
                switch (preset)
                {
                case PresetType.Box:
                {
                    presetSize   = EditorGUILayout.Vector2Field("Size", presetSize);
                    presetCenter = EditorGUILayout.Vector2Field("Center", presetCenter);

                    if (GUILayout.Button("Create") == true)
                    {
                        Undo.RecordObject(tgt, "Create Preset: Box");

                        var half = presetSize * 0.5f;

                        tgt.Points.Add(new Vector4(-half.x + presetCenter.x, -half.y + presetCenter.y, 0.0f, 0.0f));
                        tgt.Points.Add(new Vector4(-half.x + presetCenter.x, half.y + presetCenter.y, 0.0f, 0.0f));
                        tgt.Points.Add(new Vector4(half.x + presetCenter.x, half.y + presetCenter.y, 0.0f, 0.0f));
                        tgt.Points.Add(new Vector4(half.x + presetCenter.x, -half.y + presetCenter.y, 0.0f, 0.0f));

                        NotifyModified();
                    }
                }
                break;

                case PresetType.Circle:
                {
                    presetPoints = EditorGUILayout.IntField("Point Count", presetPoints);
                    presetRadius = EditorGUILayout.FloatField("Radius", presetRadius);
                    presetCenter = EditorGUILayout.Vector2Field("Center", presetCenter);

                    if (GUILayout.Button("Create") == true)
                    {
                        Undo.RecordObject(tgt, "Create Preset: Circle");

                        var step = Mathf.PI * 2.0f / presetPoints;

                        for (var i = 0; i < presetPoints; i++)
                        {
                            var x = Mathf.Sin(i * step) * presetRadius + presetCenter.x;
                            var y = Mathf.Cos(i * step) * presetRadius + presetCenter.y;

                            tgt.Points.Add(new Vector4(x, y, 0.0f, 0.0f));
                        }

                        NotifyModified();
                    }
                }
                break;

                case PresetType.AnchoredBox:
                {
                    if (GUILayout.Button("Create") == true)
                    {
                        Undo.RecordObject(tgt, "Create Preset: Anchored Box");

                        tgt.Points.Add(new Vector4(0.0f, 0.0f, 0.0f, 0.0f));
                        tgt.Points.Add(new Vector4(0.0f, 0.0f, 0.0f, 1.0f));
                        tgt.Points.Add(new Vector4(0.0f, 0.0f, 1.0f, 1.0f));
                        tgt.Points.Add(new Vector4(0.0f, 0.0f, 1.0f, 0.0f));

                        NotifyModified();
                    }
                }
                break;
                }
                EditorGUI.indentLevel--;
            }
        }
コード例 #19
0
ファイル: Device.cs プロジェクト: kratter/openrealsense
 public static extern void rs_enable_stream_preset(IntPtr device, StreamType stream, PresetType preset, out IntPtr error);
コード例 #20
0
 public FFMpegSettings(PresetType preset, int crf, int audioQuality)
 {
     this.Preset       = preset;
     this.CRFScale     = crf;
     this.AudioQuality = audioQuality;
 }
コード例 #21
0
ファイル: ViewSettings.cs プロジェクト: EdutechSRL/Adevico
 public static List <ViewOption> GetListOfDefaultActiveOptions(PresetType type)
 {
     return(FromFlagToList(DefaultActiveOptions(type)));
 }
コード例 #22
0
ファイル: CameraInfo.cs プロジェクト: danbystrom/VisionQuest
 public static bool UsesRaw(PresetType pt, vdCamera.vdCamera camera)
 {
     var preset = GetPreset(pt, camera.CameraType);
     return preset != null && preset.ImageTypeSize.StartsWith("raw",StringComparison.OrdinalIgnoreCase);
 }
コード例 #23
0
 private static extern IntPtr GpuStereoBMCreate(PresetType preset, int ndisparities, int winSize);
コード例 #24
0
ファイル: CameraInfo.cs プロジェクト: danbystrom/VisionQuest
 public static void ApplyPreset(PresetType pt, vdCamera.vdCamera camera)
 {
     var preset = GetPreset(pt,camera.CameraType);
     if ( preset != null )
         preset.Apply( camera );
 }
コード例 #25
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="buttons">A list of buttons to appear in the alert view.</param>
 /// <param name="presetType"></param>
 /// <param name="title"></param>
 /// <param name="titleFont"></param>
 /// <param name="content"></param>
 /// <param name="contentFont"></param>
 /// <param name="buttonFont"></param>
 /// <param name="okCommand"></param>
 /// <returns></returns>
 public static async Task ShowPresetAlert(List <ExtendedButton> buttons, PresetType presetType, string title = "", ExtendedFont titleFont = null,
                                          string content = "", ExtendedFont contentFont = null, ExtendedFont buttonFont = null, Command okCommand = null)
 {
     var view = new AdvancedAlertView(buttons.Cast <View>().ToList(), DefaultColor, title, titleFont, content, contentFont, AlertType.Preset, presetType: presetType);
     await Application.Current.MainPage.Navigation.PushPopupAsync(view);
 }
コード例 #26
0
 public static extern void rs_enable_stream_preset( IntPtr device, StreamType stream, PresetType preset, out IntPtr error );
コード例 #27
0
ファイル: CameraInfo.cs プロジェクト: danbystrom/VisionQuest
        public static Preset GetPreset(PresetType pt, CameraType cameraType)
        {
            Dictionary<PresetType,Preset> dic;
            Preset preset;

            if (!_presets.TryGetValue(cameraType, out dic))
                return null;
            if (!dic.TryGetValue(pt, out preset))
                return null;
            return preset;
        }