Clipper
Public Member Functions | Friends
clipper::Coord_grid Class Reference

Grid coordinate. More...

#include <coords.h>

Inheritance diagram for clipper::Coord_grid:
clipper::Vec3< int >

List of all members.

Public Member Functions

 Coord_grid ()
 null constructor
 Coord_grid (const Vec3< int > v)
 constructor: copy/convert
 Coord_grid (const int &u, const int &v, const int &w)
 constructor: from u,v,w
 Coord_grid (const Grid &g, const int &index)
 constructor: from a grid and an index in that grid
const int & u () const
 get u
const int & v () const
 get v
const int & w () const
 get w
int & u ()
 set u
int & v ()
 set v
int & w ()
 set w
Coord_map coord_map () const
 convert to Coord_map
Coord_frac coord_frac (const Grid_sampling &g) const
 convert to Coord_frac using given Grid_sampling
Coord_grid transform (const Isymop &op) const
 return transformed coordinate
Coord_grid unit (const Grid_sampling &g) const
 reduce to unit box: (0..nu-1, 0..nv-1, 0..nw-1)
const Coord_gridnext (const Grid &g)
 increment in storage order (see index())
const Coord_gridnext (const Grid_range &g)
 increment in storage order (see index())
bool last (const Grid &g) const
 test if done in storage order (see index())
bool last (const Grid_range &g) const
 test if done in storage order (see index())
int index (const Grid &g) const
 grid indexing operator
void deindex (const Grid &g, const int &index)
 grid deindexing operator
String format () const
 return formatted String representation

Friends

Coord_grid operator- (const Coord_grid &r1)
Coord_grid operator+ (const Coord_grid &r1, const Coord_grid &r2)
Coord_grid operator- (const Coord_grid &r1, const Coord_grid &r2)
Coord_grid operator* (const int &s, const Coord_grid &r1)
int operator== (const Coord_grid &r1, const Coord_grid &r2)
int operator!= (const Coord_grid &r1, const Coord_grid &r2)
Coord_grid operator* (const Isymop &op, const Coord_grid &r1)

Detailed Description

Grid coordinate.


Member Function Documentation

Coord_map clipper::Coord_grid::coord_map ( ) const [inline]
Coord_frac clipper::Coord_grid::coord_frac ( const Grid_sampling g) const [inline]

convert to Coord_frac using given Grid_sampling

Fractional coordinate is not normalised onto range 0..1

Parameters:
gThe grid concerned
Returns:
The fractional coordinate

References clipper::Grid_sampling::nu(), clipper::Grid_sampling::nv(), clipper::Grid_sampling::nw(), u(), v(), and w().

Coord_grid clipper::Coord_grid::unit ( const Grid_sampling g) const [inline]
const Coord_grid & clipper::Coord_grid::next ( const Grid g) [inline]

increment in storage order (see index())

guaranteed to increment index(g) by 1

The grid coordinate is incremented efficiently in a manner which is exaclty equivalent to increasing index() by 1 in a zero based grid.

Parameters:
gThe grid with which this increment is synchronised.

References clipper::Grid::nv(), clipper::Grid::nw(), u(), v(), and w().

Referenced by clipper::Xmap_cacheobj::Xmap_cacheobj().

const Coord_grid & clipper::Coord_grid::next ( const Grid_range g) [inline]

increment in storage order (see index())

guaranteed to increment index(g) by 1

The grid coordinate is incremented efficiently in a manner which is exaclty equivalent to increasing index() by 1 in a non-zero based grid.

Parameters:
gThe grid with which this increment is synchronised.

References clipper::Grid_range::max(), clipper::Grid_range::min(), u(), v(), and w().

bool clipper::Coord_grid::last ( const Grid g) const [inline]

test if done in storage order (see index())

Test whether this coordinate has been incremented using next() beyond the end of the specified zero based grid.

Parameters:
gThe grid concerned.

References clipper::Grid::nu(), and u().

Referenced by clipper::Xmap_cacheobj::Xmap_cacheobj().

bool clipper::Coord_grid::last ( const Grid_range g) const [inline]

test if done in storage order (see index())

Test whether this coordinate has been incremented using next() beyond the end of the specified non-zero based grid.

Parameters:
gThe grid concerned.

References clipper::Grid_range::max(), and u().

int clipper::Coord_grid::index ( const Grid g) const [inline]

grid indexing operator

Return the index in a 1-d array corresponding to this coordinate for a zero based grid.

Parameters:
gThe grid concerned.
Returns:
The corresponding index.

References clipper::Grid::nv(), clipper::Grid::nw(), u(), v(), and w().

Referenced by deindex(), and clipper::Grid::index().

void clipper::Coord_grid::deindex ( const Grid g,
const int &  index 
) [inline]

grid deindexing operator

Return the coordinate corresponding to a given index in a zero based grid.

Parameters:
gThe grid concerned.
Returns:
The corresponding coordinate.

References index(), clipper::Grid::nv(), clipper::Grid::nw(), u(), v(), and w().

Referenced by Coord_grid().

String clipper::Coord_grid::format ( ) const

return formatted String representation

Returns:
The formatted text string

Reimplemented from clipper::Vec3< int >.

References u(), v(), and w().


The documentation for this class was generated from the following files: