def test_deref_vtk(self):
        """Test the `deref_vtk` function."""
        p = Prop()
        o = tvtk_base.deref_vtk(p)
        self.assertEqual(o.IsA('vtkProperty'), True)
        o1 = tvtk_base.deref_vtk(o)
        self.assertEqual(o1.IsA('vtkProperty'), True)

        o = tvtk_base.deref_vtk(self)
        self.assertEqual(o.__class__.__name__, 'TestTVTKBase')
Beispiel #2
0
    def test_deref_vtk(self):
        """Test the `deref_vtk` function."""
        p = Prop()
        o = tvtk_base.deref_vtk(p)
        self.assertEqual(o.IsA('vtkProperty'), True)
        o1 = tvtk_base.deref_vtk(o)
        self.assertEqual(o1.IsA('vtkProperty'), True)

        o = tvtk_base.deref_vtk(self)
        self.assertEqual(o.__class__.__name__, 'TestTVTKBase')
Beispiel #3
0
    def test_global_disable_update(self):
        # Given
        p = Prop()
        vp = tvtk_base.deref_vtk(p)

        # When
        with tvtk_base.global_disable_update():
            vp.SetOpacity(0.5)
            vp.Modified()

        # Then
        self.assertEqual(p.opacity, 1.0)

        # When
        vp.SetOpacity(0.4)

        # Then
        self.assertEqual(p.opacity, 0.4)
Beispiel #4
0
    def test_global_disable_update(self):
        # Given
        p = Prop()
        vp = tvtk_base.deref_vtk(p)

        # When
        with tvtk_base.global_disable_update():
            vp.SetOpacity(0.5)
            vp.Modified()

        # Then
        self.assertEqual(p.opacity, 1.0)

        # When
        vp.SetOpacity(0.4)

        # Then
        self.assertEqual(p.opacity, 0.4)