remove unnecessary implementation detail

This commit is contained in:
ccolin 2022-02-19 00:13:21 +01:00
parent 340cdbd7ed
commit 6178f294cd

View File

@ -14,7 +14,6 @@
#include <vtkOpenGLProjectedTetrahedraMapper.h> #include <vtkOpenGLProjectedTetrahedraMapper.h>
#include <vtkUnstructuredGridReader.h> #include <vtkUnstructuredGridReader.h>
#include <vtkPiecewiseFunction.h> #include <vtkPiecewiseFunction.h>
#include <vtkDoubleArray.h>
#include <array> #include <array>
#include <vector> #include <vector>
@ -60,7 +59,7 @@ int main(int argc, char **argv) {
/* Display angles in console. */ /* Display angles in console. */
anglesFilter->Update(); anglesFilter->Update();
vtkUnstructuredGrid *grid = anglesFilter->GetOutput(); vtkUnstructuredGrid *grid = anglesFilter->GetOutput();
auto *angles = vtkDoubleArray::SafeDownCast(grid->GetCellData()->GetArray("angles")); auto *angles = grid->GetCellData()->GetArray("angles");
for (ssize_t i = 0; i < angles->GetNumberOfTuples(); i++) { for (ssize_t i = 0; i < angles->GetNumberOfTuples(); i++) {
std::cout << "cell " << i << ": "; std::cout << "cell " << i << ": ";
for (ssize_t j = 0; j < angles->GetNumberOfComponents(); j++) { for (ssize_t j = 0; j < angles->GetNumberOfComponents(); j++) {
@ -76,7 +75,7 @@ int main(int argc, char **argv) {
/* Display aspect ratios in console. */ /* Display aspect ratios in console. */
aspectRatioFilter->Update(); aspectRatioFilter->Update();
grid = aspectRatioFilter->GetOutput(); grid = aspectRatioFilter->GetOutput();
auto *aspectRatios = vtkDoubleArray::SafeDownCast(grid->GetCellData()->GetArray("aspect_ratio")); auto *aspectRatios = grid->GetCellData()->GetArray("aspect_ratio");
for (ssize_t i = 0; i < aspectRatios->GetNumberOfTuples(); i++) { for (ssize_t i = 0; i < aspectRatios->GetNumberOfTuples(); i++) {
std::cout << "cell " << i << ": " std::cout << "cell " << i << ": "
<< aspectRatios->GetTuple1(i) << "\n"; << aspectRatios->GetTuple1(i) << "\n";