MCPcopy Create free account
hub / github.com/Kitware/VTK / CellGrid

Method CellGrid

Filters/General/vtkBoxClipDataSet.cxx:986–1534  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Tetra Grid : Subdivide cells in consistent tetrahedra. For each cell, search the smallest global index. Case Tetrahedron(10): Just insert this cell in the newCellArray Case Voxel(11) or Hexahedron(12): - for each face: looking for the diagonal edge with the smallest index - 2 possibilities: subdivide a cell in 5 or 6

Source from the content-addressed store, hash-verified

984//
985//------------------------------------------------------------------------------
986void vtkBoxClipDataSet::CellGrid(
987 vtkIdType typeobj, vtkIdType npts, const vtkIdType* cellIds, vtkCellArray* newCellArray)
988{
989 vtkIdType tab[4];
990 vtkIdType tabp[5];
991 vtkIdType ptstriangle = 3;
992 vtkIdType ptstetra = 4;
993 vtkIdType xmin;
994 vtkIdType idt;
995 int i, j;
996 unsigned int id = 0;
997 unsigned int idpy = 0;
998
999 unsigned int Edg_f[6][2]; // edge selected of each face
1000 unsigned int idv[4];
1001
1002 unsigned int idopos;
1003 unsigned int numbertetra;
1004
1005 constexpr vtkIdType triPassThrough[3] = { 0, 1, 2 };
1006 vtkIdType tri[3];
1007 vtkIdType line[2];
1008
1009 switch (typeobj)
1010 {
1011 case VTK_VERTEX:
1012 case VTK_POLY_VERTEX:
1013 for (idt = 0; idt < npts; idt++)
1014 {
1015 newCellArray->InsertNextCell(1, &idt);
1016 }
1017 break;
1018
1019 case VTK_LINE:
1020 case VTK_POLY_LINE:
1021 for (idt = 0; idt < npts - 1; idt++)
1022 {
1023 line[0] = idt;
1024 line[1] = idt + 1;
1025 newCellArray->InsertNextCell(2, line);
1026 }
1027 break;
1028
1029 case VTK_TRIANGLE: // 5
1030 case VTK_QUADRATIC_TRIANGLE:
1031 case VTK_BIQUADRATIC_TRIANGLE:
1032 newCellArray->InsertNextCell(ptstriangle, triPassThrough);
1033 break;
1034
1035 case VTK_TRIANGLE_STRIP: // 6
1036 for (idt = 0; idt < npts - 2; idt++)
1037 {
1038 if (idt % 2 == 0)
1039 {
1040 tri[0] = idt;
1041 tri[1] = idt + 1;
1042 tri[2] = idt + 2;
1043 }

Callers 15

ClipBoxMethod · 0.95
ClipHexahedronMethod · 0.95
ClipBoxInOutMethod · 0.95
ClipHexahedronInOutMethod · 0.95
ClipBox2DMethod · 0.95
ClipBoxInOut2DMethod · 0.95
ClipHexahedron2DMethod · 0.95
ClipHexahedronInOut2DMethod · 0.95
ClipBox1DMethod · 0.95
ClipBoxInOut1DMethod · 0.95
ClipHexahedron1DMethod · 0.95
ClipHexahedronInOut1DMethod · 0.95

Calls 3

MinEdgeFMethod · 0.95
WedgeToTetraMethod · 0.95
InsertNextCellMethod · 0.45

Tested by

no test coverage detected