| 879 | } |
| 880 | |
| 881 | int vtkGenerateStatistics::RequestDataCellGrid(vtkCellGrid* cellGrid, vtkStatisticalModel* model) |
| 882 | { |
| 883 | if (!cellGrid) |
| 884 | { |
| 885 | return 1; |
| 886 | } |
| 887 | auto samples = vtkSmartPointer<vtkTable>::New(); |
| 888 | vtkNew<vtkCellGridSampleQuery> query; |
| 889 | query->IncludeSourceCellInfoOff(); |
| 890 | query->IncludeSourceCellSiteOff(); |
| 891 | query->SetOutput(samples); |
| 892 | query->SetInput(cellGrid); |
| 893 | if (!cellGrid->Query(query)) |
| 894 | { |
| 895 | vtkErrorMacro("Could not produce sample table."); |
| 896 | return 0; |
| 897 | } |
| 898 | this->StatisticsAlgorithm->SetInputDataObject(vtkStatisticsAlgorithm::INPUT_DATA, samples); |
| 899 | |
| 900 | // Configure this->StatisticsAlgorithm for Learn mode |
| 901 | // and run this->StatisticsAlgorithm |
| 902 | this->StatisticsAlgorithm->SetLearnOption(true); |
| 903 | this->StatisticsAlgorithm->SetDeriveOption(false); |
| 904 | this->StatisticsAlgorithm->SetAssessOption(false); |
| 905 | this->StatisticsAlgorithm->SetTestOption(false); |
| 906 | this->StatisticsAlgorithm->Update(); |
| 907 | |
| 908 | // Copy the computed model into the output model: |
| 909 | model->DeepCopy( |
| 910 | this->StatisticsAlgorithm->GetOutputDataObject(vtkStatisticsAlgorithm::OUTPUT_MODEL)); |
| 911 | return 1; |
| 912 | } |
| 913 | |
| 914 | int vtkGenerateStatistics::RequestDataPlain(vtkDataObject* dataObject, vtkStatisticalModel* model) |
| 915 | { |
no test coverage detected