Package schrodinger :: Package application :: Package jaguar :: Package gui :: Package tabs :: Module coordinates :: Class CoordinatesModel
[hide private]
[frames] | no frames]

Class CoordinatesModel

PyQt4.QtCore.QAbstractTableModel --+
                                   |
                                  CoordinatesModel

A base class for cordinates models used for constraint and scan coordinates in Scan and Optimization tabs. This class should not(!) be initialized on its own. This model is used with Qt view.

Instance Methods [hide private]
 
__init__(self, parent=None)
 
headerData(self, section, orientation, role)
Retrieve the requested header data.
int
rowCount(self, parent=None)
Return the number of rows in the model
int
columnCount(self, parent=None)
Return the number of columns in the model
bool
checkNewCoordinate(self, atoms, coordinate_type)
This function check whether this coordinate is already present in this model.
 
reset(self)
Remove any existing data
bool
removeRow(self, row, parent=QtCore.QModelIndex())
Removes the given row from the child items of the parent specified.
bool
removeCoordinate(self, atoms, coordinate_type)
This function searches for a given coordinate.
int or None
findCoordinate(self, atoms, coordinate_type)
This function searches for coordinate defined by atoms list and coordinate type.
Class Variables [hide private]
object COLUMN = None
class that contains information about columns in which coordinates data is displayed.
Method Details [hide private]

headerData(self, section, orientation, role)

 

Retrieve the requested header data. This data is used to show Qt view column/row headers.

Parameters:
  • section (int) - The row/column number to retrieve header data for
  • orientation (int) - The orientation of the header (Qt.Horizontal or Qt.Vertical) to retrieve data for
  • role (int) - The role to retrieve header data for

rowCount(self, parent=None)

 

Return the number of rows in the model

Parameters:
  • parent - Unused, but preset for PyQt compatibility
Returns: int
The number of rows in the model.

columnCount(self, parent=None)

 

Return the number of columns in the model

Parameters:
  • parent - Unused, but preset for PyQt compatibility
Returns: int
The number of columns in the model.

checkNewCoordinate(self, atoms, coordinate_type)

 

This function check whether this coordinate is already present in this model.

Parameters:
  • atoms (list) - atom indices
  • coordinate_type (int) - coordinate type
Returns: bool
True if this coordinate has not been found and False otherwise.

removeRow(self, row, parent=QtCore.QModelIndex())

 

Removes the given row from the child items of the parent specified. Returns true if the row is removed; otherwise returns false.

Parameters:
  • row (int) - row index
  • index (QtCore.QModelIndex) - parent index
Returns: bool
True or False

removeCoordinate(self, atoms, coordinate_type)

 

This function searches for a given coordinate. If match is found coordinate is removed.

Parameters:
  • atoms (list) - atom indices
  • coordinate_type (int) - coordinate type
Returns: bool
True if this coordinate was found and removed, False otherwise.

findCoordinate(self, atoms, coordinate_type)

 

This function searches for coordinate defined by atoms list and coordinate type. If match is found this function returns row index and None otherwise.

Parameters:
  • atoms (list) - atom indices
  • coordinate_type (int) - coordinate type
Returns: int or None
row index if this coordinate has been found and None otherwise.

Class Variable Details [hide private]

COLUMN

class that contains information about columns in which coordinates data is displayed. It should contain NAMES variable for column names and indices of columns. This object needs to be initialize in derived classes.
Type:
object
Value:
None