| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
ProjectRow
ProjectRow allows access to the structure and properties of an entry
in the project. It is an access mechanism and not a completely
self-contained object - project row objects should be treated as
transient, they may become invalid by subsequent project operations.
This class represents a project entry.
Each row is linked to one entry, but row != entry
Project entry index - project order, entry in project - NOT sorted and
NOT same as entry_id
Table row position - changes when table is sorted
Project entry ID - ID of the entry represented by this
Normally it won't be necessary to create an explicit ProjectRow object,
one will be returned by indexing into a ProjectTable object
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
doc =
|
|||
|
|||
|
structure This attribute is obsolete. |
|||
|
title The title of the entry |
|||
|
index Project index of the row |
|||
|
entry_id Entry ID of the row |
|||
|
group EntryGroup for the row |
|||
|
in_workspace Inclusion state of the entry (NOT_IN_WORKSPACE/IN_WORKSPACE/LOCKED_IN_WORKSPACE) WARNING: This property should NOT be treated as a boolean. |
|||
|
is_selected Whether the entry is selected |
|||
|
read_only Whether the entry is read only or not |
|||
|
deletable Whether the entry is deletable or not |
|||
|
cms_structure_reader Return StructureReader for associated CMS file or EmptyIterator if there is no associated file |
|||
|
cms_file Return associated CMS file or None if there is no associated file |
|||
|
surfaces Return an interator to the surface objects available for this entry |
|||
|
Inherited from |
|||
|
|||
Construct a Project Row for the given Project instance based an an entry index.
|
Return string representation
|
Returns:
Structure: The entry's structure
Arguments:
props: True - Associated properties are included
in the returned Structure.
False - Associated properties are excluded from
the returne Structure.
copy: True - Makes and returns a duplicate of the entry's CT
False - Returns the original CT for the entry
WARNING: The current default (copy=True) is to make a duplicate
of the entry's structure. These will be marked for garbage
collection once they go out of scope in the calling code, but if,
for example, you are in a loop your memory usage will grow until
the loop is exited (and it may even take a while for it to drop
since garbage collection is not necessarily immediate). This can
cause large memory usage if, for example, you are iterating over
a large number entries. In some cases you may want to
explicitly delete the returned Structure. For example,
in a loop iterating over a large number of entries you may want to
delete the Structure while still in the loop (after you're
done processing the Structure) to prevent memory bloat.
|
Set the structure of the entry to the specified structure.
Arguments:
struct (required) - Set the entry to this Structure object
copy (optional, default True) -
If True, a copy of the Structure (CT) is
made and that copy is used to set the entry.
If False, the original Structure, struct,
is placed into the project table. Doing this
hands off control of struct and you should no
longer use struct.
props (option, default True) -
If True, update properties in the entry.
If False, properties are ignored.
|
Set Project Row property value prop is the name of the property, i.e. the key |
Obsolete. Use ProjectRow.in_workspace property instead. |
If there is no associated cms file, then we return an empty iterator. This allows you to always just write a loop: for i in cms_structure_reader: and avoid checking if cms_structure_reader exists. If it does not, the loop will do nothing. If there is an associated cms file, then we return a StructureReader that allows one to retrieve the data by iterating. |
Returns the file instead of the reader. This is more convenient to use than the reader in some cases. If there is no associated cms file, then we return None. |
|
|||
doc
|
|
|||
structure
This attribute is obsolete. Please use ProjectRow.getStructure() and
ProjectRow.setStructure() instead.
Reference for the entry Structure. Associated properties are not included.
Properties can be accessed directly from the project via getPropertyNames()
If you wish to update a structure in the project, you may work on that
structure directly. Do something like:
for row in pt.selected_rows:
for atom in row.structure.atom
atom.color = 44 #blue
You must be careful that the project entry you modify is not also
currently included in the Workspace. When that entry is excluded
from the Workspace, its updated contents will be placed into the
entry in the project, potentially overwriting any direct changes
you made to the project entry.
If you want to pass the returned structure to another operation, make a
copy of it first as follows:
st = row.structure.copy()
The Structure returned by row.structure will be invalid after the entry is
edited by Maestro or after setting row.structure to another structure.
WARNING: If you are working with large numbers of entries, you
may experience high memory usage. This typically happens when
retrieving structures while iterating over large number of entries,
but will increase for every structure you retrieve. So if your
cumulative total of retrieved structurs is large then your memory
foot print is likely to be large as well. This is because
the returned structures are configured not to be garbage collected.
You may wish to explicitly delete each Structure once you've finished
processing it in order to minimize memory usage.
|
indexProject index of the row
|
entry_idEntry ID of the row
|
groupEntryGroup for the row
|
in_workspaceInclusion state of the entry (NOT_IN_WORKSPACE/IN_WORKSPACE/LOCKED_IN_WORKSPACE) WARNING: This property should NOT be treated as a boolean.
|
is_selectedWhether the entry is selected
|
read_onlyWhether the entry is read only or not
|
deletableWhether the entry is deletable or not
|
cms_structure_readerReturn StructureReader for associated CMS file or EmptyIterator if there is no associated file
|
cms_fileReturn associated CMS file or None if there is no associated file
|
surfacesReturn an interator to the surface objects available for this entry
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Fri Aug 31 21:32:17 2012 | http://epydoc.sourceforge.net |