<s> """<STR_LIT>""" <EOL> from traits . api import Instance , Enum , Property , Bool , DelegatesTo <EOL> from traitsui . api import View , Group , Item <EOL> from tvtk . api import tvtk <EOL> from tvtk . common import is_old_pipeline <EOL> from mayavi . core . module import Module <EOL> from mayavi . components . actor import Actor <EOL> from mayavi . core . pipeline_info import PipelineInfo <EOL> class Outline ( Module ) : <EOL> __version__ = <NUM_LIT:0> <EOL> outline_filter = Property ( Instance ( tvtk . ObjectBase , <EOL> allow_none = False ) , record = True ) <EOL> outline_mode = Enum ( '<STR_LIT>' , '<STR_LIT>' , <EOL> desc = '<STR_LIT>' ) <EOL> actor = Instance ( Actor , allow_none = False , record = True ) <EOL> input_info = PipelineInfo ( datasets = [ '<STR_LIT>' ] , <EOL> attribute_types = [ '<STR_LIT>' ] , <EOL> attributes = [ '<STR_LIT>' ] ) <EOL> outline_source = Instance ( tvtk . OutlineSource , ( ) ) <EOL> bounds = DelegatesTo ( '<STR_LIT>' , <EOL> desc = "<STR_LIT>" ) <EOL> manual_bounds = Bool ( <EOL> desc = "<STR_LIT>" <EOL> "<STR_LIT>" ) <EOL> view = View ( Group ( <EOL> Group ( <EOL> Item ( name = '<STR_LIT>' ) , <EOL> Item ( name = '<STR_LIT>' , <EOL> style = '<STR_LIT>' , <EOL> enabled_when = '<STR_LIT>' , <EOL> visible_when = '<STR_LIT>' , <EOL> resizable = True , <EOL> show_label = False ) , <EOL> label = '<STR_LIT>' , <EOL> show_labels = False ) , <EOL> Group ( '<STR_LIT>' , <EOL> Item ( '<STR_LIT>' , enabled_when = '<STR_LIT>' ) , <EOL> label = '<STR_LIT>' , <EOL> ) , <EOL> Item ( name = '<STR_LIT>' , style = '<STR_LIT>' ) , <EOL> layout = '<STR_LIT>' , <EOL> show_labels = False ) , <EOL> resizable = True ) <EOL> _full_outline = Instance ( tvtk . OutlineFilter , args = ( ) , <EOL> allow_none = False ) <EOL> _cornered_outline = Instance ( tvtk . OutlineCornerFilter , args = ( ) , <EOL> allow_none = False ) <EOL> def setup_pipeline ( self ) : <EOL> """<STR_LIT>""" <EOL> self . _full_outline . on_trait_change ( self . render ) <EOL> self . _cornered_outline . on_trait_change ( self . render ) <EOL> self . configure_connection ( self . outline_filter , self . outline_source ) <EOL> self . actor = Actor ( ) <EOL> def update_pipeline ( self ) : <EOL> """<STR_LIT>""" <EOL> mm = self . module_manager <EOL> if mm is None : <EOL> return <EOL> self . _outline_mode_changed ( self . outline_mode ) <EOL> self . pipeline_changed = True <EOL> def update_data ( self ) : <EOL> """<STR_LIT>""" <EOL> self . data_changed = True <EOL> def render ( self ) : <EOL> if not is_old_pipeline ( ) : <EOL> self . outline_filter . update ( ) <EOL> super ( Outline , self ) . render ( ) <EOL> def _outline_mode_changed ( self , value ) : <EOL> """<STR_LIT>""" <EOL> new = self . outline_filter <EOL> old = self . _cornered_outline <EOL> if new is self . _full_outline : <EOL> old = self . _cornered_outline <EOL> self . trait_property_changed ( '<STR_LIT>' , old , new ) <EOL> mm = self . module_manager <EOL> if mm is None : <EOL> return <EOL> self . _manual_bounds_changed ( ) <EOL> self . outputs = [ self . outline_filter . output ] <EOL> def _get_outline_filter ( self ) : <EOL> if self . outline_mode == '<STR_LIT>' : <EOL> return self . _full_outline <EOL> else : <EOL> return self . _cornered_outline <EOL> def _actor_changed ( self , old , new ) : <EOL> new . scene = self . scene <EOL> new . inputs = [ self ] <EOL> self . _change_components ( old , new ) <EOL> def _manual_bounds_changed ( self ) : <EOL> if self . manual_bounds : <EOL> if is_old_pipeline ( ) : <EOL> self . outline_filter . input = self . outline_source . output <EOL> else : <EOL> self . outline_filter . input_connection = self . outline_source . output_port <EOL> else : <EOL> mm = self . module_manager <EOL> self . configure_connection ( self . outline_filter , mm . source ) <EOL> self . render ( ) <EOL> def _bounds_changed ( self ) : <EOL> self . outline_filter . update ( ) <EOL> self . pipeline_changed = True </s>
