47 vtkDataSet *dataSet = vtkDataSet::SafeDownCast(this->GetInput());
53 this->
printErr(
"Could not open file `" + std::string{FileName} +
"' :(");
57 Stream <<
"OFF" << std::endl;
58 Stream << dataSet->GetNumberOfPoints() <<
" " << dataSet->GetNumberOfCells()
62 for(vtkIdType i = 0; i < dataSet->GetNumberOfPoints(); i++) {
63 dataSet->GetPoint(i, p);
64 Stream << p[0] <<
" " << p[1] <<
" " << p[2] <<
" ";
68 for(
int j = 0; j < dataSet->GetPointData()->GetNumberOfArrays(); j++) {
69 vtkDataArray *array = dataSet->GetPointData()->GetArray(j);
70 for(
int k = 0; k < array->GetNumberOfComponents(); k++) {
71 Stream << array->GetComponent(i, k) <<
" ";
78 for(vtkIdType i = 0; i < dataSet->GetNumberOfCells(); i++) {
79 vtkCell *c = dataSet->GetCell(i);
81 Stream << c->GetNumberOfPoints() <<
" ";
82 for(
int j = 0; j < c->GetNumberOfPoints(); j++) {
83 Stream << c->GetPointId(j) <<
" ";
88 for(
int j = 0; j < dataSet->GetCellData()->GetNumberOfArrays(); j++) {
89 vtkDataArray *array = dataSet->GetCellData()->GetArray(j);
90 for(
int k = 0; k < array->GetNumberOfComponents(); k++) {
91 Stream << array->GetComponent(i, k) <<
" ";