------------------------------------------------------------------------------
| 63 | |
| 64 | //------------------------------------------------------------------------------ |
| 65 | int vtkLinearExtrusionFilter::RequestData(vtkInformation* vtkNotUsed(request), |
| 66 | vtkInformationVector** inputVector, vtkInformationVector* outputVector) |
| 67 | { |
| 68 | // get the info objects |
| 69 | vtkInformation* inInfo = inputVector[0]->GetInformationObject(0); |
| 70 | vtkInformation* outInfo = outputVector->GetInformationObject(0); |
| 71 | |
| 72 | // get the input and output |
| 73 | vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 74 | vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT())); |
| 75 | |
| 76 | vtkIdType numPts, numCells; |
| 77 | vtkPointData* pd = input->GetPointData(); |
| 78 | vtkDataArray* inNormals = nullptr; |
| 79 | vtkPolyData* mesh; |
| 80 | vtkPoints* inPts; |
| 81 | vtkCellArray *inVerts, *inLines, *inPolys, *inStrips; |
| 82 | vtkIdType inCellId, outCellId; |
| 83 | int numEdges, dim; |
| 84 | const vtkIdType* pts = nullptr; |
| 85 | vtkIdType npts = 0; |
| 86 | vtkIdType ptId, ncells, p1, p2; |
| 87 | vtkIdType i, j; |
| 88 | double x[3]; |
| 89 | vtkPoints* newPts; |
| 90 | vtkCellArray *newLines = nullptr, *newPolys = nullptr, *newStrips; |
| 91 | vtkCell* edge; |
| 92 | vtkIdList *cellIds, *cellPts; |
| 93 | vtkPointData* outputPD = output->GetPointData(); |
| 94 | // Here is a big pain about ordering of cells. (Copy CellData) |
| 95 | vtkIdList* lineIds; |
| 96 | vtkIdList* polyIds; |
| 97 | vtkIdList* stripIds; |
| 98 | |
| 99 | // Initialize / check input |
| 100 | // |
| 101 | vtkDebugMacro(<< "Linearly extruding data"); |
| 102 | |
| 103 | numPts = input->GetNumberOfPoints(); |
| 104 | numCells = input->GetNumberOfCells(); |
| 105 | |
| 106 | if (numPts < 1 || numCells < 1) |
| 107 | { |
| 108 | vtkErrorMacro(<< "No data to extrude!"); |
| 109 | return 1; |
| 110 | } |
| 111 | |
| 112 | // Decide which vector to use for extrusion |
| 113 | // |
| 114 | if (this->ExtrusionType == VTK_POINT_EXTRUSION) |
| 115 | { |
| 116 | this->ExtrudePoint = &vtkLinearExtrusionFilter::ViaPoint; |
| 117 | } |
| 118 | else if (this->ExtrusionType == VTK_NORMAL_EXTRUSION && (inNormals = pd->GetNormals()) != nullptr) |
| 119 | { |
| 120 | this->ExtrudePoint = &vtkLinearExtrusionFilter::ViaNormal; |
| 121 | inNormals = pd->GetNormals(); |
| 122 | } |
nothing calls this directly
no test coverage detected