- BaseWidget
- base class for all widgets
- MoleculeRenderWidget
- widget for 3D rendering
- MoleculeThumbnailWidget
- small frame for exploring a molecule
- ButtonToolbar
- button toolbar
- VibrationalToolbar
- navigation through vibrations
- VibrationalToolbarLight
- for exploring single vibration
- NavigationToolbar
- manipulating camera of MoleculeRenderWidget
- WindowNavigationToolbar
- toolbar for switching between windows
- GeometryMeasureToolbar
- widget for measuring distances, angles etc.
- VibNavigationFrame
- component of VibrationalToolbar
- SplashScreen
- shown during a long operation
- InfoWidget
- widget for providing a help text
- TwoDCircles
- canvas for rendering matrices
- CorrelationResultsTable
- table for representing matrices
- CorrelationResultsNoteBook
- exploring results of a correlation of v/m
- WizardWidget
- wizard widget
- ChooseColorWidget
- widget for choosing a color
- AxesSettingsWidget
- widget for setting properties of axes
- PropertiesWidget
- widget for showing text properties
- PatchedPmwOptionMenu
- patched version of Pmw.OptionMenu
- show_exception()
- show an exception in a text dialog
- mouse_wheel()
- mouse wheel callback for a widget
- bind_mouse_wheel()
- bind the mouse wheel events to a widget
- pmw_widget()
- instantiate a Pmw widget
Author: | Maxim Fedorovsky |
---|
Base class for all widgets.
This class defines a set of protected methods that are called in the initializer in the following sequence:
- _init_vars()
- initialize some variables
- _constructGUI()
- construct the GUI of the widget
- _declare_properties()
- declare properties of the widget
- _bind_help()
- bind help messages to the GUI components
- _bind_events()
- bind events
These methods are intended to be overridden in subclasses. The base class implementations do nothing.
The following protected instance variables are created:
- _smartdict
- to store options
- _varsdict
- to store GUI variables
- _balloon
- to provide help message on the GUI
Initializer of the class.
Keywords arguments are options of the widget.
Widget for 3D rendering.
The class inherits from vtkTkRenderWidget and overrides the mouse button events.
Initializer of the class.
Parameters: |
|
---|
Create a series of files for animation of a vibration.
The function does not compile the result images to the animation. It produces the files and returns the name of file with the list of the created frames. The files will be stored in a temporaral directory.
Parameters: |
|
---|
Deselect the picked atoms.
Parameter: | atom_index_list – list of 0-based indices of PICKED atoms these are NOT indices of atoms to be unpicked. If None, use all the PICKED atoms |
---|
If the only element in the list is -1 -> depick the last picked atom.
Get a node.
Parameters: |
|
---|---|
Returns: | None unless the arguments are valid or nothing was found. |
Highlight/unhighlight the picked atoms.
Nothing is done the atom list is not supplied.
Parameters: |
|
---|
Pick given atoms.
If the atom list is not supplied, all the atoms are picked.
Parameter: | atom_index_list – atom indices (zero-based ndarray), indices are zero-based |
---|
Render group contribution patterns (GCPs).
The contributions are placed in center of gravities of the groups.
Parameters: |
|
---|
Render the molecule.
Parameters: |
|
---|
Render scalar values on the atoms such as e.g. ACPs.
Parameters: |
|
---|
Render a triangle.
Parameter: | i1, i2, i3 – coordinates of the vertices |
---|
See also
pyviblib.gui.rendering.BaseNode
Render a vibration.
Parameters: |
|
---|
Rotate the active camera at given Euler angles.
Parameters: |
|
---|
The rotation does not affect the synchronized widget.
Make a snapshot of the 3D render window.
Parameters: |
|
---|
Start a synchronous picking of atoms in two render widgets.
Parameters: |
|
---|
Set a render widget for synchronous rotation/zooming.
By default the rotation and zooming are synchronized. Consider the do_sync_rotation and do_sync_zoom properties to control the synchronized behaviour.
Parameter: | sync_widget – the render widget can be None |
---|
Zoom in/out.
Parameter: | zoomFactor – the height of the viewport in world-coordinate distances. |
---|
Note
This factor works as an “inverse scale” i.e. larger numbers produce smaller images. This factor has no meaning if the perspective projection is on.
The zooming does not affect the synchronized widget.
Small frame for viewing a molecule.
The widget is made up of a Molecule menu at the top, a 3D render widget and a check box. The contents of the menu reflects the data which the molecule possesses.
Initializer of the class.
Parameters: |
|
---|
Button toolbar.
The widget is based on Tkinter.Frame.
Initializer of the class.
Parameters: |
|
---|
Add a button.
The methods accepts the keyword arguments for Tkinter.Button.
Parameters: |
|
---|---|
Returns: | the reference to the button created |
Widget for navigating through vibrations.
The widget is based on Pmw.ScrolledFrame.
Initializer of the class.
The size of the toolbar is hardcoded to be 1000x105.
Parameters: |
|
---|
Like VibrationalToolbar but for exploring single vibration.
Supports also marking of vibrational motion on a fragment.
The following readable and writable properties are exposed:
- vib_no
- number of the vibration
- rep_type
- cartesian or mass-weighted excursions
- rep_subtype
- representation subtype
- invert_phase
- whether the phase is to be inverted
- sync_toolbar
- VibrationalToolbarLight to synchronize with
The following properties are exposed uf fragment_controls=True was supplied in the Initializer of the class:
- mark_fragment
- fragment to be marked
- show_marked_only
- show vibrational motion only on the fragment
The following public methods are exported:
- increase_scale_factor()
- increase the scale factor
- decrease_scale_factor()
- decrease the scale factor
Initializer of the class.
Parameters: |
|
---|
Manipulating camera of MoleculeRenderWidget.
Initializer of the class.
Parameters: |
|
---|
Save the camera camera state to a dictionary.
Parameter: | camera_state – the dictionary to save to, if None save to the internal dictionary |
---|
Update the current camera.
Parameter: | camera_stat – dictionary with the camera state |
---|
Toolbar for switching between windows.
Initializer of the class.
Parameters: |
|
---|
Toolbar for measuring distances, angles and dihedral angles.
Initializer of the class.
Parameters: |
|
---|
Frame for navigating through vibrations.
Component of VibrationalToolbar.
Initializer of the class.
Parameters: |
|
---|
Enable / disable the controls.
Parameter: | enable – whether the controls are to be enabled |
---|
Splash screen which can be shown during a long operation.
Initializer of the class.
Parameters: |
|
---|
Widget for providing a help text.
Initializer of the class.
Parameters: |
|
---|
Canvas for rendering matrices such as e.g. GCMs, overlaps or similarities.
The widget is based on Tkinter.Canvas.
Initializer of the class.
All arrays supplied in the keyword args must be one-based ndarrays.
Parameters: |
|
---|
Mark/unmark a rectangle.
Parameters: |
|
---|
Table for representing matrices e.g. overlaps or similarities.
The widget is based on Pmw.ScrolledText.
Initializer of the class.
Parameters: |
|
---|
Get the numbers of vibrations.
Parameters: |
|
---|---|
Returns: | (ref_index, tr_index). Negative indices correspond to translations/rotations |
Update the contents of the table.
Parameters: |
|
---|
Get the number of the row and column.
Parameters: |
|
---|
Widget for representing results of a correlation of vibrational motions.
The widget is based on Pmw.NoteBook.
Initializer of the class.
Parameters: |
|
---|
Switch to the A4 representation of the circles.
Parameters: |
|
---|
Update the contents of the table and circles.
Parameters: |
|
---|
Wizard widget.
Initializer of the class.
Parameters: |
|
---|
Widget for choosing a color.
Consists of a label with a description and a button for changing the color.
Initializer of the class.
Parameters: |
|
---|
Widget for setting properties of axes.
Properties marked with an asterisk (*) are exposed if the add_limits argument of the constructor was set to True.
Initializer of the class.
Parameters: |
|
---|
Widget for showing text properties.
Each property is represented by one line with the name of the property shown at the left and its value at the right.
Initializer of the class.
Parameters: |
|
---|
Add a new line.
Parameters: |
|
---|
Patched version of Pmw.OptionMenu.
The original setitems() raises an exception for Python 2.5.4+.
http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg728050.html
Initializer of the class.
Parameter: | parent – parent widget |
---|
The keywords are passed to Pmw.OptionMenu
Show an exception in a dialog.
Parameter: | exception_info – must be the return value of sys.exc_info() |
---|
Mouse wheel callback for a widget.
Parameter: | widget – widget |
---|
Usage:
>>> from pyviblib.util.misc import Command
>>> from pyviblib.gui.widgets import mouse_wheel
>>> widget.bind('<Button-4>', Command(mouse_wheel, widget))
>>> widget.bind('<Button-5>', Command(mouse_wheel, widget))
Instantiate a Pmw widget.
Parameter: | cls_name – class name of the widget |
---|
The positional and keyword arguments will be delegated to the widget.