Package schrodinger :: Package application :: Package jaguar :: Package gui :: Module base_panel :: Class CoordinateMarkerMixin
[hide private]
[frames] | no frames]

Class CoordinateMarkerMixin

 object --+    
          |    
MarkerMixin --+
              |
             CoordinateMarkerMixin
Known Subclasses:

A mixin for marking constraints from the Scan or Optimization tabs. Note that this mixin should not be directly applied to a panel. Instead, the OptimizationTabMarkerMixin, ScanTabMarkerMixin, or OptimizationAndScanMixin should be used.

Current limitations:

Instance Methods [hide private]
 
setup(self)
Initialize self._selected_entries
 
_connectInputTabSignals(self)
Connect signals from the input tab.
 
layOut(self)
Once setup is complete, properly initialize the selected entries for the Scan and/or Optimization tabs
 
_connectMarkerSignals(self, tab)
Connect the signals from the specified tab to the appropriate slots
 
clearConstraintsIfWorkspace(self, what_changed)
Check to see if coordinate picking is allowed or if constraints need to be cleared in response to a workspace change.
 
clearConstraintsIfProject(self)
Check to see if coordinate picking is allowed or if constraints need to be cleared in response to a project table change.
 
_clearConstraintsStructureCheck(self)
Only allow coordinate picking if there is exactly one entry in the workspace and it is also selected in the project table.
tuple
_getSelectedEidsAndLength(self)
Retrieve the entry ids for the structures selected in the project table (or included in the workspace, depending on the current Input tab settings).
 
_setAcceptableConstraintEids(self, eids, picking_err)
Pass the constraint or scan picking restrictions to the appropriate tab.
 
_addCoordMarker(self, atom_nums, coordinate_type)
Add a marker to the specified atoms.
tuple
_optMarkerSettings(self)
Get the marker settings to use for the Optimization tab
tuple
_scanMarkerSettings(self)
Get the marker settings to use for the Scan tab
tuple
_markerSettings(self)
Get the marker settings to use for newly added markers.
dict
_getJaguarMarkerSettings(self, num_atoms)
Get the marker settings to use for a newly added marker with the specified number of atoms.
dict
_applyMarkerSettings(self, num_atoms, alt_color, colors, icons)
Get the marker settings to use for a newly added marker with the specified number of atoms.
 
_deleteCoordMarker(self, atom_nums)
Remove the marker from the specified atoms
list
_getAtomsFromInts(self, atom_nums)
Get the workspace atoms with the specified atom numbers
 
_addHighlighting(self, atom_nums)
Highlight the marker for the specified atoms
 
_removeHighlighting(self, atom_nums)
Un-highlight the marker for the specified atoms
 
stopPicking(self)
Stop atom picking in response to changing tabs

Inherited from MarkerMixin: showAllJaguarMarkers

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from MarkerMixin: MARKER_TAB_CLASSES

Instance Variables [hide private]
int or NoneType _selected_eid_atom_total
If there is only one entry id in _selected_eids, then _selected_eid_atom_total contains the number of atoms in that entry.
set _selected_eids
A set of entry ids currently selected in the project table.

Inherited from MarkerMixin: MARKER_TABS

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

setup(self)

 

Initialize self._selected_entries

Overrides: MarkerMixin.setup

_connectInputTabSignals(self)

 

Connect signals from the input tab. Note that this method is overridden in MultiStructurePanelMarkerMixin.

_connectMarkerSignals(self, tab)

 

Connect the signals from the specified tab to the appropriate slots

Parameters:

clearConstraintsIfWorkspace(self, what_changed)

 

Check to see if coordinate picking is allowed or if constraints need to be cleared in response to a workspace change. This callback is needed when the user adds or deleted atoms.

Parameters:
  • what_changed (str) - A flag indicating what has changed in the workspace
Decorators:
  • @af2.maestro_callback.workspace_changed

clearConstraintsIfProject(self)

 

Check to see if coordinate picking is allowed or if constraints need to be cleared in response to a project table change.

Decorators:
  • @af2.maestro_callback.project_updated

_clearConstraintsStructureCheck(self)

 

Only allow coordinate picking if there is exactly one entry in the workspace and it is also selected in the project table. If the selected entry has changed or if the number of atoms in the selected entry has changed, clear all coordinates.

_getSelectedEidsAndLength(self)

 

Retrieve the entry ids for the structures selected in the project table (or included in the workspace, depending on the current Input tab settings). If there is exactly one structure selected, also return the number of atoms in that structure.

Returns: tuple
A tuple of:
  • The entry ids for the structures selected in the project table as a set. If the project table is not available, will be an empty set.
  • If there is exactly one structure selected in the project table, the number of atoms in that structure. None otherwise.

_setAcceptableConstraintEids(self, eids, picking_err)

 

Pass the constraint or scan picking restrictions to the appropriate tab.

Parameters:
  • eids (set) - The entry ids for which coordinate picking is acceptable.
  • picking_err (str or NoneType) - If picking should not be allowed at all, this is the text of the error that will displayed to the user. If picking is allowed, should be None.

_addCoordMarker(self, atom_nums, coordinate_type)

 

Add a marker to the specified atoms. The settings from _markerSettings will be used to style the marker.

Parameters:
  • atom_nums (list) - A list of atom numbers
  • coordinate_type - Ignored. Present for compatability with the tab signal.

_optMarkerSettings(self)

 

Get the marker settings to use for the Optimization tab

Returns: tuple
A tuple of
  • The alt_color for the marker
  • A tuple of colors to use for marking (atoms, pairs, angles, torsions)
  • A tuple of icons to use for marking (atoms, pairs, angles, torsions)

_scanMarkerSettings(self)

 

Get the marker settings to use for the Scan tab

Returns: tuple
A tuple of
  • The alt_color for the marker
  • A tuple of colors to use for marking (atoms, pairs, angles, torsions)
  • A tuple of icons to use for marking (atoms, pairs, angles, torsions)

_markerSettings(self)

 

Get the marker settings to use for newly added markers. This function must be defined in subclasses.

Returns: tuple
A tuple of
  • The alt_color for the marker
  • A tuple of colors to use for marking (atoms, pairs, angles, torsions)
  • A tuple of icons to use for marking (atoms, pairs, angles, torsions)

Note: Marker icon constants aren't defined until runtime because they're not importable outside of Maestro, so these values can't be directly set as class constants, hence this function.

_getJaguarMarkerSettings(self, num_atoms)

 

Get the marker settings to use for a newly added marker with the specified number of atoms. The marker settings from _markerSettings will be used.

Parameters:
  • num_atoms (int) - The number of atoms that will be marked
Returns: dict
A dictionary containing the appropriate addJaguarMarker() arguments for color, alt_color, and icon

_applyMarkerSettings(self, num_atoms, alt_color, colors, icons)

 

Get the marker settings to use for a newly added marker with the specified number of atoms.

Parameters:
  • num_atoms (int) - The number of atoms that will be marked
  • alt_color (tuple, str, int, or schrodinger.structutils.color) - The alt_color for the marker
  • colors (tuple) - A tuple of colors to use for marking (atoms, pairs, angles, torsions)
  • icons (tuple) - A tuple of icons to use for marking (atoms, pairs, angles, torsions)
Returns: dict
A dictionary containing the appropriate addJaguarMarker() arguments for color, alt_color, and icon

_deleteCoordMarker(self, atom_nums)

 

Remove the marker from the specified atoms

Parameters:
  • atom_nums (list) - A list of atom numbers

_getAtomsFromInts(self, atom_nums)

 

Get the workspace atoms with the specified atom numbers

Parameters:
  • atom_nums (list) - A list of atom numbers
Returns: list
A list of atom objects

_addHighlighting(self, atom_nums)

 

Highlight the marker for the specified atoms

Parameters:
  • atom_nums (list) - A list of atom numbers

_removeHighlighting(self, atom_nums)

 

Un-highlight the marker for the specified atoms

Parameters:
  • atom_nums (list) - A list of atom numbers

Instance Variable Details [hide private]

_selected_eid_atom_total

If there is only one entry id in _selected_eids, then _selected_eid_atom_total contains the number of atoms in that entry. If the number of atoms changes, all constraints will be cleared. If _selected_eids is empty of contains more than one entry id, then _selected_eid_atom_total is None.
Type:
int or NoneType

_selected_eids

A set of entry ids currently selected in the project table. If the selected entries changes, all constraints will be cleared.
Type:
set