Exemplo n.º 1
0
    def test_parent_child_input(self):
        """Case where parent has GetInput and child SetInput."""
        vm = tvtk.VolumeTextureMapper2D()
        # In this case if the wrapping is not done right, the input
        # trait is made read-only which is a bug.  We set the input
        # below to test this.
        vm.input = tvtk.ImageData()

        spw = tvtk.StructuredPointsWriter()
        spw.input = None
Exemplo n.º 2
0
 def test_parent_child_input(self):
     """Case where parent has GetInput and child SetInput."""
     vm = tvtk.VolumeTextureMapper2D()
     # In this case if the wrapping is not done right, the input
     # trait is made read-only which is a bug.  We set the input
     # below to test this.
     configure_input_data(vm, tvtk.ImageData())
     spw = tvtk.StructuredPointsWriter()
     if vtk_major_version < 6:
         spw.input = None
     else:
         spw.input_connection = None
Exemplo n.º 3
0
    def _volume_mapper_type_changed(self, value):
        mm = self.module_manager
        if mm is None:
            return

        old_vm = self._volume_mapper
        if old_vm is not None:
            old_vm.on_trait_change(self.render, remove=True)

        if value == 'RayCastMapper':
            new_vm = tvtk.VolumeRayCastMapper()
            self._volume_mapper = new_vm
            self._ray_cast_functions = [
                'RayCastCompositeFunction', 'RayCastMIPFunction',
                'RayCastIsosurfaceFunction'
            ]
            new_vm.volume_ray_cast_function = tvtk.VolumeRayCastCompositeFunction(
            )
        elif value == 'SmartVolumeMapper':
            new_vm = tvtk.SmartVolumeMapper()
            self._volume_mapper = new_vm
            self._ray_cast_functions = ['']
        elif value == 'TextureMapper2D':
            new_vm = tvtk.VolumeTextureMapper2D()
            self._volume_mapper = new_vm
            self._ray_cast_functions = ['']
        elif value == 'TextureMapper3D':
            new_vm = tvtk.VolumeTextureMapper3D()
            self._volume_mapper = new_vm
            self._ray_cast_functions = ['']
        elif value == 'VolumeProMapper':
            new_vm = tvtk.VolumeProMapper()
            self._volume_mapper = new_vm
            self._ray_cast_functions = ['']
        elif value == 'FixedPointVolumeRayCastMapper':
            new_vm = tvtk.FixedPointVolumeRayCastMapper()
            self._volume_mapper = new_vm
            self._ray_cast_functions = ['']
        elif value == 'UnstructuredGridVolumeRayCastMapper':
            new_vm = tvtk.UnstructuredGridVolumeRayCastMapper()
            self._volume_mapper = new_vm
            self._ray_cast_functions = ['']
        elif value == 'UnstructuredGridVolumeZSweepMapper':
            new_vm = tvtk.UnstructuredGridVolumeZSweepMapper()
            self._volume_mapper = new_vm
            self._ray_cast_functions = ['']

        src = mm.source
        self.configure_connection(new_vm, src)
        self.volume.mapper = new_vm
        new_vm.on_trait_change(self.render)