示例#1
0
 public NamedColorTable(GLTexture1D tex, Vector3 nanColor, string name, string groupname)
 {
     this.name = name;
     this.groupname = groupname;
     this.nanColor = nanColor;
     this.tex = tex;
     this.flipped = false;
 }
示例#2
0
            public InputSection(ColorTableManager colorTableMgr, GLFont font)
            {
                this.colorTableMgr = colorTableMgr;
                this.font = font;

                InsertSplitterPinAction = ActionManager.CreateAction("Insert splitter pin", this, "InsertSplitterPin");
                InsertNestedPinAction = ActionManager.CreateAction("Insert nesting pin", this, "InsertNestedPin");
                MovePinAction = ActionManager.CreateAction("Move pin", this, "MovePin");
                RemovePinAction = ActionManager.CreateAction("Remove pin", this, "RemovePin");
                SetSectionColormapAction = ActionManager.CreateAction("Set colormap of section", this, "SetSectionColormap");
                ResetColorTableAction = ActionManager.CreateAction("Reset colormap", this, "ResetColorTable");

                // Create colormap
                colormapTexture = new GLTexture1D("colormap", new byte[4 * FINAL_COLORMAP_SIZE], FINAL_COLORMAP_SIZE, PixelFormat.Rgba, false);

                // Create histogram grid as line list mesh
                List<Vector3> positions = new List<Vector3>();
                /*positions.AddRange(new Vector3[] {
                    // Outline
                    new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 0.5f, 0.0f),
                    new Vector3(0.0f, 0.5f, 0.0f), new Vector3(1.0f, 0.5f, 0.0f),
                    new Vector3(1.0f, 0.5f, 0.0f), new Vector3(1.0f, 0.0f, 0.0f),
                    new Vector3(1.0f, 0.0f, 0.0f), new Vector3(0.0f, 0.0f, 0.0f)
                });*/
                for(int i = 0; i <= 10; ++i)
                {
                    float y = (float)i / 10.0f * 0.9f + 0.1f;
                    positions.Add(new Vector3(0.0f, y, 0.0f));
                    positions.Add(new Vector3(1.0f, y, 0.0f));
                }
                for(int i = 0; i <= 10; ++i)
                {
                    float x = (float)i / 10.0f;
                    positions.Add(new Vector3(x, 0.1f, 0.0f));
                    positions.Add(new Vector3(x, 1.0f, 0.0f));
                }
                meshLines = new GLMesh(positions.ToArray(), null, null, null, null, null, PrimitiveType.Lines);

                // Create textures
                texSplitter = GLTexture2D.FromFile(Global.EXE_DIR + "splitter.png", false);
                texInterjectorLeft = GLTexture2D.FromFile(Global.EXE_DIR + "interjectorLeft.png", false);
                texInterjectorRight = GLTexture2D.FromFile(Global.EXE_DIR + "interjectorRight.png", false);

                // Create number font
                //font = new GLNumberFont("HelveticaNeue_12.png", new FontDefinition(new int[] {0, 14, 26, 39, 53, 67, 80, 93, 106, 120, 133}, new int[] {0, 19}), Common.meshQuad, true);
                //font = new GLNumberFont("HelveticaNeue_16.png", new FontDefinition(new int[] {0, 18, 34, 53, 71, 89, 106, 124, 142, 160, 178}, new int[] {0, 25}), true);
                //font = new GLTextFont("fntDefault.png", new Vector2(19.0f, 32.0f), Common.meshQuad);
            }