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

Method RequestData

Filters/General/vtkRotationFilter.cxx:46–213  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

44
45//------------------------------------------------------------------------------
46int vtkRotationFilter::RequestData(vtkInformation* vtkNotUsed(request),
47 vtkInformationVector** inputVector, vtkInformationVector* outputVector)
48{
49 // get the info objects
50 vtkInformation* inInfo = inputVector[0]->GetInformationObject(0);
51 vtkInformation* outInfo = outputVector->GetInformationObject(0);
52
53 // get the input and output
54 vtkDataSet* input = vtkDataSet::SafeDownCast(inInfo->Get(vtkDataObject::DATA_OBJECT()));
55 vtkUnstructuredGrid* output =
56 vtkUnstructuredGrid::SafeDownCast(outInfo->Get(vtkDataObject::DATA_OBJECT()));
57
58 vtkPointData* inPD = input->GetPointData();
59 vtkPointData* outPD = output->GetPointData();
60 vtkCellData* inCD = input->GetCellData();
61 vtkCellData* outCD = output->GetCellData();
62
63 if (!this->GetNumberOfCopies())
64 {
65 vtkErrorMacro("No number of copy set!");
66 return 1;
67 }
68
69 double tuple[3];
70 vtkPoints* outPoints;
71 double point[3], center[3], negativCenter[3];
72 vtkIdType ptId, cellId;
73 vtkGenericCell* cell = vtkGenericCell::New();
74 vtkIdList* ptIds = vtkIdList::New();
75
76 outPoints = vtkPoints::New();
77
78 vtkIdType numPts = input->GetNumberOfPoints();
79 vtkIdType numCells = input->GetNumberOfCells();
80
81 if (this->CopyInput)
82 {
83 outPoints->Allocate((this->CopyInput + this->GetNumberOfCopies()) * numPts);
84 output->Allocate((this->CopyInput + this->GetNumberOfCopies()) * numPts);
85 }
86 else
87 {
88 outPoints->Allocate(this->GetNumberOfCopies() * numPts);
89 output->Allocate(this->GetNumberOfCopies() * numPts);
90 }
91
92 outPD->CopyAllocate(inPD);
93 outCD->CopyAllocate(inCD);
94
95 vtkDataArray *inPtVectors, *outPtVectors;
96 vtkDataArray *inCellVectors, *outCellVectors;
97
98 inPtVectors = inPD->GetVectors();
99 outPtVectors = outPD->GetVectors();
100 inCellVectors = inCD->GetVectors();
101 outCellVectors = outCD->GetVectors();
102
103 // Copy first points.

Callers

nothing calls this directly

Calls 15

GetInformationObjectMethod · 0.80
RotateXMethod · 0.80
RotateYMethod · 0.80
RotateZMethod · 0.80
CheckAbortMethod · 0.80
CheckAttributesMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
GetMethod · 0.45
GetPointDataMethod · 0.45
GetCellDataMethod · 0.45
GetNumberOfPointsMethod · 0.45

Tested by

no test coverage detected