------------------------------------------------------------------------------
| 35 | |
| 36 | //------------------------------------------------------------------------------ |
| 37 | int vtkReflectionFilter::ComputeBounds(vtkDataObject* input, double bounds[6]) |
| 38 | { |
| 39 | // get the input and output |
| 40 | vtkDataSet* inputDS = vtkDataSet::SafeDownCast(input); |
| 41 | vtkCompositeDataSet* inputCD = vtkCompositeDataSet::SafeDownCast(input); |
| 42 | |
| 43 | if (inputDS) |
| 44 | { |
| 45 | inputDS->GetBounds(bounds); |
| 46 | return 1; |
| 47 | } |
| 48 | |
| 49 | if (inputCD) |
| 50 | { |
| 51 | vtkBoundingBox bbox; |
| 52 | |
| 53 | vtkSmartPointer<vtkCompositeDataIterator> iter; |
| 54 | iter.TakeReference(inputCD->NewIterator()); |
| 55 | for (iter->InitTraversal(); !iter->IsDoneWithTraversal(); iter->GoToNextItem()) |
| 56 | { |
| 57 | vtkDataSet* ds = vtkDataSet::SafeDownCast(iter->GetCurrentDataObject()); |
| 58 | if (!ds) |
| 59 | { |
| 60 | vtkErrorMacro("Input composite dataset must be comprised for vtkDataSet " |
| 61 | "subclasses alone."); |
| 62 | return 0; |
| 63 | } |
| 64 | bbox.AddBounds(ds->GetBounds()); |
| 65 | } |
| 66 | if (bbox.IsValid()) |
| 67 | { |
| 68 | bbox.GetBounds(bounds); |
| 69 | return 1; |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | return 0; |
| 74 | } |
| 75 | |
| 76 | //------------------------------------------------------------------------------ |
| 77 | vtkIdType vtkReflectionFilter::ReflectNon3DCell( |
no test coverage detected