static void Main() { string VTK_DATA_ROOT = "C:/Program Files/VTKData"; // Create a vtkBYUReader and read in a data set. vtkBYUReader fohe = new vtkBYUReader(); fohe.SetGeometryFileName(VTK_DATA_ROOT + "/Data/teapot.g"); // Create a vtkPolyDataNormals filter to calculate the normals of the // data set. vtkPolyDataNormals normals = new vtkPolyDataNormals(); normals.SetInputConnection(fohe.GetOutputPort()); // Set up the associated mapper and actor. vtkPolyDataMapper foheMapper = new vtkPolyDataMapper(); foheMapper.SetInputConnection(normals.GetOutputPort()); vtkLODActor foheActor = new vtkLODActor(); foheActor.SetMapper(foheMapper); // Create a vtkOutlineFilter to draw the bounding box of the data set. // Also create the associated mapper and actor. vtkOutlineFilter outline = new vtkOutlineFilter(); outline.SetInputConnection(normals.GetOutputPort()); vtkPolyDataMapper mapOutline = new vtkPolyDataMapper(); mapOutline.SetInputConnection(outline.GetOutputPort()); vtkActor outlineActor = new vtkActor(); outlineActor.SetMapper(mapOutline); outlineActor.GetProperty().SetColor(0, 0, 0); // Create a vtkCamera, and set the camera parameters. vtkCamera camera = new vtkCamera(); camera.SetClippingRange(1.60187, 20.0842); camera.SetFocalPoint(0.21406, 1.5, 0); camera.SetPosition(8.3761, 4.94858, 4.12505); camera.SetViewUp(0.180325, 0.549245, -0.815974); // Create a vtkLight, and set the light parameters. vtkLight light = new vtkLight(); light.SetFocalPoint(0.21406, 1.5, 0); light.SetPosition(8.3761, 4.94858, 4.12505); // Create the Renderers. Assign them the appropriate viewport // coordinates, active camera, and light. vtkRenderer ren = new vtkRenderer(); ren.SetViewport(0, 0, 0.5, 1.0); ren.SetActiveCamera(camera); ren.AddLight(light); vtkRenderer ren2 = new vtkRenderer(); ren2.SetViewport(0.5, 0, 1.0, 1.0); ren2.SetActiveCamera(camera); ren2.AddLight(light); // Create the RenderWindow and RenderWindowInteractor. vtkRenderWindow renWin = new vtkRenderWindow(); renWin.AddRenderer(ren); renWin.AddRenderer(ren2); renWin.SetWindowName("VTK - Cube Axes"); renWin.SetSize(600, 300); vtkRenderWindowInteractor iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow(renWin); // Add the actors to the renderer, and set the background. ren.AddViewProp(foheActor); ren.AddViewProp(outlineActor); ren2.AddViewProp(foheActor); ren2.AddViewProp(outlineActor); ren.SetBackground(0.1, 0.2, 0.4); ren2.SetBackground(0.1, 0.2, 0.4); // Create a text property for both cube axes vtkTextProperty tprop = new vtkTextProperty(); tprop.SetColor(1, 1, 1); tprop.ShadowOn(); // Create a vtkCubeAxesActor2D. Use the outer edges of the bounding box to // draw the axes. Add the actor to the renderer. vtkCubeAxesActor2D axes = new vtkCubeAxesActor2D(); axes.SetInput(normals.GetOutput()); axes.SetCamera(ren.GetActiveCamera()); axes.SetLabelFormat("%6.4g"); axes.SetFlyModeToOuterEdges(); axes.SetFontFactor(0.8); axes.SetAxisTitleTextProperty(tprop); axes.SetAxisLabelTextProperty(tprop); ren.AddViewProp(axes); // Create a vtkCubeAxesActor2D. Use the closest vertex to the camera to // determine where to draw the axes. Add the actor to the renderer. vtkCubeAxesActor2D axes2 = new vtkCubeAxesActor2D(); axes2.SetViewProp(foheActor); axes2.SetCamera(ren2.GetActiveCamera()); axes2.SetLabelFormat("%6.4g"); axes2.SetFlyModeToClosestTriad(); axes2.SetFontFactor(0.8); axes2.ScalingOff(); axes2.SetAxisTitleTextProperty(tprop); axes2.SetAxisLabelTextProperty(tprop); ren2.AddViewProp(axes2); renWin.AddObserver((uint) EventIds.AbortCheckEvent, CheckAbort); iren.Initialize(); renWin.Render(); iren.Start(); vtkWin32OpenGLRenderWindow win32win = vtkWin32OpenGLRenderWindow.SafeDownCast(renWin); if (null != win32win) win32win.Clean(); }
/// <summary> /// The main entry method called by the CSharp driver /// </summary> /// <param name="argv"></param> public static void AVPlot3DVectors(String [] argv) { //Prefix Content is: "" //[] // All Plot3D vector functions[] //[] // Create the RenderWindow, Renderer and both Actors[] //[] renWin = vtkRenderWindow.New(); renWin.SetMultiSamples(0); ren1 = vtkRenderer.New(); ren1.SetBackground((double).8, (double).8, (double).2); renWin.AddRenderer((vtkRenderer)ren1); iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow((vtkRenderWindow)renWin); vectorLabels = "Velocity Vorticity Momentum Pressure_Gradient"; vectorFunctions = "200 201 202 210"; camera = new vtkCamera(); light = new vtkLight(); // All text actors will share the same text prop[] textProp = new vtkTextProperty(); textProp.SetFontSize((int)10); textProp.SetFontFamilyToArial(); textProp.SetColor((double).3, (double)1, (double)1); i = 0; foreach (string vectorFunction in vectorFunctions.Split(new char[] { ' ' })) { pl3d[getArrayIndex(vectorFunction)] = new vtkMultiBlockPLOT3DReader(); pl3d[getArrayIndex(vectorFunction)].SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinxyz.bin"); pl3d[getArrayIndex(vectorFunction)].SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinq.bin"); pl3d[getArrayIndex(vectorFunction)].SetVectorFunctionNumber((int)(int)(getArrayIndex(vectorFunction))); pl3d[getArrayIndex(vectorFunction)].Update(); plane[getArrayIndex(vectorFunction)] = new vtkStructuredGridGeometryFilter(); plane[getArrayIndex(vectorFunction)].SetInputData((vtkDataSet)pl3d[getArrayIndex(vectorFunction)].GetOutput().GetBlock(0)); plane[getArrayIndex(vectorFunction)].SetExtent((int)25, (int)25, (int)0, (int)100, (int)0, (int)100); hog[getArrayIndex(vectorFunction)] = new vtkHedgeHog(); hog[getArrayIndex(vectorFunction)].SetInputConnection((vtkAlgorithmOutput)plane[getArrayIndex(vectorFunction)].GetOutputPort()); maxnorm = ((vtkDataSet)pl3d[getArrayIndex(vectorFunction)].GetOutput().GetBlock(0)).GetPointData().GetVectors().GetMaxNorm(); hog[getArrayIndex(vectorFunction)].SetScaleFactor((double)1.0 / maxnorm); mapper[getArrayIndex(vectorFunction)] = vtkPolyDataMapper.New(); mapper[getArrayIndex(vectorFunction)].SetInputConnection((vtkAlgorithmOutput)hog[getArrayIndex(vectorFunction)].GetOutputPort()); actor[getArrayIndex(vectorFunction)] = new vtkActor(); actor[getArrayIndex(vectorFunction)].SetMapper((vtkMapper)mapper[getArrayIndex(vectorFunction)]); ren[getArrayIndex(vectorFunction)] = vtkRenderer.New(); ren[getArrayIndex(vectorFunction)].SetBackground((double)0.5, (double).5, (double).5); ren[getArrayIndex(vectorFunction)].SetActiveCamera((vtkCamera)camera); ren[getArrayIndex(vectorFunction)].AddLight((vtkLight)light); renWin.AddRenderer(ren[getArrayIndex(vectorFunction)]); ren[getArrayIndex(vectorFunction)].AddActor((vtkProp)actor[getArrayIndex(vectorFunction)]); textMapper[getArrayIndex(vectorFunction)] = new vtkTextMapper(); textMapper[getArrayIndex(vectorFunction)].SetInput(vectorLabels.Split(new char[] { ' ' })[i]); textMapper[getArrayIndex(vectorFunction)].SetTextProperty((vtkTextProperty)textProp); text[getArrayIndex(vectorFunction)] = new vtkActor2D(); text[getArrayIndex(vectorFunction)].SetMapper((vtkMapper2D)textMapper[getArrayIndex(vectorFunction)]); text[getArrayIndex(vectorFunction)].SetPosition((double)2, (double)5); ren[getArrayIndex(vectorFunction)].AddActor2D((vtkProp)text[getArrayIndex(vectorFunction)]); i = i + 1; } //[] // now layout renderers[] column = 1; row = 1; deltaX = 1.0 / 2.0; deltaY = 1.0 / 2.0; foreach (string vectorFunction in vectorFunctions.Split(new char[] { ' ' })) { ren[getArrayIndex(vectorFunction)].SetViewport((double)(column - 1) * deltaX + (deltaX * .05), (double)(row - 1) * deltaY + (deltaY * .05), (double)column * deltaX - (deltaX * .05), (double)row * deltaY - (deltaY * .05)); column = column + 1; if ((column) > 2) { column = 1; row = row + 1; } } camera.SetViewUp((double)1, (double)0, (double)0); camera.SetFocalPoint((double)0, (double)0, (double)0); camera.SetPosition((double).4, (double)-.5, (double)-.75); ren[200].ResetCamera(); camera.Dolly((double)1.25); ren[200].ResetCameraClippingRange(); ren[201].ResetCameraClippingRange(); ren[202].ResetCameraClippingRange(); ren[210].ResetCameraClippingRange(); light.SetPosition(camera.GetPosition()[0], camera.GetPosition()[1], camera.GetPosition()[2]); light.SetFocalPoint(camera.GetFocalPoint()[0], camera.GetFocalPoint()[1], camera.GetFocalPoint()[2]); renWin.SetSize(350, 350); renWin.Render(); iren.Initialize(); // render the image[] //[] // prevent the tk window from showing up then start the event loop[] //deleteAllVTKObjects(); }
public void AddLight(Color color) { vtkLight Light = new vtkLight(); //Light.SetFocalPoint(1.875, 0.6125, 0); Light.SetPosition(0.875, 1.6125, 1.0); Light.SetColor(0.1, 0.0, 0.0); ren1.AddLight(Light); }
///<summary> A Set Method for Static Variables </summary> public static void Setlight(vtkLight toSet) { light = toSet; }
/// <summary> /// The main entry method called by the CSharp driver /// </summary> /// <param name="argv"></param> public static void AVPlot3DScalars(String[] argv) { //Prefix Content is: "" //[] // All Plot3D scalar functions[] //[] // Create the RenderWindow, Renderer and both Actors[] //[] renWin = vtkRenderWindow.New(); renWin.SetMultiSamples(0); iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow((vtkRenderWindow)renWin); scalarLabels = "Density Pressure Temperature Enthalpy Internal_Energy Kinetic_Energy Velocity_Magnitude Stagnation_Energy Entropy Swirl"; scalarFunctions = "100 110 120 130 140 144 153 163 170 184"; camera = new vtkCamera(); light = new vtkLight(); math = new vtkMath(); // All text actors will share the same text prop[] textProp = new vtkTextProperty(); textProp.SetFontSize((int)10); textProp.SetFontFamilyToArial(); textProp.SetColor((double)0, (double)0, (double)0); i = 0; foreach (string scalarFunction in scalarFunctions.Split(new char[] { ' ' })) { pl3d[getArrayIndex(scalarFunction)] = new vtkMultiBlockPLOT3DReader(); pl3d[getArrayIndex(scalarFunction)].SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinxyz.bin"); pl3d[getArrayIndex(scalarFunction)].SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinq.bin"); pl3d[getArrayIndex(scalarFunction)].SetScalarFunctionNumber((int)(int)(Int32.Parse(scalarFunction))); pl3d[getArrayIndex(scalarFunction)].Update(); plane[getArrayIndex(scalarFunction)] = new vtkStructuredGridGeometryFilter(); plane[getArrayIndex(scalarFunction)].SetInputData((vtkDataSet)pl3d[getArrayIndex(scalarFunction)].GetOutput().GetBlock(0)); plane[getArrayIndex(scalarFunction)].SetExtent((int)25, (int)25, (int)0, (int)100, (int)0, (int)100); mapper[getArrayIndex(scalarFunction)] = vtkPolyDataMapper.New(); mapper[getArrayIndex(scalarFunction)].SetInputConnection((vtkAlgorithmOutput)plane[getArrayIndex(scalarFunction)].GetOutputPort()); mapper[getArrayIndex(scalarFunction)].SetScalarRange((double)((vtkDataSet)pl3d[getArrayIndex(scalarFunction)].GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[0], (double)((vtkDataSet)pl3d[getArrayIndex(scalarFunction)].GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[1]); actor[getArrayIndex(scalarFunction)] = new vtkActor(); actor[getArrayIndex(scalarFunction)].SetMapper((vtkMapper)mapper[getArrayIndex(scalarFunction)]); ren[getArrayIndex(scalarFunction)] = vtkRenderer.New(); ren[getArrayIndex(scalarFunction)].SetBackground((double)0, (double)0, (double).5); ren[getArrayIndex(scalarFunction)].SetActiveCamera((vtkCamera)camera); ren[getArrayIndex(scalarFunction)].AddLight((vtkLight)light); renWin.AddRenderer(ren[getArrayIndex(scalarFunction)]); ren[getArrayIndex(scalarFunction)].SetBackground((double)vtkMath.Random((double).5, (double)1), (double)vtkMath.Random((double).5, (double)1), (double)vtkMath.Random((double).5, (double)1)); ren[getArrayIndex(scalarFunction)].AddActor((vtkProp)actor[getArrayIndex(scalarFunction)]); textMapper[getArrayIndex(scalarFunction)] = new vtkTextMapper(); textMapper[getArrayIndex(scalarFunction)].SetInput(scalarLabels.Split(new char[] { ' ' })[i]); textMapper[getArrayIndex(scalarFunction)].SetTextProperty((vtkTextProperty)textProp); text[getArrayIndex(scalarFunction)] = new vtkActor2D(); text[getArrayIndex(scalarFunction)].SetMapper((vtkMapper2D)textMapper[getArrayIndex(scalarFunction)]); text[getArrayIndex(scalarFunction)].SetPosition((double)2, (double)3); ren[getArrayIndex(scalarFunction)].AddActor2D(text[getArrayIndex(scalarFunction)]); i = i + 1; } //[] // now layout renderers[] column = 1; row = 1; deltaX = 1.0 / 5.0; deltaY = 1.0 / 2.0; foreach (string scalarFunction in scalarFunctions.Split(new char[] { ' ' })) { ren[getArrayIndex(scalarFunction)].SetViewport((double)(column - 1) * deltaX, (double)(row - 1) * deltaY, (double)column * deltaX, (double)row * deltaY); column = column + 1; if ((column) > 5) { column = 1; row = row + 1; } } camera.SetViewUp((double)0, (double)1, (double)0); camera.SetFocalPoint((double)0, (double)0, (double)0); camera.SetPosition((double)1, (double)0, (double)0); ren[100].ResetCamera(); camera.Dolly((double)1.25); ren[100].ResetCameraClippingRange(); ren[110].ResetCameraClippingRange(); ren[120].ResetCameraClippingRange(); ren[130].ResetCameraClippingRange(); ren[140].ResetCameraClippingRange(); ren[144].ResetCameraClippingRange(); ren[153].ResetCameraClippingRange(); ren[163].ResetCameraClippingRange(); ren[170].ResetCameraClippingRange(); ren[184].ResetCameraClippingRange(); light.SetPosition(camera.GetPosition()[0], camera.GetPosition()[1], camera.GetPosition()[2]); light.SetFocalPoint(camera.GetFocalPoint()[0], camera.GetFocalPoint()[1], camera.GetFocalPoint()[2]); renWin.SetSize(600, 180); renWin.Render(); iren.Initialize(); // render the image[] //[] // prevent the tk window from showing up then start the event loop[] //deleteAllVTKObjects(); }
/// <summary> /// An example that does not use a Windows Form /// </summary> /// <param name="argv"></param> public static void Main(String[] argv) { // This example demonstrates the use of vtkCubeAxesActor2D to indicate the // position in space that the camera is currently viewing. // The vtkCubeAxesActor2D draws axes on the bounding box of the data set and // labels the axes with x-y-z coordinates. // // First we include the VTK Tcl packages which will make available // all of the vtk commands to Tcl // // Create a vtkBYUReader and read in a data set. // fohe = vtkBYUReader.New(); fohe.SetGeometryFileName("../../../teapot.g"); // Create a vtkPolyDataNormals filter to calculate the normals of the data set. normals = vtkPolyDataNormals.New(); normals.SetInputConnection(fohe.GetOutputPort()); // Set up the associated mapper and actor. foheMapper = vtkPolyDataMapper.New(); foheMapper.SetInputConnection(normals.GetOutputPort()); foheActor = vtkLODActor.New(); foheActor.SetMapper(foheMapper); // Create a vtkOutlineFilter to draw the bounding box of the data set. Also // create the associated mapper and actor. outline = vtkOutlineFilter.New(); outline.SetInputConnection(normals.GetOutputPort()); mapOutline = vtkPolyDataMapper.New(); mapOutline.SetInputConnection(outline.GetOutputPort()); outlineActor = vtkActor.New(); outlineActor.SetMapper(mapOutline); outlineActor.GetProperty().SetColor(0, 0, 0); // Create a vtkCamera, and set the camera parameters. camera = vtkCamera.New(); camera.SetClippingRange(1.60187, 20.0842); camera.SetFocalPoint(0.21406, 1.5, 0); camera.SetPosition(8.3761, 4.94858, 4.12505); camera.SetViewUp(0.180325, 0.549245, -0.815974); // Create a vtkLight, and set the light parameters. light = vtkLight.New(); light.SetFocalPoint(0.21406, 1.5, 0); light.SetPosition(8.3761, 4.94858, 4.12505); // Create the Renderers. Assign them the appropriate viewport coordinates, // active camera, and light. ren1 = vtkRenderer.New(); ren1.SetViewport(0, 0, 0.5, 1.0); ren1.SetActiveCamera(camera); ren1.AddLight(light); ren2 = vtkRenderer.New(); ren2.SetViewport(0.5, 0, 1.0, 1.0); ren2.SetActiveCamera(camera); ren2.AddLight(light); // Create the RenderWindow and RenderWindowInteractor. renWin = vtkRenderWindow.New(); renWin.AddRenderer(ren1); renWin.AddRenderer(ren2); renWin.SetWindowName("VTK - Cube Axes"); renWin.SetSize(600, 300); iren = vtkRenderWindowInteractor.New(); iren.SetRenderWindow(renWin); // Add the actors to the renderer, and set the background. ren1.AddViewProp(foheActor); ren1.AddViewProp(outlineActor); ren2.AddViewProp(foheActor); ren2.AddViewProp(outlineActor); ren1.SetBackground(0.1, 0.2, 0.4); ren2.SetBackground(0.1, 0.2, 0.4); // Create a text property for both cube axes tprop = vtkTextProperty.New(); tprop.SetColor(1, 1, 1); tprop.ShadowOn(); // Create a vtkCubeAxesActor2D. Use the outer edges of the bounding box to // draw the axes. Add the actor to the renderer. axes = vtkCubeAxesActor2D.New(); axes.SetInput(normals.GetOutput()); axes.SetCamera(ren1.GetActiveCamera()); axes.SetLabelFormat("%6.4g"); axes.SetFlyModeToOuterEdges(); axes.SetFontFactor(0.8); axes.SetAxisTitleTextProperty(tprop); axes.SetAxisLabelTextProperty(tprop); ren1.AddViewProp(axes); // Create a vtkCubeAxesActor2D. Use the closest vertex to the camera to // determine where to draw the axes. Add the actor to the renderer. axes2 = vtkCubeAxesActor2D.New(); axes2.SetViewProp(foheActor); axes2.SetCamera(ren2.GetActiveCamera()); axes2.SetLabelFormat("%6.4g"); axes2.SetFlyModeToClosestTriad(); axes2.SetFontFactor(0.8); axes2.ScalingOff(); axes2.SetAxisTitleTextProperty(tprop); axes2.SetAxisLabelTextProperty(tprop); ren2.AddViewProp(axes2); // Render renWin.Render(); // Set the user method (bound to key 'u') iren.Initialize(); iren.Start(); // Set up a check for aborting rendering. renWin.AbortCheckEvt += new vtkObject.vtkObjectEventHandler(TkCheckAbort); //Clean Up deleteAllVTKObjects(); }
/// <summary> /// The main entry method called by the CSharp driver /// </summary> /// <param name="argv"></param> public static void AVPlot3DVectors(String [] argv) { //Prefix Content is: "" //[] // All Plot3D vector functions[] //[] // Create the RenderWindow, Renderer and both Actors[] //[] renWin = vtkRenderWindow.New(); ren1 = vtkRenderer.New(); ren1.SetBackground((double).8,(double).8,(double).2); renWin.AddRenderer((vtkRenderer)ren1); iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow((vtkRenderWindow)renWin); vectorLabels = "Velocity Vorticity Momentum Pressure_Gradient"; vectorFunctions = "200 201 202 210"; camera = new vtkCamera(); light = new vtkLight(); // All text actors will share the same text prop[] textProp = new vtkTextProperty(); textProp.SetFontSize((int)10); textProp.SetFontFamilyToArial(); textProp.SetColor((double).3,(double)1,(double)1); i = 0; foreach (string vectorFunction in vectorFunctions.Split(new char[]{' '})) { pl3d[getArrayIndex(vectorFunction)] = new vtkPLOT3DReader(); pl3d[getArrayIndex(vectorFunction)].SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinxyz.bin"); pl3d[getArrayIndex(vectorFunction)].SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinq.bin"); pl3d[getArrayIndex(vectorFunction)].SetVectorFunctionNumber((int)(int)(getArrayIndex(vectorFunction))); pl3d[getArrayIndex(vectorFunction)].Update(); plane[getArrayIndex(vectorFunction)] = new vtkStructuredGridGeometryFilter(); plane[getArrayIndex(vectorFunction)].SetInputConnection((vtkAlgorithmOutput)pl3d[getArrayIndex(vectorFunction)].GetOutputPort()); plane[getArrayIndex(vectorFunction)].SetExtent((int)25,(int)25,(int)0,(int)100,(int)0,(int)100); hog[getArrayIndex(vectorFunction)] = new vtkHedgeHog(); hog[getArrayIndex(vectorFunction)].SetInputConnection((vtkAlgorithmOutput)plane[getArrayIndex(vectorFunction)].GetOutputPort()); maxnorm = pl3d[getArrayIndex(vectorFunction)].GetOutput().GetPointData().GetVectors().GetMaxNorm(); hog[getArrayIndex(vectorFunction)].SetScaleFactor((double)1.0/maxnorm); mapper[getArrayIndex(vectorFunction)] = vtkPolyDataMapper.New(); mapper[getArrayIndex(vectorFunction)].SetInputConnection((vtkAlgorithmOutput)hog[getArrayIndex(vectorFunction)].GetOutputPort()); actor[getArrayIndex(vectorFunction)] = new vtkActor(); actor[getArrayIndex(vectorFunction)].SetMapper((vtkMapper)mapper[getArrayIndex(vectorFunction)]); ren[getArrayIndex(vectorFunction)] = vtkRenderer.New(); ren[getArrayIndex(vectorFunction)].SetBackground((double)0.5,(double).5,(double).5); ren[getArrayIndex(vectorFunction)].SetActiveCamera((vtkCamera)camera); ren[getArrayIndex(vectorFunction)].AddLight((vtkLight)light); renWin.AddRenderer(ren[getArrayIndex(vectorFunction)]); ren[getArrayIndex(vectorFunction)].AddActor((vtkProp)actor[getArrayIndex(vectorFunction)]); textMapper[getArrayIndex(vectorFunction)] = new vtkTextMapper(); textMapper[getArrayIndex(vectorFunction)].SetInput(vectorLabels.Split(new char[] { ' ' })[i]); textMapper[getArrayIndex(vectorFunction)].SetTextProperty((vtkTextProperty)textProp); text[getArrayIndex(vectorFunction)] = new vtkActor2D(); text[getArrayIndex(vectorFunction)].SetMapper((vtkMapper2D)textMapper[getArrayIndex(vectorFunction)]); text[getArrayIndex(vectorFunction)].SetPosition((double)2,(double)5); ren[getArrayIndex(vectorFunction)].AddActor2D((vtkProp)text[getArrayIndex(vectorFunction)]); i = i + 1; } //[] // now layout renderers[] column = 1; row = 1; deltaX = 1.0/2.0; deltaY = 1.0/2.0; foreach (string vectorFunction in vectorFunctions.Split(new char[]{' '})) { ren[getArrayIndex(vectorFunction)].SetViewport((double)(column - 1) * deltaX + (deltaX * .05), (double)(row - 1) * deltaY + (deltaY * .05), (double)column * deltaX - (deltaX * .05), (double)row * deltaY - (deltaY * .05)); column = column + 1; if ((column) > 2) { column = 1; row = row + 1; } } camera.SetViewUp((double)1,(double)0,(double)0); camera.SetFocalPoint((double)0,(double)0,(double)0); camera.SetPosition((double).4,(double)-.5,(double)-.75); ren[200].ResetCamera(); camera.Dolly((double)1.25); ren[200].ResetCameraClippingRange(); ren[201].ResetCameraClippingRange(); ren[202].ResetCameraClippingRange(); ren[210].ResetCameraClippingRange(); light.SetPosition(camera.GetPosition()[0],camera.GetPosition()[1],camera.GetPosition()[2]); light.SetFocalPoint(camera.GetFocalPoint()[0],camera.GetFocalPoint()[1],camera.GetFocalPoint()[2]); renWin.SetSize(350,350); renWin.Render(); 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 Setlight(vtkLight toSet) { light = toSet; }
/// <summary> /// The main entry method called by the CSharp driver /// </summary> /// <param name="argv"></param> public static void AVPlot3DScalars(String[] argv) { //Prefix Content is: "" //[] // All Plot3D scalar functions[] //[] // Create the RenderWindow, Renderer and both Actors[] //[] renWin = vtkRenderWindow.New(); renWin.SetMultiSamples(0); iren = new vtkRenderWindowInteractor(); iren.SetRenderWindow((vtkRenderWindow)renWin); scalarLabels = "Density Pressure Temperature Enthalpy Internal_Energy Kinetic_Energy Velocity_Magnitude Stagnation_Energy Entropy Swirl"; scalarFunctions = "100 110 120 130 140 144 153 163 170 184"; camera = new vtkCamera(); light = new vtkLight(); math = new vtkMath(); // All text actors will share the same text prop[] textProp = new vtkTextProperty(); textProp.SetFontSize((int)10); textProp.SetFontFamilyToArial(); textProp.SetColor((double)0, (double)0, (double)0); i = 0; foreach (string scalarFunction in scalarFunctions.Split(new char[] { ' ' })) { pl3d[getArrayIndex(scalarFunction)] = new vtkMultiBlockPLOT3DReader(); pl3d[getArrayIndex(scalarFunction)].SetXYZFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinxyz.bin"); pl3d[getArrayIndex(scalarFunction)].SetQFileName((string)"" + (VTK_DATA_ROOT.ToString()) + "/Data/bluntfinq.bin"); pl3d[getArrayIndex(scalarFunction)].SetScalarFunctionNumber((int)(int)(Int32.Parse(scalarFunction))); pl3d[getArrayIndex(scalarFunction)].Update(); plane[getArrayIndex(scalarFunction)] = new vtkStructuredGridGeometryFilter(); plane[getArrayIndex(scalarFunction)].SetInputData((vtkDataSet)pl3d[getArrayIndex(scalarFunction)].GetOutput().GetBlock(0)); plane[getArrayIndex(scalarFunction)].SetExtent((int)25, (int)25, (int)0, (int)100, (int)0, (int)100); mapper[getArrayIndex(scalarFunction)] = vtkPolyDataMapper.New(); mapper[getArrayIndex(scalarFunction)].SetInputConnection((vtkAlgorithmOutput)plane[getArrayIndex(scalarFunction)].GetOutputPort()); mapper[getArrayIndex(scalarFunction)].SetScalarRange((double)((vtkDataSet)pl3d[getArrayIndex(scalarFunction)].GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[0], (double)((vtkDataSet)pl3d[getArrayIndex(scalarFunction)].GetOutput().GetBlock(0)).GetPointData().GetScalars().GetRange()[1]); actor[getArrayIndex(scalarFunction)] = new vtkActor(); actor[getArrayIndex(scalarFunction)].SetMapper((vtkMapper)mapper[getArrayIndex(scalarFunction)]); ren[getArrayIndex(scalarFunction)] = vtkRenderer.New(); ren[getArrayIndex(scalarFunction)].SetBackground((double)0, (double)0, (double).5); ren[getArrayIndex(scalarFunction)].SetActiveCamera((vtkCamera)camera); ren[getArrayIndex(scalarFunction)].AddLight((vtkLight)light); renWin.AddRenderer(ren[getArrayIndex(scalarFunction)]); ren[getArrayIndex(scalarFunction)].SetBackground((double)vtkMath.Random((double).5, (double)1), (double)vtkMath.Random((double).5, (double)1), (double)vtkMath.Random((double).5, (double)1)); ren[getArrayIndex(scalarFunction)].AddActor((vtkProp)actor[getArrayIndex(scalarFunction)]); textMapper[getArrayIndex(scalarFunction)] = new vtkTextMapper(); textMapper[getArrayIndex(scalarFunction)].SetInput(scalarLabels.Split(new char[] { ' ' })[i]); textMapper[getArrayIndex(scalarFunction)].SetTextProperty((vtkTextProperty)textProp); text[getArrayIndex(scalarFunction)] = new vtkActor2D(); text[getArrayIndex(scalarFunction)].SetMapper((vtkMapper2D)textMapper[getArrayIndex(scalarFunction)]); text[getArrayIndex(scalarFunction)].SetPosition((double)2, (double)3); ren[getArrayIndex(scalarFunction)].AddActor2D(text[getArrayIndex(scalarFunction)]); i = i + 1; } //[] // now layout renderers[] column = 1; row = 1; deltaX = 1.0 / 5.0; deltaY = 1.0 / 2.0; foreach (string scalarFunction in scalarFunctions.Split(new char[] { ' ' })) { ren[getArrayIndex(scalarFunction)].SetViewport((double)(column - 1) * deltaX, (double)(row - 1) * deltaY, (double)column * deltaX, (double)row * deltaY); column = column + 1; if ((column) > 5) { column = 1; row = row + 1; } } camera.SetViewUp((double)0, (double)1, (double)0); camera.SetFocalPoint((double)0, (double)0, (double)0); camera.SetPosition((double)1, (double)0, (double)0); ren[100].ResetCamera(); camera.Dolly((double)1.25); ren[100].ResetCameraClippingRange(); ren[110].ResetCameraClippingRange(); ren[120].ResetCameraClippingRange(); ren[130].ResetCameraClippingRange(); ren[140].ResetCameraClippingRange(); ren[144].ResetCameraClippingRange(); ren[153].ResetCameraClippingRange(); ren[163].ResetCameraClippingRange(); ren[170].ResetCameraClippingRange(); ren[184].ResetCameraClippingRange(); light.SetPosition(camera.GetPosition()[0], camera.GetPosition()[1], camera.GetPosition()[2]); light.SetFocalPoint(camera.GetFocalPoint()[0], camera.GetFocalPoint()[1], camera.GetFocalPoint()[2]); renWin.SetSize(600, 180); renWin.Render(); iren.Initialize(); // render the image[] //[] // prevent the tk window from showing up then start the event loop[] //deleteAllVTKObjects(); }
public void DisplayXYZ() { if (CompleteScreening == null) return; int DescX = this.comboBoxDescriptorX.SelectedIndex; int DescY = this.comboBoxDescriptorY.SelectedIndex; int DescZ = this.comboBoxDescriptorZ.SelectedIndex; if (DescX < 0) DescX = 0; if (DescY < 0) DescY = 0; if (DescZ < 0) DescZ = 0; int[] Pos = new int[2]; Pos[0] = 0; Pos[1] = 0; if (CurrentWorld == null) { CurrentWorld = new c3DWorld(new cPoint3D(1000, 1000, 1000), new cPoint3D(ListScales[DescX], ListScales[DescY], ListScales[DescZ]), this.renderWindowControl1, Pos, CompleteScreening); light = vtkLight.New(); CurrentWorld.SetBackgroundColor(Color.Black); // CurrentWorld.ren1.AddLight(light); //CurrentWorld.ren1.RemoveAllLights(); } CurrentWorld.ren1.RemoveAllViewProps(); // if (widget != null) widget.SetEnabled(0); Series CurrentSeries = new Series("ScatterPoints"); double MinX = double.MaxValue; double MinY = double.MaxValue; double MinZ = double.MaxValue; double MaxZ = double.MinValue; double MaxX = double.MinValue; double MaxY = double.MinValue; double TempX, TempY, TempZ; int Idx = 0; cListPlates ListPlate = new cListPlates(); cMetaBiologicalObjectList ListMeta = new cMetaBiologicalObjectList("Test"); cBiologicalSpot CurrentSpot1 = new cBiologicalSpot(Color.White, new cPoint3D(0, 0, 0), 1, 4); cMetaBiologicalObject Plate3D = new cMetaBiologicalObject("Data", ListMeta, CurrentSpot1); if (!IsFullScreen) ListPlate.Add(CompleteScreening.GetCurrentDisplayPlate()); else ListPlate = CompleteScreening.ListPlatesActive; vtkUnsignedCharArray colors = vtkUnsignedCharArray.New(); colors.SetName("colors"); colors.SetNumberOfComponents(3); vtkPoints Allpoints = vtkPoints.New(); cExtendedList ListPtX = new cExtendedList(); cExtendedList ListPtY = new cExtendedList(); cExtendedList ListPtZ = new cExtendedList(); List<bool> ListCheckBoxes = ClassSelectionPanel.GetListSelectedClass(); for (int i = 0; i < ListPlate.Count; i++) { cPlate CurrentPlate = ListPlate[i]; for (int IdxValue = 0; IdxValue < CompleteScreening.Columns; IdxValue++) for (int IdxValue0 = 0; IdxValue0 < CompleteScreening.Rows; IdxValue0++) { cWell TmpWell = CurrentPlate.GetWell(IdxValue, IdxValue0, true); if ((TmpWell != null) && (ListCheckBoxes[TmpWell.GetCurrentClassIdx()])) { TempX = TmpWell.ListSignatures[DescX].GetValue(); if (TempX < MinX) MinX = TempX; if (TempX > MaxX) MaxX = TempX; TempY = TmpWell.ListSignatures[DescY].GetValue(); if (TempY < MinY) MinY = TempY; if (TempY > MaxY) MaxY = TempY; TempZ = TmpWell.ListSignatures[DescZ].GetValue(); if (TempZ < MinZ) MinZ = TempZ; if (TempZ > MaxZ) MaxZ = TempZ; // cBiologicalSpot CurrentSpot = new cBiologicalSpot(TmpWell.GetColor(), new cPoint3D(TempX, TempY, TempZ), 1, 4); List<char> Col = new List<char>(); Col.Add((char)(TmpWell.GetClassColor().R)); Col.Add((char)(TmpWell.GetClassColor().G)); Col.Add((char)(TmpWell.GetClassColor().B)); // IntPtr unmanagedPointer = Marshal.UnsafeAddrOfPinnedArrayElement(Col.ToArray(), 0); //colors.InsertNextTupleValue(unmanagedPointer); colors.InsertNextTuple3(Col[0], Col[1], Col[2]); ListPtX.Add(TempX); ListPtY.Add(TempY); ListPtZ.Add(TempZ); // CurrentSpot.Name = TmpWell.AssociatedPlate.Name + " - " + TmpWell.GetPosX() + "x" + TmpWell.GetPosY() + " :" + TmpWell.Name; // CurrentSpot.ObjectType = TmpWell.AssociatedPlate.Name + " - " + TmpWell.GetPosX() + "x" + TmpWell.GetPosY() + " :" + TmpWell.Name; // Plate3D.AddObject(CurrentSpot); // CurrentWorld.AddBiological3DObject(CurrentSpot); //CurrentSeries.Points.Add(TempX, TempY); // if (IsFullScreen) // CurrentSeries.Points[Idx].ToolTip = TmpWell.AssociatedPlate.Name + "\n" + TmpWell.GetPosX() + "x" + TmpWell.GetPosY() + " :" + TmpWell.Name; // else // CurrentSeries.Points[Idx].ToolTip = TmpWell.GetPosX() + "x" + TmpWell.GetPosY() + " :" + TmpWell.Name; Idx++; } } } double MinValueX = ListPtX.Min(); double MaxValueX = ListPtX.Max(); cExtendedList NormX = ListPtX.Normalize(eNormalizationType.MIN_MAX); if (NormX == null) return; double MinValueY = ListPtY.Min(); double MaxValueY = ListPtY.Max(); cExtendedList NormY = ListPtY.Normalize(eNormalizationType.MIN_MAX); if (NormY == null) return; double MinValueZ = ListPtZ.Min(); double MaxValueZ = ListPtZ.Max(); cExtendedList NormZ = ListPtZ.Normalize(eNormalizationType.MIN_MAX); if (NormZ == null) return; for (int IdxPt = 0; IdxPt < ListPtX.Count; IdxPt++) Allpoints.InsertNextPoint(NormX[IdxPt], NormY[IdxPt], NormZ[IdxPt]); vtkPolyData polydata = vtkPolyData.New(); polydata.SetPoints(Allpoints); polydata.GetPointData().SetScalars(colors); // vtkSphereSource SphereSource = vtkSphereSource.New(); SphereSource.SetRadius(RadiusSphere); //SphereSource vtkGlyph3D glyph3D = vtkGlyph3D.New(); glyph3D.SetColorModeToColorByScalar(); glyph3D.SetSourceConnection(SphereSource.GetOutputPort()); glyph3D.SetInput(polydata); glyph3D.ScalingOff(); glyph3D.Update(); vtkPolyDataMapper mapper = vtkPolyDataMapper.New(); mapper.SetInputConnection(glyph3D.GetOutputPort()); actorSpheres = vtkActor.New(); actorSpheres.SetMapper(mapper); actorSpheres.GetProperty().SetOpacity(this.SphereOpacity); CurrentWorld.ren1.AddActor(actorSpheres); if (this.IsLightAutomated) { CurrentWorld.ren1.RemoveAllLights(); CurrentWorld.ren1.AutomaticLightCreationOn(); // this.light.SetIntensity(0); } else { CurrentWorld.ren1.RemoveAllLights(); CurrentWorld.ren1.AddLight(light); this.light.SetIntensity(this.LightIntensity); CurrentWorld.ren1.AutomaticLightCreationOff(); actorSpheres.GetProperty().SetInterpolationToPhong(); actorSpheres.GetProperty().SetAmbient(this.LightAmbient); actorSpheres.GetProperty().SetDiffuse(this.LightDiffuse); actorSpheres.GetProperty().SetSpecular(this.LightSpecular); light.SetFocalPoint(0.5, 0.5, 1); light.SetPosition(0.5, 0.5, -1); light.SetDiffuseColor(1, 1, 1); if (this.IsDisplayLightSource) { light.SetPositional(1); vtkLightActor lightActor = vtkLightActor.New(); lightActor.SetLight(light); CurrentWorld.ren1.AddViewProp(lightActor); } } #region Connect For DRC if ((CompleteScreening.GetCurrentDisplayPlate().ListDRCRegions != null) && (cGlobalInfo.OptionsWindow.checkBoxConnectDRCPts.Checked)) { foreach (cDRC_Region TmpRegion in CompleteScreening.GetCurrentDisplayPlate().ListDRCRegions) { int cpt = 0; cWell[][] ListWells = TmpRegion.GetListWells(); foreach (cWell[] item in ListWells) { for (int IdxWell = 0; IdxWell < item.Length - 1; IdxWell++) { //cWell TmpWell0 = CompleteScreening.GetCurrentDisplayPlate().GetWell(item[IdxWell], IdxValue0, true); if ((item[IdxWell] != null) && (item[IdxWell + 1] != null) && (item[IdxWell].GetCurrentClassIdx() >= -1)) { double StartX = (item[IdxWell].ListSignatures[DescX].GetValue() - MinValueX) / (MaxValueX - MinValueX); double StartY = (item[IdxWell].ListSignatures[DescY].GetValue() - MinValueY) / (MaxValueY - MinValueY); double StartZ = (item[IdxWell].ListSignatures[DescZ].GetValue() - MinValueZ) / (MaxValueZ - MinValueZ); double EndX = (item[IdxWell + 1].ListSignatures[DescX].GetValue() - MinValueX) / (MaxValueX - MinValueX); double EndY = (item[IdxWell + 1].ListSignatures[DescY].GetValue() - MinValueY) / (MaxValueY - MinValueY); double EndZ = (item[IdxWell + 1].ListSignatures[DescZ].GetValue() - MinValueZ) / (MaxValueZ - MinValueZ); cPoint3D StartPt = new cPoint3D(StartX, StartY, StartZ); cPoint3D EndPt = new cPoint3D(EndX, EndY, EndZ); c3DLine NewLine = new c3DLine(StartPt, EndPt); CurrentWorld.AddGeometric3DObject(NewLine); } } } /*List<cDRC> ListDRC = new List<cDRC>(); for (int i = 0; i < CompleteScreening.ListDescriptors.Count; i++) { if (CompleteScreening.ListDescriptors[i].IsActive()) { cDRC CurrentDRC = new cDRC(TmpRegion, CompleteScreening.ListDescriptors[i]); ListDRC.Add(CurrentDRC); cpt++; } } */ //cDRCDisplay DRCDisplay = new cDRCDisplay(ListDRC, GlobalInfo); //if (DRCDisplay.CurrentChart.Series.Count == 0) continue; //DRCDisplay.CurrentChart.Location = new Point((DRCDisplay.CurrentChart.Width + 50) * 0, (DRCDisplay.CurrentChart.Height + 10 + DRCDisplay.CurrentRichTextBox.Height) * h++); //DRCDisplay.CurrentRichTextBox.Location = new Point(DRCDisplay.CurrentChart.Location.X, DRCDisplay.CurrentChart.Location.Y + DRCDisplay.CurrentChart.Height + 5); //WindowforDRCsDisplay.LChart.Add(DRCDisplay.CurrentChart); //WindowforDRCsDisplay.LRichTextBox.Add(DRCDisplay.CurrentRichTextBox); } } #endregion #region Build axis // vtkAxesActor axis = vtkAxesActor.New(); vtkAxisActor axisX = vtkAxisActor.New(); axisX.SetPoint1(0, 0, 0); axisX.SetPoint2(1, 0, 0); axisX.SetTickLocationToBoth(); axisX.SetDeltaMajor(0.1); axisX.SetMajorTickSize(0); axisX.MinorTicksVisibleOff(); //axisX.Maj CurrentWorld.ren1.AddActor(axisX); vtkAxisActor axisY = vtkAxisActor.New(); axisY.SetPoint1(0, 0, 0); axisY.SetPoint2(0, 1, 0); axisY.SetTickLocationToBoth(); axisY.SetDeltaMajor(0.1); axisY.SetMajorTickSize(0.05); axisY.MinorTicksVisibleOff(); CurrentWorld.ren1.AddActor(axisY); vtkAxisActor axisZ = vtkAxisActor.New(); axisZ.SetPoint1(0, 0, 0); axisZ.SetPoint2(0, 0, 1); axisZ.SetTickLocationToBoth(); axisZ.SetDeltaMajor(0.1); axisZ.SetMajorTickSize(0.05); axisZ.MinorTicksVisibleOff(); CurrentWorld.ren1.AddActor(axisZ); if (widget == null) { widget = vtkOrientationMarkerWidget.New(); axes = vtkAxesActor.New(); widget.SetOutlineColor(0.9300, 0.5700, 0.1300); widget.SetInteractor(CurrentWorld.iren); widget.SetViewport(0.0, 0.0, 0.4, 0.4); widget.SetEnabled(0); // widget.InteractiveOn(); if (this.comboBoxDescriptorX.SelectedItem == null) axes.SetXAxisLabelText(this.comboBoxDescriptorX.Items[0].ToString()); else axes.SetXAxisLabelText(this.comboBoxDescriptorX.SelectedItem.ToString()); if (this.comboBoxDescriptorY.SelectedItem == null) axes.SetYAxisLabelText(this.comboBoxDescriptorY.Items[0].ToString()); else axes.SetYAxisLabelText(this.comboBoxDescriptorY.SelectedItem.ToString()); if (this.comboBoxDescriptorZ.SelectedItem == null) axes.SetZAxisLabelText(this.comboBoxDescriptorZ.Items[0].ToString()); else axes.SetZAxisLabelText(this.comboBoxDescriptorZ.SelectedItem.ToString()); widget.SetOrientationMarker(axes); } else { if (this.comboBoxDescriptorX.SelectedItem != null) axes.SetXAxisLabelText(this.comboBoxDescriptorX.SelectedItem.ToString()); if (this.comboBoxDescriptorY.SelectedItem != null) axes.SetYAxisLabelText(this.comboBoxDescriptorY.SelectedItem.ToString()); if (this.comboBoxDescriptorZ.SelectedItem != null) axes.SetZAxisLabelText(this.comboBoxDescriptorZ.SelectedItem.ToString()); widget.SetOrientationMarker(axes); } if ((this.checkBoxForDisplayAxesInformation.Checked) && (ListPtX.Count > 0)) { double CurrentFontSize = this.FontSize / 400.0;// 0.02; c3DText MaxAxeX = new c3DText(CurrentWorld, MaxValueX.ToString("N2"), new cPoint3D(1, 0, 0), Color.White, CurrentFontSize); CurrentWorld.AddGeometric3DObject(MaxAxeX); c3DText MaxAxeY = new c3DText(CurrentWorld, MaxValueY.ToString("N2"), new cPoint3D(0, 1, 0), Color.White, CurrentFontSize); CurrentWorld.AddGeometric3DObject(MaxAxeY); c3DText MaxAxeZ = new c3DText(CurrentWorld, MaxValueZ.ToString("N2"), new cPoint3D(0, 0, 1), Color.White, CurrentFontSize); CurrentWorld.AddGeometric3DObject(MaxAxeZ); c3DText MinAxeX = new c3DText(CurrentWorld, MinValueX.ToString("N2"), new cPoint3D(0, -0.1, -0.1), Color.White, CurrentFontSize); CurrentWorld.AddGeometric3DObject(MinAxeX); c3DText MinAxeY = new c3DText(CurrentWorld, MinValueY.ToString("N2"), new cPoint3D(-0.1, -0.1, 0), Color.White, CurrentFontSize); CurrentWorld.AddGeometric3DObject(MinAxeY); c3DText MinAxeZ = new c3DText(CurrentWorld, MinValueZ.ToString("N2"), new cPoint3D(-0.1, 0, -0.1), Color.White, CurrentFontSize); CurrentWorld.AddGeometric3DObject(MinAxeZ); } #endregion //vtkCameraWidget Wid = vtkCameraWidget.New(); //Wid.SetInteractor(CurrentWorld.iren); //Wid.SetEnabled(1); // Wid.InteractiveOn(); //vtkDistanceWidget distanceWidget = vtkDistanceWidget.New(); //distanceWidget.SetInteractor(CurrentWorld.iren); //distanceWidget.SetEnabled(1); //distanceWidget.CreateDefaultRepresentation(); //((vtkDistanceRepresentation)distanceWidget.GetRepresentation()).SetLabelFormat("%-#6.3g mm"); /*static_cast<vtkDistanceRepresentation*>(distanceWidget->GetRepresentation()) ->SetLabelFormat("%-#6.3g mm"); */ // Plate3D.GenerateAndDisplayBoundingBox(1, Color.White, false, CurrentWorld); //c3DText CaptionX = new c3DText(CurrentWorld, CompleteScreening.ListDescriptors[DescX].GetName(), new cPoint3D(MaxX, MinY, MinZ), Color.DarkRed, this.FontSize); //c3DLine LineX = new c3DLine(new cPoint3D(MinX, MinY, MinZ), new cPoint3D(MaxX, MinY, MinZ), Color.DarkRed); //CurrentWorld.AddGeometric3DObject(LineX); //c3DText CaptionY = new c3DText(CurrentWorld, CompleteScreening.ListDescriptors[DescY].GetName(), new cPoint3D(MinX, MaxY, MinZ), Color.DarkGreen, this.FontSize); //c3DLine LineY = new c3DLine(new cPoint3D(MinX, MinY, MinZ), new cPoint3D(MinX, MaxY, MinZ), Color.DarkGreen); //CurrentWorld.AddGeometric3DObject(LineY); //c3DText CaptionZ = new c3DText(CurrentWorld, CompleteScreening.ListDescriptors[DescZ].GetName(), new cPoint3D(MinX, MinY, MaxZ), Color.DarkBlue, this.FontSize); //c3DLine LineZ = new c3DLine(new cPoint3D(MinX, MinY, MinZ), new cPoint3D(MinX, MinY, MaxZ), Color.DarkBlue); //CurrentWorld.AddGeometric3DObject(LineZ); #region Update ComboBoxes if (comboBoxDescriptorX.Text == "") ToolTipForX.SetToolTip(comboBoxDescriptorX, comboBoxDescriptorX.Items[0].ToString()); else ToolTipForX.SetToolTip(comboBoxDescriptorX, comboBoxDescriptorX.Text); if (comboBoxDescriptorY.Text == "") ToolTipForY.SetToolTip(comboBoxDescriptorY, comboBoxDescriptorY.Items[0].ToString()); else ToolTipForY.SetToolTip(comboBoxDescriptorY, comboBoxDescriptorY.Text); if (comboBoxDescriptorZ.Text == "") ToolTipForZ.SetToolTip(comboBoxDescriptorZ, comboBoxDescriptorZ.Items[0].ToString()); else ToolTipForZ.SetToolTip(comboBoxDescriptorZ, comboBoxDescriptorZ.Text); #endregion CurrentWorld.SimpleRender();// Render(); }
private void DrawTest() { vtkProp3D prop3D; vtkActor actor = vtkActor.New(); vtkActor2D actor2D = vtkActor2D.New(); vtkLODActor lODActor = vtkLODActor.New(); vtkLODProp3D lodProp3d = vtkLODProp3D.New(); vtkCamera camera = vtkCamera.New(); vtkCameraActor cameraActor = vtkCameraActor.New(); vtkLight light = vtkLight.New(); vtkLightActor lightActor = vtkLightActor.New(); vtkPicker picker = vtkPicker.New(); vtkPointPicker pointPicker = vtkPointPicker.New(); vtkCellPicker cellPicker = vtkCellPicker.New(); vtkAreaPicker areaPicker = vtkAreaPicker.New(); vtkAssembly assembly = vtkAssembly.New(); vtkConeSource coneSource = vtkConeSource.New(); vtkCone cone = vtkCone.New(); vtkArcSource arcSource = vtkArcSource.New(); vtkLineSource lineSource = vtkLineSource.New(); vtkPointSource pointSource = vtkPointSource.New(); vtkPolyData polyData = vtkPolyData.New(); vtkArrayReader arrayReader = vtkArrayReader.New(); vtkArrayDataReader arrayDataReader = vtkArrayDataReader.New(); vtkArrayWriter arrayWriter = vtkArrayWriter.New(); vtkRenderWindowInteractor renderWindowInteractor = vtkRenderWindowInteractor.New(); vtkRenderWindowInteractor3D renderWindowInteractor3D = vtkRenderWindowInteractor3D.New(); vtkInteractorStyle interactorStyle = vtkInteractorStyle.New(); vtkInteractorStyle3D interactorStyle3D = vtkInteractorStyle3D.New(); vtkInteractorStyleFlight interactorStyleFlight = vtkInteractorStyleFlight.New(); vtkInteractorStyleTrackball interactorStyleTrackball = vtkInteractorStyleTrackball.New(); vtkVolume volume = vtkVolume.New(); vtkVolumeMapper volumeMapper; vtkSmartVolumeMapper smartVolumeMapper = vtkSmartVolumeMapper.New(); vtkUnstructuredGridVolumeMapper unstructuredGridVolumeMapper; vtkUnstructuredGridVolumeRayCastMapper unstructuredGridVolumeRayCastMapper = vtkUnstructuredGridVolumeRayCastMapper.New(); vtkGPUVolumeRayCastMapper gPUVolumeRayCastMapper = vtkGPUVolumeRayCastMapper.New(); vtkVolumeRayCastMapper volumeRayCastMapper = vtkVolumeRayCastMapper.New(); vtkFixedPointVolumeRayCastMapper pointVolumeRayCastMapper = vtkFixedPointVolumeRayCastMapper.New(); vtkOpenGLGPUVolumeRayCastMapper openGLGPUVolumeRayCastMapper = vtkOpenGLGPUVolumeRayCastMapper.New(); vtkVolumeProperty volumeProperty = vtkVolumeProperty.New(); vtkTexture texture = vtkTexture.New(); vtkCoordinate coordinate = vtkCoordinate.New(); vtkImageData vtkImage = vtkImageData.New(); vtkBMPReader bMPReader = vtkBMPReader.New(); vtkJPEGReader jPEGReader = vtkJPEGReader.New(); vtkPNGReader pNGReader = vtkPNGReader.New(); vtkTIFFReader tIFFReader = vtkTIFFReader.New(); vtkOBJReader oBJReader = vtkOBJReader.New(); vtkContourFilter contourFilter = vtkContourFilter.New(); vtkSynchronizedTemplates2D synchronizedTemplates2D = vtkSynchronizedTemplates2D.New(); vtkSynchronizedTemplates3D synchronizedTemplates3D = vtkSynchronizedTemplates3D.New(); vtkSynchronizedTemplatesCutter3D synchronizedTemplatesCutter3D = vtkSynchronizedTemplatesCutter3D.New(); vtkImageMapper imageMapper = vtkImageMapper.New(); vtkImageSliceMapper imageSliceMapper = vtkImageSliceMapper.New(); vtkImageResliceMapper imageResliceMapper = vtkImageResliceMapper.New(); vtkStructuredGridReader structuredGridReader = vtkStructuredGridReader.New(); vtkRungeKutta4 integ = vtkRungeKutta4.New(); vtkStreamTracer streamer = vtkStreamTracer.New(); vtkTubeFilter streamTube = vtkTubeFilter.New(); vtkRuledSurfaceFilter ruledSurfaceFilter = vtkRuledSurfaceFilter.New(); vtkPlane plane = vtkPlane.New(); vtkCutter cutter = new vtkCutter(); vtkMergeFilter mergeFilter = vtkMergeFilter.New(); vtkImageLuminance imageLuminance = vtkImageLuminance.New(); vtkImageDataGeometryFilter imageDataGeometryFilter = vtkImageDataGeometryFilter.New(); vtkWarpScalar warpScalar = vtkWarpScalar.New(); vtkWarpVector warpVector = vtkWarpVector.New(); }