| 31 | { |
| 32 | |
| 33 | void ProduceOutline(vtkImageData* input, vtkTypeBool genFaces, vtkPoints* points, |
| 34 | vtkCellArray* lines, vtkCellArray* faces) |
| 35 | { |
| 36 | // Keep track of inserted point ids |
| 37 | vtkIdType ptIds[8]; |
| 38 | |
| 39 | // Produce the eight vtkImageData points, possibly oriented. Use the |
| 40 | // corner indices of the volume. |
| 41 | double x[3]; |
| 42 | int ext[6]; |
| 43 | input->GetExtent(ext); |
| 44 | |
| 45 | input->TransformIndexToPhysicalPoint(ext[0], ext[2], ext[4], x); |
| 46 | ptIds[0] = points->InsertNextPoint(x); |
| 47 | |
| 48 | input->TransformIndexToPhysicalPoint(ext[1], ext[2], ext[4], x); |
| 49 | ptIds[1] = points->InsertNextPoint(x); |
| 50 | |
| 51 | input->TransformIndexToPhysicalPoint(ext[0], ext[3], ext[4], x); |
| 52 | ptIds[2] = points->InsertNextPoint(x); |
| 53 | |
| 54 | input->TransformIndexToPhysicalPoint(ext[1], ext[3], ext[4], x); |
| 55 | ptIds[3] = points->InsertNextPoint(x); |
| 56 | |
| 57 | input->TransformIndexToPhysicalPoint(ext[0], ext[2], ext[5], x); |
| 58 | ptIds[4] = points->InsertNextPoint(x); |
| 59 | |
| 60 | input->TransformIndexToPhysicalPoint(ext[1], ext[2], ext[5], x); |
| 61 | ptIds[5] = points->InsertNextPoint(x); |
| 62 | |
| 63 | input->TransformIndexToPhysicalPoint(ext[0], ext[3], ext[5], x); |
| 64 | ptIds[6] = points->InsertNextPoint(x); |
| 65 | |
| 66 | input->TransformIndexToPhysicalPoint(ext[1], ext[3], ext[5], x); |
| 67 | ptIds[7] = points->InsertNextPoint(x); |
| 68 | |
| 69 | // Produce topology, lines plus optional quad faces |
| 70 | vtkIdType pts[4]; |
| 71 | |
| 72 | // Always generate wire edges. This is a historical behavior. |
| 73 | pts[0] = ptIds[0]; |
| 74 | pts[1] = ptIds[1]; |
| 75 | lines->InsertNextCell(2, pts); |
| 76 | pts[0] = ptIds[2]; |
| 77 | pts[1] = ptIds[3]; |
| 78 | lines->InsertNextCell(2, pts); |
| 79 | pts[0] = ptIds[4]; |
| 80 | pts[1] = ptIds[5]; |
| 81 | lines->InsertNextCell(2, pts); |
| 82 | pts[0] = ptIds[6]; |
| 83 | pts[1] = ptIds[7]; |
| 84 | lines->InsertNextCell(2, pts); |
| 85 | pts[0] = ptIds[0]; |
| 86 | pts[1] = ptIds[2]; |
| 87 | lines->InsertNextCell(2, pts); |
| 88 | pts[0] = ptIds[1]; |
| 89 | pts[1] = ptIds[3]; |
| 90 | lines->InsertNextCell(2, pts); |
no test coverage detected