Grid Commands

Grid Commands

Add gridded data to the current model.

[Note]See also:

addgridpoint

Syntax:

void addgridpoint(ix,  
 iy,  
 iz,  
 value); 
int  ix;
int  iy;
int  iz;
double  value;

Set a specific data point in the current grid.

For example:

addgridpoint(4, 1, 15, 4.123);

set the grid value at point { 4,1,15 } in the dataset to 4.123.

addnextgridpoint

Syntax:

void addnextgridpoint(value); 
double  value;

Add the next sequential grid point, starting at (1,1,1) and proceeding through dimensions as defined by the gridlooporder command (default is x->y->z, i.e. {1,1,1} is set first, then {2,1,1}, {3,1,1} etc.).

For example:

addnextgridpoint(20.0);

sets the next grid point value to be 20.0.

finalisegrid

Syntax:

void finalisegrid(); 

Perform internal post-load operations on the grid. Must be called for every new grid, after all data has been read in.

For example:

finalisegrid();

gridalpha

Syntax:

double gridalpha(); 
double gridalpha(newalpha); 
double  newalpha;

Set the alpha value (transparency of the current surface), with 0.0 being fully opaque and 1.0 being fully transparent (i.e. invisible), or simply return the current alpha value if no new value is provided.

For example:

gridalpha(0.5);

gridaxes

Syntax:

void gridaxes(ax,  
 ay,  
 az,  
 bx,  
 by,  
 bz,  
 cx,  
 cy,  
 cz); 
double  ax;
double  ay;
double  az;
double  bx;
double  by;
double  bz;
double  cx;
double  cy;
double  cz;

Set the axes of the current grid, specified as three vectors.

For example:

gridaxes(1, 0, 0, 0, 1, 0, 0, 0, 1);

sets a cubic system of axes for the current grid.

gridaxes(0.8, 0, 0, 0.1, 0.6, 0, 0, 0, 0.7);

sets a monoclinic system of axes for the current grid.

gridcolour

Syntax:

void gridcolour(r,  
 g,  
 b,  
 a = 1.0); 
double  r;
double  g;
double  b;
double  a = 1.0;

Set the internal colour (of the positive sign if the 'symmetric' option is enabled for the grid) of the surface to the RGB(A) triplet.

For example:

gridcolour(1.0, 1.0, 0.0);

sets the (positive) surface colour to yellow.

gridcolournegative

Syntax:

void gridcolournegative(r,  
 g,  
 b,  
 a = 1.0); 
double  r;
double  g;
double  b;
double  a = 1.0;

Set the internal colour of the negative sign of the surface to the RGB(A) triplet.

For example:

gridcolournegative(0.9, 0.9, 0.9);

sets the negative surface colour to off-white.

gridcolourscale

Syntax:

void gridcolourscale(id); 
int  id;

Set the colourscale to use for the current grid to the colourscale ID specified, which should be in the range 1-10. If '0' is given as the argument, the internal colour of the grid data is used. Linking a colourscale to a grid will result in the minimum and maximum ranges of the grid being recalculated to ensure all points in the grid are covered by the scale, whose range is adjusted if necessary.

For example:

gridcolourscale(4);

colours the grid data according to colourscale 4.

gridcolourscale(0);

uses the internal colour(s) specified for the grid.

gridcubic

Syntax:

void gridcubic(l); 
double  l;

Sets up a cubic system of axes for the current grid.

For example:

gridcubic(0.5);

sets up a cubic system of axes, each grid point 0.5 Å apart in all directions.

gridlooporder

Syntax:

void gridlooporder(order); 
string  order;

Set the grid loop order to use with addnextgridpoint, affecting in which order the dimensions of the data grid are filled. order should be given as a string of three characters, e.g. 'xyz' (equivalent to '123'), 'yxz' (equivalent to '213'), etc.

For example:

gridlooporder("zyx");

sets the loop order to the reverse of the default, so that the z-index is filled first.

gridorigin

Syntax:

void gridorigin(x,  
 y,  
 z); 
double  x;
double  y;
double  z;

Sets the origin of the grid data, in Å.

For example:

gridorigin(0, 10, 0);

sets the grid origin to be offset 10 Å along the y-axis.

gridortho

Syntax:

void gridortho(a,  
 b,  
 c); 
double  a;
double  b;
double  c;

Sets up an orthorhombic system of axes for the grid data.

For example:

gridortho(0.5, 0.5, 0.8);

sets up a system of axes elongated in the z-axis.

gridsize

Syntax:

void gridsize(nx,  
 ny,  
 nz); 
int  nx;
int  ny;
int  nz;

Sets the size of the grid data, and prepares the data array. This must be called before any calls to addpoint or addnextgridpoint are issued.

For example:

gridsize(64, 128, 64);

initialises the current grid to hold a total of (gets calculator...) 524,288 points.

gridstyle

Syntax:

void gridstyle(style); 
string  style;

Determines how the current grid data is drawn on-screen. Valid styles are listed in Grid Styles.

For example:

gridstyle("triangles");

draws the current grid as a triangle mesh.

gridusez

Syntax:

int gridusez(); 
int gridusez(usez); 
bool  usez;

For two-dimensional grid (i.e. surface) data this option controls whether the data value is used as the height (z) component of the surface, or if no data value is used and the surface is flat. If called with no arguments the current status of the option is returned (0 being 'off', and 1 being 'on').

For example:

gridusez("on");

gridvisible

Syntax:

int gridvisible(); 
int gridvisible(visible); 
bool  visible;

Set the visibility of the current grid (i.e. whether it is drawn on screen).

For example:

gridvisible(FALSE);

loadgrid

Syntax:

grid loadgrid(filename); 
string  filename;

Load an existing grid from the specified file, and add it to the current model. If successfully loaded, a reference to the new grid is returned.

For example:

grid density = loadgrid("density.pdens");

loads a grid called 'density.pdens' into the current model.

newgrid

Syntax:

grid newgrid(name); 
string  name;

Creates a new, empty grid with the provided 'name' in the current model, and returns a reference to it.

For example:

grid g = newgrid("charlie");

creates a new grid called, for some reason, 'charlie'.