Exemple #1
0
        private void model1_WorkCompleted(object sender, WorkCompletedEventArgs e)
        {
            if (e.WorkUnit == hdlView1)
            {
                var prevCam = model1.Viewports[0].Camera;

                model1.Viewports[0].Camera = secondCamera;

                hdlView2 = new MyHiddenLinesViewPrint(new HiddenLinesViewSettings(model1.Viewports[0], model1, 0.1, PenSilho, PenEdge, PenWire, false));

                model1.Viewports[0].Camera = prevCam;

                // Runs the hidden lines computation for the second view
                model1.StartWork(hdlView2);
            }
            else if (e.WorkUnit == hdlView2)
            {
                // Prints the page
                Print();
            }
        }
Exemple #2
0
        private void printButton_Click(object sender, EventArgs e)
        {
            // Defines the camera for the second view
            secondCamera = new Camera(new Point3D(320, 0, 160),
                                      600,
                                      new Quaternion(Vector3D.AxisZ, 90),
                                      projectionType.Orthographic,
                                      50,
                                      1);

            if (comboBoxPrintMode.SelectedIndex == 0) // Vector printing
            {
                hdlView1 = new MyHiddenLinesViewPrint(new HiddenLinesViewSettings(model1.Viewports[0], model1, 0.1, true, PenSilho, PenEdge, PenWire, false));
                model1.StartWork(hdlView1);
            }
            else // Raster printing
            {
                secondCamera.Move(50, 50, 0);

                // Prints the page
                Print();
            }
        }