private List <double> readUnknownTuplesizeNameSpecificCellDataArray(vtkUnstructuredGrid unstructuredGrid, string arrayName)
        {
            VTKgetNameSpecificVTKDataArray vtkSpecificDataArray = new VTKgetNameSpecificVTKDataArray();
            var cellDataArray = vtkSpecificDataArray.getNameSpecificDataArrayCellData(unstructuredGrid, arrayName);
            var dataArray     = new List <double>();
            var numbComp      = cellDataArray.GetNumberOfComponents();

            for (int j = 0; j < cellDataArray.GetNumberOfTuples(); j++)
            {
                double[] managedArray = new double[numbComp];
                IntPtr   pointerArray = Marshal.AllocCoTaskMem(sizeof(double) * managedArray.Length);
                cellDataArray.GetTuple(j, pointerArray);
                Marshal.Copy(pointerArray, managedArray, 0, numbComp);
                //Did not work to use vktFloatArray, instead can use this:
                //for (int k = 0; k<numbComp; k++)
                //		cellDataArray.GetComponent(j, k);

                dataArray.AddRange(managedArray);

                if (arrayName == "AllForcesBeam")                 //Modelo 6 iterates from 0-5 in all cell_vertexes to find the max and min forces (X,Y,Z,Mx,My,Mz)
                {
                    calculateExtremeForces(managedArray, 6, CalculateMinForcesBeam, CalculateMaxForcesBeam);
                }

                if (arrayName == "AllForcesShell")                 //Modelo 8 iterates from 0-7 in all cell_vertexes to find the max and min value (Nx,Ny,Nz,Mx,My,Mz,Vzx,Vzy)
                {
                    calculateExtremeForces(managedArray, 8, CalculateMinForcesShell, CalculateMaxForcesShell);
                }
            }
            return(dataArray);
        }
Example #2
0
        static public void DrawMesh(CMshBasicMesherDouble aMesher, vtkUnstructuredGrid anUnstructuredGrid)
        {
            vtkPoints sPoints = vtkPoints.New();

            for (int i = 0; i < aMesher.mesh().nbNodes(); ++i)
            {
                int aNodeId = aMesher.mesh().nodeId(i);

                var aNode = aMesher.mesh().node(aNodeId);

                sPoints.InsertNextPoint(aNode.x(), aNode.y(), aNode.z());
            }

            anUnstructuredGrid.SetPoints(sPoints);

            for (int i = 0; i < aMesher.mesh().nbElements(); ++i)
            {
                int anElementId = aMesher.mesh().elementId(i);

                var anElement = aMesher.mesh().element(anElementId);

                if (anElement.elementType() == EElementType.ET_TETRAHEDRON)
                {
                    var aTetrahedron = vtkTetra.New();
                    aTetrahedron.GetPointIds().SetId(0, aMesher.mesh().nodeIndex(anElement.nodeId(0)));
                    aTetrahedron.GetPointIds().SetId(1, aMesher.mesh().nodeIndex(anElement.nodeId(1)));
                    aTetrahedron.GetPointIds().SetId(2, aMesher.mesh().nodeIndex(anElement.nodeId(2)));
                    aTetrahedron.GetPointIds().SetId(3, aMesher.mesh().nodeIndex(anElement.nodeId(3)));

                    anUnstructuredGrid.InsertNextCell(aTetrahedron.GetCellType(), aTetrahedron.GetPointIds());
                }
            }
        }
Example #3
0
        private double[,] readTuple3NameSpecificPointDataArray(vtkUnstructuredGrid unstructuredGrid, string dataArrayName, bool readExtremeForces)
        {
            double[,] dataArray = new double[, ] {
            };
            var pointData = unstructuredGrid.GetPointData();

            ExtremeDisplacement = new double[3];
            for (int i = 0; i < pointData.GetNumberOfArrays(); i++)
            {
                if (pointData.GetArrayName(i) != dataArrayName)
                {
                    continue;
                }

                dataArray = new double[pointData.GetArray(i).GetNumberOfTuples(), 3];
                for (int j = 0; j < pointData.GetArray(i).GetNumberOfTuples(); j++)
                {
                    var tuple = pointData.GetArray(i).GetTuple3(j);
                    dataArray[j, 0] = tuple[0]; dataArray[j, 1] = tuple[1]; dataArray[j, 2] = tuple[2];
                    if (!readExtremeForces)
                    {
                        continue;
                    }

                    for (int k = 0; k < 3; k++)
                    {
                        if (tuple[k] > ExtremeDisplacement[k])
                        {
                            ExtremeDisplacement[k] = tuple[k];
                        }
                    }
                }
            }
            return(dataArray);
        }
Example #4
0
 //保存当前cell的id
 // static int m_totalCell = 0;
 public GridActor()
 {
     m_gridData = new vtkUnstructuredGrid();
     m_points   = new vtkPoints();
     m_cells    = new vtkCellArray();
     //  m_totalCell = 0;
 }
Example #5
0
        private void DrawMesh(CMshTriangleMesherDouble aMesher, vtkUnstructuredGrid anUnstructuredGrid)
        {
            vtkPoints points = vtkPoints.New();

            for (int i = 0; i < aMesher.mesh().nbNodes(); ++i)
            {
                int aNodeId = aMesher.mesh().nodeId(i);

                var aNode = aMesher.mesh().node(aNodeId);

                points.InsertNextPoint(aNode.x(), aNode.y(), aNode.z());
            }

            anUnstructuredGrid.SetPoints(points);

            for (int i = 0; i < aMesher.mesh().nbElements(); ++i)
            {
                int anElementId = aMesher.mesh().elementId(i);

                var anElement = aMesher.mesh().element(anElementId);

                if (anElement.elementType() == EElementType.ET_TRIANGLE)
                {
                    var aTriangle = vtkTriangle.New();
                    aTriangle.GetPointIds().SetId(0, aMesher.mesh().nodeIndex(anElement.nodeId(0)));
                    aTriangle.GetPointIds().SetId(1, aMesher.mesh().nodeIndex(anElement.nodeId(1)));
                    aTriangle.GetPointIds().SetId(2, aMesher.mesh().nodeIndex(anElement.nodeId(2)));

                    anUnstructuredGrid.InsertNextCell(aTriangle.GetCellType(), aTriangle.GetPointIds());
                }
            }
        }
        public List <VTKCell> readCells(vtkUnstructuredGrid unstructuredGrid)
        {
            var cellList = new List <VTKCell>();

            for (int i = 0; i < unstructuredGrid.GetNumberOfCells(); i++)
            {
                var cell     = unstructuredGrid.GetCell(i);
                var cellType = cell.GetCellType();
                if (cellType != 1 && cellType != 3 && cellType != 5)
                {
                    throw new Exception(String.Format("Focus Konstruksjon does not support this type of cell: {0}", cellType));
                }
                foreach (var cellDefinition in Enum.GetValues(typeof(cellDefinitions)))
                {
                    if (cell.GetType().Name == cellDefinition.ToString() && cell.GetNumberOfPoints() != (int)cellDefinition)
                    {
                        throw new Exception(String.Format("Imported vtkCell of cell type {0} expected number of points to be {1}, but number of points were {2}", cell.GetType().Name, (int)cellDefinition, cell.GetNumberOfPoints()));
                    }
                }

                var cellPointIds = cell.GetPointIds();
                var vtkPointsIds = new List <int>();
                for (int j = 0; j < cellPointIds.GetNumberOfIds(); j++)
                {
                    vtkPointsIds.Add((int)cellPointIds.GetId(j));
                }

                cellList.Add(new VTKCell(cellType, vtkPointsIds));
            }
            return(cellList);
        }
Example #7
0
        private List <double> readUnknownTuplesizeNameSpecificCellDataArray(vtkUnstructuredGrid unstructuredGrid, string arrayName)
        {
            var dataArray = new List <double>();
            var cellData  = unstructuredGrid.GetCellData();

            for (int i = 0; i < cellData.GetNumberOfArrays(); i++)
            {
                if (cellData.GetArrayName(i) != arrayName)
                {
                    continue;
                }

                var numbComp = cellData.GetArray(i).GetNumberOfComponents();
                for (int j = 0; j < cellData.GetArray(i).GetNumberOfTuples(); j++)
                {
                    var      tempTuple    = cellData.GetArray(i).GetTuple(j);
                    double[] managedArray = new double[numbComp];
                    Marshal.Copy(tempTuple, managedArray, 0, numbComp);
                    dataArray.AddRange(managedArray);

                    if (arrayName == "AllForcesBeam")                     //Modelo 6 iterates from 0-5 in all cell_vertexes to find the max and min forces (X,Y,Z,Mx,My,Mz)
                    {
                        calculateExtremeForces(managedArray, 6, CalculateMinForcesBeam, CalculateMaxForcesBeam);
                    }

                    if (arrayName == "AllForcesShell")                     //Modelo 8 iterates from 0-7 in all cell_vertexes to find the max and min value (Nx,Ny,Nz,Mx,My,Mz,Vzx,Vzy)
                    {
                        calculateExtremeForces(managedArray, 8, CalculateMinForcesShell, CalculateMaxForcesShell);
                    }
                }
            }
            return(dataArray);
        }
Example #8
0
        public void init()
        {
            var       path   = Path.Combine(Directory.GetCurrentDirectory(), "VTUInputTest.vtu");
            VTKreader reader = new VTKreader(@path);

            unstructuredGrid = reader.readFile();

            cellDataReader = new VTKCellDataReader();
        }
Example #9
0
        private void Hexahedron()
        {
            // Setup the coordinates of eight points
            // (faces must be in counter clockwise order as viewed from the outside)
            double[,] p = new double[, ] {
                { 0.0, 0.0, 0.0 },
                { 1.0, 0.0, 0.0 },
                { 1.0, 1.0, 0.0 },
                { 0.0, 1.0, 0.0 },
                { 0.0, 0.0, 1.0 },
                { 1.0, 0.0, 1.0 },
                { 1.0, 1.0, 1.0 },
                { 0.0, 1.0, 1.0 }
            };

            // Create the points
            vtkPoints points = vtkPoints.New();

            for (int i = 0; i < 8; i++)
            {
                points.InsertNextPoint(p[i, 0], p[i, 1], p[i, 2]);
            }

            // Create a hexahedron from the points
            vtkHexahedron hex = vtkHexahedron.New();

            for (int i = 0; i < 8; i++)
            {
                hex.GetPointIds().SetId(i, i);
            }

            // Add the hexahedron to a cell array
            vtkCellArray hexs = vtkCellArray.New();

            hexs.InsertNextCell(hex);

            // Add the points and hexahedron to an unstructured grid
            vtkUnstructuredGrid uGrid = vtkUnstructuredGrid.New();

            uGrid.SetPoints(points);
            uGrid.InsertNextCell(hex.GetCellType(), hex.GetPointIds());

            // Visualize
            vtkDataSetMapper mapper = vtkDataSetMapper.New();

            mapper.SetInput(uGrid);
            vtkActor actor = vtkActor.New();

            actor.SetMapper(mapper);
            actor.GetProperty().SetLineWidth(4);
            vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow;
            vtkRenderer     renderer     = renderWindow.GetRenderers().GetFirstRenderer();

            renderer.SetBackground(0.2, 0.3, 0.4);
            renderer.AddActor(actor);
            renderer.ResetCamera();
        }
Example #10
0
        public void init()
        {
            var       path   = Path.Combine(Directory.GetCurrentDirectory(), "VTUInputTest.vtu");
            VTKreader reader = new VTKreader(@path);

            unstructuredGrid = reader.readFile();
            correctIDMapping = new VTKCorrectIDMapping(unstructuredGrid);
            elID             = new int[20];
            for (int i = 0; i < 20; i++)
            {
                elID[i] = i;
            }
        }
        private double[,] readUnknownTuplesizeNameSpecificFieldDataArray(vtkUnstructuredGrid unstructuredGrid, string arrayName, bool hasCorrectIDMapping, int[] correctedElID)
        {
            VTKgetNameSpecificVTKDataArray vtkSpecificDataArray = new VTKgetNameSpecificVTKDataArray();
            var fieldDataArray = vtkSpecificDataArray.getNameSpecificDataArrayFieldData(unstructuredGrid, arrayName);

            if (fieldDataArray == null)
            {
                return(new double[0, 0]);
            }

            var numbComp  = fieldDataArray.GetNumberOfComponents();
            var dataArray = new double[fieldDataArray.GetNumberOfTuples(), numbComp];

            for (int j = 0; j < fieldDataArray.GetNumberOfTuples(); j++)
            {
                double[] managedArray = new double[numbComp];
                IntPtr   pointerArray = Marshal.AllocCoTaskMem(sizeof(double) * managedArray.Length);

                if (!hasCorrectIDMapping)
                {
                    fieldDataArray.GetTuple(correctedElID[j], pointerArray);
                }
                else
                {
                    fieldDataArray.GetTuple(j, pointerArray);
                }

                Marshal.Copy(pointerArray, managedArray, 0, numbComp);
                //Did not work to use vktFloatArray, instead can use this, gives same decimalError:
                //for (int k = 0; k<numbComp; k++)
                //		cellData.GetArray(i).GetComponent(j, k);

                for (int k = 0; k < 12; k++)
                {
                    dataArray[j, k] = managedArray[k];
                }

                if (arrayName == "BeamStressRes") //Modelo 6 iterates from 0-5 in all cell_vertexes to find the max and min forces (X,Y,Z,Mx,My,Mz)
                {
                    calculateExtremeForces(managedArray, 6, CalculateMinForcesBeam, CalculateMaxForcesBeam);
                }

                if (arrayName == "AllForcesShell") //Modelo 8 iterates from 0-7 in all cell_vertexes to find the max and min value (Nx,Ny,Nz,Mx,My,Mz,Vzx,Vzy)
                {
                    calculateExtremeForces(managedArray, 8, CalculateMinForcesShell, CalculateMaxForcesShell);
                }
            }
            return(dataArray);
        }
Example #12
0
        private void Pyramid()
        {
            vtkPoints points = vtkPoints.New();

            double[,] p = new double[, ] {
                { 1.0, 1.0, 1.0 },
                { -1.0, 1.0, 1.0 },
                { -1.0, -1.0, 1.0 },
                { 1.0, -1.0, 1.0 },
                { 0.0, 0.0, 0.0 }
            };

            for (int i = 0; i < 5; i++)
            {
                points.InsertNextPoint(p[i, 0], p[i, 1], p[i, 2]);
            }

            vtkPyramid pyramid = vtkPyramid.New();

            for (int i = 0; i < 5; i++)
            {
                pyramid.GetPointIds().SetId(i, i);
            }

            vtkCellArray cells = vtkCellArray.New();

            cells.InsertNextCell(pyramid);

            vtkUnstructuredGrid ug = vtkUnstructuredGrid.New();

            ug.SetPoints(points);
            ug.InsertNextCell(pyramid.GetCellType(), pyramid.GetPointIds());

            //Create an actor and mapper
            vtkDataSetMapper mapper = vtkDataSetMapper.New();

            mapper.SetInput(ug);
            vtkActor actor = vtkActor.New();

            actor.RotateX(105.0);
            actor.RotateZ(-36.0);
            actor.SetMapper(mapper);
            vtkRenderWindow renderWindow = renderWindowControl1.RenderWindow;
            vtkRenderer     renderer     = renderWindow.GetRenderers().GetFirstRenderer();

            renderer.SetBackground(0.2, 0.3, 0.4);
            renderer.AddActor(actor);
            renderer.ResetCamera();
        }
        public void init()
        {
            RedirectVTKOutput errorObserver = new RedirectVTKOutput();
            var       path   = Path.Combine(Directory.GetCurrentDirectory(), "VTUInputTest.vtu");
            VTKreader reader = new VTKreader(@path);

            unstructuredGrid = reader.readFile();
            fieldDataReader  = new VTKFieldDataReader(unstructuredGrid);
            allForcesBeam    = fieldDataReader.readAllForcesBeam(true, null);
            int[] elIDsBeam = new int[20];
            for (int i = 0; i < 20; i++)
            {
                elIDsBeam[i] = i;
            }
        }
        public void init()
        {
            RedirectVTKOutput errorObserver = new RedirectVTKOutput();
            var       path   = Path.Combine(Directory.GetCurrentDirectory(), "VTUInputTest.vtu");
            VTKreader reader = new VTKreader(@path);

            unstructuredGrid = reader.readFile();
            pointReader      = new VTKPointReader();

            VTKPointDataReader pointDataReader = new VTKPointDataReader(unstructuredGrid);

            translation         = pointDataReader.readTranslation(true, null);
            rotationVector      = pointDataReader.readRotationVectors(true, null);
            extremeDisplacement = pointDataReader.ExtremeDisplacement;
        }
Example #15
0
        public void init()
        {
            var       path   = Path.Combine(Directory.GetCurrentDirectory(), "FocusResults.vtu");
            VTKreader reader = new VTKreader(@path);

            unstructuredGrid = reader.readFile();
            correctIDMapping = new VTKCorrectIDMapping(unstructuredGrid);
            nodeID           = new int[21];
            for (int i = 0; i < 20; i++)
            {
                nodeID[i] = i;
            }

            nodeID[20] = 20;
        }
Example #16
0
        public vtkDataArray getNameSpecificDataArrayCellData(vtkUnstructuredGrid unstructuredGrid, string arrayName)
        {
            vtkDataArray dataArray = null;
            var          cellData  = unstructuredGrid.GetCellData();

            for (int i = 0; i < cellData.GetNumberOfArrays(); i++)
            {
                if (cellData.GetArrayName(i) != arrayName)
                {
                    continue;
                }

                dataArray = cellData.GetArray(i);
            }
            return(dataArray);
        }
Example #17
0
        public void hasCorrectIDMappingFieldDataShoudlWritePropertyWithEigtheenAtSecondPosition()
        {
            var       path   = Path.Combine(Directory.GetCurrentDirectory(), "VTUInputTestWithDifferentelID.vtu");
            VTKreader reader = new VTKreader(@path);

            unstructuredGrid = reader.readFile();
            correctIDMapping = new VTKCorrectIDMapping(unstructuredGrid);
            elID             = new int[20];
            for (int i = 0; i < 20; i++)
            {
                elID[i] = i;
            }

            correctIDMapping.hasCorrectIDMapping("BeamIDs", elID);
            Assert.AreEqual(18, correctIDMapping.BeamIDsNonContiniusAcending[1]);
        }
Example #18
0
        public void hasCorrectIDMappingPointDataShoudlWritePropertyWithEigtheenAtSecondPosition()
        {
            var       path   = Path.Combine(Directory.GetCurrentDirectory(), "FocusResultsDifferentIDs.vtu");
            VTKreader reader = new VTKreader(@path);

            unstructuredGrid = reader.readFile();
            correctIDMapping = new VTKCorrectIDMapping(unstructuredGrid);
            nodeID           = new int[21];
            for (int i = 0; i < 21; i++)
            {
                nodeID[i] = i;
            }

            correctIDMapping.hasCorrectIDMapping("NodeIDs", nodeID);
            Assert.AreEqual(19, correctIDMapping.NodeIDsNonContiniusAcending[1]);
        }
Example #19
0
        public List <Vector3D> pointReader(vtkUnstructuredGrid unstructuredGrid)
        {
            var pointsList = new List <Vector3D>();
            var points     = unstructuredGrid.GetPoints();

            for (int i = 0; i < points.GetNumberOfPoints(); i++)
            {
                if (points.GetPoint(i).Length < 3)
                {
                    throw new Exception(String.Format("Point at position {0} does not contain a 3(xyz)-coordinate point", i));
                }
                var vector = new Vector3D(points.GetPoint(i)[0], points.GetPoint(i)[1], points.GetPoint(i)[2]);
                pointsList.Add(vector);
            }
            return(pointsList);
        }
Example #20
0
        void AddVertex(vtkPoints points, vtkUnstructuredGrid grid)
        {//在每个points的位置上填上一个vertex
         //m_verticesCell = new vtkCellArray();
         //for (int i = 0; i < points.GetNumberOfPoints(); i++)
         //{
         //    vtkVertex vertex = new vtkVertex();

            //    vertex.GetPointIds().SetId(0, i);
            //    grid.InsertNextCell((int)VTKCellType.VTK_VERTEX, vertex.GetPointIds());

            //   // m_cells .InsertNextCell(vertex);
            //}
            vtkVertexGlyphFilter filter = new vtkVertexGlyphFilter();

            this.GetProperty().SetPointSize(5);
        }
Example #21
0
        static public void DrawMesh(CMshTetrahedronMesherDouble aMesher, vtkUnstructuredGrid anUnstructuredGrid, vtkRenderer aRenderer)
        {
            vtkPoints sPoints = vtkPoints.New();

            for (int i = 0; i < aMesher.mesh().nbNodes(); ++i)
            {
                int aNodeId = aMesher.mesh().nodeId(i);

                var aNode = aMesher.mesh().node(aNodeId);

                sPoints.InsertNextPoint(aNode.x(), aNode.y(), aNode.z());
            }

            anUnstructuredGrid.SetPoints(sPoints);

            for (int i = 0; i < aMesher.mesh().nbElements(); ++i)
            {
                int anElementId = aMesher.mesh().elementId(i);

                var anElement = aMesher.mesh().element(anElementId);

                if (anElement.elementType() == EElementType.ET_TETRAHEDRON)
                {
                    var aTetrahedron = vtkTetra.New();
                    aTetrahedron.GetPointIds().SetId(0, aMesher.mesh().nodeIndex(anElement.nodeId(0)));
                    aTetrahedron.GetPointIds().SetId(1, aMesher.mesh().nodeIndex(anElement.nodeId(1)));
                    aTetrahedron.GetPointIds().SetId(2, aMesher.mesh().nodeIndex(anElement.nodeId(2)));
                    aTetrahedron.GetPointIds().SetId(3, aMesher.mesh().nodeIndex(anElement.nodeId(3)));

                    anUnstructuredGrid.InsertNextCell(aTetrahedron.GetCellType(), aTetrahedron.GetPointIds());
                }
            }

            // add actor to the renderer
            var aMeshActor = vtkActor.New();

            aRenderer.AddActor(aMeshActor);

            var aMeshMapper = vtkDataSetMapper.New();

            aMeshMapper.SetInput(anUnstructuredGrid);

            aMeshActor.SetMapper(aMeshMapper);

            aMeshActor.GetProperty().SetRepresentationToWireframe();
        }
Example #22
0
        public static UnstructuredModel FromGrid(vtkUnstructuredGrid output, int numArrays)
        {
            var result = new UnstructuredModel
            {
                _Desc = DimensionDescription.FromPoints(output.GetPoints()),
                _Data = new List <PointData>()
            };

            for (var i = 0; i < numArrays; ++i)
            {
                var pdata = PointData.FromArray((vtkFloatArray)output.GetPointData().GetArray(i));
                pdata.DimensionDescription = result._Desc;
                result._Data.Add(pdata);
            }

            return(result);
        }
Example #23
0
File: Part.cs Project: ovevans/STAN
        /// <summary>
        /// Create new VTK structure of Part:
        /// <br> Points -> Grid -> Mapper -> Actor </br>
        /// </summary>
        public void CreatePart(Dictionary <int, Node> NodeLib, Dictionary <int, Element> ElemLib)
        {
            // Catch nodes - only used by Part
            Nodes = DetectPartNodes(ElemLib);

            // Initialize Elements - to connect vtkCells with Element IDs (and therefore scalar/result value)
            Elements = new List <int>();

            // Initialize VTK data
            Points = vtkPoints.New();
            Grid   = vtkUnstructuredGrid.New();
            Mapper = vtkDataSetMapper.New();
            Actor  = vtkActor.New();
            Edges  = vtkActor.New();
            Faces  = vtkPolyData.New();
            Filter = vtkDataSetSurfaceFilter.New();

            // Insert Points
            foreach (int n in Nodes.Keys)
            {
                Points.InsertNextPoint(NodeLib[n].X, NodeLib[n].Y, NodeLib[n].Z);
            }

            Grid.SetPoints(Points);      // Add points to Grid
            CreateMesh(ElemLib);         // Create Mesh grid

            // Add Grid to Mapper
            Mapper.SetInput(Grid);
            Mapper.SetScalarModeToUseCellData();
            Mapper.ScalarVisibilityOff();
            Mapper.InterpolateScalarsBeforeMappingOn();
            Mapper.Update();

            Actor.SetMapper(Mapper);                        // Add Mapper to Actor
            Actor.GetProperty().SetEdgeVisibility(1);       // Enable wireframe display mode
            Actor.GetProperty().SetLineWidth((float)0.5);   // Set wireframe line thickness
            // Set Actor default color
            ColorID = ID % 13;
            SetColor(ColorID);

            // Outer features
            ExtractFeatures();
        }
Example #24
0
            public void init()
            {
                RedirectVTKOutput errorObserver = new RedirectVTKOutput();
                var       path   = Path.Combine(Directory.GetCurrentDirectory(), "VTUInputTest.vtu");
                VTKreader reader = new VTKreader(@path);

                unstructuredGrid = reader.readFile();

                cellReader = new VTKCellReader();
                vtkCells   = cellReader.readCells(unstructuredGrid);

                VTKCellDataReader cellDataReader = new VTKCellDataReader();

                allForcesBeams  = cellDataReader.readAllForcesBeam(unstructuredGrid);
                allFourcesShell = cellDataReader.readAllForcesShell(unstructuredGrid);
                maxForcesBeam   = cellDataReader.CalculateMaxForcesBeam;
                minForcesBeam   = cellDataReader.CalculateMinForcesBeam;
                maxForceShell   = cellDataReader.CalculateMaxForcesShell;
                minForcesShell  = cellDataReader.CalculateMinForcesShell;
            }
Example #25
0
        public List <double> readFieldData(vtkUnstructuredGrid unstructuredGrid)
        {
            List <double> fieldDataList = new List <double>();
            var           fieldData     = unstructuredGrid.GetFieldData();

            for (int i = 0; i < fieldData.GetNumberOfArrays(); i++)
            {
                if (fieldData.GetArrayName(i) != "ExtremeDisplacement")
                {
                    continue;
                }

                for (int j = 0; j < fieldData.GetArray(i).GetNumberOfTuples(); j++)
                {
                    fieldDataList.AddRange(fieldData.GetArray(i).GetTuple3(j));
                }
            }

            return(fieldDataList);
        }
        public double[][] readTransformation(vtkUnstructuredGrid unstructuredGrid, string arrayName)
        {
            VTKgetNameSpecificVTKDataArray vtkSpecificDataArray = new VTKgetNameSpecificVTKDataArray();

            double[][] TransformationLists = null;
            var        cellDataArray       = vtkSpecificDataArray.getNameSpecificDataArrayCellData(unstructuredGrid, arrayName);
            var        numbComp            = cellDataArray.GetNumberOfComponents();
            var        numbTuples          = cellDataArray.GetNumberOfTuples();

            TransformationLists = new double[numbTuples][];
            for (int j = 0; j < numbTuples; j++)
            {
                double[] managedArray = new double[numbComp];
                IntPtr   pointerArray = Marshal.AllocCoTaskMem(sizeof(double) * managedArray.Length);
                cellDataArray.GetTuple(j, pointerArray);
                Marshal.Copy(pointerArray, managedArray, 0, numbComp);

                TransformationLists[j] = managedArray;
            }
            return(TransformationLists);
        }
        private double[,] readTuple3NameSpecificPointDataArray(vtkUnstructuredGrid unstructuredGrid, string dataArrayName, bool readExtremeForces, bool hasCorrectIDMapping, int[] correctedNodeID)
        {
            VTKgetNameSpecificVTKDataArray vtkSpecificDataArray = new VTKgetNameSpecificVTKDataArray();
            var pointDataArray = vtkSpecificDataArray.getNameSpecificDataArrayPointData(unstructuredGrid, dataArrayName);

            double[,] dataArray = new double[, ] {
            };
            ExtremeDisplacement = new double[3];

            dataArray = new double[pointDataArray.GetNumberOfTuples(), 3];
            for (int j = 0; j < pointDataArray.GetNumberOfTuples(); j++)
            {
                double[] tuple;
                if (!hasCorrectIDMapping)
                {
                    tuple = pointDataArray.GetTuple3(correctedNodeID[j]);
                }
                else
                {
                    tuple = pointDataArray.GetTuple3(j);
                }

                dataArray[j, 0] = tuple[0]; dataArray[j, 1] = tuple[1]; dataArray[j, 2] = tuple[2];
                if (!readExtremeForces)
                {
                    continue;
                }

                for (int k = 0; k < 3; k++)
                {
                    if (Math.Abs(tuple[k]) > Math.Abs(ExtremeDisplacement[k]))
                    {
                        ExtremeDisplacement[k] = tuple[k];
                    }
                }
            }
            return(dataArray);
        }
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVTestCellDerivs(String [] argv)
    {
        //Prefix Content is: ""

          // Demonstrates vtkCellDerivatives for all cell types[]
          //[]
          // get the interactor ui[]
          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // create a scene with one of each cell type[]
          // Voxel[]
          voxelPoints = new vtkPoints();
          voxelPoints.SetNumberOfPoints((int)8);
          voxelPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          voxelPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          voxelPoints.InsertPoint((int)2,(double)0,(double)1,(double)0);
          voxelPoints.InsertPoint((int)3,(double)1,(double)1,(double)0);
          voxelPoints.InsertPoint((int)4,(double)0,(double)0,(double)1);
          voxelPoints.InsertPoint((int)5,(double)1,(double)0,(double)1);
          voxelPoints.InsertPoint((int)6,(double)0,(double)1,(double)1);
          voxelPoints.InsertPoint((int)7,(double)1,(double)1,(double)1);
          aVoxel = new vtkVoxel();
          aVoxel.GetPointIds().SetId((int)0,(int)0);
          aVoxel.GetPointIds().SetId((int)1,(int)1);
          aVoxel.GetPointIds().SetId((int)2,(int)2);
          aVoxel.GetPointIds().SetId((int)3,(int)3);
          aVoxel.GetPointIds().SetId((int)4,(int)4);
          aVoxel.GetPointIds().SetId((int)5,(int)5);
          aVoxel.GetPointIds().SetId((int)6,(int)6);
          aVoxel.GetPointIds().SetId((int)7,(int)7);
          aVoxelGrid = new vtkUnstructuredGrid();
          aVoxelGrid.Allocate((int)1,(int)1);
          aVoxelGrid.InsertNextCell((int)aVoxel.GetCellType(),(vtkIdList)aVoxel.GetPointIds());
          aVoxelGrid.SetPoints((vtkPoints)voxelPoints);
          aVoxelMapper = new vtkDataSetMapper();
          aVoxelMapper.SetInput((vtkDataSet)aVoxelGrid);
          aVoxelActor = new vtkActor();
          aVoxelActor.SetMapper((vtkMapper)aVoxelMapper);
          aVoxelActor.GetProperty().BackfaceCullingOn();
          // Hexahedron[]
          hexahedronPoints = new vtkPoints();
          hexahedronPoints.SetNumberOfPoints((int)8);
          hexahedronPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          hexahedronPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          hexahedronPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          hexahedronPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          hexahedronPoints.InsertPoint((int)4,(double)0,(double)0,(double)1);
          hexahedronPoints.InsertPoint((int)5,(double)1,(double)0,(double)1);
          hexahedronPoints.InsertPoint((int)6,(double)1,(double)1,(double)1);
          hexahedronPoints.InsertPoint((int)7,(double)0,(double)1,(double)1);
          aHexahedron = new vtkHexahedron();
          aHexahedron.GetPointIds().SetId((int)0,(int)0);
          aHexahedron.GetPointIds().SetId((int)1,(int)1);
          aHexahedron.GetPointIds().SetId((int)2,(int)2);
          aHexahedron.GetPointIds().SetId((int)3,(int)3);
          aHexahedron.GetPointIds().SetId((int)4,(int)4);
          aHexahedron.GetPointIds().SetId((int)5,(int)5);
          aHexahedron.GetPointIds().SetId((int)6,(int)6);
          aHexahedron.GetPointIds().SetId((int)7,(int)7);
          aHexahedronGrid = new vtkUnstructuredGrid();
          aHexahedronGrid.Allocate((int)1,(int)1);
          aHexahedronGrid.InsertNextCell((int)aHexahedron.GetCellType(),(vtkIdList)aHexahedron.GetPointIds());
          aHexahedronGrid.SetPoints((vtkPoints)hexahedronPoints);
          aHexahedronMapper = new vtkDataSetMapper();
          aHexahedronMapper.SetInput((vtkDataSet)aHexahedronGrid);
          aHexahedronActor = new vtkActor();
          aHexahedronActor.SetMapper((vtkMapper)aHexahedronMapper);
          aHexahedronActor.AddPosition((double)2,(double)0,(double)0);
          aHexahedronActor.GetProperty().BackfaceCullingOn();
          // Tetra[]
          tetraPoints = new vtkPoints();
          tetraPoints.SetNumberOfPoints((int)4);
          tetraPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          tetraPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          tetraPoints.InsertPoint((int)2,(double)0,(double)1,(double)0);
          tetraPoints.InsertPoint((int)3,(double)1,(double)1,(double)1);
          aTetra = new vtkTetra();
          aTetra.GetPointIds().SetId((int)0,(int)0);
          aTetra.GetPointIds().SetId((int)1,(int)1);
          aTetra.GetPointIds().SetId((int)2,(int)2);
          aTetra.GetPointIds().SetId((int)3,(int)3);
          aTetraGrid = new vtkUnstructuredGrid();
          aTetraGrid.Allocate((int)1,(int)1);
          aTetraGrid.InsertNextCell((int)aTetra.GetCellType(),(vtkIdList)aTetra.GetPointIds());
          aTetraGrid.SetPoints((vtkPoints)tetraPoints);
          aTetraMapper = new vtkDataSetMapper();
          aTetraMapper.SetInput((vtkDataSet)aTetraGrid);
          aTetraActor = new vtkActor();
          aTetraActor.SetMapper((vtkMapper)aTetraMapper);
          aTetraActor.AddPosition((double)4,(double)0,(double)0);
          aTetraActor.GetProperty().BackfaceCullingOn();
          // Wedge[]
          wedgePoints = new vtkPoints();
          wedgePoints.SetNumberOfPoints((int)6);
          wedgePoints.InsertPoint((int)0,(double)0,(double)1,(double)0);
          wedgePoints.InsertPoint((int)1,(double)0,(double)0,(double)0);
          wedgePoints.InsertPoint((int)2,(double)0,(double).5,(double).5);
          wedgePoints.InsertPoint((int)3,(double)1,(double)1,(double)0);
          wedgePoints.InsertPoint((int)4,(double)1,(double)0,(double)0);
          wedgePoints.InsertPoint((int)5,(double)1,(double).5,(double).5);
          aWedge = new vtkWedge();
          aWedge.GetPointIds().SetId((int)0,(int)0);
          aWedge.GetPointIds().SetId((int)1,(int)1);
          aWedge.GetPointIds().SetId((int)2,(int)2);
          aWedge.GetPointIds().SetId((int)3,(int)3);
          aWedge.GetPointIds().SetId((int)4,(int)4);
          aWedge.GetPointIds().SetId((int)5,(int)5);
          aWedgeGrid = new vtkUnstructuredGrid();
          aWedgeGrid.Allocate((int)1,(int)1);
          aWedgeGrid.InsertNextCell((int)aWedge.GetCellType(),(vtkIdList)aWedge.GetPointIds());
          aWedgeGrid.SetPoints((vtkPoints)wedgePoints);
          aWedgeMapper = new vtkDataSetMapper();
          aWedgeMapper.SetInput((vtkDataSet)aWedgeGrid);
          aWedgeActor = new vtkActor();
          aWedgeActor.SetMapper((vtkMapper)aWedgeMapper);
          aWedgeActor.AddPosition((double)6,(double)0,(double)0);
          aWedgeActor.GetProperty().BackfaceCullingOn();
          // Pyramid[]
          pyramidPoints = new vtkPoints();
          pyramidPoints.SetNumberOfPoints((int)5);
          pyramidPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          pyramidPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          pyramidPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          pyramidPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          pyramidPoints.InsertPoint((int)4,(double).5,(double).5,(double)1);
          aPyramid = new vtkPyramid();
          aPyramid.GetPointIds().SetId((int)0,(int)0);
          aPyramid.GetPointIds().SetId((int)1,(int)1);
          aPyramid.GetPointIds().SetId((int)2,(int)2);
          aPyramid.GetPointIds().SetId((int)3,(int)3);
          aPyramid.GetPointIds().SetId((int)4,(int)4);
          aPyramidGrid = new vtkUnstructuredGrid();
          aPyramidGrid.Allocate((int)1,(int)1);
          aPyramidGrid.InsertNextCell((int)aPyramid.GetCellType(),(vtkIdList)aPyramid.GetPointIds());
          aPyramidGrid.SetPoints((vtkPoints)pyramidPoints);
          aPyramidMapper = new vtkDataSetMapper();
          aPyramidMapper.SetInput((vtkDataSet)aPyramidGrid);
          aPyramidActor = new vtkActor();
          aPyramidActor.SetMapper((vtkMapper)aPyramidMapper);
          aPyramidActor.AddPosition((double)8,(double)0,(double)0);
          aPyramidActor.GetProperty().BackfaceCullingOn();
          // Pixel[]
          pixelPoints = new vtkPoints();
          pixelPoints.SetNumberOfPoints((int)4);
          pixelPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          pixelPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          pixelPoints.InsertPoint((int)2,(double)0,(double)1,(double)0);
          pixelPoints.InsertPoint((int)3,(double)1,(double)1,(double)0);
          aPixel = new vtkPixel();
          aPixel.GetPointIds().SetId((int)0,(int)0);
          aPixel.GetPointIds().SetId((int)1,(int)1);
          aPixel.GetPointIds().SetId((int)2,(int)2);
          aPixel.GetPointIds().SetId((int)3,(int)3);
          aPixelGrid = new vtkUnstructuredGrid();
          aPixelGrid.Allocate((int)1,(int)1);
          aPixelGrid.InsertNextCell((int)aPixel.GetCellType(),(vtkIdList)aPixel.GetPointIds());
          aPixelGrid.SetPoints((vtkPoints)pixelPoints);
          aPixelMapper = new vtkDataSetMapper();
          aPixelMapper.SetInput((vtkDataSet)aPixelGrid);
          aPixelActor = new vtkActor();
          aPixelActor.SetMapper((vtkMapper)aPixelMapper);
          aPixelActor.AddPosition((double)0,(double)0,(double)2);
          aPixelActor.GetProperty().BackfaceCullingOn();
          // Quad[]
          quadPoints = new vtkPoints();
          quadPoints.SetNumberOfPoints((int)4);
          quadPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          quadPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          quadPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          quadPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          aQuad = new vtkQuad();
          aQuad.GetPointIds().SetId((int)0,(int)0);
          aQuad.GetPointIds().SetId((int)1,(int)1);
          aQuad.GetPointIds().SetId((int)2,(int)2);
          aQuad.GetPointIds().SetId((int)3,(int)3);
          aQuadGrid = new vtkUnstructuredGrid();
          aQuadGrid.Allocate((int)1,(int)1);
          aQuadGrid.InsertNextCell((int)aQuad.GetCellType(),(vtkIdList)aQuad.GetPointIds());
          aQuadGrid.SetPoints((vtkPoints)quadPoints);
          aQuadMapper = new vtkDataSetMapper();
          aQuadMapper.SetInput((vtkDataSet)aQuadGrid);
          aQuadActor = new vtkActor();
          aQuadActor.SetMapper((vtkMapper)aQuadMapper);
          aQuadActor.AddPosition((double)2,(double)0,(double)2);
          aQuadActor.GetProperty().BackfaceCullingOn();
          // Triangle[]
          trianglePoints = new vtkPoints();
          trianglePoints.SetNumberOfPoints((int)3);
          trianglePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          trianglePoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          trianglePoints.InsertPoint((int)2,(double).5,(double).5,(double)0);
          triangleTCoords = new vtkFloatArray();
          triangleTCoords.SetNumberOfComponents((int)2);
          triangleTCoords.SetNumberOfTuples((int)3);
          triangleTCoords.InsertTuple2((int)0,(double)1,(double)1);
          triangleTCoords.InsertTuple2((int)1,(double)2,(double)2);
          triangleTCoords.InsertTuple2((int)2,(double)3,(double)3);
          aTriangle = new vtkTriangle();
          aTriangle.GetPointIds().SetId((int)0,(int)0);
          aTriangle.GetPointIds().SetId((int)1,(int)1);
          aTriangle.GetPointIds().SetId((int)2,(int)2);
          aTriangleGrid = new vtkUnstructuredGrid();
          aTriangleGrid.Allocate((int)1,(int)1);
          aTriangleGrid.InsertNextCell((int)aTriangle.GetCellType(),(vtkIdList)aTriangle.GetPointIds());
          aTriangleGrid.SetPoints((vtkPoints)trianglePoints);
          aTriangleGrid.GetPointData().SetTCoords((vtkDataArray)triangleTCoords);
          aTriangleMapper = new vtkDataSetMapper();
          aTriangleMapper.SetInput((vtkDataSet)aTriangleGrid);
          aTriangleActor = new vtkActor();
          aTriangleActor.SetMapper((vtkMapper)aTriangleMapper);
          aTriangleActor.AddPosition((double)4,(double)0,(double)2);
          aTriangleActor.GetProperty().BackfaceCullingOn();
          // Polygon[]
          polygonPoints = new vtkPoints();
          polygonPoints.SetNumberOfPoints((int)4);
          polygonPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          polygonPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          polygonPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          polygonPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          aPolygon = new vtkPolygon();
          aPolygon.GetPointIds().SetNumberOfIds((int)4);
          aPolygon.GetPointIds().SetId((int)0,(int)0);
          aPolygon.GetPointIds().SetId((int)1,(int)1);
          aPolygon.GetPointIds().SetId((int)2,(int)2);
          aPolygon.GetPointIds().SetId((int)3,(int)3);
          aPolygonGrid = new vtkUnstructuredGrid();
          aPolygonGrid.Allocate((int)1,(int)1);
          aPolygonGrid.InsertNextCell((int)aPolygon.GetCellType(),(vtkIdList)aPolygon.GetPointIds());
          aPolygonGrid.SetPoints((vtkPoints)polygonPoints);
          aPolygonMapper = new vtkDataSetMapper();
          aPolygonMapper.SetInput((vtkDataSet)aPolygonGrid);
          aPolygonActor = new vtkActor();
          aPolygonActor.SetMapper((vtkMapper)aPolygonMapper);
          aPolygonActor.AddPosition((double)6,(double)0,(double)2);
          aPolygonActor.GetProperty().BackfaceCullingOn();
          // Triangle strip[]
          triangleStripPoints = new vtkPoints();
          triangleStripPoints.SetNumberOfPoints((int)5);
          triangleStripPoints.InsertPoint((int)0,(double)0,(double)1,(double)0);
          triangleStripPoints.InsertPoint((int)1,(double)0,(double)0,(double)0);
          triangleStripPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          triangleStripPoints.InsertPoint((int)3,(double)1,(double)0,(double)0);
          triangleStripPoints.InsertPoint((int)4,(double)2,(double)1,(double)0);
          triangleStripTCoords = new vtkFloatArray();
          triangleStripTCoords.SetNumberOfComponents((int)2);
          triangleStripTCoords.SetNumberOfTuples((int)3);
          triangleStripTCoords.InsertTuple2((int)0,(double)1,(double)1);
          triangleStripTCoords.InsertTuple2((int)1,(double)2,(double)2);
          triangleStripTCoords.InsertTuple2((int)2,(double)3,(double)3);
          triangleStripTCoords.InsertTuple2((int)3,(double)4,(double)4);
          triangleStripTCoords.InsertTuple2((int)4,(double)5,(double)5);
          aTriangleStrip = new vtkTriangleStrip();
          aTriangleStrip.GetPointIds().SetNumberOfIds((int)5);
          aTriangleStrip.GetPointIds().SetId((int)0,(int)0);
          aTriangleStrip.GetPointIds().SetId((int)1,(int)1);
          aTriangleStrip.GetPointIds().SetId((int)2,(int)2);
          aTriangleStrip.GetPointIds().SetId((int)3,(int)3);
          aTriangleStrip.GetPointIds().SetId((int)4,(int)4);
          aTriangleStripGrid = new vtkUnstructuredGrid();
          aTriangleStripGrid.Allocate((int)1,(int)1);
          aTriangleStripGrid.InsertNextCell((int)aTriangleStrip.GetCellType(),(vtkIdList)aTriangleStrip.GetPointIds());
          aTriangleStripGrid.SetPoints((vtkPoints)triangleStripPoints);
          aTriangleStripGrid.GetPointData().SetTCoords((vtkDataArray)triangleStripTCoords);
          aTriangleStripMapper = new vtkDataSetMapper();
          aTriangleStripMapper.SetInput((vtkDataSet)aTriangleStripGrid);
          aTriangleStripActor = new vtkActor();
          aTriangleStripActor.SetMapper((vtkMapper)aTriangleStripMapper);
          aTriangleStripActor.AddPosition((double)8,(double)0,(double)2);
          aTriangleStripActor.GetProperty().BackfaceCullingOn();
          // Line[]
          linePoints = new vtkPoints();
          linePoints.SetNumberOfPoints((int)2);
          linePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          linePoints.InsertPoint((int)1,(double)1,(double)1,(double)0);
          aLine = new vtkLine();
          aLine.GetPointIds().SetId((int)0,(int)0);
          aLine.GetPointIds().SetId((int)1,(int)1);
          aLineGrid = new vtkUnstructuredGrid();
          aLineGrid.Allocate((int)1,(int)1);
          aLineGrid.InsertNextCell((int)aLine.GetCellType(),(vtkIdList)aLine.GetPointIds());
          aLineGrid.SetPoints((vtkPoints)linePoints);
          aLineMapper = new vtkDataSetMapper();
          aLineMapper.SetInput((vtkDataSet)aLineGrid);
          aLineActor = new vtkActor();
          aLineActor.SetMapper((vtkMapper)aLineMapper);
          aLineActor.AddPosition((double)0,(double)0,(double)4);
          aLineActor.GetProperty().BackfaceCullingOn();
          // Polyline[]
          polyLinePoints = new vtkPoints();
          polyLinePoints.SetNumberOfPoints((int)3);
          polyLinePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          polyLinePoints.InsertPoint((int)1,(double)1,(double)1,(double)0);
          polyLinePoints.InsertPoint((int)2,(double)1,(double)0,(double)0);
          aPolyLine = new vtkPolyLine();
          aPolyLine.GetPointIds().SetNumberOfIds((int)3);
          aPolyLine.GetPointIds().SetId((int)0,(int)0);
          aPolyLine.GetPointIds().SetId((int)1,(int)1);
          aPolyLine.GetPointIds().SetId((int)2,(int)2);
          aPolyLineGrid = new vtkUnstructuredGrid();
          aPolyLineGrid.Allocate((int)1,(int)1);
          aPolyLineGrid.InsertNextCell((int)aPolyLine.GetCellType(),(vtkIdList)aPolyLine.GetPointIds());
          aPolyLineGrid.SetPoints((vtkPoints)polyLinePoints);
          aPolyLineMapper = new vtkDataSetMapper();
          aPolyLineMapper.SetInput((vtkDataSet)aPolyLineGrid);
          aPolyLineActor = new vtkActor();
          aPolyLineActor.SetMapper((vtkMapper)aPolyLineMapper);
          aPolyLineActor.AddPosition((double)2,(double)0,(double)4);
          aPolyLineActor.GetProperty().BackfaceCullingOn();
          // Vertex[]
          vertexPoints = new vtkPoints();
          vertexPoints.SetNumberOfPoints((int)1);
          vertexPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          aVertex = new vtkVertex();
          aVertex.GetPointIds().SetId((int)0,(int)0);
          aVertexGrid = new vtkUnstructuredGrid();
          aVertexGrid.Allocate((int)1,(int)1);
          aVertexGrid.InsertNextCell((int)aVertex.GetCellType(),(vtkIdList)aVertex.GetPointIds());
          aVertexGrid.SetPoints((vtkPoints)vertexPoints);
          aVertexMapper = new vtkDataSetMapper();
          aVertexMapper.SetInput((vtkDataSet)aVertexGrid);
          aVertexActor = new vtkActor();
          aVertexActor.SetMapper((vtkMapper)aVertexMapper);
          aVertexActor.AddPosition((double)0,(double)0,(double)6);
          aVertexActor.GetProperty().BackfaceCullingOn();
          // Polyvertex[]
          polyVertexPoints = new vtkPoints();
          polyVertexPoints.SetNumberOfPoints((int)3);
          polyVertexPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          polyVertexPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          polyVertexPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          aPolyVertex = new vtkPolyVertex();
          aPolyVertex.GetPointIds().SetNumberOfIds((int)3);
          aPolyVertex.GetPointIds().SetId((int)0,(int)0);
          aPolyVertex.GetPointIds().SetId((int)1,(int)1);
          aPolyVertex.GetPointIds().SetId((int)2,(int)2);
          aPolyVertexGrid = new vtkUnstructuredGrid();
          aPolyVertexGrid.Allocate((int)1,(int)1);
          aPolyVertexGrid.InsertNextCell((int)aPolyVertex.GetCellType(),(vtkIdList)aPolyVertex.GetPointIds());
          aPolyVertexGrid.SetPoints((vtkPoints)polyVertexPoints);
          aPolyVertexMapper = new vtkDataSetMapper();
          aPolyVertexMapper.SetInput((vtkDataSet)aPolyVertexGrid);
          aPolyVertexActor = new vtkActor();
          aPolyVertexActor.SetMapper((vtkMapper)aPolyVertexMapper);
          aPolyVertexActor.AddPosition((double)2,(double)0,(double)6);
          aPolyVertexActor.GetProperty().BackfaceCullingOn();
          // Pentagonal prism[]
          pentaPoints = new vtkPoints();
          pentaPoints.SetNumberOfPoints((int)10);
          pentaPoints.InsertPoint((int)0,(double)0.25,(double)0.0,(double)0.0);
          pentaPoints.InsertPoint((int)1,(double)0.75,(double)0.0,(double)0.0);
          pentaPoints.InsertPoint((int)2,(double)1.0,(double)0.5,(double)0.0);
          pentaPoints.InsertPoint((int)3,(double)0.5,(double)1.0,(double)0.0);
          pentaPoints.InsertPoint((int)4,(double)0.0,(double)0.5,(double)0.0);
          pentaPoints.InsertPoint((int)5,(double)0.25,(double)0.0,(double)1.0);
          pentaPoints.InsertPoint((int)6,(double)0.75,(double)0.0,(double)1.0);
          pentaPoints.InsertPoint((int)7,(double)1.0,(double)0.5,(double)1.0);
          pentaPoints.InsertPoint((int)8,(double)0.5,(double)1.0,(double)1.0);
          pentaPoints.InsertPoint((int)9,(double)0.0,(double)0.5,(double)1.0);
          aPenta = new vtkPentagonalPrism();
          aPenta.GetPointIds().SetId((int)0,(int)0);
          aPenta.GetPointIds().SetId((int)1,(int)1);
          aPenta.GetPointIds().SetId((int)2,(int)2);
          aPenta.GetPointIds().SetId((int)3,(int)3);
          aPenta.GetPointIds().SetId((int)4,(int)4);
          aPenta.GetPointIds().SetId((int)5,(int)5);
          aPenta.GetPointIds().SetId((int)6,(int)6);
          aPenta.GetPointIds().SetId((int)7,(int)7);
          aPenta.GetPointIds().SetId((int)8,(int)8);
          aPenta.GetPointIds().SetId((int)9,(int)9);
          aPentaGrid = new vtkUnstructuredGrid();
          aPentaGrid.Allocate((int)1,(int)1);
          aPentaGrid.InsertNextCell((int)aPenta.GetCellType(),(vtkIdList)aPenta.GetPointIds());
          aPentaGrid.SetPoints((vtkPoints)pentaPoints);
          aPentaMapper = new vtkDataSetMapper();
          aPentaMapper.SetInput((vtkDataSet)aPentaGrid);
          aPentaActor = new vtkActor();
          aPentaActor.SetMapper((vtkMapper)aPentaMapper);
          aPentaActor.AddPosition((double)10,(double)0,(double)0);
          aPentaActor.GetProperty().BackfaceCullingOn();
          // Hexagonal prism[]
          hexaPoints = new vtkPoints();
          hexaPoints.SetNumberOfPoints((int)12);
          hexaPoints.InsertPoint((int)0,(double)0.0,(double)0.0,(double)0.0);
          hexaPoints.InsertPoint((int)1,(double)0.5,(double)0.0,(double)0.0);
          hexaPoints.InsertPoint((int)2,(double)1.0,(double)0.5,(double)0.0);
          hexaPoints.InsertPoint((int)3,(double)1.0,(double)1.0,(double)0.0);
          hexaPoints.InsertPoint((int)4,(double)0.5,(double)1.0,(double)0.0);
          hexaPoints.InsertPoint((int)5,(double)0.0,(double)0.5,(double)0.0);
          hexaPoints.InsertPoint((int)6,(double)0.0,(double)0.0,(double)1.0);
          hexaPoints.InsertPoint((int)7,(double)0.5,(double)0.0,(double)1.0);
          hexaPoints.InsertPoint((int)8,(double)1.0,(double)0.5,(double)1.0);
          hexaPoints.InsertPoint((int)9,(double)1.0,(double)1.0,(double)1.0);
          hexaPoints.InsertPoint((int)10,(double)0.5,(double)1.0,(double)1.0);
          hexaPoints.InsertPoint((int)11,(double)0.0,(double)0.5,(double)1.0);
          aHexa = new vtkHexagonalPrism();
          aHexa.GetPointIds().SetId((int)0,(int)0);
          aHexa.GetPointIds().SetId((int)1,(int)1);
          aHexa.GetPointIds().SetId((int)2,(int)2);
          aHexa.GetPointIds().SetId((int)3,(int)3);
          aHexa.GetPointIds().SetId((int)4,(int)4);
          aHexa.GetPointIds().SetId((int)5,(int)5);
          aHexa.GetPointIds().SetId((int)6,(int)6);
          aHexa.GetPointIds().SetId((int)7,(int)7);
          aHexa.GetPointIds().SetId((int)8,(int)8);
          aHexa.GetPointIds().SetId((int)9,(int)9);
          aHexa.GetPointIds().SetId((int)10,(int)10);
          aHexa.GetPointIds().SetId((int)11,(int)11);
          aHexaGrid = new vtkUnstructuredGrid();
          aHexaGrid.Allocate((int)1,(int)1);
          aHexaGrid.InsertNextCell((int)aHexa.GetCellType(),(vtkIdList)aHexa.GetPointIds());
          aHexaGrid.SetPoints((vtkPoints)hexaPoints);
          aHexaMapper = new vtkDataSetMapper();
          aHexaMapper.SetInput((vtkDataSet)aHexaGrid);
          aHexaActor = new vtkActor();
          aHexaActor.SetMapper((vtkMapper)aHexaMapper);
          aHexaActor.AddPosition((double)12,(double)0,(double)0);
          aHexaActor.GetProperty().BackfaceCullingOn();
          ren1.SetBackground((double)1,(double)1,(double)1);
          ren1.AddActor((vtkProp)aVoxelActor);
          aVoxelActor.GetProperty().SetDiffuseColor((double)1,(double)0,(double)0);
          ren1.AddActor((vtkProp)aHexahedronActor);
          aHexahedronActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)0);
          ren1.AddActor((vtkProp)aTetraActor);
          aTetraActor.GetProperty().SetDiffuseColor((double)0,(double)1,(double)0);
          ren1.AddActor((vtkProp)aWedgeActor);
          aWedgeActor.GetProperty().SetDiffuseColor((double)0,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPyramidActor);
          aPyramidActor.GetProperty().SetDiffuseColor((double)1,(double)0,(double)1);
          ren1.AddActor((vtkProp)aPixelActor);
          aPixelActor.GetProperty().SetDiffuseColor((double)0,(double)1,(double)1);
          ren1.AddActor((vtkProp)aQuadActor);
          aQuadActor.GetProperty().SetDiffuseColor((double)1,(double)0,(double)1);
          ren1.AddActor((vtkProp)aTriangleActor);
          aTriangleActor.GetProperty().SetDiffuseColor((double).3,(double)1,(double).5);
          ren1.AddActor((vtkProp)aPolygonActor);
          aPolygonActor.GetProperty().SetDiffuseColor((double)1,(double).4,(double).5);
          ren1.AddActor((vtkProp)aTriangleStripActor);
          aTriangleStripActor.GetProperty().SetDiffuseColor((double).3,(double).7,(double)1);
          ren1.AddActor((vtkProp)aLineActor);
          aLineActor.GetProperty().SetDiffuseColor((double).2,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPolyLineActor);
          aPolyLineActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)1);
          ren1.AddActor((vtkProp)aVertexActor);
          aVertexActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPolyVertexActor);
          aPolyVertexActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPentaActor);
          aPentaActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)0);
          ren1.AddActor((vtkProp)aHexaActor);
          aHexaActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)0);
          //[]
          // get the cell center of each type and put a glyph there[]
          //[]
          ball = new vtkSphereSource();
          ball.SetRadius((double).2);

            bool tryWorked = false;
          aVoxelScalars = new vtkFloatArray();
          N = aVoxelGrid.GetNumberOfPoints();
          aVoxelScalar = new vtkFloatArray();
          aVoxelScalar.SetNumberOfTuples((int)N);
          aVoxelScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aVoxelScalar.SetValue(i,0);
          i = i + 1;
        }

          aVoxelScalar.SetValue(0,4);
          aVoxelGrid.GetPointData().SetScalars(aVoxelScalar);

          aHexahedronScalars = new vtkFloatArray();
          N = aHexahedronGrid.GetNumberOfPoints();
          aHexahedronScalar = new vtkFloatArray();
          aHexahedronScalar.SetNumberOfTuples((int)N);
          aHexahedronScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aHexahedronScalar.SetValue(i,0);
          i = i + 1;
        }

          aHexahedronScalar.SetValue(0,4);
          aHexahedronGrid.GetPointData().SetScalars(aHexahedronScalar);

          aWedgeScalars = new vtkFloatArray();
          N = aWedgeGrid.GetNumberOfPoints();
          aWedgeScalar = new vtkFloatArray();
          aWedgeScalar.SetNumberOfTuples((int)N);
          aWedgeScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aWedgeScalar.SetValue(i,0);
          i = i + 1;
        }

          aWedgeScalar.SetValue(0,4);
          aWedgeGrid.GetPointData().SetScalars(aWedgeScalar);

          aPyramidScalars = new vtkFloatArray();
          N = aPyramidGrid.GetNumberOfPoints();
          aPyramidScalar = new vtkFloatArray();
          aPyramidScalar.SetNumberOfTuples((int)N);
          aPyramidScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aPyramidScalar.SetValue(i,0);
          i = i + 1;
        }

          aPyramidScalar.SetValue(0,4);
          aPyramidGrid.GetPointData().SetScalars(aPyramidScalar);

          aTetraScalars = new vtkFloatArray();
          N = aTetraGrid.GetNumberOfPoints();
          aTetraScalar = new vtkFloatArray();
          aTetraScalar.SetNumberOfTuples((int)N);
          aTetraScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aTetraScalar.SetValue(i,0);
          i = i + 1;
        }

          aTetraScalar.SetValue(0,4);
          aTetraGrid.GetPointData().SetScalars(aTetraScalar);

          aQuadScalars = new vtkFloatArray();
          N = aQuadGrid.GetNumberOfPoints();
          aQuadScalar = new vtkFloatArray();
          aQuadScalar.SetNumberOfTuples((int)N);
          aQuadScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aQuadScalar.SetValue(i,0);
          i = i + 1;
        }

          aQuadScalar.SetValue(0,4);
          aQuadGrid.GetPointData().SetScalars(aQuadScalar);

          aTriangleScalars = new vtkFloatArray();
          N = aTriangleGrid.GetNumberOfPoints();
          aTriangleScalar = new vtkFloatArray();
          aTriangleScalar.SetNumberOfTuples((int)N);
          aTriangleScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aTriangleScalar.SetValue(i,0);
          i = i + 1;
        }

          aTriangleScalar.SetValue(0,4);
          aTriangleGrid.GetPointData().SetScalars(aTriangleScalar);

          aTriangleStripScalars = new vtkFloatArray();
          N = aTriangleStripGrid.GetNumberOfPoints();
          aTriangleStripScalar = new vtkFloatArray();
          aTriangleStripScalar.SetNumberOfTuples((int)N);
          aTriangleStripScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aTriangleStripScalar.SetValue(i,0);
          i = i + 1;
        }

          aTriangleStripScalar.SetValue(0,4);
          aTriangleStripGrid.GetPointData().SetScalars(aTriangleStripScalar);

          aLineScalars = new vtkFloatArray();
          N = aLineGrid.GetNumberOfPoints();
          aLineScalar = new vtkFloatArray();
          aLineScalar.SetNumberOfTuples((int)N);
          aLineScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aLineScalar.SetValue(i,0);
          i = i + 1;
        }

          aLineScalar.SetValue(0,4);
          aLineGrid.GetPointData().SetScalars(aLineScalar);

          aPolyLineScalars = new vtkFloatArray();
          N = aPolyLineGrid.GetNumberOfPoints();
          aPolyLineScalar = new vtkFloatArray();
          aPolyLineScalar.SetNumberOfTuples((int)N);
          aPolyLineScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aPolyLineScalar.SetValue(i,0);
          i = i + 1;
        }

          aPolyLineScalar.SetValue(0,4);
          aPolyLineGrid.GetPointData().SetScalars(aPolyLineScalar);

          aVertexScalars = new vtkFloatArray();
          N = aVertexGrid.GetNumberOfPoints();
          aVertexScalar = new vtkFloatArray();
          aVertexScalar.SetNumberOfTuples((int)N);
          aVertexScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aVertexScalar.SetValue(i,0);
          i = i + 1;
        }

          aVertexScalar.SetValue(0,4);
          aVertexGrid.GetPointData().SetScalars(aVertexScalar);

          aPolyVertexScalars = new vtkFloatArray();
          N = aPolyVertexGrid.GetNumberOfPoints();
          aPolyVertexScalar = new vtkFloatArray();
          aPolyVertexScalar.SetNumberOfTuples((int)N);
          aPolyVertexScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aPolyVertexScalar.SetValue(i,0);
          i = i + 1;
        }

          aPolyVertexScalar.SetValue(0,4);
          aPolyVertexGrid.GetPointData().SetScalars(aPolyVertexScalar);

          aPixelScalars = new vtkFloatArray();
          N = aPixelGrid.GetNumberOfPoints();
          aPixelScalar = new vtkFloatArray();
          aPixelScalar.SetNumberOfTuples((int)N);
          aPixelScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aPixelScalar.SetValue(i,0);
          i = i + 1;
        }

          aPixelScalar.SetValue(0,4);
          aPixelGrid.GetPointData().SetScalars(aPixelScalar);

          aPolygonScalars = new vtkFloatArray();
          N = aPolygonGrid.GetNumberOfPoints();
          aPolygonScalar = new vtkFloatArray();
          aPolygonScalar.SetNumberOfTuples((int)N);
          aPolygonScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aPolygonScalar.SetValue(i,0);
          i = i + 1;
        }

          aPolygonScalar.SetValue(0,4);
          aPolygonGrid.GetPointData().SetScalars(aPolygonScalar);

          aPentaScalars = new vtkFloatArray();
          N = aPentaGrid.GetNumberOfPoints();
          aPentaScalar = new vtkFloatArray();
          aPentaScalar.SetNumberOfTuples((int)N);
          aPentaScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aPentaScalar.SetValue(i,0);
          i = i + 1;
        }

          aPentaScalar.SetValue(0,4);
          aPentaGrid.GetPointData().SetScalars(aPentaScalar);

          aHexaScalars = new vtkFloatArray();
          N = aHexaGrid.GetNumberOfPoints();
          aHexaScalar = new vtkFloatArray();
          aHexaScalar.SetNumberOfTuples((int)N);
          aHexaScalar.SetNumberOfComponents(1);
          i = 0;
          while((i) < N)
        {
          aHexaScalar.SetValue(i,0);
          i = i + 1;
        }

          aHexaScalar.SetValue(0,4);
          aHexaGrid.GetPointData().SetScalars(aHexaScalar);

          // write to the temp directory if possible, otherwise use .[]
          dir = ".";
          dir = TclToCsScriptTestDriver.GetTempDirectory();

        aVoxelderivs = new vtkCellDerivatives();
          aVoxelderivs.SetInput(aVoxelGrid);
          aVoxelderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aVoxel";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aVoxelWriter = new vtkUnstructuredGridWriter();
          aVoxelWriter.SetInputConnection(aVoxelderivs.GetOutputPort());
          aVoxelWriter.SetFileName(FileName);
          aVoxelWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aVoxelCenters = new vtkCellCenters();
          aVoxelCenters.SetInputConnection(aVoxelderivs.GetOutputPort());
          aVoxelCenters.VertexCellsOn();
          aVoxelhog = new vtkHedgeHog();
          aVoxelhog.SetInputConnection(aVoxelCenters.GetOutputPort());
          aVoxelmapHog = vtkPolyDataMapper.New();
          aVoxelmapHog.SetInputConnection(aVoxelhog.GetOutputPort());
          aVoxelmapHog.SetScalarModeToUseCellData();
          aVoxelmapHog.ScalarVisibilityOff();
          aVoxelhogActor = new vtkActor();
          aVoxelhogActor.SetMapper(aVoxelmapHog);
          aVoxelhogActor.GetProperty().SetColor(0,1,0);
          aVoxelGlyph3D = new vtkGlyph3D();
          aVoxelGlyph3D.SetInputConnection(aVoxelCenters.GetOutputPort());
          aVoxelGlyph3D.SetSource(ball.GetOutput());
          aVoxelCentersMapper = vtkPolyDataMapper.New();
          aVoxelCentersMapper.SetInputConnection(aVoxelGlyph3D.GetOutputPort());
          aVoxelCentersActor = new vtkActor();
        aVoxelCentersActor.SetMapper(aVoxelCentersMapper);
        aVoxelhogActor.SetPosition(aVoxelActor.GetPosition()[0],aVoxelActor.GetPosition()[1],aVoxelActor.GetPosition()[2]);
        ren1.AddActor((vtkProp)aVoxelhogActor);
        aVoxelhogActor.GetProperty().SetRepresentationToWireframe();

          aHexahedronderivs = new vtkCellDerivatives();
        aHexahedronderivs.SetInput(aHexahedronGrid);
        aHexahedronderivs.SetVectorModeToComputeGradient();
        FileName = dir;
        FileName += "/aHexahedron";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aHexahedronWriter = new vtkUnstructuredGridWriter();
          aHexahedronWriter.SetInputConnection(aHexahedronderivs.GetOutputPort());
          aHexahedronWriter.SetFileName(FileName);
          aHexahedronWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aHexahedronCenters = new vtkCellCenters();
          aHexahedronCenters.SetInputConnection(aHexahedronderivs.GetOutputPort());
          aHexahedronCenters.VertexCellsOn();
          aHexahedronhog = new vtkHedgeHog();
          aHexahedronhog.SetInputConnection(aHexahedronCenters.GetOutputPort());
          aHexahedronmapHog = vtkPolyDataMapper.New();
          aHexahedronmapHog.SetInputConnection(aHexahedronhog.GetOutputPort());
          aHexahedronmapHog.SetScalarModeToUseCellData();
          aHexahedronmapHog.ScalarVisibilityOff();
          aHexahedronhogActor = new vtkActor();
          aHexahedronhogActor.SetMapper(aHexahedronmapHog);
          aHexahedronhogActor.GetProperty().SetColor(0,1,0);
          aHexahedronGlyph3D = new vtkGlyph3D();
          aHexahedronGlyph3D.SetInputConnection(aHexahedronCenters.GetOutputPort());
          aHexahedronGlyph3D.SetSource(ball.GetOutput());
          aHexahedronCentersMapper = vtkPolyDataMapper.New();
          aHexahedronCentersMapper.SetInputConnection(aHexahedronGlyph3D.GetOutputPort());
          aHexahedronCentersActor = new vtkActor();
          aHexahedronCentersActor.SetMapper(aHexahedronCentersMapper);
          aHexahedronhogActor.SetPosition(aHexahedronActor.GetPosition()[0],aHexahedronActor.GetPosition()[1],aHexahedronActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aHexahedronhogActor);
          aHexahedronhogActor.GetProperty().SetRepresentationToWireframe();

        aWedgederivs = new vtkCellDerivatives();
          aWedgederivs.SetInput(aWedgeGrid);
          aWedgederivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aWedge";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aWedgeWriter = new vtkUnstructuredGridWriter();
          aWedgeWriter.SetInputConnection(aWedgederivs.GetOutputPort());
          aWedgeWriter.SetFileName(FileName);
          aWedgeWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aWedgeCenters = new vtkCellCenters();
          aWedgeCenters.SetInputConnection(aWedgederivs.GetOutputPort());
          aWedgeCenters.VertexCellsOn();
          aWedgehog = new vtkHedgeHog();
          aWedgehog.SetInputConnection(aWedgeCenters.GetOutputPort());
          aWedgemapHog = vtkPolyDataMapper.New();
          aWedgemapHog.SetInputConnection(aWedgehog.GetOutputPort());
          aWedgemapHog.SetScalarModeToUseCellData();
          aWedgemapHog.ScalarVisibilityOff();
          aWedgehogActor = new vtkActor();
          aWedgehogActor.SetMapper(aWedgemapHog);
          aWedgehogActor.GetProperty().SetColor(0,1,0);
          aWedgeGlyph3D = new vtkGlyph3D();
          aWedgeGlyph3D.SetInputConnection(aWedgeCenters.GetOutputPort());
          aWedgeGlyph3D.SetSource(ball.GetOutput());
          aWedgeCentersMapper = vtkPolyDataMapper.New();
          aWedgeCentersMapper.SetInputConnection(aWedgeGlyph3D.GetOutputPort());
          aWedgeCentersActor = new vtkActor();
          aWedgeCentersActor.SetMapper(aWedgeCentersMapper);
          aWedgehogActor.SetPosition(aWedgeActor.GetPosition()[0],aWedgeActor.GetPosition()[1],aWedgeActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aWedgehogActor);
          aWedgehogActor.GetProperty().SetRepresentationToWireframe();

        aPyramidderivs = new vtkCellDerivatives();
          aPyramidderivs.SetInput(aPyramidGrid);
          aPyramidderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aPyramid";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aPyramidWriter = new vtkUnstructuredGridWriter();
          aPyramidWriter.SetInputConnection(aPyramidderivs.GetOutputPort());
          aPyramidWriter.SetFileName(FileName);
          aPyramidWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aPyramidCenters = new vtkCellCenters();
          aPyramidCenters.SetInputConnection(aPyramidderivs.GetOutputPort());
          aPyramidCenters.VertexCellsOn();
          aPyramidhog = new vtkHedgeHog();
          aPyramidhog.SetInputConnection(aPyramidCenters.GetOutputPort());
          aPyramidmapHog = vtkPolyDataMapper.New();
          aPyramidmapHog.SetInputConnection(aPyramidhog.GetOutputPort());
          aPyramidmapHog.SetScalarModeToUseCellData();
          aPyramidmapHog.ScalarVisibilityOff();
          aPyramidhogActor = new vtkActor();
          aPyramidhogActor.SetMapper(aPyramidmapHog);
          aPyramidhogActor.GetProperty().SetColor(0,1,0);
          aPyramidGlyph3D = new vtkGlyph3D();
          aPyramidGlyph3D.SetInputConnection(aPyramidCenters.GetOutputPort());
          aPyramidGlyph3D.SetSource(ball.GetOutput());
          aPyramidCentersMapper = vtkPolyDataMapper.New();
          aPyramidCentersMapper.SetInputConnection(aPyramidGlyph3D.GetOutputPort());
          aPyramidCentersActor = new vtkActor();
          aPyramidCentersActor.SetMapper(aPyramidCentersMapper);
          aPyramidhogActor.SetPosition(aPyramidActor.GetPosition()[0],aPyramidActor.GetPosition()[1],aPyramidActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aPyramidhogActor);
          aPyramidhogActor.GetProperty().SetRepresentationToWireframe();

        aTetraderivs = new vtkCellDerivatives();
          aTetraderivs.SetInput(aTetraGrid);
          aTetraderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aTetra";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aTetraWriter = new vtkUnstructuredGridWriter();
          aTetraWriter.SetInputConnection(aTetraderivs.GetOutputPort());
          aTetraWriter.SetFileName(FileName);
          aTetraWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aTetraCenters = new vtkCellCenters();
          aTetraCenters.SetInputConnection(aTetraderivs.GetOutputPort());
          aTetraCenters.VertexCellsOn();
          aTetrahog = new vtkHedgeHog();
          aTetrahog.SetInputConnection(aTetraCenters.GetOutputPort());
          aTetramapHog = vtkPolyDataMapper.New();
          aTetramapHog.SetInputConnection(aTetrahog.GetOutputPort());
          aTetramapHog.SetScalarModeToUseCellData();
          aTetramapHog.ScalarVisibilityOff();
          aTetrahogActor = new vtkActor();
          aTetrahogActor.SetMapper(aTetramapHog);
          aTetrahogActor.GetProperty().SetColor(0,1,0);
          aTetraGlyph3D = new vtkGlyph3D();
          aTetraGlyph3D.SetInputConnection(aTetraCenters.GetOutputPort());
          aTetraGlyph3D.SetSource(ball.GetOutput());
          aTetraCentersMapper = vtkPolyDataMapper.New();
          aTetraCentersMapper.SetInputConnection(aTetraGlyph3D.GetOutputPort());
          aTetraCentersActor = new vtkActor();
          aTetraCentersActor.SetMapper(aTetraCentersMapper);
          aTetrahogActor.SetPosition(aTetraActor.GetPosition()[0],aTetraActor.GetPosition()[1],aTetraActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aTetrahogActor);
          aTetrahogActor.GetProperty().SetRepresentationToWireframe();

        aQuadderivs = new vtkCellDerivatives();
          aQuadderivs.SetInput(aQuadGrid);
          aQuadderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aQuad";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aQuadWriter = new vtkUnstructuredGridWriter();
          aQuadWriter.SetInputConnection(aQuadderivs.GetOutputPort());
          aQuadWriter.SetFileName(FileName);
          aQuadWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aQuadCenters = new vtkCellCenters();
          aQuadCenters.SetInputConnection(aQuadderivs.GetOutputPort());
          aQuadCenters.VertexCellsOn();
          aQuadhog = new vtkHedgeHog();
          aQuadhog.SetInputConnection(aQuadCenters.GetOutputPort());
          aQuadmapHog = vtkPolyDataMapper.New();
          aQuadmapHog.SetInputConnection(aQuadhog.GetOutputPort());
          aQuadmapHog.SetScalarModeToUseCellData();
          aQuadmapHog.ScalarVisibilityOff();
          aQuadhogActor = new vtkActor();
          aQuadhogActor.SetMapper(aQuadmapHog);
          aQuadhogActor.GetProperty().SetColor(0,1,0);
          aQuadGlyph3D = new vtkGlyph3D();
          aQuadGlyph3D.SetInputConnection(aQuadCenters.GetOutputPort());
          aQuadGlyph3D.SetSource(ball.GetOutput());
          aQuadCentersMapper = vtkPolyDataMapper.New();
          aQuadCentersMapper.SetInputConnection(aQuadGlyph3D.GetOutputPort());
          aQuadCentersActor = new vtkActor();
          aQuadCentersActor.SetMapper(aQuadCentersMapper);
          aQuadhogActor.SetPosition(aQuadActor.GetPosition()[0],aQuadActor.GetPosition()[1],aQuadActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aQuadhogActor);
          aQuadhogActor.GetProperty().SetRepresentationToWireframe();

        aTrianglederivs = new vtkCellDerivatives();
          aTrianglederivs.SetInput(aTriangleGrid);
          aTrianglederivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aTriangle";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aTriangleWriter = new vtkUnstructuredGridWriter();
          aTriangleWriter.SetInputConnection(aTrianglederivs.GetOutputPort());
          aTriangleWriter.SetFileName(FileName);
          aTriangleWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aTriangleCenters = new vtkCellCenters();
          aTriangleCenters.SetInputConnection(aTrianglederivs.GetOutputPort());
          aTriangleCenters.VertexCellsOn();
          aTrianglehog = new vtkHedgeHog();
          aTrianglehog.SetInputConnection(aTriangleCenters.GetOutputPort());
          aTrianglemapHog = vtkPolyDataMapper.New();
          aTrianglemapHog.SetInputConnection(aTrianglehog.GetOutputPort());
          aTrianglemapHog.SetScalarModeToUseCellData();
          aTrianglemapHog.ScalarVisibilityOff();
          aTrianglehogActor = new vtkActor();
          aTrianglehogActor.SetMapper(aTrianglemapHog);
          aTrianglehogActor.GetProperty().SetColor(0,1,0);
          aTriangleGlyph3D = new vtkGlyph3D();
          aTriangleGlyph3D.SetInputConnection(aTriangleCenters.GetOutputPort());
          aTriangleGlyph3D.SetSource(ball.GetOutput());
          aTriangleCentersMapper = vtkPolyDataMapper.New();
          aTriangleCentersMapper.SetInputConnection(aTriangleGlyph3D.GetOutputPort());
          aTriangleCentersActor = new vtkActor();
          aTriangleCentersActor.SetMapper(aTriangleCentersMapper);
          aTrianglehogActor.SetPosition(aTriangleActor.GetPosition()[0],aTriangleActor.GetPosition()[1],aTriangleActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aTrianglehogActor);
          aTrianglehogActor.GetProperty().SetRepresentationToWireframe();

        aTriangleStripderivs = new vtkCellDerivatives();
          aTriangleStripderivs.SetInput(aTriangleStripGrid);
          aTriangleStripderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aTriangleStrip";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aTriangleStripWriter = new vtkUnstructuredGridWriter();
          aTriangleStripWriter.SetInputConnection(aTriangleStripderivs.GetOutputPort());
          aTriangleStripWriter.SetFileName(FileName);
          aTriangleStripWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aTriangleStripCenters = new vtkCellCenters();
          aTriangleStripCenters.SetInputConnection(aTriangleStripderivs.GetOutputPort());
          aTriangleStripCenters.VertexCellsOn();
          aTriangleStriphog = new vtkHedgeHog();
          aTriangleStriphog.SetInputConnection(aTriangleStripCenters.GetOutputPort());
          aTriangleStripmapHog = vtkPolyDataMapper.New();
          aTriangleStripmapHog.SetInputConnection(aTriangleStriphog.GetOutputPort());
          aTriangleStripmapHog.SetScalarModeToUseCellData();
          aTriangleStripmapHog.ScalarVisibilityOff();
          aTriangleStriphogActor = new vtkActor();
          aTriangleStriphogActor.SetMapper(aTriangleStripmapHog);
          aTriangleStriphogActor.GetProperty().SetColor(0,1,0);
          aTriangleStripGlyph3D = new vtkGlyph3D();
          aTriangleStripGlyph3D.SetInputConnection(aTriangleStripCenters.GetOutputPort());
          aTriangleStripGlyph3D.SetSource(ball.GetOutput());
          aTriangleStripCentersMapper = vtkPolyDataMapper.New();
          aTriangleStripCentersMapper.SetInputConnection(aTriangleStripGlyph3D.GetOutputPort());
          aTriangleStripCentersActor = new vtkActor();
          aTriangleStripCentersActor.SetMapper(aTriangleStripCentersMapper);
          aTriangleStriphogActor.SetPosition(aTriangleStripActor.GetPosition()[0],aTriangleStripActor.GetPosition()[1],aTriangleStripActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aTriangleStriphogActor);
          aTriangleStriphogActor.GetProperty().SetRepresentationToWireframe();

        aLinederivs = new vtkCellDerivatives();
          aLinederivs.SetInput(aLineGrid);
          aLinederivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aLine";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aLineWriter = new vtkUnstructuredGridWriter();
          aLineWriter.SetInputConnection(aLinederivs.GetOutputPort());
          aLineWriter.SetFileName(FileName);
          aLineWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aLineCenters = new vtkCellCenters();
          aLineCenters.SetInputConnection(aLinederivs.GetOutputPort());
          aLineCenters.VertexCellsOn();
          aLinehog = new vtkHedgeHog();
          aLinehog.SetInputConnection(aLineCenters.GetOutputPort());
          aLinemapHog = vtkPolyDataMapper.New();
          aLinemapHog.SetInputConnection(aLinehog.GetOutputPort());
          aLinemapHog.SetScalarModeToUseCellData();
          aLinemapHog.ScalarVisibilityOff();
          aLinehogActor = new vtkActor();
          aLinehogActor.SetMapper(aLinemapHog);
          aLinehogActor.GetProperty().SetColor(0,1,0);
          aLineGlyph3D = new vtkGlyph3D();
          aLineGlyph3D.SetInputConnection(aLineCenters.GetOutputPort());
          aLineGlyph3D.SetSource(ball.GetOutput());
          aLineCentersMapper = vtkPolyDataMapper.New();
          aLineCentersMapper.SetInputConnection(aLineGlyph3D.GetOutputPort());
          aLineCentersActor = new vtkActor();
          aLineCentersActor.SetMapper(aLineCentersMapper);
          aLinehogActor.SetPosition(aLineActor.GetPosition()[0],aLineActor.GetPosition()[1],aLineActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aLinehogActor);
          aLinehogActor.GetProperty().SetRepresentationToWireframe();

        aPolyLinederivs = new vtkCellDerivatives();
          aPolyLinederivs.SetInput(aPolyLineGrid);
          aPolyLinederivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aPolyLine";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aPolyLineWriter = new vtkUnstructuredGridWriter();
          aPolyLineWriter.SetInputConnection(aPolyLinederivs.GetOutputPort());
          aPolyLineWriter.SetFileName(FileName);
          aPolyLineWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aPolyLineCenters = new vtkCellCenters();
          aPolyLineCenters.SetInputConnection(aPolyLinederivs.GetOutputPort());
          aPolyLineCenters.VertexCellsOn();
          aPolyLinehog = new vtkHedgeHog();
          aPolyLinehog.SetInputConnection(aPolyLineCenters.GetOutputPort());
          aPolyLinemapHog = vtkPolyDataMapper.New();
          aPolyLinemapHog.SetInputConnection(aPolyLinehog.GetOutputPort());
          aPolyLinemapHog.SetScalarModeToUseCellData();
          aPolyLinemapHog.ScalarVisibilityOff();
          aPolyLinehogActor = new vtkActor();
          aPolyLinehogActor.SetMapper(aPolyLinemapHog);
          aPolyLinehogActor.GetProperty().SetColor(0,1,0);
          aPolyLineGlyph3D = new vtkGlyph3D();
          aPolyLineGlyph3D.SetInputConnection(aPolyLineCenters.GetOutputPort());
          aPolyLineGlyph3D.SetSource(ball.GetOutput());
          aPolyLineCentersMapper = vtkPolyDataMapper.New();
          aPolyLineCentersMapper.SetInputConnection(aPolyLineGlyph3D.GetOutputPort());
          aPolyLineCentersActor = new vtkActor();
          aPolyLineCentersActor.SetMapper(aPolyLineCentersMapper);
          aPolyLinehogActor.SetPosition(aPolyLineActor.GetPosition()[0],aPolyLineActor.GetPosition()[1],aPolyLineActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aPolyLinehogActor);
          aPolyLinehogActor.GetProperty().SetRepresentationToWireframe();

        aVertexderivs = new vtkCellDerivatives();
          aVertexderivs.SetInput(aVertexGrid);
          aVertexderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aVertex";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aVertexWriter = new vtkUnstructuredGridWriter();
          aVertexWriter.SetInputConnection(aVertexderivs.GetOutputPort());
          aVertexWriter.SetFileName(FileName);
          aVertexWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aVertexCenters = new vtkCellCenters();
          aVertexCenters.SetInputConnection(aVertexderivs.GetOutputPort());
          aVertexCenters.VertexCellsOn();
          aVertexhog = new vtkHedgeHog();
          aVertexhog.SetInputConnection(aVertexCenters.GetOutputPort());
          aVertexmapHog = vtkPolyDataMapper.New();
          aVertexmapHog.SetInputConnection(aVertexhog.GetOutputPort());
          aVertexmapHog.SetScalarModeToUseCellData();
          aVertexmapHog.ScalarVisibilityOff();
          aVertexhogActor = new vtkActor();
          aVertexhogActor.SetMapper(aVertexmapHog);
          aVertexhogActor.GetProperty().SetColor(0,1,0);
          aVertexGlyph3D = new vtkGlyph3D();
          aVertexGlyph3D.SetInputConnection(aVertexCenters.GetOutputPort());
          aVertexGlyph3D.SetSource(ball.GetOutput());
          aVertexCentersMapper = vtkPolyDataMapper.New();
          aVertexCentersMapper.SetInputConnection(aVertexGlyph3D.GetOutputPort());
          aVertexCentersActor = new vtkActor();
          aVertexCentersActor.SetMapper(aVertexCentersMapper);
          aVertexhogActor.SetPosition(aVertexActor.GetPosition()[0],aVertexActor.GetPosition()[1],aVertexActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aVertexhogActor);
          aVertexhogActor.GetProperty().SetRepresentationToWireframe();

        aPolyVertexderivs = new vtkCellDerivatives();
          aPolyVertexderivs.SetInput(aPolyVertexGrid);
          aPolyVertexderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aPolyVertex";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aPolyVertexWriter = new vtkUnstructuredGridWriter();
          aPolyVertexWriter.SetInputConnection(aPolyVertexderivs.GetOutputPort());
          aPolyVertexWriter.SetFileName(FileName);
          aPolyVertexWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aPolyVertexCenters = new vtkCellCenters();
          aPolyVertexCenters.SetInputConnection(aPolyVertexderivs.GetOutputPort());
          aPolyVertexCenters.VertexCellsOn();
          aPolyVertexhog = new vtkHedgeHog();
          aPolyVertexhog.SetInputConnection(aPolyVertexCenters.GetOutputPort());
          aPolyVertexmapHog = vtkPolyDataMapper.New();
          aPolyVertexmapHog.SetInputConnection(aPolyVertexhog.GetOutputPort());
          aPolyVertexmapHog.SetScalarModeToUseCellData();
          aPolyVertexmapHog.ScalarVisibilityOff();
          aPolyVertexhogActor = new vtkActor();
          aPolyVertexhogActor.SetMapper(aPolyVertexmapHog);
          aPolyVertexhogActor.GetProperty().SetColor(0,1,0);
          aPolyVertexGlyph3D = new vtkGlyph3D();
          aPolyVertexGlyph3D.SetInputConnection(aPolyVertexCenters.GetOutputPort());
          aPolyVertexGlyph3D.SetSource(ball.GetOutput());
          aPolyVertexCentersMapper = vtkPolyDataMapper.New();
          aPolyVertexCentersMapper.SetInputConnection(aPolyVertexGlyph3D.GetOutputPort());
          aPolyVertexCentersActor = new vtkActor();
          aPolyVertexCentersActor.SetMapper(aPolyVertexCentersMapper);
          aPolyVertexhogActor.SetPosition(aPolyVertexActor.GetPosition()[0],aPolyVertexActor.GetPosition()[1],aPolyVertexActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aPolyVertexhogActor);
          aPolyVertexhogActor.GetProperty().SetRepresentationToWireframe();

        aPixelderivs = new vtkCellDerivatives();
          aPixelderivs.SetInput(aPixelGrid);
          aPixelderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aPixel";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aPixelWriter = new vtkUnstructuredGridWriter();
          aPixelWriter.SetInputConnection(aPixelderivs.GetOutputPort());
          aPixelWriter.SetFileName(FileName);
          aPixelWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aPixelCenters = new vtkCellCenters();
          aPixelCenters.SetInputConnection(aPixelderivs.GetOutputPort());
          aPixelCenters.VertexCellsOn();
          aPixelhog = new vtkHedgeHog();
          aPixelhog.SetInputConnection(aPixelCenters.GetOutputPort());
          aPixelmapHog = vtkPolyDataMapper.New();
          aPixelmapHog.SetInputConnection(aPixelhog.GetOutputPort());
          aPixelmapHog.SetScalarModeToUseCellData();
          aPixelmapHog.ScalarVisibilityOff();
          aPixelhogActor = new vtkActor();
          aPixelhogActor.SetMapper(aPixelmapHog);
          aPixelhogActor.GetProperty().SetColor(0,1,0);
          aPixelGlyph3D = new vtkGlyph3D();
          aPixelGlyph3D.SetInputConnection(aPixelCenters.GetOutputPort());
          aPixelGlyph3D.SetSource(ball.GetOutput());
          aPixelCentersMapper = vtkPolyDataMapper.New();
          aPixelCentersMapper.SetInputConnection(aPixelGlyph3D.GetOutputPort());
          aPixelCentersActor = new vtkActor();
          aPixelCentersActor.SetMapper(aPixelCentersMapper);
          aPixelhogActor.SetPosition(aPixelActor.GetPosition()[0],aPixelActor.GetPosition()[1],aPixelActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aPixelhogActor);
          aPixelhogActor.GetProperty().SetRepresentationToWireframe();

        aPolygonderivs = new vtkCellDerivatives();
          aPolygonderivs.SetInput(aPolygonGrid);
          aPolygonderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aPolygon";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aPolygonWriter = new vtkUnstructuredGridWriter();
          aPolygonWriter.SetInputConnection(aPolygonderivs.GetOutputPort());
          aPolygonWriter.SetFileName(FileName);
          aPolygonWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aPolygonCenters = new vtkCellCenters();
          aPolygonCenters.SetInputConnection(aPolygonderivs.GetOutputPort());
          aPolygonCenters.VertexCellsOn();
          aPolygonhog = new vtkHedgeHog();
          aPolygonhog.SetInputConnection(aPolygonCenters.GetOutputPort());
          aPolygonmapHog = vtkPolyDataMapper.New();
          aPolygonmapHog.SetInputConnection(aPolygonhog.GetOutputPort());
          aPolygonmapHog.SetScalarModeToUseCellData();
          aPolygonmapHog.ScalarVisibilityOff();
          aPolygonhogActor = new vtkActor();
          aPolygonhogActor.SetMapper(aPolygonmapHog);
          aPolygonhogActor.GetProperty().SetColor(0,1,0);
          aPolygonGlyph3D = new vtkGlyph3D();
          aPolygonGlyph3D.SetInputConnection(aPolygonCenters.GetOutputPort());
          aPolygonGlyph3D.SetSource(ball.GetOutput());
          aPolygonCentersMapper = vtkPolyDataMapper.New();
          aPolygonCentersMapper.SetInputConnection(aPolygonGlyph3D.GetOutputPort());
          aPolygonCentersActor = new vtkActor();
          aPolygonCentersActor.SetMapper(aPolygonCentersMapper);
          aPolygonhogActor.SetPosition(aPolygonActor.GetPosition()[0],aPolygonActor.GetPosition()[1],aPolygonActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aPolygonhogActor);
          aPolygonhogActor.GetProperty().SetRepresentationToWireframe();

        aPentaderivs = new vtkCellDerivatives();
          aPentaderivs.SetInput(aPentaGrid);
          aPentaderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aPenta";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aPentaWriter = new vtkUnstructuredGridWriter();
          aPentaWriter.SetInputConnection(aPentaderivs.GetOutputPort());
          aPentaWriter.SetFileName(FileName);
          aPentaWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aPentaCenters = new vtkCellCenters();
          aPentaCenters.SetInputConnection(aPentaderivs.GetOutputPort());
          aPentaCenters.VertexCellsOn();
          aPentahog = new vtkHedgeHog();
          aPentahog.SetInputConnection(aPentaCenters.GetOutputPort());
          aPentamapHog = vtkPolyDataMapper.New();
          aPentamapHog.SetInputConnection(aPentahog.GetOutputPort());
          aPentamapHog.SetScalarModeToUseCellData();
          aPentamapHog.ScalarVisibilityOff();
          aPentahogActor = new vtkActor();
          aPentahogActor.SetMapper(aPentamapHog);
          aPentahogActor.GetProperty().SetColor(0,1,0);
          aPentaGlyph3D = new vtkGlyph3D();
          aPentaGlyph3D.SetInputConnection(aPentaCenters.GetOutputPort());
          aPentaGlyph3D.SetSource(ball.GetOutput());
          aPentaCentersMapper = vtkPolyDataMapper.New();
          aPentaCentersMapper.SetInputConnection(aPentaGlyph3D.GetOutputPort());
          aPentaCentersActor = new vtkActor();
          aPentaCentersActor.SetMapper(aPentaCentersMapper);
          aPentahogActor.SetPosition(aPentaActor.GetPosition()[0],aPentaActor.GetPosition()[1],aPentaActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aPentahogActor);
          aPentahogActor.GetProperty().SetRepresentationToWireframe();

        aHexaderivs = new vtkCellDerivatives();
          aHexaderivs.SetInput(aHexaGrid);
          aHexaderivs.SetVectorModeToComputeGradient();
          FileName = dir;
          FileName += "/aHexa";
          FileName += ".vtk";
          // make sure the directory is writeable first[]
          tryWorked = false;
          try
          {
         channel = new StreamWriter("" + (dir.ToString()) + "/test.tmp");
         tryWorked = true;
          }
          catch(Exception)
        {
        tryWorked = false;
        }
          if(tryWorked)
        {
          channel.Close();
          File.Delete("" + (dir.ToString()) + "/test.tmp");
          aHexaWriter = new vtkUnstructuredGridWriter();
          aHexaWriter.SetInputConnection(aHexaderivs.GetOutputPort());
          aHexaWriter.SetFileName(FileName);
          aHexaWriter.Write();
          // delete the file[]
          File.Delete("FileName");
        }

          aHexaCenters = new vtkCellCenters();
          aHexaCenters.SetInputConnection(aHexaderivs.GetOutputPort());
          aHexaCenters.VertexCellsOn();
          aHexahog = new vtkHedgeHog();
          aHexahog.SetInputConnection(aHexaCenters.GetOutputPort());
          aHexamapHog = vtkPolyDataMapper.New();
          aHexamapHog.SetInputConnection(aHexahog.GetOutputPort());
          aHexamapHog.SetScalarModeToUseCellData();
          aHexamapHog.ScalarVisibilityOff();
          aHexahogActor = new vtkActor();
          aHexahogActor.SetMapper(aHexamapHog);
          aHexahogActor.GetProperty().SetColor(0,1,0);
          aHexaGlyph3D = new vtkGlyph3D();
          aHexaGlyph3D.SetInputConnection(aHexaCenters.GetOutputPort());
          aHexaGlyph3D.SetSource(ball.GetOutput());
          aHexaCentersMapper = vtkPolyDataMapper.New();
          aHexaCentersMapper.SetInputConnection(aHexaGlyph3D.GetOutputPort());
          aHexaCentersActor = new vtkActor();
          aHexaCentersActor.SetMapper(aHexaCentersMapper);
          aHexahogActor.SetPosition(aHexaActor.GetPosition()[0],aHexaActor.GetPosition()[1],aHexaActor.GetPosition()[2]);
          ren1.AddActor((vtkProp)aHexahogActor);
          aHexahogActor.GetProperty().SetRepresentationToWireframe();

          ren1.ResetCamera();
          ren1.GetActiveCamera().Azimuth((double)30);
          ren1.GetActiveCamera().Elevation((double)20);
          ren1.GetActiveCamera().Dolly((double)3.0);
          ren1.ResetCameraClippingRange();
          renWin.SetSize((int)300,(int)150);
          renWin.Render();
          // render the image[]
          //[]
          iren.Initialize();

        //deleteAllVTKObjects();
    }
Example #29
0
        private void Simulate(CMshTriangleMesherDouble aMesher, vtkUnstructuredGrid anUnstructuredGrid, vtkRenderer aRenderer)
        {
            var T = new CPdeFieldDouble();

            T.setMesh(aMesher.mesh());
            T.setDiscretMethod(EDiscretMethod.DM_FEM);
            T.setDiscretOrder(EDiscretOrder.DO_LINEAR);
            T.setDiscretLocation(EDiscretLocation.DL_NODE);
            T.setSimulationType(ESimulationType.ST_THERMAL);
            T.setNbDofs(1);

            // Set BC and initial conditions
            T.setSize(T.mesh().nbNodes());

            for (int i = 0; i < T.mesh().nbNodes(); ++i)
            {
                int aNodeId = T.mesh().nodeId(i);
                var aNode   = T.mesh().node(aNodeId);

                if (Math.Abs(aNode.x() + 0.0) < 1E-6)
                {
                    T.setFixedValue(i, 0.0);
                }

                if (Math.Abs(aNode.x() - 1.0) < 1E-6)
                {
                    T.setFixedValue(i, 0.0);
                }

                if (Math.Abs(aNode.y() + 0.0) < 1E-6)
                {
                    T.setFixedValue(i, 0.0);
                }

                if (Math.Abs(aNode.y() - 1.0) < 1E-6)
                {
                    T.setFixedValue(i, 0.0);
                }

                T.setValue(i, 1.0);
            }

            double rho = 1.0;   // density
            double Cp  = 1.0;   // specific heat
            double k   = 1.0;   // conductivity

            double time  = 0.1;
            int    nIter = 10;
            double dt    = time / nIter;

            // Unsteady conduction in a plate
            for (int i = 0; i < nIter; ++i)
            {
                Debug.WriteLine("Time = " + dt * (i + 1));

                var aTransientTerm = new CSleSystemDouble();
                aTransientTerm = ENigMA.ddt(T);
                aTransientTerm.Multiply(rho * Cp / dt);

                var aDiffusionTerm = new CSleSystemDouble();
                aDiffusionTerm = ENigMA.laplacian(T);
                aDiffusionTerm.Multiply(k);

                var aSystem = new CSleSystemDouble();
                aSystem = aTransientTerm;
                aSystem.Plus(aDiffusionTerm);

                var aPdeEquation = new CPdeEquationDouble(aSystem);

                aPdeEquation.setElimination(T);

                aPdeEquation.solve(T);
            }

            var sScalars = vtkFloatArray.New();

            sScalars.SetNumberOfTuples(T.mesh().nbNodes());

            for (int i = 0; i < T.mesh().nbNodes(); ++i)
            {
                int aControlVolumeId = T.mesh().nodeId(i);

                sScalars.SetTuple1(aControlVolumeId, T.value(i));
            }

            anUnstructuredGrid.GetPointData().SetScalars(sScalars);

            var aGeometryFilter = vtkGeometryFilter.New();

            aGeometryFilter.SetInput(anUnstructuredGrid);
            aGeometryFilter.Update();

            var aBoundedFilter = vtkBandedPolyDataContourFilter.New();

            aBoundedFilter.SetInput(aGeometryFilter.GetOutput());
            aBoundedFilter.GenerateValues(24, sScalars.GetRange()[0], sScalars.GetRange()[1]);

            var aLookupTable = vtkLookupTable.New();

            aLookupTable.SetNumberOfColors(256);
            aLookupTable.SetHueRange(0.667, 0.0);
            aLookupTable.Build();

            var aBandedMapper = vtkPolyDataMapper.New();

            aBandedMapper.SetInputConnection(aBoundedFilter.GetOutputPort());
            aBandedMapper.SetScalarModeToUsePointData();
            aBandedMapper.SetScalarRange(sScalars.GetRange()[0], sScalars.GetRange()[1]);
            aBandedMapper.SetLookupTable(aLookupTable);

            // add actor to the renderer
            var MeshActor = vtkActor.New();

            aRenderer.AddActor(MeshActor);

            var MeshMapper = vtkDataSetMapper.New();

            MeshMapper.SetInput(anUnstructuredGrid);

            MeshActor.SetMapper(aBandedMapper);
        }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaWedgeGrid(vtkUnstructuredGrid toSet)
 {
     aWedgeGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaVoxelGrid(vtkUnstructuredGrid toSet)
 {
     aVoxelGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaTriangleStripGrid(vtkUnstructuredGrid toSet)
 {
     aTriangleStripGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaTetraGrid(vtkUnstructuredGrid toSet)
 {
     aTetraGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaQuadGrid(vtkUnstructuredGrid toSet)
 {
     aQuadGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaPyramidGrid(vtkUnstructuredGrid toSet)
 {
     aPyramidGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaPolyVertexGrid(vtkUnstructuredGrid toSet)
 {
     aPolyVertexGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaPolyLineGrid(vtkUnstructuredGrid toSet)
 {
     aPolyLineGrid = toSet;
 }
 ///<summary> A Set Method for Static Variables </summary>
 public static void SetaHexahedronGrid(vtkUnstructuredGrid toSet)
 {
     aHexahedronGrid = toSet;
 }
Example #39
0
 public double[,] readRotationVectors(vtkUnstructuredGrid unstructuredGrid)
 {
     return(readTuple3NameSpecificPointDataArray(unstructuredGrid, "RotationVector", false));
 }
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVpickCells(String [] argv)
    {
        //Prefix Content is: ""

          ren1 = vtkRenderer.New();
          renWin = vtkRenderWindow.New();
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          // create a scene with one of each cell type[]
          // Voxel[]
          voxelPoints = new vtkPoints();
          voxelPoints.SetNumberOfPoints((int)8);
          voxelPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          voxelPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          voxelPoints.InsertPoint((int)2,(double)0,(double)1,(double)0);
          voxelPoints.InsertPoint((int)3,(double)1,(double)1,(double)0);
          voxelPoints.InsertPoint((int)4,(double)0,(double)0,(double)1);
          voxelPoints.InsertPoint((int)5,(double)1,(double)0,(double)1);
          voxelPoints.InsertPoint((int)6,(double)0,(double)1,(double)1);
          voxelPoints.InsertPoint((int)7,(double)1,(double)1,(double)1);
          aVoxel = new vtkVoxel();
          aVoxel.GetPointIds().SetId((int)0,(int)0);
          aVoxel.GetPointIds().SetId((int)1,(int)1);
          aVoxel.GetPointIds().SetId((int)2,(int)2);
          aVoxel.GetPointIds().SetId((int)3,(int)3);
          aVoxel.GetPointIds().SetId((int)4,(int)4);
          aVoxel.GetPointIds().SetId((int)5,(int)5);
          aVoxel.GetPointIds().SetId((int)6,(int)6);
          aVoxel.GetPointIds().SetId((int)7,(int)7);
          aVoxelGrid = new vtkUnstructuredGrid();
          aVoxelGrid.Allocate((int)1,(int)1);
          aVoxelGrid.InsertNextCell((int)aVoxel.GetCellType(),(vtkIdList)aVoxel.GetPointIds());
          aVoxelGrid.SetPoints((vtkPoints)voxelPoints);
          aVoxelMapper = new vtkDataSetMapper();
          aVoxelMapper.SetInput((vtkDataSet)aVoxelGrid);
          aVoxelActor = new vtkActor();
          aVoxelActor.SetMapper((vtkMapper)aVoxelMapper);
          aVoxelActor.GetProperty().BackfaceCullingOn();
          // Hexahedron[]
          hexahedronPoints = new vtkPoints();
          hexahedronPoints.SetNumberOfPoints((int)8);
          hexahedronPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          hexahedronPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          hexahedronPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          hexahedronPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          hexahedronPoints.InsertPoint((int)4,(double)0,(double)0,(double)1);
          hexahedronPoints.InsertPoint((int)5,(double)1,(double)0,(double)1);
          hexahedronPoints.InsertPoint((int)6,(double)1,(double)1,(double)1);
          hexahedronPoints.InsertPoint((int)7,(double)0,(double)1,(double)1);
          aHexahedron = new vtkHexahedron();
          aHexahedron.GetPointIds().SetId((int)0,(int)0);
          aHexahedron.GetPointIds().SetId((int)1,(int)1);
          aHexahedron.GetPointIds().SetId((int)2,(int)2);
          aHexahedron.GetPointIds().SetId((int)3,(int)3);
          aHexahedron.GetPointIds().SetId((int)4,(int)4);
          aHexahedron.GetPointIds().SetId((int)5,(int)5);
          aHexahedron.GetPointIds().SetId((int)6,(int)6);
          aHexahedron.GetPointIds().SetId((int)7,(int)7);
          aHexahedronGrid = new vtkUnstructuredGrid();
          aHexahedronGrid.Allocate((int)1,(int)1);
          aHexahedronGrid.InsertNextCell((int)aHexahedron.GetCellType(),(vtkIdList)aHexahedron.GetPointIds());
          aHexahedronGrid.SetPoints((vtkPoints)hexahedronPoints);
          aHexahedronMapper = new vtkDataSetMapper();
          aHexahedronMapper.SetInput((vtkDataSet)aHexahedronGrid);
          aHexahedronActor = new vtkActor();
          aHexahedronActor.SetMapper((vtkMapper)aHexahedronMapper);
          aHexahedronActor.AddPosition((double)2,(double)0,(double)0);
          aHexahedronActor.GetProperty().BackfaceCullingOn();
          // Tetra[]
          tetraPoints = new vtkPoints();
          tetraPoints.SetNumberOfPoints((int)4);
          tetraPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          tetraPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          tetraPoints.InsertPoint((int)2,(double).5,(double)1,(double)0);
          tetraPoints.InsertPoint((int)3,(double).5,(double).5,(double)1);
          aTetra = new vtkTetra();
          aTetra.GetPointIds().SetId((int)0,(int)0);
          aTetra.GetPointIds().SetId((int)1,(int)1);
          aTetra.GetPointIds().SetId((int)2,(int)2);
          aTetra.GetPointIds().SetId((int)3,(int)3);
          aTetraGrid = new vtkUnstructuredGrid();
          aTetraGrid.Allocate((int)1,(int)1);
          aTetraGrid.InsertNextCell((int)aTetra.GetCellType(),(vtkIdList)aTetra.GetPointIds());
          aTetraGrid.SetPoints((vtkPoints)tetraPoints);
          aTetraMapper = new vtkDataSetMapper();
          aTetraMapper.SetInput((vtkDataSet)aTetraGrid);
          aTetraActor = new vtkActor();
          aTetraActor.SetMapper((vtkMapper)aTetraMapper);
          aTetraActor.AddPosition((double)4,(double)0,(double)0);
          aTetraActor.GetProperty().BackfaceCullingOn();
          // Wedge[]
          wedgePoints = new vtkPoints();
          wedgePoints.SetNumberOfPoints((int)6);
          wedgePoints.InsertPoint((int)0,(double)0,(double)1,(double)0);
          wedgePoints.InsertPoint((int)1,(double)0,(double)0,(double)0);
          wedgePoints.InsertPoint((int)2,(double)0,(double).5,(double).5);
          wedgePoints.InsertPoint((int)3,(double)1,(double)1,(double)0);
          wedgePoints.InsertPoint((int)4,(double)1,(double)0,(double)0);
          wedgePoints.InsertPoint((int)5,(double)1,(double).5,(double).5);
          aWedge = new vtkWedge();
          aWedge.GetPointIds().SetId((int)0,(int)0);
          aWedge.GetPointIds().SetId((int)1,(int)1);
          aWedge.GetPointIds().SetId((int)2,(int)2);
          aWedge.GetPointIds().SetId((int)3,(int)3);
          aWedge.GetPointIds().SetId((int)4,(int)4);
          aWedge.GetPointIds().SetId((int)5,(int)5);
          aWedgeGrid = new vtkUnstructuredGrid();
          aWedgeGrid.Allocate((int)1,(int)1);
          aWedgeGrid.InsertNextCell((int)aWedge.GetCellType(),(vtkIdList)aWedge.GetPointIds());
          aWedgeGrid.SetPoints((vtkPoints)wedgePoints);
          aWedgeMapper = new vtkDataSetMapper();
          aWedgeMapper.SetInput((vtkDataSet)aWedgeGrid);
          aWedgeActor = new vtkActor();
          aWedgeActor.SetMapper((vtkMapper)aWedgeMapper);
          aWedgeActor.AddPosition((double)6,(double)0,(double)0);
          aWedgeActor.GetProperty().BackfaceCullingOn();
          // Pyramid[]
          pyramidPoints = new vtkPoints();
          pyramidPoints.SetNumberOfPoints((int)5);
          pyramidPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          pyramidPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          pyramidPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          pyramidPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          pyramidPoints.InsertPoint((int)4,(double).5,(double).5,(double)1);
          aPyramid = new vtkPyramid();
          aPyramid.GetPointIds().SetId((int)0,(int)0);
          aPyramid.GetPointIds().SetId((int)1,(int)1);
          aPyramid.GetPointIds().SetId((int)2,(int)2);
          aPyramid.GetPointIds().SetId((int)3,(int)3);
          aPyramid.GetPointIds().SetId((int)4,(int)4);
          aPyramidGrid = new vtkUnstructuredGrid();
          aPyramidGrid.Allocate((int)1,(int)1);
          aPyramidGrid.InsertNextCell((int)aPyramid.GetCellType(),(vtkIdList)aPyramid.GetPointIds());
          aPyramidGrid.SetPoints((vtkPoints)pyramidPoints);
          aPyramidMapper = new vtkDataSetMapper();
          aPyramidMapper.SetInput((vtkDataSet)aPyramidGrid);
          aPyramidActor = new vtkActor();
          aPyramidActor.SetMapper((vtkMapper)aPyramidMapper);
          aPyramidActor.AddPosition((double)8,(double)0,(double)0);
          aPyramidActor.GetProperty().BackfaceCullingOn();
          // Pixel[]
          pixelPoints = new vtkPoints();
          pixelPoints.SetNumberOfPoints((int)4);
          pixelPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          pixelPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          pixelPoints.InsertPoint((int)2,(double)0,(double)1,(double)0);
          pixelPoints.InsertPoint((int)3,(double)1,(double)1,(double)0);
          aPixel = new vtkPixel();
          aPixel.GetPointIds().SetId((int)0,(int)0);
          aPixel.GetPointIds().SetId((int)1,(int)1);
          aPixel.GetPointIds().SetId((int)2,(int)2);
          aPixel.GetPointIds().SetId((int)3,(int)3);
          aPixelGrid = new vtkUnstructuredGrid();
          aPixelGrid.Allocate((int)1,(int)1);
          aPixelGrid.InsertNextCell((int)aPixel.GetCellType(),(vtkIdList)aPixel.GetPointIds());
          aPixelGrid.SetPoints((vtkPoints)pixelPoints);
          aPixelMapper = new vtkDataSetMapper();
          aPixelMapper.SetInput((vtkDataSet)aPixelGrid);
          aPixelActor = new vtkActor();
          aPixelActor.SetMapper((vtkMapper)aPixelMapper);
          aPixelActor.AddPosition((double)0,(double)0,(double)2);
          aPixelActor.GetProperty().BackfaceCullingOn();
          // Quad[]
          quadPoints = new vtkPoints();
          quadPoints.SetNumberOfPoints((int)4);
          quadPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          quadPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          quadPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          quadPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          aQuad = new vtkQuad();
          aQuad.GetPointIds().SetId((int)0,(int)0);
          aQuad.GetPointIds().SetId((int)1,(int)1);
          aQuad.GetPointIds().SetId((int)2,(int)2);
          aQuad.GetPointIds().SetId((int)3,(int)3);
          aQuadGrid = new vtkUnstructuredGrid();
          aQuadGrid.Allocate((int)1,(int)1);
          aQuadGrid.InsertNextCell((int)aQuad.GetCellType(),(vtkIdList)aQuad.GetPointIds());
          aQuadGrid.SetPoints((vtkPoints)quadPoints);
          aQuadMapper = new vtkDataSetMapper();
          aQuadMapper.SetInput((vtkDataSet)aQuadGrid);
          aQuadActor = new vtkActor();
          aQuadActor.SetMapper((vtkMapper)aQuadMapper);
          aQuadActor.AddPosition((double)2,(double)0,(double)2);
          aQuadActor.GetProperty().BackfaceCullingOn();
          // Triangle[]
          trianglePoints = new vtkPoints();
          trianglePoints.SetNumberOfPoints((int)3);
          trianglePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          trianglePoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          trianglePoints.InsertPoint((int)2,(double).5,(double).5,(double)0);
          aTriangle = new vtkTriangle();
          aTriangle.GetPointIds().SetId((int)0,(int)0);
          aTriangle.GetPointIds().SetId((int)1,(int)1);
          aTriangle.GetPointIds().SetId((int)2,(int)2);
          aTriangleGrid = new vtkUnstructuredGrid();
          aTriangleGrid.Allocate((int)1,(int)1);
          aTriangleGrid.InsertNextCell((int)aTriangle.GetCellType(),(vtkIdList)aTriangle.GetPointIds());
          aTriangleGrid.SetPoints((vtkPoints)trianglePoints);
          aTriangleMapper = new vtkDataSetMapper();
          aTriangleMapper.SetInput((vtkDataSet)aTriangleGrid);
          aTriangleActor = new vtkActor();
          aTriangleActor.SetMapper((vtkMapper)aTriangleMapper);
          aTriangleActor.AddPosition((double)4,(double)0,(double)2);
          aTriangleActor.GetProperty().BackfaceCullingOn();
          // Polygon[]
          polygonPoints = new vtkPoints();
          polygonPoints.SetNumberOfPoints((int)4);
          polygonPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          polygonPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          polygonPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          polygonPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          aPolygon = new vtkPolygon();
          aPolygon.GetPointIds().SetNumberOfIds((int)4);
          aPolygon.GetPointIds().SetId((int)0,(int)0);
          aPolygon.GetPointIds().SetId((int)1,(int)1);
          aPolygon.GetPointIds().SetId((int)2,(int)2);
          aPolygon.GetPointIds().SetId((int)3,(int)3);
          aPolygonGrid = new vtkUnstructuredGrid();
          aPolygonGrid.Allocate((int)1,(int)1);
          aPolygonGrid.InsertNextCell((int)aPolygon.GetCellType(),(vtkIdList)aPolygon.GetPointIds());
          aPolygonGrid.SetPoints((vtkPoints)polygonPoints);
          aPolygonMapper = new vtkDataSetMapper();
          aPolygonMapper.SetInput((vtkDataSet)aPolygonGrid);
          aPolygonActor = new vtkActor();
          aPolygonActor.SetMapper((vtkMapper)aPolygonMapper);
          aPolygonActor.AddPosition((double)6,(double)0,(double)2);
          aPolygonActor.GetProperty().BackfaceCullingOn();
          // Triangle Strip[]
          triangleStripPoints = new vtkPoints();
          triangleStripPoints.SetNumberOfPoints((int)5);
          triangleStripPoints.InsertPoint((int)0,(double)0,(double)1,(double)0);
          triangleStripPoints.InsertPoint((int)1,(double)0,(double)0,(double)0);
          triangleStripPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          triangleStripPoints.InsertPoint((int)3,(double)1,(double)0,(double)0);
          triangleStripPoints.InsertPoint((int)4,(double)2,(double)1,(double)0);
          aTriangleStrip = new vtkTriangleStrip();
          aTriangleStrip.GetPointIds().SetNumberOfIds((int)5);
          aTriangleStrip.GetPointIds().SetId((int)0,(int)0);
          aTriangleStrip.GetPointIds().SetId((int)1,(int)1);
          aTriangleStrip.GetPointIds().SetId((int)2,(int)2);
          aTriangleStrip.GetPointIds().SetId((int)3,(int)3);
          aTriangleStrip.GetPointIds().SetId((int)4,(int)4);
          aTriangleStripGrid = new vtkUnstructuredGrid();
          aTriangleStripGrid.Allocate((int)1,(int)1);
          aTriangleStripGrid.InsertNextCell((int)aTriangleStrip.GetCellType(),(vtkIdList)aTriangleStrip.GetPointIds());
          aTriangleStripGrid.SetPoints((vtkPoints)triangleStripPoints);
          aTriangleStripMapper = new vtkDataSetMapper();
          aTriangleStripMapper.SetInput((vtkDataSet)aTriangleStripGrid);
          aTriangleStripActor = new vtkActor();
          aTriangleStripActor.SetMapper((vtkMapper)aTriangleStripMapper);
          aTriangleStripActor.AddPosition((double)8,(double)0,(double)2);
          aTriangleStripActor.GetProperty().BackfaceCullingOn();
          // Line[]
          linePoints = new vtkPoints();
          linePoints.SetNumberOfPoints((int)2);
          linePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          linePoints.InsertPoint((int)1,(double)1,(double)1,(double)0);
          aLine = new vtkLine();
          aLine.GetPointIds().SetId((int)0,(int)0);
          aLine.GetPointIds().SetId((int)1,(int)1);
          aLineGrid = new vtkUnstructuredGrid();
          aLineGrid.Allocate((int)1,(int)1);
          aLineGrid.InsertNextCell((int)aLine.GetCellType(),(vtkIdList)aLine.GetPointIds());
          aLineGrid.SetPoints((vtkPoints)linePoints);
          aLineMapper = new vtkDataSetMapper();
          aLineMapper.SetInput((vtkDataSet)aLineGrid);
          aLineActor = new vtkActor();
          aLineActor.SetMapper((vtkMapper)aLineMapper);
          aLineActor.AddPosition((double)0,(double)0,(double)4);
          aLineActor.GetProperty().BackfaceCullingOn();
          // Poly line[]
          polyLinePoints = new vtkPoints();
          polyLinePoints.SetNumberOfPoints((int)3);
          polyLinePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          polyLinePoints.InsertPoint((int)1,(double)1,(double)1,(double)0);
          polyLinePoints.InsertPoint((int)2,(double)1,(double)0,(double)0);
          aPolyLine = new vtkPolyLine();
          aPolyLine.GetPointIds().SetNumberOfIds((int)3);
          aPolyLine.GetPointIds().SetId((int)0,(int)0);
          aPolyLine.GetPointIds().SetId((int)1,(int)1);
          aPolyLine.GetPointIds().SetId((int)2,(int)2);
          aPolyLineGrid = new vtkUnstructuredGrid();
          aPolyLineGrid.Allocate((int)1,(int)1);
          aPolyLineGrid.InsertNextCell((int)aPolyLine.GetCellType(),(vtkIdList)aPolyLine.GetPointIds());
          aPolyLineGrid.SetPoints((vtkPoints)polyLinePoints);
          aPolyLineMapper = new vtkDataSetMapper();
          aPolyLineMapper.SetInput((vtkDataSet)aPolyLineGrid);
          aPolyLineActor = new vtkActor();
          aPolyLineActor.SetMapper((vtkMapper)aPolyLineMapper);
          aPolyLineActor.AddPosition((double)2,(double)0,(double)4);
          aPolyLineActor.GetProperty().BackfaceCullingOn();
          // Vertex[]
          vertexPoints = new vtkPoints();
          vertexPoints.SetNumberOfPoints((int)1);
          vertexPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          aVertex = new vtkVertex();
          aVertex.GetPointIds().SetId((int)0,(int)0);
          aVertexGrid = new vtkUnstructuredGrid();
          aVertexGrid.Allocate((int)1,(int)1);
          aVertexGrid.InsertNextCell((int)aVertex.GetCellType(),(vtkIdList)aVertex.GetPointIds());
          aVertexGrid.SetPoints((vtkPoints)vertexPoints);
          aVertexMapper = new vtkDataSetMapper();
          aVertexMapper.SetInput((vtkDataSet)aVertexGrid);
          aVertexActor = new vtkActor();
          aVertexActor.SetMapper((vtkMapper)aVertexMapper);
          aVertexActor.AddPosition((double)0,(double)0,(double)6);
          aVertexActor.GetProperty().BackfaceCullingOn();
          // Poly Vertex[]
          polyVertexPoints = new vtkPoints();
          polyVertexPoints.SetNumberOfPoints((int)3);
          polyVertexPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          polyVertexPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          polyVertexPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          aPolyVertex = new vtkPolyVertex();
          aPolyVertex.GetPointIds().SetNumberOfIds((int)3);
          aPolyVertex.GetPointIds().SetId((int)0,(int)0);
          aPolyVertex.GetPointIds().SetId((int)1,(int)1);
          aPolyVertex.GetPointIds().SetId((int)2,(int)2);
          aPolyVertexGrid = new vtkUnstructuredGrid();
          aPolyVertexGrid.Allocate((int)1,(int)1);
          aPolyVertexGrid.InsertNextCell((int)aPolyVertex.GetCellType(),(vtkIdList)aPolyVertex.GetPointIds());
          aPolyVertexGrid.SetPoints((vtkPoints)polyVertexPoints);
          aPolyVertexMapper = new vtkDataSetMapper();
          aPolyVertexMapper.SetInput((vtkDataSet)aPolyVertexGrid);
          aPolyVertexActor = new vtkActor();
          aPolyVertexActor.SetMapper((vtkMapper)aPolyVertexMapper);
          aPolyVertexActor.AddPosition((double)2,(double)0,(double)6);
          aPolyVertexActor.GetProperty().BackfaceCullingOn();
          // Pentagonal prism[]
          pentaPoints = new vtkPoints();
          pentaPoints.SetNumberOfPoints((int)10);
          pentaPoints.InsertPoint((int)0,(double)0.25,(double)0.0,(double)0.0);
          pentaPoints.InsertPoint((int)1,(double)0.75,(double)0.0,(double)0.0);
          pentaPoints.InsertPoint((int)2,(double)1.0,(double)0.5,(double)0.0);
          pentaPoints.InsertPoint((int)3,(double)0.5,(double)1.0,(double)0.0);
          pentaPoints.InsertPoint((int)4,(double)0.0,(double)0.5,(double)0.0);
          pentaPoints.InsertPoint((int)5,(double)0.25,(double)0.0,(double)1.0);
          pentaPoints.InsertPoint((int)6,(double)0.75,(double)0.0,(double)1.0);
          pentaPoints.InsertPoint((int)7,(double)1.0,(double)0.5,(double)1.0);
          pentaPoints.InsertPoint((int)8,(double)0.5,(double)1.0,(double)1.0);
          pentaPoints.InsertPoint((int)9,(double)0.0,(double)0.5,(double)1.0);
          aPenta = new vtkPentagonalPrism();
          aPenta.GetPointIds().SetId((int)0,(int)0);
          aPenta.GetPointIds().SetId((int)1,(int)1);
          aPenta.GetPointIds().SetId((int)2,(int)2);
          aPenta.GetPointIds().SetId((int)3,(int)3);
          aPenta.GetPointIds().SetId((int)4,(int)4);
          aPenta.GetPointIds().SetId((int)5,(int)5);
          aPenta.GetPointIds().SetId((int)6,(int)6);
          aPenta.GetPointIds().SetId((int)7,(int)7);
          aPenta.GetPointIds().SetId((int)8,(int)8);
          aPenta.GetPointIds().SetId((int)9,(int)9);
          aPentaGrid = new vtkUnstructuredGrid();
          aPentaGrid.Allocate((int)1,(int)1);
          aPentaGrid.InsertNextCell((int)aPenta.GetCellType(),(vtkIdList)aPenta.GetPointIds());
          aPentaGrid.SetPoints((vtkPoints)pentaPoints);
          aPentaMapper = new vtkDataSetMapper();
          aPentaMapper.SetInput((vtkDataSet)aPentaGrid);
          aPentaActor = new vtkActor();
          aPentaActor.SetMapper((vtkMapper)aPentaMapper);
          aPentaActor.AddPosition((double)10,(double)0,(double)0);
          aPentaActor.GetProperty().BackfaceCullingOn();
          // Hexagonal prism[]
          hexaPoints = new vtkPoints();
          hexaPoints.SetNumberOfPoints((int)12);
          hexaPoints.InsertPoint((int)0,(double)0.0,(double)0.0,(double)0.0);
          hexaPoints.InsertPoint((int)1,(double)0.5,(double)0.0,(double)0.0);
          hexaPoints.InsertPoint((int)2,(double)1.0,(double)0.5,(double)0.0);
          hexaPoints.InsertPoint((int)3,(double)1.0,(double)1.0,(double)0.0);
          hexaPoints.InsertPoint((int)4,(double)0.5,(double)1.0,(double)0.0);
          hexaPoints.InsertPoint((int)5,(double)0.0,(double)0.5,(double)0.0);
          hexaPoints.InsertPoint((int)6,(double)0.0,(double)0.0,(double)1.0);
          hexaPoints.InsertPoint((int)7,(double)0.5,(double)0.0,(double)1.0);
          hexaPoints.InsertPoint((int)8,(double)1.0,(double)0.5,(double)1.0);
          hexaPoints.InsertPoint((int)9,(double)1.0,(double)1.0,(double)1.0);
          hexaPoints.InsertPoint((int)10,(double)0.5,(double)1.0,(double)1.0);
          hexaPoints.InsertPoint((int)11,(double)0.0,(double)0.5,(double)1.0);
          aHexa = new vtkHexagonalPrism();
          aHexa.GetPointIds().SetId((int)0,(int)0);
          aHexa.GetPointIds().SetId((int)1,(int)1);
          aHexa.GetPointIds().SetId((int)2,(int)2);
          aHexa.GetPointIds().SetId((int)3,(int)3);
          aHexa.GetPointIds().SetId((int)4,(int)4);
          aHexa.GetPointIds().SetId((int)5,(int)5);
          aHexa.GetPointIds().SetId((int)6,(int)6);
          aHexa.GetPointIds().SetId((int)7,(int)7);
          aHexa.GetPointIds().SetId((int)8,(int)8);
          aHexa.GetPointIds().SetId((int)9,(int)9);
          aHexa.GetPointIds().SetId((int)10,(int)10);
          aHexa.GetPointIds().SetId((int)11,(int)11);
          aHexaGrid = new vtkUnstructuredGrid();
          aHexaGrid.Allocate((int)1,(int)1);
          aHexaGrid.InsertNextCell((int)aHexa.GetCellType(),(vtkIdList)aHexa.GetPointIds());
          aHexaGrid.SetPoints((vtkPoints)hexaPoints);
          aHexaMapper = new vtkDataSetMapper();
          aHexaMapper.SetInput((vtkDataSet)aHexaGrid);
          aHexaActor = new vtkActor();
          aHexaActor.SetMapper((vtkMapper)aHexaMapper);
          aHexaActor.AddPosition((double)12,(double)0,(double)0);
          aHexaActor.GetProperty().BackfaceCullingOn();
          ren1.SetBackground((double).1,(double).2,(double).4);
          ren1.AddActor((vtkProp)aVoxelActor);
          aVoxelActor.GetProperty().SetDiffuseColor((double)1,(double)0,(double)0);
          ren1.AddActor((vtkProp)aHexahedronActor);
          aHexahedronActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)0);
          ren1.AddActor((vtkProp)aTetraActor);
          aTetraActor.GetProperty().SetDiffuseColor((double)0,(double)1,(double)0);
          ren1.AddActor((vtkProp)aWedgeActor);
          aWedgeActor.GetProperty().SetDiffuseColor((double)0,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPyramidActor);
          aPyramidActor.GetProperty().SetDiffuseColor((double)1,(double)0,(double)1);
          ren1.AddActor((vtkProp)aPixelActor);
          aPixelActor.GetProperty().SetDiffuseColor((double)0,(double)1,(double)1);
          ren1.AddActor((vtkProp)aQuadActor);
          aQuadActor.GetProperty().SetDiffuseColor((double)1,(double)0,(double)1);
          ren1.AddActor((vtkProp)aTriangleActor);
          aTriangleActor.GetProperty().SetDiffuseColor((double).3,(double)1,(double).5);
          ren1.AddActor((vtkProp)aPolygonActor);
          aPolygonActor.GetProperty().SetDiffuseColor((double)1,(double).4,(double).5);
          ren1.AddActor((vtkProp)aTriangleStripActor);
          aTriangleStripActor.GetProperty().SetDiffuseColor((double).3,(double).7,(double)1);
          ren1.AddActor((vtkProp)aLineActor);
          aLineActor.GetProperty().SetDiffuseColor((double).2,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPolyLineActor);
          aPolyLineActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)1);
          ren1.AddActor((vtkProp)aVertexActor);
          aVertexActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPolyVertexActor);
          aPolyVertexActor.GetProperty().SetDiffuseColor((double)1,(double)1,(double)1);
          ren1.AddActor((vtkProp)aPentaActor);
          aPentaActor.GetProperty().SetDiffuseColor((double).2,(double).4,(double).7);
          ren1.AddActor((vtkProp)aHexaActor);
          aHexaActor.GetProperty().SetDiffuseColor((double).7,(double).5,(double)1);
          ren1.ResetCamera();
          ren1.GetActiveCamera().Azimuth((double)30);
          ren1.GetActiveCamera().Elevation((double)20);
          ren1.GetActiveCamera().Dolly((double)1.25);
          ren1.ResetCameraClippingRange();
          renWin.Render();
          cellPicker = new vtkCellPicker();
          pointPicker = new vtkPointPicker();
          worldPicker = new vtkWorldPointPicker();
          cellCount = 0;
          pointCount = 0;
          ren1.IsInViewport((int)0,(int)0);
          x = 0;
          while((x) <= 265)
        {
          y = 100;
          while((y) <= 200)
        {
          cellPicker.Pick((double)x,(double)y,(double)0,(vtkRenderer)ren1);
          pointPicker.Pick((double)x,(double)y,(double)0,(vtkRenderer)ren1);
          worldPicker.Pick((double)x,(double)y,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
            {
              cellCount = cellCount + 1;
            }

          if ((pointPicker.GetPointId()) != -1)
            {
              pointCount = pointCount + 1;
            }

          y = y + 6;
        }

          x = x + 6;
        }

          // render the image[]
          //[]
          iren.Initialize();

        //deleteAllVTKObjects();
    }
Example #41
0
 public double[,] readTranslation(vtkUnstructuredGrid unstructuredGrid)
 {
     return(readTuple3NameSpecificPointDataArray(unstructuredGrid, "Translation", true));
 }
    /// <summary>
    /// The main entry method called by the CSharp driver
    /// </summary>
    /// <param name="argv"></param>
    public static void AVLineIntersectQuadraticCells(String [] argv)
    {
        //Prefix Content is: ""

          // Contour every quadratic cell type[]
          // Create a scene with one of each cell type.[]
          // QuadraticEdge[]
          edgePoints = new vtkPoints();
          edgePoints.SetNumberOfPoints((int)3);
          edgePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          edgePoints.InsertPoint((int)1,(double)1.0,(double)0,(double)0);
          edgePoints.InsertPoint((int)2,(double)0.5,(double)0.25,(double)0);
          edgeScalars = new vtkFloatArray();
          edgeScalars.SetNumberOfTuples((int)3);
          edgeScalars.InsertValue((int)0,(float)0.0);
          edgeScalars.InsertValue((int)1,(float)0.0);
          edgeScalars.InsertValue((int)2,(float)0.9);
          aEdge = new vtkQuadraticEdge();
          aEdge.GetPointIds().SetId((int)0,(int)0);
          aEdge.GetPointIds().SetId((int)1,(int)1);
          aEdge.GetPointIds().SetId((int)2,(int)2);
          aEdgeGrid = new vtkUnstructuredGrid();
          aEdgeGrid.Allocate((int)1,(int)1);
          aEdgeGrid.InsertNextCell((int)aEdge.GetCellType(),(vtkIdList)aEdge.GetPointIds());
          aEdgeGrid.SetPoints((vtkPoints)edgePoints);
          aEdgeGrid.GetPointData().SetScalars((vtkDataArray)edgeScalars);
          aEdgeMapper = new vtkDataSetMapper();
          aEdgeMapper.SetInputData((vtkDataSet)aEdgeGrid);
          aEdgeMapper.ScalarVisibilityOff();
          aEdgeActor = new vtkActor();
          aEdgeActor.SetMapper((vtkMapper)aEdgeMapper);
          aEdgeActor.GetProperty().SetRepresentationToWireframe();
          aEdgeActor.GetProperty().SetAmbient((double)1.0);
          // Quadratic triangle[]
          triPoints = new vtkPoints();
          triPoints.SetNumberOfPoints((int)6);
          triPoints.InsertPoint((int)0,(double)0.0,(double)0.0,(double)0.0);
          triPoints.InsertPoint((int)1,(double)1.0,(double)0.0,(double)0.0);
          triPoints.InsertPoint((int)2,(double)0.5,(double)0.8,(double)0.0);
          triPoints.InsertPoint((int)3,(double)0.5,(double)0.0,(double)0.0);
          triPoints.InsertPoint((int)4,(double)0.75,(double)0.4,(double)0.0);
          triPoints.InsertPoint((int)5,(double)0.25,(double)0.4,(double)0.0);
          triScalars = new vtkFloatArray();
          triScalars.SetNumberOfTuples((int)6);
          triScalars.InsertValue((int)0,(float)0.0);
          triScalars.InsertValue((int)1,(float)0.0);
          triScalars.InsertValue((int)2,(float)0.0);
          triScalars.InsertValue((int)3,(float)1.0);
          triScalars.InsertValue((int)4,(float)0.0);
          triScalars.InsertValue((int)5,(float)0.0);
          aTri = new vtkQuadraticTriangle();
          aTri.GetPointIds().SetId((int)0,(int)0);
          aTri.GetPointIds().SetId((int)1,(int)1);
          aTri.GetPointIds().SetId((int)2,(int)2);
          aTri.GetPointIds().SetId((int)3,(int)3);
          aTri.GetPointIds().SetId((int)4,(int)4);
          aTri.GetPointIds().SetId((int)5,(int)5);
          aTriGrid = new vtkUnstructuredGrid();
          aTriGrid.Allocate((int)1,(int)1);
          aTriGrid.InsertNextCell((int)aTri.GetCellType(),(vtkIdList)aTri.GetPointIds());
          aTriGrid.SetPoints((vtkPoints)triPoints);
          aTriGrid.GetPointData().SetScalars((vtkDataArray)triScalars);
          aTriMapper = new vtkDataSetMapper();
          aTriMapper.SetInputData((vtkDataSet)aTriGrid);
          aTriMapper.ScalarVisibilityOff();
          aTriActor = new vtkActor();
          aTriActor.SetMapper((vtkMapper)aTriMapper);
          aTriActor.GetProperty().SetRepresentationToWireframe();
          aTriActor.GetProperty().SetAmbient((double)1.0);
          // Quadratic quadrilateral[]
          quadPoints = new vtkPoints();
          quadPoints.SetNumberOfPoints((int)8);
          quadPoints.InsertPoint((int)0,(double)0.0,(double)0.0,(double)0.0);
          quadPoints.InsertPoint((int)1,(double)1.0,(double)0.0,(double)0.0);
          quadPoints.InsertPoint((int)2,(double)1.0,(double)1.0,(double)0.0);
          quadPoints.InsertPoint((int)3,(double)0.0,(double)1.0,(double)0.0);
          quadPoints.InsertPoint((int)4,(double)0.5,(double)0.0,(double)0.0);
          quadPoints.InsertPoint((int)5,(double)1.0,(double)0.5,(double)0.0);
          quadPoints.InsertPoint((int)6,(double)0.5,(double)1.0,(double)0.0);
          quadPoints.InsertPoint((int)7,(double)0.0,(double)0.5,(double)0.0);
          quadScalars = new vtkFloatArray();
          quadScalars.SetNumberOfTuples((int)8);
          quadScalars.InsertValue((int)0,(float)0.0);
          quadScalars.InsertValue((int)1,(float)0.0);
          quadScalars.InsertValue((int)2,(float)1.0);
          quadScalars.InsertValue((int)3,(float)1.0);
          quadScalars.InsertValue((int)4,(float)1.0);
          quadScalars.InsertValue((int)5,(float)0.0);
          quadScalars.InsertValue((int)6,(float)0.0);
          quadScalars.InsertValue((int)7,(float)0.0);
          aQuad = new vtkQuadraticQuad();
          aQuad.GetPointIds().SetId((int)0,(int)0);
          aQuad.GetPointIds().SetId((int)1,(int)1);
          aQuad.GetPointIds().SetId((int)2,(int)2);
          aQuad.GetPointIds().SetId((int)3,(int)3);
          aQuad.GetPointIds().SetId((int)4,(int)4);
          aQuad.GetPointIds().SetId((int)5,(int)5);
          aQuad.GetPointIds().SetId((int)6,(int)6);
          aQuad.GetPointIds().SetId((int)7,(int)7);
          aQuadGrid = new vtkUnstructuredGrid();
          aQuadGrid.Allocate((int)1,(int)1);
          aQuadGrid.InsertNextCell((int)aQuad.GetCellType(),(vtkIdList)aQuad.GetPointIds());
          aQuadGrid.SetPoints((vtkPoints)quadPoints);
          aQuadGrid.GetPointData().SetScalars((vtkDataArray)quadScalars);
          aQuadMapper = new vtkDataSetMapper();
          aQuadMapper.SetInputData((vtkDataSet)aQuadGrid);
          aQuadMapper.ScalarVisibilityOff();
          aQuadActor = new vtkActor();
          aQuadActor.SetMapper((vtkMapper)aQuadMapper);
          aQuadActor.GetProperty().SetRepresentationToWireframe();
          aQuadActor.GetProperty().SetAmbient((double)1.0);
          // Quadratic tetrahedron[]
          tetPoints = new vtkPoints();
          tetPoints.SetNumberOfPoints((int)10);
          tetPoints.InsertPoint((int)0,(double)0.0,(double)0.0,(double)0.0);
          tetPoints.InsertPoint((int)1,(double)1.0,(double)0.0,(double)0.0);
          tetPoints.InsertPoint((int)2,(double)0.5,(double)0.8,(double)0.0);
          tetPoints.InsertPoint((int)3,(double)0.5,(double)0.4,(double)1.0);
          tetPoints.InsertPoint((int)4,(double)0.5,(double)0.0,(double)0.0);
          tetPoints.InsertPoint((int)5,(double)0.75,(double)0.4,(double)0.0);
          tetPoints.InsertPoint((int)6,(double)0.25,(double)0.4,(double)0.0);
          tetPoints.InsertPoint((int)7,(double)0.25,(double)0.2,(double)0.5);
          tetPoints.InsertPoint((int)8,(double)0.75,(double)0.2,(double)0.5);
          tetPoints.InsertPoint((int)9,(double)0.50,(double)0.6,(double)0.5);
          tetScalars = new vtkFloatArray();
          tetScalars.SetNumberOfTuples((int)10);
          tetScalars.InsertValue((int)0,(float)1.0);
          tetScalars.InsertValue((int)1,(float)1.0);
          tetScalars.InsertValue((int)2,(float)1.0);
          tetScalars.InsertValue((int)3,(float)1.0);
          tetScalars.InsertValue((int)4,(float)0.0);
          tetScalars.InsertValue((int)5,(float)0.0);
          tetScalars.InsertValue((int)6,(float)0.0);
          tetScalars.InsertValue((int)7,(float)0.0);
          tetScalars.InsertValue((int)8,(float)0.0);
          tetScalars.InsertValue((int)9,(float)0.0);
          aTet = new vtkQuadraticTetra();
          aTet.GetPointIds().SetId((int)0,(int)0);
          aTet.GetPointIds().SetId((int)1,(int)1);
          aTet.GetPointIds().SetId((int)2,(int)2);
          aTet.GetPointIds().SetId((int)3,(int)3);
          aTet.GetPointIds().SetId((int)4,(int)4);
          aTet.GetPointIds().SetId((int)5,(int)5);
          aTet.GetPointIds().SetId((int)6,(int)6);
          aTet.GetPointIds().SetId((int)7,(int)7);
          aTet.GetPointIds().SetId((int)8,(int)8);
          aTet.GetPointIds().SetId((int)9,(int)9);
          aTetGrid = new vtkUnstructuredGrid();
          aTetGrid.Allocate((int)1,(int)1);
          aTetGrid.InsertNextCell((int)aTet.GetCellType(),(vtkIdList)aTet.GetPointIds());
          aTetGrid.SetPoints((vtkPoints)tetPoints);
          aTetGrid.GetPointData().SetScalars((vtkDataArray)tetScalars);
          aTetMapper = new vtkDataSetMapper();
          aTetMapper.SetInputData((vtkDataSet)aTetGrid);
          aTetMapper.ScalarVisibilityOff();
          aTetActor = new vtkActor();
          aTetActor.SetMapper((vtkMapper)aTetMapper);
          aTetActor.GetProperty().SetRepresentationToWireframe();
          aTetActor.GetProperty().SetAmbient((double)1.0);
          // Quadratic hexahedron[]
          hexPoints = new vtkPoints();
          hexPoints.SetNumberOfPoints((int)20);
          hexPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          hexPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          hexPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          hexPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          hexPoints.InsertPoint((int)4,(double)0,(double)0,(double)1);
          hexPoints.InsertPoint((int)5,(double)1,(double)0,(double)1);
          hexPoints.InsertPoint((int)6,(double)1,(double)1,(double)1);
          hexPoints.InsertPoint((int)7,(double)0,(double)1,(double)1);
          hexPoints.InsertPoint((int)8,(double)0.5,(double)0,(double)0);
          hexPoints.InsertPoint((int)9,(double)1,(double)0.5,(double)0);
          hexPoints.InsertPoint((int)10,(double)0.5,(double)1,(double)0);
          hexPoints.InsertPoint((int)11,(double)0,(double)0.5,(double)0);
          hexPoints.InsertPoint((int)12,(double)0.5,(double)0,(double)1);
          hexPoints.InsertPoint((int)13,(double)1,(double)0.5,(double)1);
          hexPoints.InsertPoint((int)14,(double)0.5,(double)1,(double)1);
          hexPoints.InsertPoint((int)15,(double)0,(double)0.5,(double)1);
          hexPoints.InsertPoint((int)16,(double)0,(double)0,(double)0.5);
          hexPoints.InsertPoint((int)17,(double)1,(double)0,(double)0.5);
          hexPoints.InsertPoint((int)18,(double)1,(double)1,(double)0.5);
          hexPoints.InsertPoint((int)19,(double)0,(double)1,(double)0.5);
          hexScalars = new vtkFloatArray();
          hexScalars.SetNumberOfTuples((int)20);
          hexScalars.InsertValue((int)0,(float)1.0);
          hexScalars.InsertValue((int)1,(float)1.0);
          hexScalars.InsertValue((int)2,(float)1.0);
          hexScalars.InsertValue((int)3,(float)1.0);
          hexScalars.InsertValue((int)4,(float)1.0);
          hexScalars.InsertValue((int)5,(float)1.0);
          hexScalars.InsertValue((int)6,(float)1.0);
          hexScalars.InsertValue((int)7,(float)1.0);
          hexScalars.InsertValue((int)8,(float)0.0);
          hexScalars.InsertValue((int)9,(float)0.0);
          hexScalars.InsertValue((int)10,(float)0.0);
          hexScalars.InsertValue((int)11,(float)0.0);
          hexScalars.InsertValue((int)12,(float)0.0);
          hexScalars.InsertValue((int)13,(float)0.0);
          hexScalars.InsertValue((int)14,(float)0.0);
          hexScalars.InsertValue((int)15,(float)0.0);
          hexScalars.InsertValue((int)16,(float)0.0);
          hexScalars.InsertValue((int)17,(float)0.0);
          hexScalars.InsertValue((int)18,(float)0.0);
          hexScalars.InsertValue((int)19,(float)0.0);
          aHex = new vtkQuadraticHexahedron();
          aHex.GetPointIds().SetId((int)0,(int)0);
          aHex.GetPointIds().SetId((int)1,(int)1);
          aHex.GetPointIds().SetId((int)2,(int)2);
          aHex.GetPointIds().SetId((int)3,(int)3);
          aHex.GetPointIds().SetId((int)4,(int)4);
          aHex.GetPointIds().SetId((int)5,(int)5);
          aHex.GetPointIds().SetId((int)6,(int)6);
          aHex.GetPointIds().SetId((int)7,(int)7);
          aHex.GetPointIds().SetId((int)8,(int)8);
          aHex.GetPointIds().SetId((int)9,(int)9);
          aHex.GetPointIds().SetId((int)10,(int)10);
          aHex.GetPointIds().SetId((int)11,(int)11);
          aHex.GetPointIds().SetId((int)12,(int)12);
          aHex.GetPointIds().SetId((int)13,(int)13);
          aHex.GetPointIds().SetId((int)14,(int)14);
          aHex.GetPointIds().SetId((int)15,(int)15);
          aHex.GetPointIds().SetId((int)16,(int)16);
          aHex.GetPointIds().SetId((int)17,(int)17);
          aHex.GetPointIds().SetId((int)18,(int)18);
          aHex.GetPointIds().SetId((int)19,(int)19);
          aHexGrid = new vtkUnstructuredGrid();
          aHexGrid.Allocate((int)1,(int)1);
          aHexGrid.InsertNextCell((int)aHex.GetCellType(),(vtkIdList)aHex.GetPointIds());
          aHexGrid.SetPoints((vtkPoints)hexPoints);
          aHexGrid.GetPointData().SetScalars((vtkDataArray)hexScalars);
          aHexMapper = new vtkDataSetMapper();
          aHexMapper.SetInputData((vtkDataSet)aHexGrid);
          aHexMapper.ScalarVisibilityOff();
          aHexActor = new vtkActor();
          aHexActor.SetMapper((vtkMapper)aHexMapper);
          aHexActor.GetProperty().SetRepresentationToWireframe();
          aHexActor.GetProperty().SetAmbient((double)1.0);
          // Quadratic wedge[]
          wedgePoints = new vtkPoints();
          wedgePoints.SetNumberOfPoints((int)15);
          wedgePoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          wedgePoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          wedgePoints.InsertPoint((int)2,(double)0,(double)1,(double)0);
          wedgePoints.InsertPoint((int)3,(double)0,(double)0,(double)1);
          wedgePoints.InsertPoint((int)4,(double)1,(double)0,(double)1);
          wedgePoints.InsertPoint((int)5,(double)0,(double)1,(double)1);
          wedgePoints.InsertPoint((int)6,(double)0.5,(double)0,(double)0);
          wedgePoints.InsertPoint((int)7,(double)0.5,(double)0.5,(double)0);
          wedgePoints.InsertPoint((int)8,(double)0,(double)0.5,(double)0);
          wedgePoints.InsertPoint((int)9,(double)0.5,(double)0,(double)1);
          wedgePoints.InsertPoint((int)10,(double)0.5,(double)0.5,(double)1);
          wedgePoints.InsertPoint((int)11,(double)0,(double)0.5,(double)1);
          wedgePoints.InsertPoint((int)12,(double)0,(double)0,(double)0.5);
          wedgePoints.InsertPoint((int)13,(double)1,(double)0,(double)0.5);
          wedgePoints.InsertPoint((int)14,(double)0,(double)1,(double)0.5);
          wedgeScalars = new vtkFloatArray();
          wedgeScalars.SetNumberOfTuples((int)15);
          wedgeScalars.InsertValue((int)0,(float)1.0);
          wedgeScalars.InsertValue((int)1,(float)1.0);
          wedgeScalars.InsertValue((int)2,(float)1.0);
          wedgeScalars.InsertValue((int)3,(float)1.0);
          wedgeScalars.InsertValue((int)4,(float)1.0);
          wedgeScalars.InsertValue((int)5,(float)1.0);
          wedgeScalars.InsertValue((int)6,(float)1.0);
          wedgeScalars.InsertValue((int)7,(float)1.0);
          wedgeScalars.InsertValue((int)8,(float)0.0);
          wedgeScalars.InsertValue((int)9,(float)0.0);
          wedgeScalars.InsertValue((int)10,(float)0.0);
          wedgeScalars.InsertValue((int)11,(float)0.0);
          wedgeScalars.InsertValue((int)12,(float)0.0);
          wedgeScalars.InsertValue((int)13,(float)0.0);
          wedgeScalars.InsertValue((int)14,(float)0.0);
          aWedge = new vtkQuadraticWedge();
          aWedge.GetPointIds().SetId((int)0,(int)0);
          aWedge.GetPointIds().SetId((int)1,(int)1);
          aWedge.GetPointIds().SetId((int)2,(int)2);
          aWedge.GetPointIds().SetId((int)3,(int)3);
          aWedge.GetPointIds().SetId((int)4,(int)4);
          aWedge.GetPointIds().SetId((int)5,(int)5);
          aWedge.GetPointIds().SetId((int)6,(int)6);
          aWedge.GetPointIds().SetId((int)7,(int)7);
          aWedge.GetPointIds().SetId((int)8,(int)8);
          aWedge.GetPointIds().SetId((int)9,(int)9);
          aWedge.GetPointIds().SetId((int)10,(int)10);
          aWedge.GetPointIds().SetId((int)11,(int)11);
          aWedge.GetPointIds().SetId((int)12,(int)12);
          aWedge.GetPointIds().SetId((int)13,(int)13);
          aWedge.GetPointIds().SetId((int)14,(int)14);
          aWedgeGrid = new vtkUnstructuredGrid();
          aWedgeGrid.Allocate((int)1,(int)1);
          aWedgeGrid.InsertNextCell((int)aWedge.GetCellType(),(vtkIdList)aWedge.GetPointIds());
          aWedgeGrid.SetPoints((vtkPoints)wedgePoints);
          aWedgeGrid.GetPointData().SetScalars((vtkDataArray)wedgeScalars);
          wedgeContours = new vtkClipDataSet();
          wedgeContours.SetInputData((vtkDataObject)aWedgeGrid);
          wedgeContours.SetValue((double)0.5);
          aWedgeContourMapper = new vtkDataSetMapper();
          aWedgeContourMapper.SetInputConnection((vtkAlgorithmOutput)wedgeContours.GetOutputPort());
          aWedgeContourMapper.ScalarVisibilityOff();
          aWedgeMapper = new vtkDataSetMapper();
          aWedgeMapper.SetInputData((vtkDataSet)aWedgeGrid);
          aWedgeMapper.ScalarVisibilityOff();
          aWedgeActor = new vtkActor();
          aWedgeActor.SetMapper((vtkMapper)aWedgeMapper);
          aWedgeActor.GetProperty().SetRepresentationToWireframe();
          aWedgeActor.GetProperty().SetAmbient((double)1.0);
          aWedgeContourActor = new vtkActor();
          aWedgeContourActor.SetMapper((vtkMapper)aWedgeContourMapper);
          aWedgeContourActor.GetProperty().SetAmbient((double)1.0);
          // Quadratic pyramid[]
          pyraPoints = new vtkPoints();
          pyraPoints.SetNumberOfPoints((int)13);
          pyraPoints.InsertPoint((int)0,(double)0,(double)0,(double)0);
          pyraPoints.InsertPoint((int)1,(double)1,(double)0,(double)0);
          pyraPoints.InsertPoint((int)2,(double)1,(double)1,(double)0);
          pyraPoints.InsertPoint((int)3,(double)0,(double)1,(double)0);
          pyraPoints.InsertPoint((int)4,(double)0,(double)0,(double)1);
          pyraPoints.InsertPoint((int)5,(double)0.5,(double)0,(double)0);
          pyraPoints.InsertPoint((int)6,(double)1,(double)0.5,(double)0);
          pyraPoints.InsertPoint((int)7,(double)0.5,(double)1,(double)0);
          pyraPoints.InsertPoint((int)8,(double)0,(double)0.5,(double)0);
          pyraPoints.InsertPoint((int)9,(double)0,(double)0,(double)0.5);
          pyraPoints.InsertPoint((int)10,(double)0.5,(double)0,(double)0.5);
          pyraPoints.InsertPoint((int)11,(double)0.5,(double)0.5,(double)0.5);
          pyraPoints.InsertPoint((int)12,(double)0,(double)0.5,(double)0.5);
          pyraScalars = new vtkFloatArray();
          pyraScalars.SetNumberOfTuples((int)13);
          pyraScalars.InsertValue((int)0,(float)1.0);
          pyraScalars.InsertValue((int)1,(float)1.0);
          pyraScalars.InsertValue((int)2,(float)1.0);
          pyraScalars.InsertValue((int)3,(float)1.0);
          pyraScalars.InsertValue((int)4,(float)1.0);
          pyraScalars.InsertValue((int)5,(float)1.0);
          pyraScalars.InsertValue((int)6,(float)1.0);
          pyraScalars.InsertValue((int)7,(float)1.0);
          pyraScalars.InsertValue((int)8,(float)0.0);
          pyraScalars.InsertValue((int)9,(float)0.0);
          pyraScalars.InsertValue((int)10,(float)0.0);
          pyraScalars.InsertValue((int)11,(float)0.0);
          pyraScalars.InsertValue((int)12,(float)0.0);
          aPyramid = new vtkQuadraticPyramid();
          aPyramid.GetPointIds().SetId((int)0,(int)0);
          aPyramid.GetPointIds().SetId((int)1,(int)1);
          aPyramid.GetPointIds().SetId((int)2,(int)2);
          aPyramid.GetPointIds().SetId((int)3,(int)3);
          aPyramid.GetPointIds().SetId((int)4,(int)4);
          aPyramid.GetPointIds().SetId((int)5,(int)5);
          aPyramid.GetPointIds().SetId((int)6,(int)6);
          aPyramid.GetPointIds().SetId((int)7,(int)7);
          aPyramid.GetPointIds().SetId((int)8,(int)8);
          aPyramid.GetPointIds().SetId((int)9,(int)9);
          aPyramid.GetPointIds().SetId((int)10,(int)10);
          aPyramid.GetPointIds().SetId((int)11,(int)11);
          aPyramid.GetPointIds().SetId((int)12,(int)12);
          aPyramidGrid = new vtkUnstructuredGrid();
          aPyramidGrid.Allocate((int)1,(int)1);
          aPyramidGrid.InsertNextCell((int)aPyramid.GetCellType(),(vtkIdList)aPyramid.GetPointIds());
          aPyramidGrid.SetPoints((vtkPoints)pyraPoints);
          aPyramidGrid.GetPointData().SetScalars((vtkDataArray)pyraScalars);
          pyraContours = new vtkClipDataSet();
          pyraContours.SetInputData((vtkDataObject)aPyramidGrid);
          pyraContours.SetValue((double)0.5);
          aPyramidContourMapper = new vtkDataSetMapper();
          aPyramidContourMapper.SetInputConnection((vtkAlgorithmOutput)pyraContours.GetOutputPort());
          aPyramidContourMapper.ScalarVisibilityOff();
          aPyramidMapper = new vtkDataSetMapper();
          aPyramidMapper.SetInputData((vtkDataSet)aPyramidGrid);
          aPyramidMapper.ScalarVisibilityOff();
          aPyramidActor = new vtkActor();
          aPyramidActor.SetMapper((vtkMapper)aPyramidMapper);
          aPyramidActor.GetProperty().SetRepresentationToWireframe();
          aPyramidActor.GetProperty().SetAmbient((double)1.0);
          aPyramidContourActor = new vtkActor();
          aPyramidContourActor.SetMapper((vtkMapper)aPyramidContourMapper);
          aPyramidContourActor.GetProperty().SetAmbient((double)1.0);
          // Create the rendering related stuff.[]
          // Since some of our actors are a single vertex, we need to remove all[]
          // cullers so the single vertex actors will render[]
          ren1 = vtkRenderer.New();
          ren1.GetCullers().RemoveAllItems();
          renWin = vtkRenderWindow.New();
          renWin.SetMultiSamples(0);
          renWin.AddRenderer((vtkRenderer)ren1);
          iren = new vtkRenderWindowInteractor();
          iren.SetRenderWindow((vtkRenderWindow)renWin);
          ren1.SetBackground((double).1,(double).2,(double).3);
          renWin.SetSize((int)400,(int)200);
          // specify properties[]
          ren1.AddActor((vtkProp)aEdgeActor);
          ren1.AddActor((vtkProp)aTriActor);
          ren1.AddActor((vtkProp)aQuadActor);
          ren1.AddActor((vtkProp)aTetActor);
          ren1.AddActor((vtkProp)aHexActor);
          ren1.AddActor((vtkProp)aWedgeActor);
          ren1.AddActor((vtkProp)aPyramidActor);
          // places everyone!![]
          aTriActor.AddPosition((double)2,(double)0,(double)0);
          aQuadActor.AddPosition((double)4,(double)0,(double)0);
          aTetActor.AddPosition((double)6,(double)0,(double)0);
          aHexActor.AddPosition((double)8,(double)0,(double)0);
          aWedgeActor.AddPosition((double)10,(double)0,(double)0);
          aPyramidActor.AddPosition((double)12,(double)0,(double)0);
          BuildBackdrop(-1, 15, -1, 4, -1, 2, .1);
          ren1.AddActor((vtkProp)base1);
          base1.GetProperty().SetDiffuseColor((double).2,(double).2,(double).2);
          ren1.AddActor((vtkProp)left);
          left.GetProperty().SetDiffuseColor((double).2,(double).2,(double).2);
          ren1.AddActor((vtkProp)back);
          back.GetProperty().SetDiffuseColor((double).2,(double).2,(double).2);
          ren1.ResetCamera();
          ren1.GetActiveCamera().Dolly((double)2.5);
          ren1.ResetCameraClippingRange();
          renWin.Render();
          // create a little scorecard above each of the cells. These are displayed[]
          // if a ray cast hits the cell, otherwise they are not shown.[]
          pm = new vtkPlaneSource();
          pm.SetXResolution((int)1);
          pm.SetYResolution((int)1);
          pmapper = vtkPolyDataMapper.New();
          pmapper.SetInputConnection((vtkAlgorithmOutput)pm.GetOutputPort());
          // now try intersecting rays with the cell[]
          cellPicker = new vtkCellPicker();
          edgeCheck = new vtkActor();
          edgeCheck.SetMapper((vtkMapper)pmapper);
          edgeCheck.AddPosition((double)0.5,(double)2.5,(double)0);
          cellPicker.Pick((double)87,(double)71,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
        {
          ren1.AddActor((vtkProp)edgeCheck);
        }

          triCheck = new vtkActor();
          triCheck.SetMapper((vtkMapper)pmapper);
          triCheck.AddPosition((double)2.5,(double)2.5,(double)0);
          cellPicker.Pick((double)139,(double)72,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
        {
          ren1.AddActor((vtkProp)triCheck);
        }

          quadCheck = new vtkActor();
          quadCheck.SetMapper((vtkMapper)pmapper);
          quadCheck.AddPosition((double)4.5,(double)2.5,(double)0);
          cellPicker.Pick((double)192,(double)78,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
        {
          ren1.AddActor((vtkProp)quadCheck);
        }

          tetCheck = new vtkActor();
          tetCheck.SetMapper((vtkMapper)pmapper);
          tetCheck.AddPosition((double)6.5,(double)2.5,(double)0);
          cellPicker.Pick((double)233,(double)70,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
        {
          ren1.AddActor((vtkProp)tetCheck);
        }

          hexCheck = new vtkActor();
          hexCheck.SetMapper((vtkMapper)pmapper);
          hexCheck.AddPosition((double)8.5,(double)2.5,(double)0);
          cellPicker.Pick((double)287,(double)80,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
        {
          ren1.AddActor((vtkProp)hexCheck);
        }

          wedgeCheck = new vtkActor();
          wedgeCheck.SetMapper((vtkMapper)pmapper);
          wedgeCheck.AddPosition((double)10.5,(double)2.5,(double)0);
          cellPicker.Pick((double)287,(double)80,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
        {
          ren1.AddActor((vtkProp)wedgeCheck);
        }

          pyraCheck = new vtkActor();
          pyraCheck.SetMapper((vtkMapper)pmapper);
          pyraCheck.AddPosition((double)12.5,(double)2.5,(double)0);
          cellPicker.Pick((double)287,(double)80,(double)0,(vtkRenderer)ren1);
          if ((cellPicker.GetCellId()) != -1)
        {
          ren1.AddActor((vtkProp)pyraCheck);
        }

          // render the image[]
          //[]
          iren.Initialize();

        //deleteAllVTKObjects();
    }