/// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVstreamTracer(String [] argv)
    {
        //Prefix Content is: ""

          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();

          // this test has some wireframe geometry
          // Make sure multisampling is disabled to avoid generating multiple
          // regression images
          // renWin SetMultiSamples 0

          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // read data[]
          //[]
          reader = new vtkStructuredGridReader();
          reader.SetFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/office.binary.vtk");
          reader.Update();
          //force a read to occur[]
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          mapOutline = vtkPolyDataMapper.New();
          mapOutline.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)mapOutline);
          outlineActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          rk = new vtkRungeKutta45();
          // Create source for streamtubes[]
          streamer = new vtkStreamTracer();
          streamer.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          streamer.SetStartPosition((double)0.1,(double)2.1,(double)0.5);
          streamer.SetMaximumPropagation((double)500);
          streamer.SetIntegrationStepUnit(2);
          streamer.SetMinimumIntegrationStep((double)0.1);
          streamer.SetMaximumIntegrationStep((double)1.0);
          streamer.SetInitialIntegrationStep((double)0.2);
          streamer.SetIntegrationDirection((int)0);
          streamer.SetIntegrator((vtkInitialValueProblemSolver)rk);
          streamer.SetRotationScale((double)0.5);
          streamer.SetMaximumError((double)1.0e-8);
          aa = new vtkAssignAttribute();
          aa.SetInputConnection((vtkAlgorithmOutput)streamer.GetOutputPort());
          aa.Assign((string)"Normals",(string)"NORMALS",(string)"POINT_DATA");
          rf1 = new vtkRibbonFilter();
          rf1.SetInputConnection((vtkAlgorithmOutput)aa.GetOutputPort());
          rf1.SetWidth((double)0.1);
          rf1.VaryWidthOff();
          mapStream = vtkPolyDataMapper.New();
          mapStream.SetInputConnection((vtkAlgorithmOutput)rf1.GetOutputPort());
          mapStream.SetScalarRange((double)((vtkDataSet)reader.GetOutput()).GetScalarRange()[0],(double)((vtkDataSet)reader.GetOutput()).GetScalarRange()[1]);
          streamActor = new vtkActor();
          streamActor.SetMapper((vtkMapper)mapStream);
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)streamActor);
          ren1.SetBackground((double)0.4,(double)0.4,(double)0.5);
          cam = ren1.GetActiveCamera();
          cam.SetPosition((double)-2.35599,(double)-3.35001,(double)4.59236);
          cam.SetFocalPoint((double)2.255,(double)2.255,(double)1.28413);
          cam.SetViewUp((double)0.311311,(double)0.279912,(double)0.908149);
          cam.SetClippingRange((double)1.12294,(double)16.6226);
          renWin.SetSize((int)300,(int)200);
          iren.Initialize();
          // interact with data[]

        //deleteAllVTKObjects();
    }
Beispiel #2
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVstreamTracer(String [] argv)
    {
        //Prefix Content is: ""

        ren1   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();

        // this test has some wireframe geometry
        // Make sure multisampling is disabled to avoid generating multiple
        // regression images
        // renWin SetMultiSamples 0

        renWin.AddRenderer((vtkRenderer)ren1);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // read data[]
        //[]
        reader = new vtkStructuredGridReader();
        reader.SetFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/office.binary.vtk");
        reader.Update();
        //force a read to occur[]
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
        mapOutline = vtkPolyDataMapper.New();
        mapOutline.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)mapOutline);
        outlineActor.GetProperty().SetColor((double)0, (double)0, (double)0);
        rk = new vtkRungeKutta45();
        // Create source for streamtubes[]
        streamer = new vtkStreamTracer();
        streamer.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
        streamer.SetStartPosition((double)0.1, (double)2.1, (double)0.5);
        streamer.SetMaximumPropagation((double)500);
        streamer.SetIntegrationStepUnit(2);
        streamer.SetMinimumIntegrationStep((double)0.1);
        streamer.SetMaximumIntegrationStep((double)1.0);
        streamer.SetInitialIntegrationStep((double)0.2);
        streamer.SetIntegrationDirection((int)0);
        streamer.SetIntegrator((vtkInitialValueProblemSolver)rk);
        streamer.SetRotationScale((double)0.5);
        streamer.SetMaximumError((double)1.0e-8);
        aa = new vtkAssignAttribute();
        aa.SetInputConnection((vtkAlgorithmOutput)streamer.GetOutputPort());
        aa.Assign((string)"Normals", (string)"NORMALS", (string)"POINT_DATA");
        rf1 = new vtkRibbonFilter();
        rf1.SetInputConnection((vtkAlgorithmOutput)aa.GetOutputPort());
        rf1.SetWidth((double)0.1);
        rf1.VaryWidthOff();
        mapStream = vtkPolyDataMapper.New();
        mapStream.SetInputConnection((vtkAlgorithmOutput)rf1.GetOutputPort());
        mapStream.SetScalarRange((double)((vtkDataSet)reader.GetOutput()).GetScalarRange()[0], (double)((vtkDataSet)reader.GetOutput()).GetScalarRange()[1]);
        streamActor = new vtkActor();
        streamActor.SetMapper((vtkMapper)mapStream);
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)streamActor);
        ren1.SetBackground((double)0.4, (double)0.4, (double)0.5);
        cam = ren1.GetActiveCamera();
        cam.SetPosition((double)-2.35599, (double)-3.35001, (double)4.59236);
        cam.SetFocalPoint((double)2.255, (double)2.255, (double)1.28413);
        cam.SetViewUp((double)0.311311, (double)0.279912, (double)0.908149);
        cam.SetClippingRange((double)1.12294, (double)16.6226);
        renWin.SetSize((int)300, (int)200);
        iren.Initialize();
        // interact with data[]

//deleteAllVTKObjects();
    }