|(AdMatrix *)||- grid|
|(NSArray *)||- spacing|
|(NSArray *)||- divisions|
|(NSString *)||- openDXRepresentationWithData:|
|(NSIndexSet *)||- indexesOfGridPointsLessThan:fromNSPoint:|
AdGrid instances represent a three dimensional cartesian grid in a volume defined by the grids cavity delegate which must conform to the AdGridDelegate protocol. The spacing of the grid points is determined when the object is initialised. The units used by the object are dimensionless.
AdGrid implements the NSCoding protocol. It only supports keyed coding.
|- (id) cavity|
Returns the grid delegate.
|- (void) cavityDidMove|
Should be sent on a change of cavity poisition. The grid object compares the old and new centers and moves translates grid accordingly. If the volume defined by the cavity also changes you should use resetCavity instead. This method does not affect the grid matrix references i.e. the pointer to grid matrix remains the same.
|- (NSArray *) divisions|
Returns the number of divisions (ticks) on each axis.
|- (AdMatrix*) grid|
Returns the grid as an AdMatrix structure. The returned pointer will be invalidated when the AdGrid instance is released, when a new cavity is set using setCavity:, when resetCavity is called or when setSpacing is called.
|+ (id) gridWithDensity:||(double)||density|
Returns an autoreleased AdGrid object containing a grid with the given density of points in the volume defined by cavity.
|+ (id) gridWithDivisions:||(NSArray*)||divisions|
Returns an autoreleased AdGrid object containing a grid with the given number of ticks on each axis.
|+ (id) gridWithSpacing:||(NSArray*)||spacing|
Returns an autoreleased AdGrid object containing a a grid with the given spacing between ticks on each axis.
|- (NSIndexSet *) indexesOfGridPointsLessThan:||(double)||cutoff|
Returns the indexes of all grid points within cutoff of point
|- (int) indexOfGridPointNearestToNSPoint:||(NSArray*)||point|
As indexOfGridPointNearestToPoint: except taking an NSArray
|- (int) indexOfGridPointNearestToPoint:||(Vector3D*)||point|
Returns the index of the row in the grid matrix that is nearest to point. However if point isn't within the searchCutoff of any grid point i.e. its more than this value away on every axis from the nearest grid point, this method returns -1. Effectively this only returns a value if the point is within the volume covered by the grid.
As indexOfGridPointNearestToPoint: but on return array contains the x, y and z indexes of the grid point. That is the index of the x, y, z tick nearest to the point. array must have space for three ints.
|- (id) init|
As initWithSpacing: passing [1.0, 1.0, 1.0] for spacing.
|- (id) initWithDensity:||(double)||density|
Creates a grid with the given density of points in the volume defined by the delegate.
|- (id) initWithDivisions:||(NSArray*)||divisions|
|- (id) initWithSpacing:||(NSArray*)||spacing|
As initWithSpacing:cavity: passing nil for cavity.
|- (id) initWithSpacing:||(NSArray*)||spacing|
Designated initialiser. Creates a grid in the volume defined by cavity with the given spacing between ticks on each axis.
|An||NSArray of double specifying the spacing for each axis in the order x,y,z. If nil the spacing defaults to one in each direction.|
|cavity||An object implementing the AdGridDelegate protocol. If nil the grid is not created. It will be created at the next call to setCavity: with a valid argument.|
|- (int) numberOfPoints|
Returns the total number of grid points.
|- (NSString *) openDXRepresentationWithData:||(NSArray*)||data|
Writes an opendx representation of the grid which involves associating each grid point with a value given by the elements of data. Often the value is the result of evaluating some function at each grid-point e.g. the value of a potential. The result opendx file can be read by many viewers used to generate a volume map of the function in the space defined by the grid.
|- (void) resetCavity|
If the space defined by the cavity changes this message should be sent in order to update the grid. Any objects that retain references to the grid matrix should acquire a new reference. The method can also be used if the cavity centre was changed. However in this case cavityDidMove is more efficent. If no cavity has been set this method does nothing.
|- (double) searchCutoff|
Returns the cutoff. Points outside the grid volume but within this cutoff will be be assigned to a grid point by indexOfGridPointNearestToPoint:.
|- (void) setCavity:||(id)||anObject|
Changes the grids cavity delegate to anObject which must conform to the AdGridDelegate protocol. If it does not an NSInvalidArgumentException is raised. The old grid is freed (if it exists) and a new one is created.
|- (void) setSearchCutoff:||(double)||value|
Sets the cutoff. Points outside the grid volume but within this cutoff will be be assigned to a grid point by indexOfGridPointNearestToPoint:.
|- (void) setSpacing:||(NSArray*)||anArray|
Sets the grid spacing. If a cavity is set a grid is created with the supplied spacing. Any previous grids are destroyed.
|- (NSArray *) spacing|
Retuns the spacing between the point on each axis (dimensionless)