

def testAdjustBounds(self):
    sphere1 = IECore.SpherePrimitive()
    sphere2 = IECore.SpherePrimitive(2)
    input = GafferSceneTest.CompoundObjectSource()
    input['in'].setValue(IECore.CompoundObject({
        'bound': IECore.Box3fData(sphere2.bound()),
        'children': {
            'group': {
                'bound': IECore.Box3fData(sphere2.bound()),
                'children': {
                    'sphere1': {
                        'bound': IECore.Box3fData(sphere1.bound()),
                        'object': sphere1,
                    },
                    'sphere2': {
                        'bound': IECore.Box3fData(sphere2.bound()),
                        'object': sphere2,
                    },
                },
            },
        },
    }))
    isolate = GafferScene.Isolate()
    isolate['in'].setInput(input['out'])
    filter = GafferScene.PathFilter()
    filter['paths'].setValue(IECore.StringVectorData(['/group/sphere1']))
    isolate['filter'].setInput(filter['out'])
    self.assertEqual(isolate['out'].bound('/'), sphere2.bound())
    self.assertEqual(isolate['out'].bound('/group'), sphere2.bound())
    self.assertEqual(isolate['out'].bound('/group/sphere1'), sphere1.bound())
    isolate['adjustBounds'].setValue(True)
    self.assertEqual(isolate['out'].bound('/'), sphere1.bound())
    self.assertEqual(isolate['out'].bound('/group'), sphere1.bound())
    self.assertEqual(isolate['out'].bound('/group/sphere1'), sphere1.bound())

dataset/ETHPy150Open ImageEngine/gaffer/python/GafferSceneTest/IsolateTest.py IsolateTest.testAdjustBounds/original