Inherits from
- HasPrivateTraits: enthought.traits.has_traits.HasPrivateTraits
Attributes
- actor_added
Event fired when an actor is added to the scene.
actor_added = Event(record = False)
- actor_removed
Event fired when any actor is removed from the scene.
actor_removed = Event(record = False)
- add_actor
Conevenience methods.
add_actor = add_actors
- anti_aliasing_frames
Specifies the number of frames to use for anti-aliasing when saving a scene. This basically increases self.render_window.aa_frames in order to produce anti-aliased figures when a scene is saved to an image. It then restores the aa_frames in order to get interactive rendering rates.
anti_aliasing_frames = Range(0, 20, 8, desc = 'number of frames to use for anti-aliasing when saving a scene')
- background
The background color of the window. This is really a shadow trait of the renderer's background. Delegation does not seem to work nicely for this.
background = Trait(vtk_color_trait((0.5, 0.5, 0.5)), desc = 'the background color of the window')
- busy
Is the scene busy or not.
busy = Property(Bool, record = False)
- camera
The camera.
camera = Property(Instance(tvtk.Camera))
- closed
The control has been closed.
closed = Event(record = False)
- closing
The control is going to be closed.
closing = Event(record = False)
- control
The control to mimic the Widget behavior.
control = Any
- disable_render
Disable rendering.
disable_render = Bool(False, desc = 'if rendering is to be disabled')
- foreground
The default foreground color of any actors. This basically saves the preference and actors will listen to changes -- the scene itself does not use this.
foreground = Trait(vtk_color_trait((1.0, 1.0, 1.0)), desc = 'the default foreground color of actors')
- interactor
The interactor used by the scene.
interactor = Property(Instance(tvtk.GenericRenderWindowInteractor))
- jpeg_progressive
Default JPEG progressive setting.
jpeg_progressive = Bool(True, desc = 'if the generated JPEG should be progressive')
- jpeg_quality
Default JPEG quality.
jpeg_quality = Range(10, 100, 95, desc = 'the quality of the JPEG image to produce')
- light_manager
The light manager.
light_manager = Instance(light_manager.LightManager, record = True)
- line_smoothing
Perform line smoothing for all renderered lines. This produces much nicer looking lines but renders slower. This setting works only when called before the first render.
line_smoothing = Bool(False)
- magnification
The magnification to use when generating images from the render window.
magnification = Range(1, 2048, 1, desc = 'the magnification used when the screen is saved to an image')
- off_screen_rendering
Enable off-screen rendering. This allows a user to render the scene to an image without the need to have the window active. For example, the application can be minimized and the saved scene should be generated correctly. This is handy for batch scripts and the like. This works under Win32. Under Mac OS X and Linux it requires a recent VTK version (later than Oct 2005 and ideally later than March 2006) to work correctly.
off_screen_rendering = Bool(False, desc = 'if off-screen rendering is enabled')
- parallel_projection
Enable parallel projection. This trait is synchronized with that of the camera.
parallel_projection = Bool(False, desc = 'if the camera uses parallel projection')
- point_smoothing
Perform point smoothing for all renderered points. This produces much nicer looking points but renders slower. This setting works only when called before the first render.
point_smoothing = Bool(False)
- polygon_smoothing
Perform polygon smoothing (anti-aliasing) for all rendered polygons. This produces much nicer looking points but renders slower. This setting works only when called before the first render.
polygon_smoothing = Bool(False)
- recorder
A recorder for script recording.
recorder = Instance(HasTraits, record = False, transient = True)
- remove_actor
remove_actor = remove_actors
- render_window
The render_window.
render_window = Property(Instance(tvtk.RenderWindow))
- renderer
The renderer.
renderer = Property(Instance(tvtk.Renderer))
- stereo
Turn on/off stereo rendering. This is set on initialization and has no effect once the widget is realized.
stereo = Bool(False)
Inherited from base classes
Method summary
- __get_pure_state__(self)
- __getstate__(self)
- __init__(self, parent = None, **traits)
- __setstate__(self, str_state)
- add_actors(self, actors)
- add_widgets(self, widgets, enabled = True)
- close(self)
- get_size(self)
- isometric_view(self)
- remove_actors(self, actors)
- remove_widgets(self, widgets)
- render(self)
- reset_zoom(self)
- save(self, file_name, size = None, **kw_args)
- save_bmp(self, file_name)
- save_gl2ps(self, file_name, exp = None)
- save_iv(self, file_name)
- save_jpg(self, file_name, quality = None, progressive = None)
- save_oogl(self, file_name)
- save_png(self, file_name)
- save_povray(self, file_name)
- save_ps(self, file_name)
- save_rib(self, file_name, bg = 0, resolution = None, resfactor = 1.0)
- save_tiff(self, file_name)
- save_vrml(self, file_name)
- save_wavefront(self, file_name)
- save_x3d(self, file_name)
- set_size(self, size)
- x_minus_view(self)
- x_plus_view(self)
- y_minus_view(self)
- y_plus_view(self)
- z_minus_view(self)
- z_plus_view(self)
Inherited from base classes
- __deepcopy__(self, memo)
- __prefix_trait__(self, name, is_set)
- __reduce_ex__(self, protocol)
- add_class_trait(cls, name, *trait)
- add_trait(self, name, *trait)
- add_trait_category(cls, category)
- add_trait_listener(self, object, prefix = '')
- all_trait_names(self)
- base_trait(self, name)
- class_default_traits_view(cls)
- class_editable_traits(cls)
- class_trait_names(cls, **metadata)
- class_trait_view(cls, name = None, view_element = None)
- class_trait_view_elements(cls)
- class_traits(cls, **metadata)
- clone_traits(self, traits = None, memo = None, copy = None, **metadata)
- configure_traits(self, filename = None, view = None, kind = None, edit = True, context = None, handler = None, id = '', scrollable = None, **args)
- copy_traits(self, other, traits = None, memo = None, copy = None, **metadata)
- copyable_trait_names(self, **metadata)
- default_traits_view(self)
- edit_traits(self, view = None, parent = None, kind = None, context = None, handler = None, id = '', scrollable = None, **args)
- editable_traits(self)
- has_traits_interface(self, *interfaces)
- on_trait_change(self, handler, name = None, remove = False, dispatch = 'same', priority = False, deferred = False)
- print_traits(self, show_help = False, **metadata)
- remove_trait(self, name)
- remove_trait_listener(self, object, prefix = '')
- reset_traits(self, traits = None, **metadata)
- set_trait_dispatch_handler(cls, name, klass, override = False)
- sync_trait(self, trait_name, object, alias = None, mutual = True, remove = False)
- trait(self, name, force = False, copy = False)
- trait_context(self)
- trait_get(self, *names, **metadata)
- trait_monitor(cls, handler, remove = False)
- trait_names(self, **metadata)
- trait_set(self, trait_change_notify = True, **traits)
- trait_setq(self, **traits)
- trait_subclasses(cls, all = False)
- trait_view(self, name = None, view_element = None)
- trait_view_elements(self)
- trait_views(self, klass = None)
- traits(self, **metadata)
- validate_trait(self, name, value)
Methods
- __get_pure_state__(self)
Allows us to pickle the scene.
- __getstate__(self)
- __init__(self, parent = None, **traits)
Initializes the object.
- __setstate__(self, str_state)
- add_actors(self, actors)
Adds a single actor or a tuple or list of actors to the renderer.
- add_widgets(self, widgets, enabled = True)
Adds a single 3D widget or a sequence of widgets to the renderer. If enabled is True the widget is also enabled once it is added.
- close(self)
Close the scene cleanly. This ensures that the scene is shutdown cleanly. This should be called if you are getting async errors when closing a scene from a UI. This is based on the observations of Charl Botha here:
http://public.kitware.com/pipermail/vtkusers/2008-May/095291.html
- get_size(self)
Return size of the render window.
- isometric_view(self)
Set the view to an iso-metric view.
- remove_actors(self, actors)
Removes a single actor or a tuple or list of actors from the renderer.
- remove_widgets(self, widgets)
Removes a single 3D widget or a sequence of widgets from the renderer.
- render(self)
Force the scene to be rendered. Nothing is done if the disable_render trait is set to True.
- reset_zoom(self)
Reset the camera so everything in the scene fits.
- save(self, file_name, size = None, **kw_args)
Saves rendered scene to one of several image formats depending on the specified extension of the filename.
If an additional size (2-tuple) argument is passed the window is resized to the specified size in order to produce a suitably sized output image. Please note that when the window is resized, the window may be obscured by other widgets and the camera zoom is not reset which is likely to produce an image that does not reflect what is seen on screen.
Any extra keyword arguments are passed along to the respective image format's save method.
- save_bmp(self, file_name)
Save to a BMP image file.
- save_gl2ps(self, file_name, exp = None)
Save scene to a vector PostScript/EPS/PDF/TeX file using GL2PS. If you choose to use a TeX file then note that only the text output is saved to the file. You will need to save the graphics separately.
Keyword Arguments:
file_name -- File name to save to.
exp -- Optionally configured vtkGL2PSExporter object. Defaults to None and this will use the default settings with the output file type chosen based on the extention of the file name.
- save_iv(self, file_name)
Save to an OpenInventor file.
- save_jpg(self, file_name, quality = None, progressive = None)
Arguments: file_name if passed will be used, quality is the quality of the JPEG(10-100) are valid, the progressive arguments toggles progressive jpegs.
- save_oogl(self, file_name)
Saves the scene to a Geomview OOGL file. Requires VTK 4 to work.
- save_png(self, file_name)
Save to a PNG image file.
- save_povray(self, file_name)
Save scene to a POVRAY (Persistance of Vision Raytracer), file (http://www.povray.org).
Keyword Arguments:
file_name -- File name to save to.
- save_ps(self, file_name)
Saves the rendered scene to a rasterized PostScript image. For vector graphics use the save_gl2ps method.
- save_rib(self, file_name, bg = 0, resolution = None, resfactor = 1.0)
Save scene to a RenderMan RIB file.
Keyword Arguments:
file_name -- File name to save to.
bg -- Optional background option. If 0 then no background is saved. If non-None then a background is saved. If left alone (defaults to None) it will result in a pop-up window asking for yes/no.
resolution -- Specify the resolution of the generated image in the form of a tuple (nx, ny).
resfactor -- The resolution factor which scales the resolution.
- save_tiff(self, file_name)
Save to a TIFF image file.
- save_vrml(self, file_name)
Save to a VRML file.
- save_wavefront(self, file_name)
Save scene to a Wavefront OBJ file. Two files are generated. One with a .obj extension and another with a .mtl extension which contains the material proerties.
Keyword Arguments:
file_name -- File name to save to
- save_x3d(self, file_name)
Save scene to an X3D file (http://www.web3d.org/x3d/).
Keyword Arguments:
file_name -- File name to save to.
- set_size(self, size)
Set the size of the window.
- x_minus_view(self)
View scene down the -X axis.
- x_plus_view(self)
View scene down the +X axis.
- y_minus_view(self)
View scene down the -Y axis.
- y_plus_view(self)
View scene down the +Y axis.
- z_minus_view(self)
View scene down the -Z axis.
- z_plus_view(self)
View scene down the +Z axis.