Пример #1
0
    public SpherePropertiesDialog(Sphere sphere) {
      InitializeComponent();

      numericUpDown1.Text = sphere.getX().ToString();
      numericUpDown2.Text = sphere.getY().ToString();
      numericUpDown3.Text = sphere.getZ().ToString();
      numericUpDown4.Text = sphere.getRadius().ToString();
      numericUpDown5.Text = sphere.getReflection().ToString();
      numericUpDown6.Text = sphere.getTransparency().ToString();
      surface = sphere.getSurface();
      emission = sphere.getEmission();
      pictureBox1.BackColor = System.Drawing.Color.FromArgb(surface.A, surface.R, surface.G, surface.B);
      pictureBox2.BackColor = System.Drawing.Color.FromArgb(emission.A, emission.R, emission.G, emission.B);
    }
Пример #2
0
    private void addSphere(object sender, EventArgs args) {
      TreeView view = ((SpheresTabPage) tabControl1.SelectedTab.Controls[0]).treeView1;
      TreeNode node = new TreeNode();
      node.Text = "sphere " + sphereCount++;
      Sphere sphere = new Sphere();
      node.Tag = sphere;
      view.Nodes.Add(node);

      for (int i = 1; i < tabControl1.TabPages.Count; i++) {
        TreeView passView = ((PassTabPage) tabControl1.TabPages[i].Controls[0]).treeView1;

        Move move = new Move();
        TreeNode moveNode = new TreeNode();
        moveNode.Text = node.Text;
        moveNode.Tag = move;
        passView.Nodes.Add(moveNode);
      }
    }