Beispiel #1
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            cam    = new TCamera();
            render = new TRender(this.splitContainer1.Panel2);
            editor = new TEditor(cam, render);

            //инициализируем несколько объектов
            detail = new CSGSystem.CSGObjects.TCSGBoolOp();
            CSGObjects.TCSGBox box = new CSGSystem.CSGObjects.TCSGBox(2, 2, 1);
            //CSGObjects.TCSGSphere sp = new CSGSystem.CSGObjects.TCSGSphere(1);
            //CSGObjects.TCSGCylinder sp = new CSGSystem.CSGObjects.TCSGCylinder(1,2,30);
            //sp.SetRotation(Matrix.RotationX(3.14f / 4.0f));
            CSGObjects.TCSGBox sp = new CSGSystem.CSGObjects.TCSGBox(1, 4, 4);
            detail.AddOperand(box);
            detail.AddOperand(sp);
            CSGObjects.TCSGSphere sp1 = new CSGSystem.CSGObjects.TCSGSphere(1);
            //sp1.SubDivLevel=0;
            detail.AddOperand(sp1);
            detail.Update();

            detail.BuildTreeView(treeView1.Nodes.Add("Деталь"));

            editor.Select(sp);
            propertyGrid1.SelectedObject = sp;

            timer1.Enabled = true;
            toolStripComboBox1.SelectedIndex = 0;
            toolStripTextBox1.Text           = cam.GetDist().ToString();
            toolStripButton3.Checked         = true;
            treeView1.ExpandAll();
        }
Beispiel #2
0
 public TEditor(TCamera use_cam, TRender use_render)
 {
     cam    = use_cam;
     render = use_render;
 }
Beispiel #3
0
 public void ViewByCam(TCamera cam)
 {
     _device.Transform.View = cam.GetView();
 }