30 vtkInformationVector **inputVector,
31 vtkInformationVector *outputVector) {
33 if(request->Has(vtkDemandDrivenPipeline::REQUEST_DATA())) {
34 return this->
RequestData(request, inputVector, outputVector);
38 if(request->Has(vtkDemandDrivenPipeline::REQUEST_INFORMATION())) {
43 if(request->Has(vtkStreamingDemandDrivenPipeline::REQUEST_UPDATE_EXTENT())) {
69 vtkInformationVector **inputVector,
70 vtkInformationVector *) {
73 vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
74 inInfo->Remove(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT());
75 if(inInfo->Has(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT())) {
76 inInfo->Set(vtkStreamingDemandDrivenPipeline::UPDATE_EXTENT(),
77 inInfo->Get(vtkStreamingDemandDrivenPipeline::WHOLE_EXTENT()),
145 vtkInformationVector **inputVector,
146 vtkInformationVector *outputVector) {
149 const auto domain = vtkDataSet::GetData(inputVector[0]);
152 return !this->
printErr(
"Unable to retrieve required input data object.");
157 this->
printErr(
"Input triangulation pointer is NULL.");
163 if(triangulation->isEmpty()) {
164 this->
printErr(
"Triangulation allocation problem.");
169 this->
printErr(
"Input pointer is NULL.");
173 const auto numberOfVertices = domain->GetNumberOfPoints();
174 if(numberOfVertices <= 0) {
175 this->
printErr(
"Domain has no points.");
179 std::stringstream ss;
180 ss <<
"Surface number of vertices : " << triangulation->getNumberOfVertices();
184 ss <<
"Surface number of triangles : "
185 << triangulation->getNumberOfTriangles();
192 imageData->SetOrigin(Origin[0], Origin[1], Origin[2]);
194 imageData->SetDimensions(DataExtent[1], DataExtent[3], DataExtent[5]);
197 if(!boundingTriangulation) {
198 this->
printErr(
"Input bounding triangulation pointer is NULL.");
202 if(boundingTriangulation->isEmpty()) {
203 this->
printErr(
"Encompassing triangulation allocation problem.");
208 ss <<
"Field number of vertices : "
209 << boundingTriangulation->getNumberOfVertices();
213 ss <<
"Field number of edges : " << boundingTriangulation->getNumberOfEdges();
217 auto outputNoPoints = imageData->GetNumberOfPoints();
219 vtkNew<vtkFloatArray> outputScalars{};
220 outputScalars->SetNumberOfTuples(outputNoPoints);
221 outputScalars->SetName(
"signedDistanceField");
223 vtkNew<vtkIntArray> edgeCrossing{};
224 edgeCrossing->SetNumberOfTuples(outputNoPoints);
225 edgeCrossing->SetName(
"edgeCrossing");
227 vtkNew<vtkIntArray> isInterior{};
228 isInterior->SetNumberOfTuples(outputNoPoints);
229 isInterior->SetName(
"isInterior");
237 triangulation->getType(), boundingTriangulation->getType(),
239 = this->execute(ttkUtils::GetPointer<float>(outputScalars),
240 (
static_cast<TTK_TT1 *
>(triangulation->getData())),
241 (
static_cast<TTK_TT2 *
>(boundingTriangulation->getData())),
242 ttkUtils::GetPointer<int>(edgeCrossing),
243 ttkUtils::GetPointer<int>(isInterior))));
247 this->
printErr(
"SignedDistanceField.execute() error code: "
248 + std::to_string(ret));
252 imageData->GetPointData()->AddArray(outputScalars);
253 imageData->GetPointData()->AddArray(edgeCrossing);
254 imageData->GetPointData()->AddArray(isInterior);
257 auto output = vtkImageData::GetData(outputVector);
258 output->ShallowCopy(imageData);
printMsg(debug::output::BOLD+" | | | | | . \\ | | (__| | / __/| |_| / __/|__ _|"+debug::output::ENDCOLOR, debug::Priority::PERFORMANCE, debug::LineMode::NEW, stream)