- 1.7
- 1.6
- 1.5
- Beta
- Examples (for 1.6a)
- Misc
Model creation and management.
Syntax:
void createatoms( | ); |
Can be run when importing trajectory frames. Creates enough atoms in the current trajectory frame to match the parent model.
For example:
createatoms();
Syntax:
model currentmodel( | ); |
model currentmodel( | id); |
int | id; |
model currentmodel( | name); |
string | name; |
model currentmodel( | m); |
model | m; |
Returns a reference to the current model (if no argument is given) or selects the supplied model and makes it the current model. The model may be selected either by name, by its integer position in the list of loaded models (i.e. 1 to N), or a model-type variable containing a valid model reference may be passed.
For example:
currentmodel(4);
selects the fourth loaded model.
currentmodel("Protein coordinates")selects the model named "Protein coordinates" (provided it exists)
model m1, m2;
m1 = newmodel("Test model 1");
m2 = newmodel("Test model 2");
currentmodel(m1);creates two models, storing references to each, and then re-selects the first one and makes it the current target again.
Syntax:
voiddeletemodel( | id); |
int | id; |
void deletemodel( | name); |
string | name; |
void deletemodel( | m); |
model | m; |
Deletes the current model (if no argument is given) or the supplied model.
Syntax:
model firstmodel( | ); |
Makes the first loaded / created model the current model, and returns a reference to it.
For example:
firstmodel();
Syntax:
void finalisemodel( | ); |
Performs various internal tasks after a model has been fully created within a filter. Should be called after all operations on each created model have finished.
For example:
finalisemodel();
Syntax:
model getmodel( | id); |
int | id; |
model getmodel( | name); |
string | name; |
model getmodel( | m); |
model | m; |
Returns a reference to the requested model, but unlike currentmodel does not make it the current model.
For example:
model alpha = getmodel("alpha2");grabs a reference to the model named 'alpha2'.
model m = getmodel(5);
gets a reference to the fifth loaded model.
Syntax:
model lastmodel( | ); |
Makes the last loaded / created model the current model, and returns a reference to it.
For example:
model final = lastmodel();
Syntax:
int loadmodel( | filename); |
string | filename; |
int loadmodel( | filename, | |
newname); |
string | filename; |
string | newname; |
Load model(s) from the filename provided, changing the name of the the (last loaded) model to newname (if provided). The last loaded model becomes the current model, and the number of models loaded is returned.
For example:
loadmodel("/home/foo/coords/test.xyz", "mymodel");loads a model called 'test.xyz' and gives it the new name 'mymodel'.
Syntax:
void modeltemplate( | ); |
Can only be run when importing trajectory frames. Templates the atoms in the trajectory's parent model by creating an equal number of atoms in the target trajectory frame, and copying the element and style data. Positions, forces, and velocities are not copied from the parent model atoms.
For example:
modeltemplate();
Syntax:
model newmodel( | name); |
string | name; |
Create a new model called name which becomes the current model, and return a reference to it.
For example:
newmodel("emptymodel");creates a new, empty model called 'emptymodel' and makes it current.
model c12 = newmodel("dodecane");creates a new, empty model called 'dodecane', makes it current, and stores a reference to it in the variable c12.
Syntax:
model nextmodel( | ); |
Skips to the next loaded model, makes it current, and returns a reference to it.
For example:
model next = nextmodel();
Syntax:
void parentmodel( | ); |
Makes the parent model of the current trajectory frame the current model.
For example:
parentmodel();
Syntax:
model prevmodel( | ); |
Skips to the previous loaded model, makes it current, and returns a reference to it.
For example:
model prev = prevmodel();
Syntax:
int savemodel( | format, | |
filename); |
string | format; |
string | filename; |
Save the current model in the format given (which should correspond to a model export Filter nickname) to the filename specified. If the save was successful, an integer value of '1' is returned, otherwise '0'.
For example:
int success = savemodel("xyz", "/home/foo/newcoords/test.config");saves the current model in xyz format to the filename given.

