/// <summary> /// The main entry method called by the CSharp driver /// </summary> /// <param name="argv"></param> public static void AVTestExtrudePiece(String [] argv) { //Prefix Content is: "" disk = new vtkDiskSource(); disk.SetRadialResolution((int)2); disk.SetCircumferentialResolution((int)9); clean = new vtkCleanPolyData(); clean.SetInputConnection((vtkAlgorithmOutput)disk.GetOutputPort()); clean.SetTolerance((double)0.01); piece = new vtkExtractPolyDataPiece(); piece.SetInputConnection((vtkAlgorithmOutput)clean.GetOutputPort()); extrude = new vtkPLinearExtrusionFilter(); extrude.SetInputConnection((vtkAlgorithmOutput)piece.GetOutputPort()); extrude.PieceInvariantOn(); // Create the RenderWindow, Renderer and both Actors[] //[] ren1 = vtkRenderer.New(); renWin = vtkRenderWindow.New(); renWin.AddRenderer((vtkRenderer)ren1); iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow((vtkRenderWindow)renWin); mapper = vtkPolyDataMapper.New(); mapper.SetInputConnection((vtkAlgorithmOutput)extrude.GetOutputPort()); mapper.SetNumberOfPieces((int)2); mapper.SetPiece((int)1); bf = new vtkProperty(); bf.SetColor((double)1,(double)0,(double)0); actor = new vtkActor(); actor.SetMapper((vtkMapper)mapper); actor.GetProperty().SetColor((double)1,(double)1,(double)0.8); actor.SetBackfaceProperty((vtkProperty)bf); // Add the actors to the renderer, set the background and size[] //[] ren1.AddActor((vtkProp)actor); ren1.SetBackground((double)0.1,(double)0.2,(double)0.4); renWin.SetSize((int)300,(int)300); // render the image[] //[] cam1 = ren1.GetActiveCamera(); cam1.Azimuth((double)20); cam1.Elevation((double)40); ren1.ResetCamera(); cam1.Zoom((double)1.2); iren.Initialize(); // prevent the tk window from showing up then start the event loop[] //deleteAllVTKObjects(); }
///<summary> A Set Method for Static Variables </summary> public static void Setextrude(vtkPLinearExtrusionFilter toSet) { extrude = toSet; }