MCPcopy Create free account
hub / github.com/Kitware/VTK / ComputeBounds

Method ComputeBounds

Filters/General/vtkReflectionFilter.cxx:37–74  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

35
36//------------------------------------------------------------------------------
37int 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//------------------------------------------------------------------------------
77vtkIdType vtkReflectionFilter::ReflectNon3DCell(

Callers 4

RequestDataMethod · 0.95
InitializeFlowMethod · 0.45
InitializeMethod · 0.45

Calls 9

GetBoundsMethod · 0.45
TakeReferenceMethod · 0.45
NewIteratorMethod · 0.45
InitTraversalMethod · 0.45
IsDoneWithTraversalMethod · 0.45
GoToNextItemMethod · 0.45
GetCurrentDataObjectMethod · 0.45
AddBoundsMethod · 0.45
IsValidMethod · 0.45

Tested by

no test coverage detected