コード例 #1
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVEnSight6OfficeBin(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);
        //skipping Delete cdp
        reader.SetCaseFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/EnSight/office6_bin.case");
        reader.Update();
        // to add coverage for vtkOnePieceExtentTranslator[]
        translator = new vtkOnePieceExtentTranslator();
        vtkStreamingDemandDrivenPipeline.SetExtentTranslator(reader.GetOutputInformation(0), (vtkExtentTranslator)translator);
        outline = new vtkStructuredGridOutlineFilter();
        outline.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
        mapOutline = new vtkHierarchicalPolyDataMapper();
        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.9);
        cones.SetScaleModeToScaleByVector();
        mapCones = new vtkHierarchicalPolyDataMapper();
        mapCones.SetInputConnection((vtkAlgorithmOutput)cones.GetOutputPort());
        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();
    }
コード例 #2
0
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVEnSight6OfficeBin(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);
          //skipping Delete cdp
          reader.SetCaseFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/EnSight/office6_bin.case");
          reader.Update();
          // to add coverage for vtkOnePieceExtentTranslator[]
          translator = new vtkOnePieceExtentTranslator();
          reader.GetOutput().SetExtentTranslator((vtkExtentTranslator)translator);
          outline = new vtkStructuredGridOutlineFilter();
          outline.SetInputConnection((vtkAlgorithmOutput)reader.GetOutputPort());
          mapOutline = new vtkHierarchicalPolyDataMapper();
          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.SetSource((vtkPolyData)cone.GetOutput());
          cones.SetScaleFactor((double)0.9);
          cones.SetScaleModeToScaleByVector();
          mapCones = new vtkHierarchicalPolyDataMapper();
          mapCones.SetInputConnection((vtkAlgorithmOutput)cones.GetOutputPort());
          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();
    }
コード例 #3
0
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetmapCones(vtkHierarchicalPolyDataMapper toSet)
 {
     mapCones = toSet;
 }
コード例 #4
0
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetmapOutline(vtkHierarchicalPolyDataMapper toSet)
 {
     mapOutline = toSet;
 }
コード例 #5
0
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetmapOutline(vtkHierarchicalPolyDataMapper toSet)
 {
     mapOutline = toSet;
 }
コード例 #6
0
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetmapCones(vtkHierarchicalPolyDataMapper toSet)
 {
     mapCones = toSet;
 }