public ColorChangePanel(InputPanel ip, object ob, ObjectInspectorPanel oip)
 {
     inputPanel = ip;
     objectInspectorPanel = oip;
     InitializeComponent();
     initialiseColors();
     updateListBox(ob);
 }
Пример #2
0
        public InputLinePanel(InputPanel ip)
        {
            inputPanel = ip;
            List<Point> points = inputPanel.pointsInScene;
            InitializeComponent();

            //Don't allow the functionality of chosing two points to create the line between if there are no existing points
            if (points.Count <= 0)
            {
                buttonExistingPoints.Enabled = false;
            }
        }
Пример #3
0
        public Scene(InputPanel ip)
        {
            //Stops GLUT trying to re-initialise if it has already been initialised.
            int glutTime = Glut.glutGet(Glut.GLUT_ELAPSED_TIME);
            if (glutTime <= 0)
            {
                Glut.glutInit();
            }

            //Initialises GLUT
            Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_DEPTH);
            Glut.glutInitWindowSize(width, height);
            Glut.glutCreateWindow("Scene");

            Glut.glutSetOption(Glut.GLUT_ACTION_ON_WINDOW_CLOSE, 1);
            Glut.glutCloseFunc(closeFunc);

            Glut.glutIdleFunc(OnRenderFrame);

            Gl.Enable(EnableCap.Blend);

            //Creates the rendering ShaderProgram
            program = new ShaderProgram(VertexShader, FragmentShader);

            program.Use();
            program["projection_matrix"].SetValue(Matrix4.CreatePerspectiveFieldOfView(0.45f, (float)width / height, 0.1f, 1000f));
            resetCamera();

            //Initialises colors
            colors[0] = new Vector3(1, 0.5f, 0);
            colors[1] = new Vector3(1, 1, 0);
            colors[2] = new Vector3(0.5f, 1, 0);
            colors[3] = new Vector3(0, 1, 0);
            colors[4] = new Vector3(0, 1, 0.5f);
            colors[5] = new Vector3(0, 0.5f, 1);
            colors[6] = new Vector3(0, 0, 1);
            colors[7] = new Vector3(0.5f, 0, 1);
            colors[8] = new Vector3(1, 0, 1);
            colors[9] = new Vector3(1, 0, 0.5f);

            //Starts the Stopwatch
            watch = System.Diagnostics.Stopwatch.StartNew();

            inputPanel = ip;

            //Enters the main loop
            Glut.glutMainLoop();
        }
        public InputLineFromPointsPanel(InputPanel ip)
        {
            inputPanel = ip;
            InitializeComponent();

            pointsInScene = getPoints();

            //Create two appropriate lists to be displayed to the user
            BindingList<string> firstPointsToBeDisplayed = convertPointsToStrings(pointsInScene);
            BindingList<string> secondPointsToBeDisplayed = convertPointsToStrings(pointsInScene); ;

            //Assign the two above lists to the list boxes
            firstPointListBox.DataSource = firstPointsToBeDisplayed;
            secondPointListBox.DataSource = secondPointsToBeDisplayed;

            this.Show();
        }
Пример #5
0
        public InputAnglePanel(InputPanel ip)
        {
            inputPanel = ip;
            InitializeComponent();

            linesInScene = getLines();

            //If there are no lines in the scene, don't enable the submit button
            if (linesInScene.Count <= 0)
            {
                submitButton.Enabled = false;
            }

            //Create two appropriate lists to be displayed to the user
            BindingList<string> firstDisplayList = convertLinesToStrings(linesInScene);
            BindingList<string> secondDisplayList = convertLinesToStrings(linesInScene);

            //Assign the two above lists to the list boxes
            firstLineListBox.DataSource = firstDisplayList;
            secondLineListBox.DataSource = secondDisplayList;
        }
Пример #6
0
 public InputPointPanel(InputPanel ip)
 {
     InitializeComponent();
     inputPanel = ip;
 }
 public ObjectInspectorPanel(InputPanel ip)
 {
     inputPanel = ip;
     InitializeComponent();
     updateListBox();
 }