PrincipalAxesDM.h

Classes

PrincipalAxesDM -- Interface for DisplayMethods which have data arranged in "axes." (full description)

class PrincipalAxesDM : public DisplayMethod

Interface

Public Members
PrincipalAxesDM(uInt xAxis, uInt yAxis, uInt mAxis, PrincipalAxesDD *padd)
virtual ~PrincipalAxesDM()
virtual void draw(Display::RefreshReason reason, WorldCanvasHolder &wcHolder)
virtual void cleanup()
Protected Members
virtual void setup(IPosition fixedPos)
virtual void setup2d()
virtual IPosition dataShape() = 0
virtual uInt dataDrawSelf(WorldCanvas *wCanvas, const Vector<Double> &blc, const Vector<Double> &trc, const IPosition &start, const IPosition &sliceShape, const IPosition &stride, const Bool usePixelEdges = False) = 0
virtual Bool dataRedrawSelf(WorldCanvas*, Display::RefreshReason)
virtual Bool needToTranspose()
PrincipalAxesDM()
PrincipalAxesDM(const PrincipalAxesDM &other)
void operator=(const PrincipalAxesDM &other)

Description

Synopsis

This class adds to the interface defined by DisplayMethod to provide further infrastructure relevant to data which is arranged by axis (eg. lattice or column-based data).

Member Description

PrincipalAxesDM(uInt xAxis, uInt yAxis, uInt mAxis, PrincipalAxesDD *padd)

User constructor.

virtual ~PrincipalAxesDM()

Destructor.

virtual void draw(Display::RefreshReason reason, WorldCanvasHolder &wcHolder)

Draw on the provided WorldCanvasHolder. This method provides generic preparation that is common to all objects which are being sliced along principal axes. It calls the pure virtual functions (below) which must be defined in fully typed derived classes.

virtual void cleanup()

clear drawlist state.

virtual void setup(IPosition fixedPos)

This method does setup stuff that is common to all elements of an axis-bound display data element.

virtual void setup2d()

virtual IPosition dataShape() = 0

This method should be defined in derived classes to simply return the shape of the data object, eg. Array.shape() or Image.shape(), etc.

virtual uInt dataDrawSelf(WorldCanvas *wCanvas, const Vector<Double> &blc, const Vector<Double> &trc, const IPosition &start, const IPosition &sliceShape, const IPosition &stride, const Bool usePixelEdges = False) = 0

This method should be defined in derived classes to actually draw the data contained in datMatrix, however it likes, starting at the point blc, on *wCanvas. It *must* return a uInt which indicates the drawListNumber it allocated for this drawing. If usePixelEdges is True, then the given blc and trc correspond to the world blc and trc of the first and last pixels in the given data, otherwise they correspond to the world centres of the blc and trc pixels.

virtual Bool dataRedrawSelf(WorldCanvas*, Display::RefreshReason)

Called by draw(): an optimization for ColormapChange in 24bit mode. Redraws the last image using only mapToColor on the WorldCanvas, if possible. If it returns True, the new method WC::redrawIndexedImage() was used successfully (otherwise, draw() continues in the normal way). Override to enable, if necessary (see LatticePADMRaster for an example).

virtual Bool needToTranspose()

Is a transpose necessary?

PrincipalAxesDM()

The logic behind this cryptic code (see LatticePADM::dataGetSlice): If a either a 1xN or Nx1 slice (including 1x1) is requested, LatticePADM's latt.getSlice() Array will be 1-dimensional, which the Matrix = Array operator will turn into an Nx1 matrix. If, on the other hand, there is no degeneracy in the desired slice Matrix, it is returned in lattice (not X,Y) order. (dk)

(Required) default constructor.

PrincipalAxesDM(const PrincipalAxesDM &other)

(Required) copy constructor.

void operator=(const PrincipalAxesDM &other)

(Required) copy assignment.