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

Method RequestData

Filters/Modeling/vtkRotationalExtrusionFilter.cxx:33–333  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

31
32//------------------------------------------------------------------------------
33int vtkRotationalExtrusionFilter::RequestData(vtkInformation* vtkNotUsed(request),
34 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
35{
36 // get the info objects
37 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
38 vtkInformation* outInfo = outputVector->GetInformationObject(0);
39
40 // get the input and output
41 vtkPolyData* input = vtkPolyData::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
42 vtkPolyData* output = vtkPolyData::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
43
44 vtkIdType numPts, numCells;
45 vtkPointData* pd = input->GetPointData();
46 vtkCellData* cd = input->GetCellData();
47 vtkPolyData* mesh;
48 vtkPoints* inPts;
49 vtkCellArray *inVerts, *inLines, *inPolys, *inStrips;
50 int numEdges;
51 const vtkIdType* pts = nullptr;
52 vtkIdType npts = 0;
53 vtkIdType cellId, ptId, ncells;
54 double x[3], newX[3], angleIncr, radIncr, transIncr;
55 vtkPoints* newPts;
56 vtkCellArray *newLines = nullptr, *newPolys = nullptr, *newStrips;
57 vtkCell* edge;
58 vtkIdList* cellIds;
59 int i, j, k;
60 vtkIdType p1, p2;
61 vtkPointData* outPD = output->GetPointData();
62 vtkCellData* outCD = output->GetCellData();
63 bool abort = false;
64
65 // Initialize / check input
66 //
67 vtkDebugMacro(<< "Rotationally extruding data");
68
69 numPts = input->GetNumberOfPoints();
70 numCells = input->GetNumberOfCells();
71 if (numPts < 1 || numCells < 1)
72 {
73 vtkErrorMacro(<< "No data to extrude!");
74 return 1;
75 }
76
77 double normalizedRotationAxis[3] = { this->RotationAxis[0], this->RotationAxis[1],
78 this->RotationAxis[2] };
79 double norm = vtkMath::Normalize(normalizedRotationAxis);
80
81 // if norm is equal to zero, the extrusion cannot be done
82 if (norm == 0.0)
83 {
84 vtkErrorMacro(<< "Cannot perform extrusion around an axis with a norm of 0.");
85 return 0;
86 }
87
88 // Build cell data structure.
89 //
90 mesh = vtkPolyData::New();

Callers

nothing calls this directly

Calls 15

ProjectVectorFunction · 0.85
GetInformationObjectMethod · 0.80
GetVertsMethod · 0.80
GetPolysMethod · 0.80
GetStripsMethod · 0.80
SetVertsMethod · 0.80
SetLinesMethod · 0.80
SetPolysMethod · 0.80
SetStripsMethod · 0.80
AllocateEstimateMethod · 0.80
InsertCellPointMethod · 0.80
CheckAbortMethod · 0.80

Tested by

no test coverage detected