Ejemplo n.º 1
0
        void DisplayFlag_Click(object sender, EventArgs e)
        {
            ToolStripMenuItem item = (ToolStripMenuItem)sender;
            TetDisplayFlag    flag = (TetDisplayFlag)item.Tag;

            GlobalTetSetting.TetDisplayFlag ^= flag;
            item.Checked = !item.Checked;
            OnChanged(EventArgs.Empty);
        }
Ejemplo n.º 2
0
        public void DrawFlag(TetMesh mesh)
        {
            TetDisplayFlag mode = GlobalTetSetting.TetDisplayFlag;

            GL.Enable(EnableCap.DepthTest);
            GL.Enable(EnableCap.PolygonOffsetFill);
            foreach (var item in methods)
            {
                if ((mode & item.Flag) == item.Flag)
                {
                    item.Action(mesh);
                }
            }
            GL.Disable(EnableCap.PolygonOffsetFill);
        }
Ejemplo n.º 3
0
        private void InitDisplay()
        {
            Array arr = Enum.GetValues(typeof(TetDisplayFlag));

            for (int i = 1; i < arr.Length; i++)
            {
                TetDisplayFlag    type = (TetDisplayFlag)arr.GetValue(i);
                ToolStripMenuItem item = new ToolStripMenuItem();
                item.Name = type.ToString() + "Flag";
                item.Text = type.ToString();
                item.Tag  = type;
                if ((GlobalTetSetting.TetDisplayFlag & type) == type)
                {
                    item.Checked = true;
                }
                item.Click += DisplayFlag_Click;
                this.displayMenuItem.DropDownItems.Add(item);
            }
        }
Ejemplo n.º 4
0
 public Method(TetDisplayFlag flag, Action<TetMesh> action)
 {
     this.Flag = flag;
     this.Action = action;
 }
Ejemplo n.º 5
0
 public Method(TetDisplayFlag flag, Action <TetMesh> action)
 {
     this.Flag   = flag;
     this.Action = action;
 }