schrodinger :: structutils :: color :: ColorScheme :: Class ColorScheme
[hide private]
[frames] | no frames]

Class ColorScheme

                  object --+    
                           |    
utils.colorscheme.MM_CScheme --+
                               |
                              ColorScheme

Define a Maestro color scheme.

This class provides the following functionality:

   colorscheme.apply(st, [atoms])
   for color, asl in colorscheme:
       <do>
Instance Methods [hide private]
 
__init__(self, name='element', color_asl_list=[])
Create ColorScheme object
 
add(self, color_str, asl, rule_description='')
Add another set of rules to this color scheme.
 
__iter__(self)
Iterate over all entries in this scheme.
 
__len__(self)
Return the number of rules in the scheme
 
copy(self)
Return a copy of this scheme.
 
apply(self, st, atoms=None)
Applies the scheme to the specified Structure <st>.
 
writeSchemeFile(self, filename)
Write the scheme to the specified *.sch file.

Inherited from utils.colorscheme.MM_CScheme: __repr__, __swig_destroy__, addRule, applyScheme, clearRules, deleteFile, getDescription, getFileName, getLongName, getOriginalName, getRules, getShortName, readRulesFromFile, setDescription, setFileName, setLongName, setOriginalName, setRules, setShortName, writeFile

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

Properties [hide private]

Inherited from utils.colorscheme.MM_CScheme: thisown

Inherited from object: __class__

Method Details [hide private]

__init__(self, name='element', color_asl_list=[])
(Constructor)

 

Create ColorScheme object

Parameters:
  • name - Name of ColorScheme
  • color_asl_list - List of asl patterns in ColorScheme
Overrides: object.__init__

add(self, color_str, asl, rule_description='')

 

Add another set of rules to this color scheme.

Parameters:
  • color - color string
  • asl - what to apply the color to

__iter__(self)

 

Iterate over all entries in this scheme.

Returns a tuple of (Color, asl)

apply(self, st, atoms=None)

 

Applies the scheme to the specified Structure <st>.

Parameters:
  • atoms - Optionally specify which atoms to apply the scheme to in format. Can be a list atom atom indices, or a Bitset instance.

writeSchemeFile(self, filename)

 

Write the scheme to the specified *.sch file.

Parameters:
  • filename - filelocation to save scheme file to