My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
gcp::util::CoordAxes Class Reference

#include <CoordAxes.h>

Public Member Functions

 CoordAxes ()
 
 CoordAxes (unsigned nel0)
 
 CoordAxes (unsigned nel0, unsigned nel1)
 
 CoordAxes (unsigned nel0, unsigned nel1, unsigned nel2)
 
 CoordAxes (CoordAxes *regAxes)
 
void reset ()
 
void setAxis (unsigned nAxis, unsigned nEl)
 
virtual ~CoordAxes ()
 
unsigned int nAxis ()
 
unsigned int nEl (int axis=-1)
 
unsigned int elementOffsetOf (Coord &coord)
 
unsigned int elementOffsetOf (Coord *coord)
 
Coord coordOf (unsigned element)
 
std::vector< Range< unsigned > > getRanges (CoordRange range)
 
std::vector< Range< unsigned > > getRanges (CoordRange *range=0)
 
bool rangeIsValid (CoordRange &range)
 
bool rangeIsValid (CoordRange *range)
 
unsigned nEl (CoordRange &range)
 
unsigned nEl (CoordRange *range)
 
bool operator== (CoordAxes &axes)
 
void operator= (CoordAxes &axes)
 
void fillRange (CoordRange &range)
 

Public Attributes

std::vector< unsigned int > nEl_
 

Friends

std::ostream & operator<< (std::ostream &os, CoordAxes axes)
 

Detailed Description

Class for managing coordinate axes.

NB: All axis specifiers are indexed starting from 0

Constructor & Destructor Documentation

CoordAxes::CoordAxes ( )

Constructors.

....................................................................... Constructor.

CoordAxes::CoordAxes ( unsigned  nel0)

....................................................................... Constructor.

CoordAxes::CoordAxes ( unsigned  nel0,
unsigned  nel1 
)

....................................................................... Constructor.

CoordAxes::CoordAxes ( unsigned  nel0,
unsigned  nel1,
unsigned  nel2 
)

....................................................................... Constructor.

CoordAxes::CoordAxes ( CoordAxes regAxes)

Copy constructor

....................................................................... Copy constructor

CoordAxes::~CoordAxes ( )
virtual

Destructor.

....................................................................... Destructor.

Member Function Documentation

Coord CoordAxes::coordOf ( unsigned  iEl)

An N-dimensional axis description can be thought of as indexing a contiguous one-dimensional array.

This method returns the multi-dimensional coordinate corresponding to the requested element offset in that hypothetical 1-D array.

....................................................................... Given an element offset, return the coordinate corresponding to it.

unsigned int CoordAxes::elementOffsetOf ( Coord coord)

An N-dimensional axis description can be thought of as indexing a contiguous one-dimensional array.

This method returns the offset, in elements, of the specified multi-dimensional coordinate from the beginning of the hypothetical 1-D array corresponding to this axis descriptor.

....................................................................... Return the element offset of the specified coordinate from the start of the register array

unsigned int CoordAxes::elementOffsetOf ( Coord coord)

....................................................................... Return the element offset of the specified coordinate from the start of the register array

void CoordAxes::fillRange ( CoordRange range)

This method fills out any missing dimensions in the range object with the full range for that axis.

....................................................................... A range will be considered consistent with this axis description even if indices for fewer than nAxis() are specified. We assume that an axis in the range for which indices have not been specified should default to the whole range for that axis.

This method fills out any missing dimensions in the range object with the full range for that axis.

std::vector< Range< unsigned > > CoordAxes::getRanges ( CoordRange  coordRange)

CoordRange objects can specify a different range of indices in each axis. In terms of the corresponding element offset in a hypothetical 1-D array corresponding to this multi-dimensional axis description, these may translate into a single contiguous element range, or a series of non-contiguous ranges.

This method takes a CoordRange object and returns a vector of contiguous element ranges in the 1-D array.

Neither one of these methods modifies the input. The second is provided so that a NULL range can be passed to mean "all"

....................................................................... Return a vector of byte ranges associated with the specified input coordinate range.

std::vector< Range< unsigned > > CoordAxes::getRanges ( CoordRange coordRange = 0)

....................................................................... Return a vector of byte ranges associated with the specified input coordinate range.

unsigned int CoordAxes::nAxis ( )

Return the number of axes in this axis description

....................................................................... Return the number of axes in this register

unsigned int CoordAxes::nEl ( int  axis = -1)

Return the number of elements in an axis.

If axis < 0, return the total number of elements in this descriptor. Else return the number of elements in the requested axis.

....................................................................... Return the number of elements in this register

unsigned CoordAxes::nEl ( CoordRange coordRange)

Return the total number of elements specified in a range object

....................................................................... Return the total number of elements specified in a range object

unsigned CoordAxes::nEl ( CoordRange coordRange)

....................................................................... Return the total number of elements specified in a range object

void CoordAxes::operator= ( CoordAxes regAxes)

An operator for assigning two Axes

....................................................................... Copy constructor

bool CoordAxes::operator== ( CoordAxes axes)

An operator for testing equality of two Axes

bool CoordAxes::rangeIsValid ( CoordRange range)

Check if a coordinate range is consistent with this axis specifier

....................................................................... Check if a coordinate range is consistent with this axis specifier

bool CoordAxes::rangeIsValid ( CoordRange range)

....................................................................... Check if a coordinate range is consistent with this axis specifier

void CoordAxes::reset ( )

Reset this object

....................................................................... Reset this object

void CoordAxes::setAxis ( unsigned  iAxis,
unsigned  nEl 
)

Method for setting the number of elements on an arbitrary axis

....................................................................... Method for setting arbitrary axes

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
CoordAxes  axes 
)
friend

An operator for printing this object


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