Exemplo n.º 1
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVEnSightOfficeBin(String [] argv)
    {
        //Prefix Content is: ""

        ren1   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.AddRenderer((vtkRenderer)ren1);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // read data[]
        //[]
        reader = new vtkGenericEnSightReader();
        // Make sure all algorithms use the composite data pipeline[]
        cdp = new vtkCompositeDataPipeline();
        vtkGenericEnSightReader.SetDefaultExecutivePrototype((vtkExecutive)cdp);
        reader.SetCaseFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/EnSight/office_bin.case");
        reader.Update();
        // to add coverage for vtkOnePieceExtentTranslator[]
        translator = new vtkOnePieceExtentTranslator();
        vtkStreamingDemandDrivenPipeline.SetExtentTranslator(reader.GetOutputInformation(0), (vtkExtentTranslator)translator);
        outline = new vtkStructuredGridOutlineFilter();
        //    outline SetInputConnection [reader GetOutputPort][]
        outline.SetInputData((vtkDataObject)reader.GetOutput().GetBlock((uint)0));
        mapOutline = vtkPolyDataMapper.New();
        mapOutline.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)mapOutline);
        outlineActor.GetProperty().SetColor((double)0, (double)0, (double)0);
        // Create source for streamtubes[]
        streamer = new vtkStreamPoints();
        //    streamer SetInputConnection [reader GetOutputPort][]
        streamer.SetInputData((vtkDataObject)reader.GetOutput().GetBlock((uint)0));
        streamer.SetStartPosition((double)0.1, (double)2.1, (double)0.5);
        streamer.SetMaximumPropagationTime((double)500);
        streamer.SetTimeIncrement((double)0.5);
        streamer.SetIntegrationDirectionToForward();
        cone = new vtkConeSource();
        cone.SetResolution((int)8);
        cones = new vtkGlyph3D();
        cones.SetInputConnection((vtkAlgorithmOutput)streamer.GetOutputPort());
        cones.SetSourceConnection(cone.GetOutputPort());
        cones.SetScaleFactor((double)0.9);
        cones.SetScaleModeToScaleByVector();
        mapCones = vtkPolyDataMapper.New();
        mapCones.SetInputConnection((vtkAlgorithmOutput)cones.GetOutputPort());
        //    eval mapCones SetScalarRange [[reader GetOutput] GetScalarRange][]
        mapCones.SetScalarRange((double)((vtkDataSet)reader.GetOutput().GetBlock((uint)0)).GetScalarRange()[0],
                                (double)((vtkDataSet)reader.GetOutput().GetBlock((uint)0)).GetScalarRange()[1]);
        conesActor = new vtkActor();
        conesActor.SetMapper((vtkMapper)mapCones);
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)conesActor);
        ren1.SetBackground((double)0.4, (double)0.4, (double)0.5);
        renWin.SetSize((int)300, (int)300);
        iren.Initialize();
        // interact with data[]
        vtkGenericEnSightReader.SetDefaultExecutivePrototype(null);

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

          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // read data[]
          //[]
          reader = new vtkGenericEnSightReader();
          // Make sure all algorithms use the composite data pipeline[]
          cdp = new vtkCompositeDataPipeline();
          vtkGenericEnSightReader.SetDefaultExecutivePrototype((vtkExecutive)cdp);
          reader.SetCaseFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/EnSight/office_bin.case");
          reader.Update();
          // to add coverage for vtkOnePieceExtentTranslator[]
          translator = new vtkOnePieceExtentTranslator();
          vtkStreamingDemandDrivenPipeline.SetExtentTranslator(reader.GetOutputInformation(0), (vtkExtentTranslator)translator);
          outline = new vtkStructuredGridOutlineFilter();
          //    outline SetInputConnection [reader GetOutputPort][]
          outline.SetInputData((vtkDataObject)reader.GetOutput().GetBlock((uint)0));
          mapOutline = vtkPolyDataMapper.New();
          mapOutline.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)mapOutline);
          outlineActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          // Create source for streamtubes[]
          streamer = new vtkStreamPoints();
          //    streamer SetInputConnection [reader GetOutputPort][]
          streamer.SetInputData((vtkDataObject)reader.GetOutput().GetBlock((uint)0));
          streamer.SetStartPosition((double)0.1,(double)2.1,(double)0.5);
          streamer.SetMaximumPropagationTime((double)500);
          streamer.SetTimeIncrement((double)0.5);
          streamer.SetIntegrationDirectionToForward();
          cone = new vtkConeSource();
          cone.SetResolution((int)8);
          cones = new vtkGlyph3D();
          cones.SetInputConnection((vtkAlgorithmOutput)streamer.GetOutputPort());
          cones.SetSourceConnection(cone.GetOutputPort());
          cones.SetScaleFactor((double)0.9);
          cones.SetScaleModeToScaleByVector();
          mapCones = vtkPolyDataMapper.New();
          mapCones.SetInputConnection((vtkAlgorithmOutput)cones.GetOutputPort());
          //    eval mapCones SetScalarRange [[reader GetOutput] GetScalarRange][]
          mapCones.SetScalarRange((double)((vtkDataSet)reader.GetOutput().GetBlock((uint)0)).GetScalarRange()[0],
          (double)((vtkDataSet)reader.GetOutput().GetBlock((uint)0)).GetScalarRange()[1]);
          conesActor = new vtkActor();
          conesActor.SetMapper((vtkMapper)mapCones);
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)conesActor);
          ren1.SetBackground((double)0.4,(double)0.4,(double)0.5);
          renWin.SetSize((int)300,(int)300);
          iren.Initialize();
          // interact with data[]
          vtkGenericEnSightReader.SetDefaultExecutivePrototype(null);

        //deleteAllVTKObjects();
    }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetGeometry5(vtkStructuredGridOutlineFilter toSet)
 {
     Geometry5 = toSet;
 }
Exemplo n.º 4
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVmergeFilter(String [] argv)
    {
        //Prefix Content is: ""

          // Create the RenderWindow, Renderer and both Actors[]
          //[]
          ren1 = vtkRenderer.New();
          ren2 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          renWin.AddRenderer((vtkRenderer)ren2);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // create pipeline[]
          //[]
          pl3d = new vtkPLOT3DReader();
          pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
          pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
          pl3d.SetScalarFunctionNumber((int)110);
          pl3d.SetVectorFunctionNumber((int)202);
          pl3d.Update();
          probeLine = new vtkLineSource();
          probeLine.SetPoint1((double)1,(double)1,(double)29);
          probeLine.SetPoint2((double)16.5,(double)5,(double)31.7693);
          probeLine.SetResolution((int)500);
          probe = new vtkProbeFilter();
          probe.SetInputConnection((vtkAlgorithmOutput)probeLine.GetOutputPort());
          probe.SetSource((vtkDataObject)pl3d.GetOutput());
          probeTube = new vtkTubeFilter();
          probeTube.SetInput((vtkDataObject)probe.GetPolyDataOutput());
          probeTube.SetNumberOfSides((int)5);
          probeTube.SetRadius((double).05);
          probeMapper = vtkPolyDataMapper.New();
          probeMapper.SetInputConnection((vtkAlgorithmOutput)probeTube.GetOutputPort());
          probeMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[1]);
          probeActor = new vtkActor();
          probeActor.SetMapper((vtkMapper)probeMapper);
          displayLine = new vtkLineSource();
          displayLine.SetPoint1((double)0,(double)0,(double)0);
          displayLine.SetPoint2((double)1,(double)0,(double)0);
          displayLine.SetResolution((int)probeLine.GetResolution());
          displayMerge = new vtkMergeFilter();
          displayMerge.SetGeometry((vtkDataSet)displayLine.GetOutput());
          displayMerge.SetScalars((vtkDataSet)probe.GetPolyDataOutput());
          displayWarp = new vtkWarpScalar();
          displayWarp.SetInput((vtkDataObject)displayMerge.GetPolyDataOutput());
          displayWarp.SetNormal((double)0,(double)1,(double)0);
          displayWarp.SetScaleFactor((double).000001);
          displayMapper = vtkPolyDataMapper.New();
          displayMapper.SetInput((vtkPolyData)displayWarp.GetPolyDataOutput());
          displayMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[1]);
          displayActor = new vtkActor();
          displayActor.SetMapper((vtkMapper)displayMapper);
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          outlineMapper = vtkPolyDataMapper.New();
          outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)outlineMapper);
          outlineActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)probeActor);
          ren1.SetBackground((double)1,(double)1,(double)1);
          ren1.SetViewport((double)0,(double).25,(double)1,(double)1);
          ren2.AddActor((vtkProp)displayActor);
          ren2.SetBackground((double)0,(double)0,(double)0);
          ren2.SetViewport((double)0,(double)0,(double)1,(double).25);
          renWin.SetSize((int)300,(int)300);
          ren1.ResetCamera();
          cam1 = ren1.GetActiveCamera();
          cam1.SetClippingRange((double)3.95297,(double)50);
          cam1.SetFocalPoint((double)8.88908,(double)0.595038,(double)29.3342);
          cam1.SetPosition((double)9.9,(double)-26,(double)41);
          cam1.SetViewUp((double)0.060772,(double)-0.319905,(double)0.945498);
          ren2.ResetCamera();
          cam2 = ren2.GetActiveCamera();
          cam2.ParallelProjectionOn();
          cam2.SetParallelScale((double).15);
          iren.Initialize();
          // render the image[]
          //[]
          // prevent the tk window from showing up then start the event loop[]

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

        // we need to use composite data pipeline with multiblock datasets[]
        alg = new vtkAlgorithm();
        pip = new vtkCompositeDataPipeline();
        vtkAlgorithm.SetDefaultExecutivePrototype((vtkExecutive)pip);
        //skipping Delete pip
        Ren1 = vtkRenderer.New();
        Ren1.SetBackground((double)0.33, (double)0.35, (double)0.43);

        renWin = vtkRenderWindow.New();
        renWin.AddRenderer((vtkRenderer)Ren1);

        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);

        Plot3D0 = new vtkMultiBlockPLOT3DReader();
        Plot3D0.SetFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
        Plot3D0.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
        Plot3D0.SetBinaryFile((int)1);
        Plot3D0.SetMultiGrid((int)0);
        Plot3D0.SetHasByteCount((int)0);
        Plot3D0.SetIBlanking((int)0);
        Plot3D0.SetTwoDimensionalGeometry((int)0);
        Plot3D0.SetForceRead((int)0);
        Plot3D0.SetByteOrder((int)0);
        Plot3D0.Update();

        Geometry5 = new vtkStructuredGridOutlineFilter();
        Geometry5.SetInputData((vtkDataSet)Plot3D0.GetOutput().GetBlock(0));

        Mapper5 = vtkPolyDataMapper.New();
        Mapper5.SetInputConnection((vtkAlgorithmOutput)Geometry5.GetOutputPort());
        Mapper5.SetImmediateModeRendering((int)1);
        Mapper5.UseLookupTableScalarRangeOn();
        Mapper5.SetScalarVisibility((int)0);
        Mapper5.SetScalarModeToDefault();

        Actor5 = new vtkActor();
        Actor5.SetMapper((vtkMapper)Mapper5);
        Actor5.GetProperty().SetRepresentationToSurface();
        Actor5.GetProperty().SetInterpolationToGouraud();
        Actor5.GetProperty().SetAmbient((double)0.15);
        Actor5.GetProperty().SetDiffuse((double)0.85);
        Actor5.GetProperty().SetSpecular((double)0.1);
        Actor5.GetProperty().SetSpecularPower((double)100);
        Actor5.GetProperty().SetSpecularColor((double)1, (double)1, (double)1);

        Actor5.GetProperty().SetColor((double)1, (double)1, (double)1);
        Ren1.AddActor((vtkProp)Actor5);

        ExtractGrid[0] = new vtkExtractGrid();
        ExtractGrid[0].SetInputData((vtkDataSet)Plot3D0.GetOutput().GetBlock(0));
        ExtractGrid[0].SetVOI((int)0, (int)14, (int)0, (int)32, (int)0, (int)24);
        ExtractGrid[0].SetSampleRate((int)1, (int)1, (int)1);
        ExtractGrid[0].SetIncludeBoundary((int)0);

        ExtractGrid[1] = new vtkExtractGrid();
        ExtractGrid[1].SetInputData((vtkDataSet)Plot3D0.GetOutput().GetBlock(0));
        ExtractGrid[1].SetVOI((int)14, (int)29, (int)0, (int)32, (int)0, (int)24);
        ExtractGrid[1].SetSampleRate((int)1, (int)1, (int)1);
        ExtractGrid[1].SetIncludeBoundary((int)0);

        ExtractGrid[2] = new vtkExtractGrid();
        ExtractGrid[2].SetInputData((vtkDataSet)Plot3D0.GetOutput().GetBlock(0));
        ExtractGrid[2].SetVOI((int)29, (int)56, (int)0, (int)32, (int)0, (int)24);
        ExtractGrid[2].SetSampleRate((int)1, (int)1, (int)1);
        ExtractGrid[2].SetIncludeBoundary((int)0);

        LineSourceWidget0 = new vtkLineSource();
        LineSourceWidget0.SetPoint1((double)3.05638, (double)-3.00497, (double)28.2211);
        LineSourceWidget0.SetPoint2((double)3.05638, (double)3.95916, (double)28.2211);
        LineSourceWidget0.SetResolution((int)20);

        mbds = new vtkMultiBlockDataSet();
        mbds.SetNumberOfBlocks((uint)3);
        i = 0;
        while ((i) < 3)
        {
            ExtractGrid[i].Update();
            sg[i] = vtkStructuredGrid.New();
            sg[i].ShallowCopy(ExtractGrid[i].GetOutput());
            mbds.SetBlock((uint)i, sg[i]);
            //skipping Delete sg[i]
            i = i + 1;
        }

        Stream0 = new vtkStreamTracer();
        Stream0.SetInputData((vtkDataObject)mbds);
        Stream0.SetSourceConnection(LineSourceWidget0.GetOutputPort());
        Stream0.SetIntegrationStepUnit(2);
        Stream0.SetMaximumPropagation((double)20);
        Stream0.SetInitialIntegrationStep((double)0.5);
        Stream0.SetIntegrationDirection((int)0);
        Stream0.SetIntegratorType((int)0);
        Stream0.SetMaximumNumberOfSteps((int)2000);
        Stream0.SetTerminalSpeed((double)1e-12);

        //skipping Delete mbds

        aa = new vtkAssignAttribute();
        aa.SetInputConnection((vtkAlgorithmOutput)Stream0.GetOutputPort());
        aa.Assign((string)"Normals", (string)"NORMALS", (string)"POINT_DATA");

        Ribbon0 = new vtkRibbonFilter();
        Ribbon0.SetInputConnection((vtkAlgorithmOutput)aa.GetOutputPort());
        Ribbon0.SetWidth((double)0.1);
        Ribbon0.SetAngle((double)0);
        Ribbon0.SetDefaultNormal((double)0, (double)0, (double)1);
        Ribbon0.SetVaryWidth((int)0);

        LookupTable1 = new vtkLookupTable();
        LookupTable1.SetNumberOfTableValues((int)256);
        LookupTable1.SetHueRange((double)0, (double)0.66667);
        LookupTable1.SetSaturationRange((double)1, (double)1);
        LookupTable1.SetValueRange((double)1, (double)1);
        LookupTable1.SetTableRange((double)0.197813, (double)0.710419);
        LookupTable1.SetVectorComponent((int)0);
        LookupTable1.Build();

        Mapper10 = vtkPolyDataMapper.New();
        Mapper10.SetInputConnection((vtkAlgorithmOutput)Ribbon0.GetOutputPort());
        Mapper10.SetImmediateModeRendering((int)1);
        Mapper10.UseLookupTableScalarRangeOn();
        Mapper10.SetScalarVisibility((int)1);
        Mapper10.SetScalarModeToUsePointFieldData();
        Mapper10.SelectColorArray((string)"Density");
        Mapper10.SetLookupTable((vtkScalarsToColors)LookupTable1);

        Actor10 = new vtkActor();
        Actor10.SetMapper((vtkMapper)Mapper10);
        Actor10.GetProperty().SetRepresentationToSurface();
        Actor10.GetProperty().SetInterpolationToGouraud();
        Actor10.GetProperty().SetAmbient((double)0.15);
        Actor10.GetProperty().SetDiffuse((double)0.85);
        Actor10.GetProperty().SetSpecular((double)0);
        Actor10.GetProperty().SetSpecularPower((double)1);
        Actor10.GetProperty().SetSpecularColor((double)1, (double)1, (double)1);
        Ren1.AddActor((vtkProp)Actor10);

        // enable user interface interactor[]
        iren.Initialize();
        // prevent the tk window from showing up then start the event loop[]
        vtkAlgorithm.SetDefaultExecutivePrototype(null);
        //skipping Delete alg

//deleteAllVTKObjects();
    }
Exemplo n.º 6
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVtextureThreshold(String [] argv)
    {
        //Prefix Content is: ""

        // Create the RenderWindow, Renderer and both Actors[]
        //[]
        ren1   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.AddRenderer((vtkRenderer)ren1);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // read data[]
        //[]
        pl3d = new vtkMultiBlockPLOT3DReader();
        pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinxyz.bin");
        pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinq.bin");
        pl3d.SetScalarFunctionNumber((int)100);
        pl3d.SetVectorFunctionNumber((int)202);
        pl3d.Update();
        // wall[]
        //[]
        wall = new vtkStructuredGridGeometryFilter();
        wall.SetInputData(pl3d.GetOutput().GetBlock(0));
        wall.SetExtent((int)0, (int)100, (int)0, (int)0, (int)0, (int)100);
        wallMap = vtkPolyDataMapper.New();
        wallMap.SetInputConnection((vtkAlgorithmOutput)wall.GetOutputPort());
        wallMap.ScalarVisibilityOff();
        wallActor = new vtkActor();
        wallActor.SetMapper((vtkMapper)wallMap);
        wallActor.GetProperty().SetColor((double)0.8, (double)0.8, (double)0.8);
        // fin[]
        // []
        fin = new vtkStructuredGridGeometryFilter();
        fin.SetInputData(pl3d.GetOutput().GetBlock(0));
        fin.SetExtent((int)0, (int)100, (int)0, (int)100, (int)0, (int)0);
        finMap = vtkPolyDataMapper.New();
        finMap.SetInputConnection((vtkAlgorithmOutput)fin.GetOutputPort());
        finMap.ScalarVisibilityOff();
        finActor = new vtkActor();
        finActor.SetMapper((vtkMapper)finMap);
        finActor.GetProperty().SetColor((double)0.8, (double)0.8, (double)0.8);
        // planes to threshold[]
        tmap = new vtkStructuredPointsReader();
        tmap.SetFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/texThres2.vtk");
        texture = new vtkTexture();
        texture.SetInputConnection((vtkAlgorithmOutput)tmap.GetOutputPort());
        texture.InterpolateOff();
        texture.RepeatOff();
        plane1 = new vtkStructuredGridGeometryFilter();
        plane1.SetInputData(pl3d.GetOutput().GetBlock(0));
        plane1.SetExtent((int)10, (int)10, (int)0, (int)100, (int)0, (int)100);
        thresh1 = new vtkThresholdTextureCoords();
        thresh1.SetInputConnection((vtkAlgorithmOutput)plane1.GetOutputPort());
        thresh1.ThresholdByUpper((double)1.5);
        plane1Map = new vtkDataSetMapper();
        plane1Map.SetInputConnection((vtkAlgorithmOutput)thresh1.GetOutputPort());
        plane1Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                 (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        plane1Actor = new vtkActor();
        plane1Actor.SetMapper((vtkMapper)plane1Map);
        plane1Actor.SetTexture((vtkTexture)texture);
        plane1Actor.GetProperty().SetOpacity((double)0.999);
        plane2 = new vtkStructuredGridGeometryFilter();
        plane2.SetInputData(pl3d.GetOutput().GetBlock(0));
        plane2.SetExtent((int)30, (int)30, (int)0, (int)100, (int)0, (int)100);
        thresh2 = new vtkThresholdTextureCoords();
        thresh2.SetInputConnection((vtkAlgorithmOutput)plane2.GetOutputPort());
        thresh2.ThresholdByLower((double)1.5);
        plane2Map = new vtkDataSetMapper();
        plane2Map.SetInputConnection((vtkAlgorithmOutput)thresh2.GetOutputPort());
        plane2Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                 (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        plane2Actor = new vtkActor();
        plane2Actor.SetMapper((vtkMapper)plane2Map);
        plane2Actor.SetTexture((vtkTexture)texture);
        plane2Actor.GetProperty().SetOpacity((double)0.999);
        plane3 = new vtkStructuredGridGeometryFilter();
        plane3.SetInputData(pl3d.GetOutput().GetBlock(0));
        plane3.SetExtent((int)35, (int)35, (int)0, (int)100, (int)0, (int)100);
        thresh3 = new vtkThresholdTextureCoords();
        thresh3.SetInputConnection((vtkAlgorithmOutput)plane3.GetOutputPort());
        thresh3.ThresholdBetween((double)1.5, (double)1.8);
        plane3Map = new vtkDataSetMapper();
        plane3Map.SetInputConnection((vtkAlgorithmOutput)thresh3.GetOutputPort());
        plane3Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                 (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        plane3Actor = new vtkActor();
        plane3Actor.SetMapper((vtkMapper)plane3Map);
        plane3Actor.SetTexture((vtkTexture)texture);
        plane3Actor.GetProperty().SetOpacity((double)0.999);
        // outline[]
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputData(pl3d.GetOutput().GetBlock(0));
        outlineMapper = vtkPolyDataMapper.New();
        outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)outlineMapper);
        outlineProp = outlineActor.GetProperty();
        outlineProp.SetColor((double)0, (double)0, (double)0);
        // Add the actors to the renderer, set the background and size[]
        //[]
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)wallActor);
        ren1.AddActor((vtkProp)finActor);
        ren1.AddActor((vtkProp)plane1Actor);
        ren1.AddActor((vtkProp)plane2Actor);
        ren1.AddActor((vtkProp)plane3Actor);
        ren1.SetBackground((double)1, (double)1, (double)1);
        renWin.SetSize((int)256, (int)256);
        cam1 = new vtkCamera();
        cam1.SetClippingRange((double)1.51176, (double)75.5879);
        cam1.SetFocalPoint((double)2.33749, (double)2.96739, (double)3.61023);
        cam1.SetPosition((double)10.8787, (double)5.27346, (double)15.8687);
        cam1.SetViewAngle((double)30);
        cam1.SetViewUp((double)-0.0610856, (double)0.987798, (double)-0.143262);
        ren1.SetActiveCamera((vtkCamera)cam1);
        iren.Initialize();
        // render the image[]
        //[]
        // prevent the tk window from showing up then start the event loop[]

//deleteAllVTKObjects();
    }
Exemplo n.º 7
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVtextureThreshold(String [] argv)
    {
        //Prefix Content is: ""

          // Create the RenderWindow, Renderer and both Actors[]
          //[]
          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // read data[]
          //[]
          pl3d = new vtkMultiBlockPLOT3DReader();
          pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinxyz.bin");
          pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinq.bin");
          pl3d.SetScalarFunctionNumber((int)100);
          pl3d.SetVectorFunctionNumber((int)202);
          pl3d.Update();
          // wall[]
          //[]
          wall = new vtkStructuredGridGeometryFilter();
          wall.SetInputData(pl3d.GetOutput().GetBlock(0));
          wall.SetExtent((int)0,(int)100,(int)0,(int)0,(int)0,(int)100);
          wallMap = vtkPolyDataMapper.New();
          wallMap.SetInputConnection((vtkAlgorithmOutput)wall.GetOutputPort());
          wallMap.ScalarVisibilityOff();
          wallActor = new vtkActor();
          wallActor.SetMapper((vtkMapper)wallMap);
          wallActor.GetProperty().SetColor((double)0.8,(double)0.8,(double)0.8);
          // fin[]
          // []
          fin = new vtkStructuredGridGeometryFilter();
          fin.SetInputData(pl3d.GetOutput().GetBlock(0));
          fin.SetExtent((int)0,(int)100,(int)0,(int)100,(int)0,(int)0);
          finMap = vtkPolyDataMapper.New();
          finMap.SetInputConnection((vtkAlgorithmOutput)fin.GetOutputPort());
          finMap.ScalarVisibilityOff();
          finActor = new vtkActor();
          finActor.SetMapper((vtkMapper)finMap);
          finActor.GetProperty().SetColor((double)0.8,(double)0.8,(double)0.8);
          // planes to threshold[]
          tmap = new vtkStructuredPointsReader();
          tmap.SetFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/texThres2.vtk");
          texture = new vtkTexture();
          texture.SetInputConnection((vtkAlgorithmOutput)tmap.GetOutputPort());
          texture.InterpolateOff();
          texture.RepeatOff();
          plane1 = new vtkStructuredGridGeometryFilter();
          plane1.SetInputData(pl3d.GetOutput().GetBlock(0));
          plane1.SetExtent((int)10,(int)10,(int)0,(int)100,(int)0,(int)100);
          thresh1 = new vtkThresholdTextureCoords();
          thresh1.SetInputConnection((vtkAlgorithmOutput)plane1.GetOutputPort());
          thresh1.ThresholdByUpper((double)1.5);
          plane1Map = new vtkDataSetMapper();
          plane1Map.SetInputConnection((vtkAlgorithmOutput)thresh1.GetOutputPort());
          plane1Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
          plane1Actor = new vtkActor();
          plane1Actor.SetMapper((vtkMapper)plane1Map);
          plane1Actor.SetTexture((vtkTexture)texture);
          plane1Actor.GetProperty().SetOpacity((double)0.999);
          plane2 = new vtkStructuredGridGeometryFilter();
          plane2.SetInputData(pl3d.GetOutput().GetBlock(0));
          plane2.SetExtent((int)30,(int)30,(int)0,(int)100,(int)0,(int)100);
          thresh2 = new vtkThresholdTextureCoords();
          thresh2.SetInputConnection((vtkAlgorithmOutput)plane2.GetOutputPort());
          thresh2.ThresholdByLower((double)1.5);
          plane2Map = new vtkDataSetMapper();
          plane2Map.SetInputConnection((vtkAlgorithmOutput)thresh2.GetOutputPort());
          plane2Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
          plane2Actor = new vtkActor();
          plane2Actor.SetMapper((vtkMapper)plane2Map);
          plane2Actor.SetTexture((vtkTexture)texture);
          plane2Actor.GetProperty().SetOpacity((double)0.999);
          plane3 = new vtkStructuredGridGeometryFilter();
          plane3.SetInputData(pl3d.GetOutput().GetBlock(0));
          plane3.SetExtent((int)35,(int)35,(int)0,(int)100,(int)0,(int)100);
          thresh3 = new vtkThresholdTextureCoords();
          thresh3.SetInputConnection((vtkAlgorithmOutput)plane3.GetOutputPort());
          thresh3.ThresholdBetween((double)1.5,(double)1.8);
          plane3Map = new vtkDataSetMapper();
          plane3Map.SetInputConnection((vtkAlgorithmOutput)thresh3.GetOutputPort());
          plane3Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
          plane3Actor = new vtkActor();
          plane3Actor.SetMapper((vtkMapper)plane3Map);
          plane3Actor.SetTexture((vtkTexture)texture);
          plane3Actor.GetProperty().SetOpacity((double)0.999);
          // outline[]
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputData(pl3d.GetOutput().GetBlock(0));
          outlineMapper = vtkPolyDataMapper.New();
          outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)outlineMapper);
          outlineProp = outlineActor.GetProperty();
          outlineProp.SetColor((double)0,(double)0,(double)0);
          // Add the actors to the renderer, set the background and size[]
          //[]
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)wallActor);
          ren1.AddActor((vtkProp)finActor);
          ren1.AddActor((vtkProp)plane1Actor);
          ren1.AddActor((vtkProp)plane2Actor);
          ren1.AddActor((vtkProp)plane3Actor);
          ren1.SetBackground((double)1,(double)1,(double)1);
          renWin.SetSize((int)256,(int)256);
          cam1 = new vtkCamera();
          cam1.SetClippingRange((double)1.51176,(double)75.5879);
          cam1.SetFocalPoint((double)2.33749,(double)2.96739,(double)3.61023);
          cam1.SetPosition((double)10.8787,(double)5.27346,(double)15.8687);
          cam1.SetViewAngle((double)30);
          cam1.SetViewUp((double)-0.0610856,(double)0.987798,(double)-0.143262);
          ren1.SetActiveCamera((vtkCamera)cam1);
          iren.Initialize();
          // render the image[]
          //[]
          // prevent the tk window from showing up then start the event loop[]

        //deleteAllVTKObjects();
    }
Exemplo n.º 8
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVpolyConn(String [] argv)
    {
        //Prefix Content is: ""

        // Create the RenderWindow, Renderer and both Actors[]
        //[]
        ren1   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.AddRenderer((vtkRenderer)ren1);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // read data[]
        //[]
        pl3d = new vtkMultiBlockPLOT3DReader();
        pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
        pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
        pl3d.SetScalarFunctionNumber((int)100);
        pl3d.SetVectorFunctionNumber((int)202);
        pl3d.Update();
        // planes to connect[]
        plane1 = new vtkStructuredGridGeometryFilter();
        plane1.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        plane1.SetExtent((int)20, (int)20, (int)0, (int)100, (int)0, (int)100);
        conn = new vtkPolyDataConnectivityFilter();
        conn.SetInputConnection((vtkAlgorithmOutput)plane1.GetOutputPort());
        conn.ScalarConnectivityOn();
        conn.SetScalarRange((double)0.19, (double)0.25);
        plane1Map = vtkPolyDataMapper.New();
        plane1Map.SetInputConnection((vtkAlgorithmOutput)conn.GetOutputPort());
        plane1Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                 (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        plane1Actor = new vtkActor();
        plane1Actor.SetMapper((vtkMapper)plane1Map);
        plane1Actor.GetProperty().SetOpacity((double)0.999);
        // outline[]
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        outlineMapper = vtkPolyDataMapper.New();
        outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)outlineMapper);
        outlineProp = outlineActor.GetProperty();
        outlineProp.SetColor((double)0, (double)0, (double)0);
        // Add the actors to the renderer, set the background and size[]
        //[]
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)plane1Actor);
        ren1.SetBackground((double)1, (double)1, (double)1);
        renWin.SetSize((int)300, (int)300);
        cam1 = new vtkCamera();
        cam1.SetClippingRange((double)14.29, (double)63.53);
        cam1.SetFocalPoint((double)8.58522, (double)1.58266, (double)30.6486);
        cam1.SetPosition((double)37.6808, (double)-20.1298, (double)35.4016);
        cam1.SetViewAngle((double)30);
        cam1.SetViewUp((double)-0.0566235, (double)0.140504, (double)0.98846);
        ren1.SetActiveCamera((vtkCamera)cam1);
        iren.Initialize();
        // render the image[]
        //[]
        // prevent the tk window from showing up then start the event loop[]

//deleteAllVTKObjects();
    }
Exemplo n.º 9
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVpolyConn(String [] argv)
    {
        //Prefix Content is: ""

          // Create the RenderWindow, Renderer and both Actors[]
          //[]
          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // read data[]
          //[]
          pl3d = new vtkMultiBlockPLOT3DReader();
          pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
          pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
          pl3d.SetScalarFunctionNumber((int)100);
          pl3d.SetVectorFunctionNumber((int)202);
          pl3d.Update();
          // planes to connect[]
          plane1 = new vtkStructuredGridGeometryFilter();
          plane1.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
          plane1.SetExtent((int)20,(int)20,(int)0,(int)100,(int)0,(int)100);
          conn = new vtkPolyDataConnectivityFilter();
          conn.SetInputConnection((vtkAlgorithmOutput)plane1.GetOutputPort());
          conn.ScalarConnectivityOn();
          conn.SetScalarRange((double)0.19,(double)0.25);
          plane1Map = vtkPolyDataMapper.New();
          plane1Map.SetInputConnection((vtkAlgorithmOutput)conn.GetOutputPort());
          plane1Map.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
          plane1Actor = new vtkActor();
          plane1Actor.SetMapper((vtkMapper)plane1Map);
          plane1Actor.GetProperty().SetOpacity((double)0.999);
          // outline[]
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
          outlineMapper = vtkPolyDataMapper.New();
          outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)outlineMapper);
          outlineProp = outlineActor.GetProperty();
          outlineProp.SetColor((double)0,(double)0,(double)0);
          // Add the actors to the renderer, set the background and size[]
          //[]
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)plane1Actor);
          ren1.SetBackground((double)1,(double)1,(double)1);
          renWin.SetSize((int)300,(int)300);
          cam1 = new vtkCamera();
          cam1.SetClippingRange((double)14.29,(double)63.53);
          cam1.SetFocalPoint((double)8.58522,(double)1.58266,(double)30.6486);
          cam1.SetPosition((double)37.6808,(double)-20.1298,(double)35.4016);
          cam1.SetViewAngle((double)30);
          cam1.SetViewUp((double)-0.0566235,(double)0.140504,(double)0.98846);
          ren1.SetActiveCamera((vtkCamera)cam1);
          iren.Initialize();
          // render the image[]
          //[]
          // prevent the tk window from showing up then start the event loop[]

        //deleteAllVTKObjects();
    }
Exemplo n.º 10
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVTestGridSynchronizedTemplates3D(String [] argv)
    {
        //Prefix Content is: ""

        // cut data[]
        pl3d = new vtkMultiBlockPLOT3DReader();
        pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
        pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
        pl3d.SetScalarFunctionNumber((int)100);
        pl3d.SetVectorFunctionNumber((int)202);
        pl3d.Update();
        range = ((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange();
        min   = (double)(lindex(range, 0));
        max   = (double)(lindex(range, 1));
        value = (min + max) / 2.0;
        //vtkGridSynchronizedTemplates3D cf[]
        cf = new vtkContourFilter();
        cf.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        cf.SetValue((int)0, (double)value);
        //cf ComputeNormalsOff[]
        cfMapper = vtkPolyDataMapper.New();
        cfMapper.ImmediateModeRenderingOn();
        cfMapper.SetInputConnection((vtkAlgorithmOutput)cf.GetOutputPort());
        cfMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[0], (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[1]);
        cfActor = new vtkActor();
        cfActor.SetMapper((vtkMapper)cfMapper);
        //outline[]
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        outlineMapper = vtkPolyDataMapper.New();
        outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)outlineMapper);
        outlineActor.GetProperty().SetColor((double)0, (double)0, (double)0);
        //# Graphics stuff[]
        // Create the RenderWindow, Renderer and both Actors[]
        //[]
        ren1   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.SetMultiSamples(0);
        renWin.AddRenderer((vtkRenderer)ren1);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // Add the actors to the renderer, set the background and size[]
        //[]
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)cfActor);
        ren1.SetBackground((double)1, (double)1, (double)1);
        renWin.SetSize((int)400, (int)400);
        cam1 = ren1.GetActiveCamera();
        cam1.SetClippingRange((double)3.95297, (double)50);
        cam1.SetFocalPoint((double)9.71821, (double)0.458166, (double)29.3999);
        cam1.SetPosition((double)2.7439, (double)-37.3196, (double)38.7167);
        cam1.SetViewUp((double)-0.16123, (double)0.264271, (double)0.950876);
        iren.Initialize();
        // render the image[]
        //[]
        // loop over surfaces[]
        i = 0;
        while ((i) < 17)
        {
            cf.SetValue((int)0, (double)min + (i / 16.0) * (max - min));
            renWin.Render();
            i = i + 1;
        }

        cf.SetValue((int)0, (double)min + (0.2) * (max - min));
        renWin.Render();
        // prevent the tk window from showing up then start the event loop[]

//deleteAllVTKObjects();
    }
Exemplo n.º 11
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVcombStreamers2(String [] argv)
    {
        //Prefix Content is: ""

          // Create the RenderWindow, Renderer and both Actors[]
          //[]
          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // create pipeline[]
          //[]
          pl3d = new vtkPLOT3DReader();
          pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
          pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
          pl3d.SetScalarFunctionNumber((int)100);
          pl3d.SetVectorFunctionNumber((int)202);
          pl3d.Update();
          ps = new vtkPlaneSource();
          ps.SetXResolution((int)4);
          ps.SetYResolution((int)4);
          ps.SetOrigin((double)2,(double)-2,(double)26);
          ps.SetPoint1((double)2,(double)2,(double)26);
          ps.SetPoint2((double)2,(double)-2,(double)32);
          psMapper = vtkPolyDataMapper.New();
          psMapper.SetInputConnection((vtkAlgorithmOutput)ps.GetOutputPort());
          psActor = new vtkActor();
          psActor.SetMapper((vtkMapper)psMapper);
          psActor.GetProperty().SetRepresentationToWireframe();
          streamer = new vtkDashedStreamLine();
          streamer.SetInputConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          streamer.SetSource((vtkDataSet)ps.GetOutput());
          streamer.SetMaximumPropagationTime((double)100);
          streamer.SetIntegrationStepLength((double).2);
          streamer.SetStepLength((double).001);
          streamer.SetNumberOfThreads((int)1);
          streamer.SetIntegrationDirectionToForward();
          streamMapper = vtkPolyDataMapper.New();
          streamMapper.SetInputConnection((vtkAlgorithmOutput)streamer.GetOutputPort());
          streamMapper.SetScalarRange(
          (double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[1]);
          streamline = new vtkActor();
          streamline.SetMapper((vtkMapper)streamMapper);
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          outlineMapper = vtkPolyDataMapper.New();
          outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)outlineMapper);
          // Add the actors to the renderer, set the background and size[]
          //[]
          ren1.AddActor((vtkProp)psActor);
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)streamline);
          ren1.SetBackground((double)1,(double)1,(double)1);
          renWin.SetSize((int)300,(int)300);
          ren1.SetBackground((double)0.1,(double)0.2,(double)0.4);
          cam1 = ren1.GetActiveCamera();
          cam1.SetClippingRange((double)3.95297,(double)50);
          cam1.SetFocalPoint((double)9.71821,(double)0.458166,(double)29.3999);
          cam1.SetPosition((double)2.7439,(double)-37.3196,(double)38.7167);
          cam1.SetViewUp((double)-0.16123,(double)0.264271,(double)0.950876);
          // render the image[]
          //[]
          renWin.Render();
          // prevent the tk window from showing up then start the event loop[]

        //deleteAllVTKObjects();
    }
Exemplo n.º 12
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVmergeFilter(String [] argv)
    {
        //Prefix Content is: ""

        // Create the RenderWindow, Renderer and both Actors[]
        //[]
        ren1   = vtkRenderer.New();
        ren2   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.SetMultiSamples(0);
        renWin.AddRenderer((vtkRenderer)ren1);
        renWin.AddRenderer((vtkRenderer)ren2);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // create pipeline[]
        //[]
        pl3d = new vtkMultiBlockPLOT3DReader();
        pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
        pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
        pl3d.SetScalarFunctionNumber((int)110);
        pl3d.SetVectorFunctionNumber((int)202);
        pl3d.Update();
        probeLine = new vtkLineSource();
        probeLine.SetPoint1((double)1, (double)1, (double)29);
        probeLine.SetPoint2((double)16.5, (double)5, (double)31.7693);
        probeLine.SetResolution((int)500);
        probe = new vtkProbeFilter();
        probe.SetInputConnection((vtkAlgorithmOutput)probeLine.GetOutputPort());
        probe.SetSourceData((vtkDataObject)pl3d.GetOutput().GetBlock(0));
        probe.Update();
        probeTube = new vtkTubeFilter();
        probeTube.SetInputData((vtkDataObject)probe.GetPolyDataOutput());
        probeTube.SetNumberOfSides((int)5);
        probeTube.SetRadius((double).05);
        probeMapper = vtkPolyDataMapper.New();
        probeMapper.SetInputConnection((vtkAlgorithmOutput)probeTube.GetOutputPort());
        probeMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                   (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        probeActor = new vtkActor();
        probeActor.SetMapper((vtkMapper)probeMapper);
        displayLine = new vtkLineSource();
        displayLine.SetPoint1((double)0, (double)0, (double)0);
        displayLine.SetPoint2((double)1, (double)0, (double)0);
        displayLine.SetResolution((int)probeLine.GetResolution());
        displayMerge = new vtkMergeFilter();
        displayMerge.SetGeometryConnection(displayLine.GetOutputPort());
        displayMerge.SetScalarsData((vtkDataSet)probe.GetPolyDataOutput());
        displayMerge.Update();

        displayWarp = new vtkWarpScalar();
        displayWarp.SetInputData((vtkDataObject)displayMerge.GetPolyDataOutput());
        displayWarp.SetNormal((double)0, (double)1, (double)0);
        displayWarp.SetScaleFactor((double).000001);
        displayWarp.Update();

        displayMapper = vtkPolyDataMapper.New();
        displayMapper.SetInputData((vtkPolyData)displayWarp.GetPolyDataOutput());
        displayMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                     (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        displayActor = new vtkActor();
        displayActor.SetMapper((vtkMapper)displayMapper);
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputData(pl3d.GetOutput().GetBlock(0));
        outlineMapper = vtkPolyDataMapper.New();
        outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)outlineMapper);
        outlineActor.GetProperty().SetColor((double)0, (double)0, (double)0);
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)probeActor);
        ren1.SetBackground((double)1, (double)1, (double)1);
        ren1.SetViewport((double)0, (double).25, (double)1, (double)1);
        ren2.AddActor((vtkProp)displayActor);
        ren2.SetBackground((double)0, (double)0, (double)0);
        ren2.SetViewport((double)0, (double)0, (double)1, (double).25);
        renWin.SetSize((int)300, (int)300);
        ren1.ResetCamera();
        cam1 = ren1.GetActiveCamera();
        cam1.SetClippingRange((double)3.95297, (double)50);
        cam1.SetFocalPoint((double)8.88908, (double)0.595038, (double)29.3342);
        cam1.SetPosition((double)9.9, (double)-26, (double)41);
        cam1.SetViewUp((double)0.060772, (double)-0.319905, (double)0.945498);
        ren2.ResetCamera();
        cam2 = ren2.GetActiveCamera();
        cam2.ParallelProjectionOn();
        cam2.SetParallelScale((double).15);
        iren.Initialize();
        // render the image[]
        //[]
        // prevent the tk window from showing up then start the event loop[]

//deleteAllVTKObjects();
    }
    /// <summary>
    /// Entry Point
    /// </summary>
    /// <param name="argv"></param>
    public static void Main(String[] argv)
    {
        // This example demonstrates how to use the vtkLineWidget to seed
        // and manipulate streamlines. Two line widgets are created. One is
        // invoked by pressing 'W', the other by pressing 'L'. Both can exist
        // together.
        // Start by loading some data.
        pl3d = vtkMultiBlockPLOT3DReader.New();
        pl3d.SetXYZFileName("../../../combxyz.bin");
        pl3d.SetQFileName("../../../combq.bin");
        pl3d.SetScalarFunctionNumber(100);
        pl3d.SetVectorFunctionNumber(202);
        pl3d.Update();
        // The line widget is used seed the streamlines.
        lineWidget = vtkLineWidget.New();
        seeds = vtkPolyData.New();

        lineWidget.SetInput(pl3d.GetOutput());
        lineWidget.SetAlignToYAxis();
        lineWidget.PlaceWidget();
        lineWidget.GetPolyData(seeds);
        lineWidget.ClampToBoundsOn();

        rk4 = vtkRungeKutta4.New();
        streamer = vtkStreamLine.New();
        streamer.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        streamer.SetSource(seeds);
        streamer.SetMaximumPropagationTime(100);
        streamer.SetIntegrationStepLength(.2);
        streamer.SetStepLength(.001);
        streamer.SetNumberOfThreads(1);
        streamer.SetIntegrationDirectionToForward();
        streamer.VorticityOn();
        streamer.SetIntegrator(rk4);

        rf = vtkRibbonFilter.New();
        rf.SetInputConnection(streamer.GetOutputPort());
        rf.SetWidth(0.1);
        rf.SetWidthFactor(5);

        streamMapper = vtkPolyDataMapper.New();
        streamMapper.SetInputConnection(rf.GetOutputPort());
        streamMapper.SetScalarRange(pl3d.GetOutput().GetScalarRange()[0], pl3d.GetOutput().GetScalarRange()[1]);
        streamline = vtkActor.New();
        streamline.SetMapper(streamMapper);
        streamline.VisibilityOff();

        // The second line widget is used seed more streamlines.
        lineWidget2 = vtkLineWidget.New();
        seeds2 = vtkPolyData.New();
        lineWidget2.SetInput(pl3d.GetOutput());
        lineWidget2.PlaceWidget();
        lineWidget2.GetPolyData(seeds2);
        lineWidget2.SetKeyPressActivationValue((sbyte)108);

        streamer2 = vtkStreamLine.New();
        streamer2.SetInputDaat((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        streamer2.SetSource(seeds2);
        streamer2.SetMaximumPropagationTime(100);
        streamer2.SetIntegrationStepLength(.2);
        streamer2.SetStepLength(.001);
        streamer2.SetNumberOfThreads(1);
        streamer2.SetIntegrationDirectionToForward();
        streamer2.VorticityOn();
        streamer2.SetIntegrator(rk4);

        rf2 = vtkRibbonFilter.New();
        rf2.SetInputConnection(streamer2.GetOutputPort());
        rf2.SetWidth(0.1);
        rf2.SetWidthFactor(5);

        streamMapper2 = vtkPolyDataMapper.New();
        streamMapper2.SetInputConnection(rf2.GetOutputPort());
        streamMapper2.SetScalarRange(pl3d.GetOutput().GetScalarRange()[0], pl3d.GetOutput().GetScalarRange()[1]);

        streamline2 = vtkActor.New();
        streamline2.SetMapper(streamMapper2);
        streamline2.VisibilityOff();

        outline = vtkStructuredGridOutlineFilter.New();
        outline.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));

        outlineMapper = vtkPolyDataMapper.New();
        outlineMapper.SetInputConnection(outline.GetOutputPort());
        outlineActor = vtkActor.New();
        outlineActor.SetMapper(outlineMapper);

        // Create the RenderWindow, Renderer and both Actors
        ren1 = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.AddRenderer(ren1);
        iren = vtkRenderWindowInteractor.New();
        iren.SetRenderWindow(renWin);

        // Associate the line widget with the interactor
        lineWidget.SetInteractor(iren);
        lineWidget.StartInteractionEvt += new vtkObject.vtkObjectEventHandler(BeginInteraction);
        lineWidget.InteractionEvt += new vtkObject.vtkObjectEventHandler(GenerateStreamlines);
        lineWidget2.SetInteractor(iren);
        lineWidget2.StartInteractionEvt += new vtkObject.vtkObjectEventHandler(BeginInteraction2);
        lineWidget2.EndInteractionEvt += new vtkObject.vtkObjectEventHandler(GenerateStreamlines2);

        // Add the actors to the renderer, set the background and size
        ren1.AddActor(outlineActor);
        ren1.AddActor(streamline);
        ren1.AddActor(streamline2);

        ren1.SetBackground(1, 1, 1);
        renWin.SetSize(300, 300);
        ren1.SetBackground(0.1, 0.2, 0.4);

        cam1 = ren1.GetActiveCamera();
        cam1.SetClippingRange(3.95297, 50);
        cam1.SetFocalPoint(9.71821, 0.458166, 29.3999);
        cam1.SetPosition(2.7439, -37.3196, 38.7167);
        cam1.SetViewUp(-0.16123, 0.264271, 0.950876);

        // render the image
        renWin.Render();
        lineWidget2.On();
        iren.Initialize();
        iren.Start();

        //Clean Up
        deleteAllVTKObjects();
    }
Exemplo n.º 14
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVTestSplineFilter(String [] argv)
    {
        //Prefix Content is: ""

        // Create the RenderWindow, Renderer and both Actors[]
        //[]
        ren1   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.AddRenderer((vtkRenderer)ren1);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // create pipeline[]
        //[]
        pl3d = new vtkMultiBlockPLOT3DReader();
        pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
        pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
        pl3d.SetScalarFunctionNumber((int)100);
        pl3d.SetVectorFunctionNumber((int)202);
        pl3d.Update();
        ps = new vtkPlaneSource();
        ps.SetXResolution((int)4);
        ps.SetYResolution((int)4);
        ps.SetOrigin((double)2, (double)-2, (double)26);
        ps.SetPoint1((double)2, (double)2, (double)26);
        ps.SetPoint2((double)2, (double)-2, (double)32);
        psMapper = vtkPolyDataMapper.New();
        psMapper.SetInputConnection((vtkAlgorithmOutput)ps.GetOutputPort());
        psActor = new vtkActor();
        psActor.SetMapper((vtkMapper)psMapper);
        psActor.GetProperty().SetRepresentationToWireframe();
        rk4      = new vtkRungeKutta4();
        streamer = new vtkStreamLine();
        streamer.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        streamer.SetSourceConnection(ps.GetOutputPort());
        streamer.SetMaximumPropagationTime((double)100);
        streamer.SetIntegrationStepLength((double).2);
        streamer.SetStepLength((double).001);
        streamer.SetNumberOfThreads((int)1);
        streamer.SetIntegrationDirectionToForward();
        streamer.VorticityOn();
        streamer.SetIntegrator((vtkInitialValueProblemSolver)rk4);
        sf = new vtkSplineFilter();
        sf.SetInputConnection((vtkAlgorithmOutput)streamer.GetOutputPort());
        sf.SetSubdivideToLength();
        sf.SetLength((double)0.15);
        rf = new vtkRibbonFilter();
        rf.SetInputConnection((vtkAlgorithmOutput)sf.GetOutputPort());
        rf.SetWidth((double)0.1);
        rf.SetWidthFactor((double)5);
        streamMapper = vtkPolyDataMapper.New();
        streamMapper.SetInputConnection((vtkAlgorithmOutput)rf.GetOutputPort());
        streamMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                    (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        streamline = new vtkActor();
        streamline.SetMapper((vtkMapper)streamMapper);
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        outlineMapper = vtkPolyDataMapper.New();
        outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)outlineMapper);
        // Add the actors to the renderer, set the background and size[]
        //[]
        ren1.AddActor((vtkProp)psActor);
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)streamline);
        ren1.SetBackground((double)1, (double)1, (double)1);
        renWin.SetSize((int)300, (int)300);
        ren1.SetBackground((double)0.1, (double)0.2, (double)0.4);
        cam1 = ren1.GetActiveCamera();
        cam1.SetClippingRange((double)3.95297, (double)50);
        cam1.SetFocalPoint((double)9.71821, (double)0.458166, (double)29.3999);
        cam1.SetPosition((double)2.7439, (double)-37.3196, (double)38.7167);
        cam1.SetViewUp((double)-0.16123, (double)0.264271, (double)0.950876);
        // render the image[]
        //[]
        renWin.Render();
        // prevent the tk window from showing up then start the event loop[]
        // for testing[]
        threshold = 15;

//deleteAllVTKObjects();
    }
Exemplo n.º 15
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVprobeComb(String [] argv)
    {
        //Prefix Content is: ""

          // create planes[]
          // Create the RenderWindow, Renderer and both Actors[]
          //[]
          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // create pipeline[]
          //[]
          pl3d = new vtkPLOT3DReader();
          pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
          pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
          pl3d.SetScalarFunctionNumber((int)100);
          pl3d.SetVectorFunctionNumber((int)202);
          pl3d.Update();
          plane = new vtkPlaneSource();
          plane.SetResolution((int)50,(int)50);
          transP1 = new vtkTransform();
          transP1.Translate((double)3.7,(double)0.0,(double)28.37);
          transP1.Scale((double)5,(double)5,(double)5);
          transP1.RotateY((double)90);
          tpd1 = new vtkTransformPolyDataFilter();
          tpd1.SetInputConnection((vtkAlgorithmOutput)plane.GetOutputPort());
          tpd1.SetTransform((vtkAbstractTransform)transP1);
          outTpd1 = new vtkOutlineFilter();
          outTpd1.SetInputConnection((vtkAlgorithmOutput)tpd1.GetOutputPort());
          mapTpd1 = vtkPolyDataMapper.New();
          mapTpd1.SetInputConnection((vtkAlgorithmOutput)outTpd1.GetOutputPort());
          tpd1Actor = new vtkActor();
          tpd1Actor.SetMapper((vtkMapper)mapTpd1);
          tpd1Actor.GetProperty().SetColor((double)0,(double)0,(double)0);
          transP2 = new vtkTransform();
          transP2.Translate((double)9.2,(double)0.0,(double)31.20);
          transP2.Scale((double)5,(double)5,(double)5);
          transP2.RotateY((double)90);
          tpd2 = new vtkTransformPolyDataFilter();
          tpd2.SetInputConnection((vtkAlgorithmOutput)plane.GetOutputPort());
          tpd2.SetTransform((vtkAbstractTransform)transP2);
          outTpd2 = new vtkOutlineFilter();
          outTpd2.SetInputConnection((vtkAlgorithmOutput)tpd2.GetOutputPort());
          mapTpd2 = vtkPolyDataMapper.New();
          mapTpd2.SetInputConnection((vtkAlgorithmOutput)outTpd2.GetOutputPort());
          tpd2Actor = new vtkActor();
          tpd2Actor.SetMapper((vtkMapper)mapTpd2);
          tpd2Actor.GetProperty().SetColor((double)0,(double)0,(double)0);
          transP3 = new vtkTransform();
          transP3.Translate((double)13.27,(double)0.0,(double)33.30);
          transP3.Scale((double)5,(double)5,(double)5);
          transP3.RotateY((double)90);
          tpd3 = new vtkTransformPolyDataFilter();
          tpd3.SetInputConnection((vtkAlgorithmOutput)plane.GetOutputPort());
          tpd3.SetTransform((vtkAbstractTransform)transP3);
          outTpd3 = new vtkOutlineFilter();
          outTpd3.SetInputConnection((vtkAlgorithmOutput)tpd3.GetOutputPort());
          mapTpd3 = vtkPolyDataMapper.New();
          mapTpd3.SetInputConnection((vtkAlgorithmOutput)outTpd3.GetOutputPort());
          tpd3Actor = new vtkActor();
          tpd3Actor.SetMapper((vtkMapper)mapTpd3);
          tpd3Actor.GetProperty().SetColor((double)0,(double)0,(double)0);
          appendF = new vtkAppendPolyData();
          appendF.AddInput((vtkPolyData)tpd1.GetOutput());
          appendF.AddInput((vtkPolyData)tpd2.GetOutput());
          appendF.AddInput((vtkPolyData)tpd3.GetOutput());
          probe = new vtkProbeFilter();
          probe.SetInputConnection((vtkAlgorithmOutput)appendF.GetOutputPort());
          probe.SetSource((vtkDataObject)pl3d.GetOutput());
          contour = new vtkContourFilter();
          contour.SetInputConnection((vtkAlgorithmOutput)probe.GetOutputPort());
          contour.GenerateValues((int)50,(double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[1]);
          contourMapper = vtkPolyDataMapper.New();
          contourMapper.SetInputConnection((vtkAlgorithmOutput)contour.GetOutputPort());
          contourMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[0],
          (double)((vtkDataSet)pl3d.GetOutput()).GetScalarRange()[1]);
          planeActor = new vtkActor();
          planeActor.SetMapper((vtkMapper)contourMapper);
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          outlineMapper = vtkPolyDataMapper.New();
          outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)outlineMapper);
          outlineActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)planeActor);
          ren1.AddActor((vtkProp)tpd1Actor);
          ren1.AddActor((vtkProp)tpd2Actor);
          ren1.AddActor((vtkProp)tpd3Actor);
          ren1.SetBackground((double)1,(double)1,(double)1);
          renWin.SetSize((int)400,(int)400);
          cam1 = ren1.GetActiveCamera();
          cam1.SetClippingRange((double)3.95297,(double)50);
          cam1.SetFocalPoint((double)8.88908,(double)0.595038,(double)29.3342);
          cam1.SetPosition((double)-12.3332,(double)31.7479,(double)41.2387);
          cam1.SetViewUp((double)0.060772,(double)-0.319905,(double)0.945498);
          iren.Initialize();
          // prevent the tk window from showing up then start the event loop[]

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

          // cut data[]
          pl3d = new vtkMultiBlockPLOT3DReader();
          pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
          pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
          pl3d.SetScalarFunctionNumber((int)100);
          pl3d.SetVectorFunctionNumber((int)202);
          pl3d.Update();
          range = ((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange();
          min = (double)(lindex(range,0));
          max = (double)(lindex(range,1));
          value = (min+max)/2.0;
          //vtkGridSynchronizedTemplates3D cf[]
          cf = new vtkContourFilter();
          cf.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
          cf.SetValue((int)0,(double)value);
          //cf ComputeNormalsOff[]
          cfMapper = vtkPolyDataMapper.New();
          cfMapper.ImmediateModeRenderingOn();
          cfMapper.SetInputConnection((vtkAlgorithmOutput)cf.GetOutputPort());
          cfMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[0], (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[1]);
          cfActor = new vtkActor();
          cfActor.SetMapper((vtkMapper)cfMapper);
          //outline[]
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
          outlineMapper = vtkPolyDataMapper.New();
          outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)outlineMapper);
          outlineActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          //# Graphics stuff[]
          // Create the RenderWindow, Renderer and both Actors[]
          //[]
          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.SetMultiSamples(0);
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // Add the actors to the renderer, set the background and size[]
          //[]
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)cfActor);
          ren1.SetBackground((double)1,(double)1,(double)1);
          renWin.SetSize((int)400,(int)400);
          cam1 = ren1.GetActiveCamera();
          cam1.SetClippingRange((double)3.95297,(double)50);
          cam1.SetFocalPoint((double)9.71821,(double)0.458166,(double)29.3999);
          cam1.SetPosition((double)2.7439,(double)-37.3196,(double)38.7167);
          cam1.SetViewUp((double)-0.16123,(double)0.264271,(double)0.950876);
          iren.Initialize();
          // render the image[]
          //[]
          // loop over surfaces[]
          i = 0;
          while((i) < 17)
        {
          cf.SetValue((int)0,(double)min+(i/16.0)*(max-min));
          renWin.Render();
          i = i + 1;
        }

          cf.SetValue((int)0,(double)min+(0.2)*(max-min));
          renWin.Render();
          // prevent the tk window from showing up then start the event loop[]

        //deleteAllVTKObjects();
    }
Exemplo n.º 17
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();
    }
Exemplo n.º 18
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVofficeStreamPoints(String [] argv)
    {
        //Prefix Content is: ""

          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          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[]
          // to add coverage for vtkOnePieceExtentTranslator[]
          translator = new vtkOnePieceExtentTranslator();
          vtkStreamingDemandDrivenPipeline.SetExtentTranslator(reader.GetOutputInformation(0), (vtkExtentTranslator)translator);
          length = reader.GetOutput().GetLength();
          maxVelocity = reader.GetOutput().GetPointData().GetVectors().GetMaxNorm();
          maxTime = 35.0*length/maxVelocity;
          table1 = new vtkStructuredGridGeometryFilter();
          table1.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          table1.SetExtent((int)11,(int)15,(int)7,(int)9,(int)8,(int)8);
          mapTable1 = vtkPolyDataMapper.New();
          mapTable1.SetInputConnection((vtkAlgorithmOutput)table1.GetOutputPort());
          mapTable1.ScalarVisibilityOff();
          table1Actor = new vtkActor();
          table1Actor.SetMapper((vtkMapper)mapTable1);
          table1Actor.GetProperty().SetColor((double).59,(double).427,(double).392);
          table2 = new vtkStructuredGridGeometryFilter();
          table2.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          table2.SetExtent((int)11,(int)15,(int)10,(int)12,(int)8,(int)8);
          mapTable2 = vtkPolyDataMapper.New();
          mapTable2.SetInputConnection((vtkAlgorithmOutput)table2.GetOutputPort());
          mapTable2.ScalarVisibilityOff();
          table2Actor = new vtkActor();
          table2Actor.SetMapper((vtkMapper)mapTable2);
          table2Actor.GetProperty().SetColor((double).59,(double).427,(double).392);
          FilingCabinet1 = new vtkStructuredGridGeometryFilter();
          FilingCabinet1.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          FilingCabinet1.SetExtent((int)15,(int)15,(int)7,(int)9,(int)0,(int)8);
          mapFilingCabinet1 = vtkPolyDataMapper.New();
          mapFilingCabinet1.SetInputConnection((vtkAlgorithmOutput)FilingCabinet1.GetOutputPort());
          mapFilingCabinet1.ScalarVisibilityOff();
          FilingCabinet1Actor = new vtkActor();
          FilingCabinet1Actor.SetMapper((vtkMapper)mapFilingCabinet1);
          FilingCabinet1Actor.GetProperty().SetColor((double).8,(double).8,(double).6);
          FilingCabinet2 = new vtkStructuredGridGeometryFilter();
          FilingCabinet2.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          FilingCabinet2.SetExtent((int)15,(int)15,(int)10,(int)12,(int)0,(int)8);
          mapFilingCabinet2 = vtkPolyDataMapper.New();
          mapFilingCabinet2.SetInputConnection((vtkAlgorithmOutput)FilingCabinet2.GetOutputPort());
          mapFilingCabinet2.ScalarVisibilityOff();
          FilingCabinet2Actor = new vtkActor();
          FilingCabinet2Actor.SetMapper((vtkMapper)mapFilingCabinet2);
          FilingCabinet2Actor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf1Top = new vtkStructuredGridGeometryFilter();
          bookshelf1Top.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf1Top.SetExtent((int)13,(int)13,(int)0,(int)4,(int)0,(int)11);
          mapBookshelf1Top = vtkPolyDataMapper.New();
          mapBookshelf1Top.SetInputConnection((vtkAlgorithmOutput)bookshelf1Top.GetOutputPort());
          mapBookshelf1Top.ScalarVisibilityOff();
          bookshelf1TopActor = new vtkActor();
          bookshelf1TopActor.SetMapper((vtkMapper)mapBookshelf1Top);
          bookshelf1TopActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf1Bottom = new vtkStructuredGridGeometryFilter();
          bookshelf1Bottom.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf1Bottom.SetExtent((int)20,(int)20,(int)0,(int)4,(int)0,(int)11);
          mapBookshelf1Bottom = vtkPolyDataMapper.New();
          mapBookshelf1Bottom.SetInputConnection((vtkAlgorithmOutput)bookshelf1Bottom.GetOutputPort());
          mapBookshelf1Bottom.ScalarVisibilityOff();
          bookshelf1BottomActor = new vtkActor();
          bookshelf1BottomActor.SetMapper((vtkMapper)mapBookshelf1Bottom);
          bookshelf1BottomActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf1Front = new vtkStructuredGridGeometryFilter();
          bookshelf1Front.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf1Front.SetExtent((int)13,(int)20,(int)0,(int)0,(int)0,(int)11);
          mapBookshelf1Front = vtkPolyDataMapper.New();
          mapBookshelf1Front.SetInputConnection((vtkAlgorithmOutput)bookshelf1Front.GetOutputPort());
          mapBookshelf1Front.ScalarVisibilityOff();
          bookshelf1FrontActor = new vtkActor();
          bookshelf1FrontActor.SetMapper((vtkMapper)mapBookshelf1Front);
          bookshelf1FrontActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf1Back = new vtkStructuredGridGeometryFilter();
          bookshelf1Back.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf1Back.SetExtent((int)13,(int)20,(int)4,(int)4,(int)0,(int)11);
          mapBookshelf1Back = vtkPolyDataMapper.New();
          mapBookshelf1Back.SetInputConnection((vtkAlgorithmOutput)bookshelf1Back.GetOutputPort());
          mapBookshelf1Back.ScalarVisibilityOff();
          bookshelf1BackActor = new vtkActor();
          bookshelf1BackActor.SetMapper((vtkMapper)mapBookshelf1Back);
          bookshelf1BackActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf1LHS = new vtkStructuredGridGeometryFilter();
          bookshelf1LHS.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf1LHS.SetExtent((int)13,(int)20,(int)0,(int)4,(int)0,(int)0);
          mapBookshelf1LHS = vtkPolyDataMapper.New();
          mapBookshelf1LHS.SetInputConnection((vtkAlgorithmOutput)bookshelf1LHS.GetOutputPort());
          mapBookshelf1LHS.ScalarVisibilityOff();
          bookshelf1LHSActor = new vtkActor();
          bookshelf1LHSActor.SetMapper((vtkMapper)mapBookshelf1LHS);
          bookshelf1LHSActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf1RHS = new vtkStructuredGridGeometryFilter();
          bookshelf1RHS.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf1RHS.SetExtent((int)13,(int)20,(int)0,(int)4,(int)11,(int)11);
          mapBookshelf1RHS = vtkPolyDataMapper.New();
          mapBookshelf1RHS.SetInputConnection((vtkAlgorithmOutput)bookshelf1RHS.GetOutputPort());
          mapBookshelf1RHS.ScalarVisibilityOff();
          bookshelf1RHSActor = new vtkActor();
          bookshelf1RHSActor.SetMapper((vtkMapper)mapBookshelf1RHS);
          bookshelf1RHSActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf2Top = new vtkStructuredGridGeometryFilter();
          bookshelf2Top.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf2Top.SetExtent((int)13,(int)13,(int)15,(int)19,(int)0,(int)11);
          mapBookshelf2Top = vtkPolyDataMapper.New();
          mapBookshelf2Top.SetInputConnection((vtkAlgorithmOutput)bookshelf2Top.GetOutputPort());
          mapBookshelf2Top.ScalarVisibilityOff();
          bookshelf2TopActor = new vtkActor();
          bookshelf2TopActor.SetMapper((vtkMapper)mapBookshelf2Top);
          bookshelf2TopActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf2Bottom = new vtkStructuredGridGeometryFilter();
          bookshelf2Bottom.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf2Bottom.SetExtent((int)20,(int)20,(int)15,(int)19,(int)0,(int)11);
          mapBookshelf2Bottom = vtkPolyDataMapper.New();
          mapBookshelf2Bottom.SetInputConnection((vtkAlgorithmOutput)bookshelf2Bottom.GetOutputPort());
          mapBookshelf2Bottom.ScalarVisibilityOff();
          bookshelf2BottomActor = new vtkActor();
          bookshelf2BottomActor.SetMapper((vtkMapper)mapBookshelf2Bottom);
          bookshelf2BottomActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf2Front = new vtkStructuredGridGeometryFilter();
          bookshelf2Front.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf2Front.SetExtent((int)13,(int)20,(int)15,(int)15,(int)0,(int)11);
          mapBookshelf2Front = vtkPolyDataMapper.New();
          mapBookshelf2Front.SetInputConnection((vtkAlgorithmOutput)bookshelf2Front.GetOutputPort());
          mapBookshelf2Front.ScalarVisibilityOff();
          bookshelf2FrontActor = new vtkActor();
          bookshelf2FrontActor.SetMapper((vtkMapper)mapBookshelf2Front);
          bookshelf2FrontActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf2Back = new vtkStructuredGridGeometryFilter();
          bookshelf2Back.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf2Back.SetExtent((int)13,(int)20,(int)19,(int)19,(int)0,(int)11);
          mapBookshelf2Back = vtkPolyDataMapper.New();
          mapBookshelf2Back.SetInputConnection((vtkAlgorithmOutput)bookshelf2Back.GetOutputPort());
          mapBookshelf2Back.ScalarVisibilityOff();
          bookshelf2BackActor = new vtkActor();
          bookshelf2BackActor.SetMapper((vtkMapper)mapBookshelf2Back);
          bookshelf2BackActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf2LHS = new vtkStructuredGridGeometryFilter();
          bookshelf2LHS.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf2LHS.SetExtent((int)13,(int)20,(int)15,(int)19,(int)0,(int)0);
          mapBookshelf2LHS = vtkPolyDataMapper.New();
          mapBookshelf2LHS.SetInputConnection((vtkAlgorithmOutput)bookshelf2LHS.GetOutputPort());
          mapBookshelf2LHS.ScalarVisibilityOff();
          bookshelf2LHSActor = new vtkActor();
          bookshelf2LHSActor.SetMapper((vtkMapper)mapBookshelf2LHS);
          bookshelf2LHSActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          bookshelf2RHS = new vtkStructuredGridGeometryFilter();
          bookshelf2RHS.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          bookshelf2RHS.SetExtent((int)13,(int)20,(int)15,(int)19,(int)11,(int)11);
          mapBookshelf2RHS = vtkPolyDataMapper.New();
          mapBookshelf2RHS.SetInputConnection((vtkAlgorithmOutput)bookshelf2RHS.GetOutputPort());
          mapBookshelf2RHS.ScalarVisibilityOff();
          bookshelf2RHSActor = new vtkActor();
          bookshelf2RHSActor.SetMapper((vtkMapper)mapBookshelf2RHS);
          bookshelf2RHSActor.GetProperty().SetColor((double).8,(double).8,(double).6);
          window = new vtkStructuredGridGeometryFilter();
          window.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          window.SetExtent((int)20,(int)20,(int)6,(int)13,(int)10,(int)13);
          mapWindow = vtkPolyDataMapper.New();
          mapWindow.SetInputConnection((vtkAlgorithmOutput)window.GetOutputPort());
          mapWindow.ScalarVisibilityOff();
          windowActor = new vtkActor();
          windowActor.SetMapper((vtkMapper)mapWindow);
          windowActor.GetProperty().SetColor((double).3,(double).3,(double).5);
          outlet = new vtkStructuredGridGeometryFilter();
          outlet.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          outlet.SetExtent((int)0,(int)0,(int)9,(int)10,(int)14,(int)16);
          mapOutlet = vtkPolyDataMapper.New();
          mapOutlet.SetInputConnection((vtkAlgorithmOutput)outlet.GetOutputPort());
          mapOutlet.ScalarVisibilityOff();
          outletActor = new vtkActor();
          outletActor.SetMapper((vtkMapper)mapOutlet);
          outletActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          inlet = new vtkStructuredGridGeometryFilter();
          inlet.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          inlet.SetExtent((int)0,(int)0,(int)9,(int)10,(int)0,(int)6);
          mapInlet = vtkPolyDataMapper.New();
          mapInlet.SetInputConnection((vtkAlgorithmOutput)inlet.GetOutputPort());
          mapInlet.ScalarVisibilityOff();
          inletActor = new vtkActor();
          inletActor.SetMapper((vtkMapper)mapInlet);
          inletActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          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);
          // Create source for streamtubes[]
          streamer = new vtkStreamPoints();
          streamer.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          streamer.SetStartPosition((double)0.1,(double)2.1,(double)0.5);
          streamer.SetMaximumPropagationTime((double)500);
          streamer.SetTimeIncrement((double)0.5);
          streamer.SetIntegrationDirectionToForward();
          cone = new vtkConeSource();
          cone.SetResolution((int)8);
          cones = new vtkGlyph3D();
          cones.SetInputConnection((vtkAlgorithmOutput)streamer.GetOutputPort());
          cones.SetSourceConnection(cone.GetOutputPort());
          cones.SetScaleFactor((double)0.5);
          cones.SetScaleModeToScaleByVector();
          mapCones = vtkPolyDataMapper.New();
          mapCones.SetInputConnection((vtkAlgorithmOutput)cones.GetOutputPort());
          mapCones.SetScalarRange((double)((vtkDataSet)reader.GetOutput()).GetScalarRange()[0],(double)((vtkDataSet)reader.GetOutput()).GetScalarRange()[1]);
          conesActor = new vtkActor();
          conesActor.SetMapper((vtkMapper)mapCones);
          ren1.AddActor((vtkProp)table1Actor);
          ren1.AddActor((vtkProp)table2Actor);
          ren1.AddActor((vtkProp)FilingCabinet1Actor);
          ren1.AddActor((vtkProp)FilingCabinet2Actor);
          ren1.AddActor((vtkProp)bookshelf1TopActor);
          ren1.AddActor((vtkProp)bookshelf1BottomActor);
          ren1.AddActor((vtkProp)bookshelf1FrontActor);
          ren1.AddActor((vtkProp)bookshelf1BackActor);
          ren1.AddActor((vtkProp)bookshelf1LHSActor);
          ren1.AddActor((vtkProp)bookshelf1RHSActor);
          ren1.AddActor((vtkProp)bookshelf2TopActor);
          ren1.AddActor((vtkProp)bookshelf2BottomActor);
          ren1.AddActor((vtkProp)bookshelf2FrontActor);
          ren1.AddActor((vtkProp)bookshelf2BackActor);
          ren1.AddActor((vtkProp)bookshelf2LHSActor);
          ren1.AddActor((vtkProp)bookshelf2RHSActor);
          ren1.AddActor((vtkProp)windowActor);
          ren1.AddActor((vtkProp)outletActor);
          ren1.AddActor((vtkProp)inletActor);
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)conesActor);
          ren1.SetBackground((double)0.4,(double)0.4,(double)0.5);
          aCamera = new vtkCamera();
          aCamera.SetClippingRange((double)0.7724,(double)39);
          aCamera.SetFocalPoint((double)1.14798,(double)3.08416,(double)2.47187);
          aCamera.SetPosition((double)-2.64683,(double)-3.55525,(double)3.55848);
          aCamera.SetViewUp((double)0.0511273,(double)0.132773,(double)0.989827);
          aCamera.SetViewAngle((double)15.5033);
          ren1.SetActiveCamera((vtkCamera)aCamera);
          renWin.SetSize((int)500,(int)300);
          iren.Initialize();
          // interact with data[]

        //deleteAllVTKObjects();
    }
Exemplo n.º 19
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();
    }
Exemplo n.º 20
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVprobe(String [] argv)
    {
        //Prefix Content is: ""

          // Create the RenderWindow, Renderer and both Actors[]
          //[]
          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // cut data[]
          pl3d = new vtkPLOT3DReader();
          pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
          pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
          pl3d.SetScalarFunctionNumber((int)100);
          pl3d.SetVectorFunctionNumber((int)202);
          pl3d.Update();
          plane = new vtkPlane();
          plane.SetOrigin(pl3d.GetOutput().GetCenter()[0],pl3d.GetOutput().GetCenter()[1],pl3d.GetOutput().GetCenter()[2]);
          plane.SetNormal((double)-0.287,(double)0,(double)0.9579);
          planeCut = new vtkCutter();
          planeCut.SetInputConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          planeCut.SetCutFunction((vtkImplicitFunction)plane);
          probe = new vtkProbeFilter();
          probe.SetInputConnection((vtkAlgorithmOutput)planeCut.GetOutputPort());
          probe.SetSourceConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          cutMapper = new vtkDataSetMapper();
          cutMapper.SetInputConnection((vtkAlgorithmOutput)probe.GetOutputPort());
          cutMapper.SetScalarRange((double)((vtkStructuredGrid)pl3d.GetOutput()).GetPointData().GetScalars().GetRange()[0],
          (double)((vtkStructuredGrid)pl3d.GetOutput()).GetPointData().GetScalars().GetRange()[1]);
          cutActor = new vtkActor();
          cutActor.SetMapper((vtkMapper)cutMapper);
          //extract plane[]
          compPlane = new vtkStructuredGridGeometryFilter();
          compPlane.SetInputConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          compPlane.SetExtent((int)0,(int)100,(int)0,(int)100,(int)9,(int)9);
          planeMapper = vtkPolyDataMapper.New();
          planeMapper.SetInputConnection((vtkAlgorithmOutput)compPlane.GetOutputPort());
          planeMapper.ScalarVisibilityOff();
          planeActor = new vtkActor();
          planeActor.SetMapper((vtkMapper)planeMapper);
          planeActor.GetProperty().SetRepresentationToWireframe();
          planeActor.GetProperty().SetColor((double)0,(double)0,(double)0);
          //outline[]
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputConnection((vtkAlgorithmOutput)pl3d.GetOutputPort());
          outlineMapper = vtkPolyDataMapper.New();
          outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
          outlineActor = new vtkActor();
          outlineActor.SetMapper((vtkMapper)outlineMapper);
          outlineProp = outlineActor.GetProperty();
          outlineProp.SetColor((double)0,(double)0,(double)0);
          // Add the actors to the renderer, set the background and size[]
          //[]
          ren1.AddActor((vtkProp)outlineActor);
          ren1.AddActor((vtkProp)planeActor);
          ren1.AddActor((vtkProp)cutActor);
          ren1.SetBackground((double)1,(double)1,(double)1);
          renWin.SetSize((int)400,(int)300);
          cam1 = ren1.GetActiveCamera();
          cam1.SetClippingRange((double)11.1034,(double)59.5328);
          cam1.SetFocalPoint((double)9.71821,(double)0.458166,(double)29.3999);
          cam1.SetPosition((double)-2.95748,(double)-26.7271,(double)44.5309);
          cam1.SetViewUp((double)0.0184785,(double)0.479657,(double)0.877262);
          iren.Initialize();
          // render the image[]
          //[]
          // prevent the tk window from showing up then start the event loop[]

        //deleteAllVTKObjects();
    }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetGeometry5(vtkStructuredGridOutlineFilter toSet)
 {
     Geometry5 = toSet;
 }
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVTestMultiBlockStreamer(String [] argv)
    {
        //Prefix Content is: ""

          // we need to use composite data pipeline with multiblock datasets[]
          alg = new vtkAlgorithm();
          pip = new vtkCompositeDataPipeline();
          vtkAlgorithm.SetDefaultExecutivePrototype((vtkExecutive)pip);
          //skipping Delete pip
          Ren1 = vtkRenderer.New();
          Ren1.SetBackground((double)0.33,(double)0.35,(double)0.43);

          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)Ren1);

          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);

          Plot3D0 = new vtkPLOT3DReader();
          Plot3D0.SetFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
          Plot3D0.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
          Plot3D0.SetBinaryFile((int)1);
          Plot3D0.SetMultiGrid((int)0);
          Plot3D0.SetHasByteCount((int)0);
          Plot3D0.SetIBlanking((int)0);
          Plot3D0.SetTwoDimensionalGeometry((int)0);
          Plot3D0.SetForceRead((int)0);
          Plot3D0.SetByteOrder((int)0);

          Geometry5 = new vtkStructuredGridOutlineFilter();
          Geometry5.SetInputConnection((vtkAlgorithmOutput)Plot3D0.GetOutputPort());

          Mapper5 = vtkPolyDataMapper.New();
          Mapper5.SetInputConnection((vtkAlgorithmOutput)Geometry5.GetOutputPort());
          Mapper5.SetImmediateModeRendering((int)1);
          Mapper5.UseLookupTableScalarRangeOn();
          Mapper5.SetScalarVisibility((int)0);
          Mapper5.SetScalarModeToDefault();

          Actor5 = new vtkActor();
          Actor5.SetMapper((vtkMapper)Mapper5);
          Actor5.GetProperty().SetRepresentationToSurface();
          Actor5.GetProperty().SetInterpolationToGouraud();
          Actor5.GetProperty().SetAmbient((double)0.15);
          Actor5.GetProperty().SetDiffuse((double)0.85);
          Actor5.GetProperty().SetSpecular((double)0.1);
          Actor5.GetProperty().SetSpecularPower((double)100);
          Actor5.GetProperty().SetSpecularColor((double)1,(double)1,(double)1);

          Actor5.GetProperty().SetColor((double)1,(double)1,(double)1);
          Ren1.AddActor((vtkProp)Actor5);

          ExtractGrid[0] = new vtkExtractGrid();
          ExtractGrid[0].SetInputConnection((vtkAlgorithmOutput)Plot3D0.GetOutputPort());
          ExtractGrid[0].SetVOI((int)0,(int)14,(int)0,(int)32,(int)0,(int)24);
          ExtractGrid[0].SetSampleRate((int)1,(int)1,(int)1);
          ExtractGrid[0].SetIncludeBoundary((int)0);

          ExtractGrid[1] = new vtkExtractGrid();
          ExtractGrid[1].SetInputConnection((vtkAlgorithmOutput)Plot3D0.GetOutputPort());
          ExtractGrid[1].SetVOI((int)14,(int)29,(int)0,(int)32,(int)0,(int)24);
          ExtractGrid[1].SetSampleRate((int)1,(int)1,(int)1);
          ExtractGrid[1].SetIncludeBoundary((int)0);

          ExtractGrid[2] = new vtkExtractGrid();
          ExtractGrid[2].SetInputConnection((vtkAlgorithmOutput)Plot3D0.GetOutputPort());
          ExtractGrid[2].SetVOI((int)29,(int)56,(int)0,(int)32,(int)0,(int)24);
          ExtractGrid[2].SetSampleRate((int)1,(int)1,(int)1);
          ExtractGrid[2].SetIncludeBoundary((int)0);

          LineSourceWidget0 = new vtkLineSource();
          LineSourceWidget0.SetPoint1((double)3.05638,(double)-3.00497,(double)28.2211);
          LineSourceWidget0.SetPoint2((double)3.05638,(double)3.95916,(double)28.2211);
          LineSourceWidget0.SetResolution((int)20);

          mbds = new vtkMultiBlockDataSet();
          mbds.SetNumberOfBlocks((uint)3);
          i = 0;
          while((i) < 3)
        {
          ExtractGrid[i].Update();
          sg[i] = vtkStructuredGrid.New();
          sg[i].ShallowCopy(ExtractGrid[i].GetOutput());
          mbds.SetBlock((uint)i, sg[i]);
          //skipping Delete sg[i]
          i = i + 1;
        }

          Stream0 = new vtkStreamTracer();
          Stream0.SetInput((vtkDataObject)mbds);
          Stream0.SetSource((vtkDataSet)LineSourceWidget0.GetOutput());
          Stream0.SetIntegrationStepUnit(2);
          Stream0.SetMaximumPropagation((double)20);
          Stream0.SetInitialIntegrationStep((double)0.5);
          Stream0.SetIntegrationDirection((int)0);
          Stream0.SetIntegratorType((int)0);
          Stream0.SetMaximumNumberOfSteps((int)2000);
          Stream0.SetTerminalSpeed((double)1e-12);

          //skipping Delete mbds

          aa = new vtkAssignAttribute();
          aa.SetInputConnection((vtkAlgorithmOutput)Stream0.GetOutputPort());
          aa.Assign((string)"Normals",(string)"NORMALS",(string)"POINT_DATA");

          Ribbon0 = new vtkRibbonFilter();
          Ribbon0.SetInputConnection((vtkAlgorithmOutput)aa.GetOutputPort());
          Ribbon0.SetWidth((double)0.1);
          Ribbon0.SetAngle((double)0);
          Ribbon0.SetDefaultNormal((double)0,(double)0,(double)1);
          Ribbon0.SetVaryWidth((int)0);

          LookupTable1 = new vtkLookupTable();
          LookupTable1.SetNumberOfTableValues((int)256);
          LookupTable1.SetHueRange((double)0,(double)0.66667);
          LookupTable1.SetSaturationRange((double)1,(double)1);
          LookupTable1.SetValueRange((double)1,(double)1);
          LookupTable1.SetTableRange((double)0.197813,(double)0.710419);
          LookupTable1.SetVectorComponent((int)0);
          LookupTable1.Build();

          Mapper10 = vtkPolyDataMapper.New();
          Mapper10.SetInputConnection((vtkAlgorithmOutput)Ribbon0.GetOutputPort());
          Mapper10.SetImmediateModeRendering((int)1);
          Mapper10.UseLookupTableScalarRangeOn();
          Mapper10.SetScalarVisibility((int)1);
          Mapper10.SetScalarModeToUsePointFieldData();
          Mapper10.SelectColorArray((string)"Density");
          Mapper10.SetLookupTable((vtkScalarsToColors)LookupTable1);

          Actor10 = new vtkActor();
          Actor10.SetMapper((vtkMapper)Mapper10);
          Actor10.GetProperty().SetRepresentationToSurface();
          Actor10.GetProperty().SetInterpolationToGouraud();
          Actor10.GetProperty().SetAmbient((double)0.15);
          Actor10.GetProperty().SetDiffuse((double)0.85);
          Actor10.GetProperty().SetSpecular((double)0);
          Actor10.GetProperty().SetSpecularPower((double)1);
          Actor10.GetProperty().SetSpecularColor((double)1,(double)1,(double)1);
          Ren1.AddActor((vtkProp)Actor10);

          // enable user interface interactor[]
          iren.Initialize();
          // prevent the tk window from showing up then start the event loop[]
          vtkAlgorithm.SetDefaultExecutivePrototype(null);
          //skipping Delete alg

        //deleteAllVTKObjects();
    }
Exemplo n.º 23
0
 ///<summary> A Set Method for Static Variables </summary>
 public static void Setoutline(vtkStructuredGridOutlineFilter toSet)
 {
     outline = toSet;
 }
Exemplo n.º 24
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVprobeComb(String [] argv)
    {
        //Prefix Content is: ""

        // create planes[]
        // Create the RenderWindow, Renderer and both Actors[]
        //[]
        ren1   = vtkRenderer.New();
        renWin = vtkRenderWindow.New();
        renWin.SetMultiSamples(0);
        renWin.AddRenderer((vtkRenderer)ren1);
        iren = new vtkRenderWindowInteractor();
        iren.SetRenderWindow((vtkRenderWindow)renWin);
        // create pipeline[]
        //[]
        pl3d = new vtkMultiBlockPLOT3DReader();
        pl3d.SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combxyz.bin");
        pl3d.SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/combq.bin");
        pl3d.SetScalarFunctionNumber((int)100);
        pl3d.SetVectorFunctionNumber((int)202);
        pl3d.Update();
        plane = new vtkPlaneSource();
        plane.SetResolution((int)50, (int)50);
        transP1 = new vtkTransform();
        transP1.Translate((double)3.7, (double)0.0, (double)28.37);
        transP1.Scale((double)5, (double)5, (double)5);
        transP1.RotateY((double)90);
        tpd1 = new vtkTransformPolyDataFilter();
        tpd1.SetInputConnection((vtkAlgorithmOutput)plane.GetOutputPort());
        tpd1.SetTransform((vtkAbstractTransform)transP1);
        outTpd1 = new vtkOutlineFilter();
        outTpd1.SetInputConnection((vtkAlgorithmOutput)tpd1.GetOutputPort());
        mapTpd1 = vtkPolyDataMapper.New();
        mapTpd1.SetInputConnection((vtkAlgorithmOutput)outTpd1.GetOutputPort());
        tpd1Actor = new vtkActor();
        tpd1Actor.SetMapper((vtkMapper)mapTpd1);
        tpd1Actor.GetProperty().SetColor((double)0, (double)0, (double)0);
        transP2 = new vtkTransform();
        transP2.Translate((double)9.2, (double)0.0, (double)31.20);
        transP2.Scale((double)5, (double)5, (double)5);
        transP2.RotateY((double)90);
        tpd2 = new vtkTransformPolyDataFilter();
        tpd2.SetInputConnection((vtkAlgorithmOutput)plane.GetOutputPort());
        tpd2.SetTransform((vtkAbstractTransform)transP2);
        outTpd2 = new vtkOutlineFilter();
        outTpd2.SetInputConnection((vtkAlgorithmOutput)tpd2.GetOutputPort());
        mapTpd2 = vtkPolyDataMapper.New();
        mapTpd2.SetInputConnection((vtkAlgorithmOutput)outTpd2.GetOutputPort());
        tpd2Actor = new vtkActor();
        tpd2Actor.SetMapper((vtkMapper)mapTpd2);
        tpd2Actor.GetProperty().SetColor((double)0, (double)0, (double)0);
        transP3 = new vtkTransform();
        transP3.Translate((double)13.27, (double)0.0, (double)33.30);
        transP3.Scale((double)5, (double)5, (double)5);
        transP3.RotateY((double)90);
        tpd3 = new vtkTransformPolyDataFilter();
        tpd3.SetInputConnection((vtkAlgorithmOutput)plane.GetOutputPort());
        tpd3.SetTransform((vtkAbstractTransform)transP3);
        outTpd3 = new vtkOutlineFilter();
        outTpd3.SetInputConnection((vtkAlgorithmOutput)tpd3.GetOutputPort());
        mapTpd3 = vtkPolyDataMapper.New();
        mapTpd3.SetInputConnection((vtkAlgorithmOutput)outTpd3.GetOutputPort());
        tpd3Actor = new vtkActor();
        tpd3Actor.SetMapper((vtkMapper)mapTpd3);
        tpd3Actor.GetProperty().SetColor((double)0, (double)0, (double)0);
        appendF = new vtkAppendPolyData();
        appendF.AddInputConnection(tpd1.GetOutputPort());
        appendF.AddInputConnection(tpd2.GetOutputPort());
        appendF.AddInputConnection(tpd3.GetOutputPort());
        probe = new vtkProbeFilter();
        probe.SetInputConnection((vtkAlgorithmOutput)appendF.GetOutputPort());
        probe.SetSourceData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        contour = new vtkContourFilter();
        contour.SetInputConnection((vtkAlgorithmOutput)probe.GetOutputPort());
        contour.GenerateValues((int)50, (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                               (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        contourMapper = vtkPolyDataMapper.New();
        contourMapper.SetInputConnection((vtkAlgorithmOutput)contour.GetOutputPort());
        contourMapper.SetScalarRange((double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[0],
                                     (double)((vtkDataSet)pl3d.GetOutput().GetBlock(0)).GetScalarRange()[1]);
        planeActor = new vtkActor();
        planeActor.SetMapper((vtkMapper)contourMapper);
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputData((vtkDataSet)pl3d.GetOutput().GetBlock(0));
        outlineMapper = vtkPolyDataMapper.New();
        outlineMapper.SetInputConnection((vtkAlgorithmOutput)outline.GetOutputPort());
        outlineActor = new vtkActor();
        outlineActor.SetMapper((vtkMapper)outlineMapper);
        outlineActor.GetProperty().SetColor((double)0, (double)0, (double)0);
        ren1.AddActor((vtkProp)outlineActor);
        ren1.AddActor((vtkProp)planeActor);
        ren1.AddActor((vtkProp)tpd1Actor);
        ren1.AddActor((vtkProp)tpd2Actor);
        ren1.AddActor((vtkProp)tpd3Actor);
        ren1.SetBackground((double)1, (double)1, (double)1);
        renWin.SetSize((int)400, (int)400);
        cam1 = ren1.GetActiveCamera();
        cam1.SetClippingRange((double)3.95297, (double)50);
        cam1.SetFocalPoint((double)8.88908, (double)0.595038, (double)29.3342);
        cam1.SetPosition((double)-12.3332, (double)31.7479, (double)41.2387);
        cam1.SetViewUp((double)0.060772, (double)-0.319905, (double)0.945498);
        iren.Initialize();
        // prevent the tk window from showing up then start the event loop[]

//deleteAllVTKObjects();
    }
Exemplo n.º 25
0
 ///<summary> A Set Method for Static Variables </summary>
 public static void Setoutline(vtkStructuredGridOutlineFilter toSet)
 {
     outline = toSet;
 }
Exemplo n.º 26
0
        private void DrawRainBow()
        {
            //# First create pipeline a simple pipeline that reads a structure grid
            //# and then extracts a plane from the grid. The plane will be colored
            //# differently by using different lookup tables.
            //#
            //# Note: the Update method is manually invoked because it causes the
            //# reader to read; later on we use the output of the reader to set
            //# a range for the scalar values.
            vtkMultiBlockPLOT3DReader pl3d = vtkMultiBlockPLOT3DReader.New();

            pl3d.SetXYZFileName(@"..\..\Data\combxyz.bin");
            pl3d.SetQFileName(@"..\..\Data\combq.bin");
            pl3d.SetScalarFunctionNumber(100);
            pl3d.SetVectorFunctionNumber(202);
            pl3d.Update();
            vtkDataObject pl3d_output = pl3d.GetOutput().GetBlock(0);

            vtkStructuredGridGeometryFilter planeFilter = vtkStructuredGridGeometryFilter.New();

            planeFilter.SetInputData(pl3d_output);
            planeFilter.SetExtent(1, 100, 1, 100, 7, 7);
            vtkLookupTable    lut         = vtkLookupTable.New();
            vtkPolyDataMapper planeMapper = vtkPolyDataMapper.New();

            planeMapper.SetLookupTable(lut);
            planeMapper.SetInputConnection(planeFilter.GetOutputPort());
            //planeMapper.SetScalarRange(pl3d_output.)
            vtkActor planeActor = vtkActor.New();

            planeActor.SetMapper(planeMapper);

            //this creates an outline around the data
            vtkStructuredGridOutlineFilter outlineFilter = vtkStructuredGridOutlineFilter.New();

            outlineFilter.SetInputData(pl3d_output);
            vtkPolyDataMapper outlineMapper = vtkPolyDataMapper.New();

            outlineMapper.SetInputConnection(outlineFilter.GetOutputPort());
            vtkActor outlineActor = vtkActor.New();

            outlineActor.SetMapper(outlineMapper);

            //Much of the following is commented out. To try different lookup tables.
            //This create a black to white lut
            //lut.SetHueRange(0, 0);
            //lut.SetSaturationRange(0, 0);
            //lut.SetValueRange(0.2, 1.0);

            //This creates a red to blue lut
            //lut.SetHueRange(0.0, 0.677);

            //This creates a blue to red lue
            lut.SetHueRange(0.667, 0.0);

            //This creates a weird effect. the Build() method cause lookup
            //table to allocate memory and create a table based on the correct
            //hue, saturatioin, value, and alpha range. Here we then
            //manully overwrite the value generated by the Build() method.
            lut.SetNumberOfColors(256);
            lut.Build();
            for (int i = 0; i < 16; i++)
            {
                lut.SetTableValue(i * 16, (float)Color.Red.R / 256, (float)Color.Red.G / 256, (float)Color.Red.B / 256, 1);
                lut.SetTableValue(i * 16 + 1, (float)Color.Green.R / 256, (float)Color.Green.G / 256, (float)Color.Green.B / 256, 1);
                lut.SetTableValue(i * 16 + 2, (float)Color.Blue.R / 256, (float)Color.Blue.G / 256, (float)Color.Blue.B / 256, 1);
                lut.SetTableValue(i * 16 + 3, (float)Color.Black.R / 256, (float)Color.Black.G / 256, (float)Color.Black.B / 256, 1);
            }


            //Create the renderwindow, the render and both actors
            vtkRenderer     ren    = vtkRenderer.New();
            vtkRenderWindow renWin = myRenderWindowControl.RenderWindow;

            renWin.AddRenderer(ren);

            //Add the actors to the renderer, set the backgroud
            ren.AddActor(outlineActor);
            ren.AddActor(planeActor);

            ren.SetBackground(0.1, 0.2, 0.4);
            ren.TwoSidedLightingOff();
        }