<s> """<STR_LIT>""" <EOL> from pyface . api import FileDialog , OK <EOL> from pyface . action . api import Action <EOL> from traits . api import Instance , Property , Str <EOL> class SceneAction ( Action ) : <EOL> """<STR_LIT>""" <EOL> scene_manager = Property ( Instance ( <EOL> '<STR_LIT>' <EOL> ) ) <EOL> def _get_scene_manager ( self ) : <EOL> """<STR_LIT>""" <EOL> from tvtk . plugins . scene . i_scene_manager import ( <EOL> ISceneManager <EOL> ) <EOL> return self . window . get_service ( ISceneManager ) <EOL> class NewScene ( Action ) : <EOL> """<STR_LIT>""" <EOL> name = '<STR_LIT>' <EOL> def perform ( self , event ) : <EOL> """<STR_LIT>""" <EOL> from tvtk . plugins . scene . scene_editor import SceneEditor <EOL> editor = self . window . edit ( object ( ) , kind = SceneEditor ) <EOL> return editor <EOL> class SaveScene ( SceneAction ) : <EOL> """<STR_LIT>""" <EOL> name = '<STR_LIT>' <EOL> def perform ( self , event ) : <EOL> """<STR_LIT>""" <EOL> extensions = [ <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' <EOL> ] <EOL> wildcard = '<STR_LIT:|>' . join ( extensions ) <EOL> dialog = FileDialog ( <EOL> parent = self . window . control , <EOL> title = '<STR_LIT>' , <EOL> action = '<STR_LIT>' , <EOL> wildcard = wildcard <EOL> ) <EOL> if dialog . open ( ) == OK : <EOL> scene = self . scene_manager . current_scene <EOL> if scene is not None : <EOL> scene . save ( dialog . path ) <EOL> return <EOL> class SaveSceneToImage ( SceneAction ) : <EOL> """<STR_LIT>""" <EOL> name = '<STR_LIT>' <EOL> save_method = Str ( '<STR_LIT>' ) <EOL> wildcard = Str ( "<STR_LIT>" ) <EOL> def perform ( self , event ) : <EOL> """<STR_LIT>""" <EOL> dialog = FileDialog ( <EOL> parent = self . window . control , <EOL> title = '<STR_LIT>' % self . name , <EOL> action = '<STR_LIT>' , <EOL> wildcard = self . wildcard <EOL> ) <EOL> if dialog . open ( ) == OK : <EOL> scene = self . scene_manager . current_scene <EOL> if scene is not None : <EOL> method = getattr ( scene , self . save_method ) <EOL> method ( dialog . path ) <EOL> return <EOL> class SaveSceneToPNG ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToJPEG ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToBMP ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToTIFF ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToPS ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToGL2PS ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToRIB ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToOOGL ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToIV ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToVRML ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SaveSceneToOBJ ( SaveSceneToImage ) : <EOL> name = '<STR_LIT>' <EOL> save_method = '<STR_LIT>' <EOL> wildcard = '<STR_LIT>' '<STR_LIT>' <EOL> class SetView ( SceneAction ) : <EOL> """<STR_LIT>""" <EOL> view_method = Str <EOL> def perform ( self , event ) : <EOL> """<STR_LIT>""" <EOL> scene = self . scene_manager . current_scene <EOL> if scene is not None : <EOL> method = getattr ( scene , self . view_method ) <EOL> method ( ) <EOL> return <EOL> class ResetZoom ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' <EOL> class IsometricView ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' <EOL> class XPlusView ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' <EOL> class XMinusView ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' <EOL> class YPlusView ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' <EOL> class YMinusView ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' <EOL> class ZPlusView ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' <EOL> class ZMinusView ( SetView ) : <EOL> name = '<STR_LIT>' <EOL> view_method = '<STR_LIT>' </s>
