casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
casa::PlotAxesStack Class Reference

A PlotAxesStack is basically a list of PlotRegions as well as axis information that provides stack functionality such as a current index, and moving up and down the stack. More...

#include <PlotOptions.h>

Public Member Functions

 PlotAxesStack (int lengthLimit=-1)
 Constructor for empty stack. More...
 
 ~PlotAxesStack ()
 Destructor. More...
 
int lengthLimit () const
 Gets/Sets the length limit on this stack. More...
 
void setLengthLimit (int lengthLimit)
 
void clearLengthLimit ()
 
bool isValid () const
 Returns whether the stack is valid (has size > 0) or not. More...
 
unsigned int stackIndex () const
 Returns the current stack index. More...
 
unsigned int size () const
 Returns the stack size. More...
 
std::vector< PlotRegionstack () const
 Returns a copy of the stack. More...
 
std::vector< std::pair
< PlotAxis, PlotAxis > > 
stackAxes () const
 Returns a copy of the stack axes. More...
 
void setBase (const PlotRegion &base, PlotAxis xAxis, PlotAxis yAxis)
 Resets the stack and sets the stack base to the given. More...
 
void addRegion (const PlotRegion &region, PlotAxis xAxis, PlotAxis yAxis)
 Adds the given region to the stack. More...
 
void clearStack (bool keepBase=false)
 Clears the stack, including the base if keepBase is false. More...
 
PlotRegion currentRegion () const
 Returns the current region in the stack. More...
 
PlotAxis currentXAxis () const
 Returns the x-axis for the current region in the stack. More...
 
PlotAxis currentYAxis () const
 Returns the y-axis for the current region in the stack. More...
 
void move (int delta)
 Moves the stack index the given delta. More...
 
PlotRegion moveAndReturn (int delta)
 Moves the stack index the given delta (see move()) and returns the current region. More...
 

Private Member Functions

void shrinkStacks (unsigned int n)
 Shrinks the region and axes stack to the given size, discarding the oldest UNLESS the stack index is in the elements to be discarded. More...
 

Private Attributes

int m_lengthLimit
 Length limit. More...
 
std::vector< PlotRegionm_stack
 Region stack. More...
 
std::vector< std::pair
< PlotAxis, PlotAxis > > 
m_axes
 Axes stack. More...
 
unsigned int m_stackIndex
 casacore::Stack index. More...
 

Detailed Description

A PlotAxesStack is basically a list of PlotRegions as well as axis information that provides stack functionality such as a current index, and moving up and down the stack.

A valid stack has a "base" followed by zero or more PlotRegions. A stack can optionally have a limit on its length; adding to the stack after it reaches its length will remove the oldest members after the base. The smallest value this limit can be is 2, (base + 1 value).

Definition at line 735 of file PlotOptions.h.

Constructor & Destructor Documentation

casa::PlotAxesStack::PlotAxesStack ( int  lengthLimit = -1)

Constructor for empty stack.

Length limits with values <= 1 mean no limit.

casa::PlotAxesStack::~PlotAxesStack ( )

Destructor.

Member Function Documentation

void casa::PlotAxesStack::addRegion ( const PlotRegion region,
PlotAxis  xAxis,
PlotAxis  yAxis 
)

Adds the given region to the stack.

void casa::PlotAxesStack::clearLengthLimit ( )
inline

Definition at line 749 of file PlotOptions.h.

References setLengthLimit().

void casa::PlotAxesStack::clearStack ( bool  keepBase = false)

Clears the stack, including the base if keepBase is false.

PlotRegion casa::PlotAxesStack::currentRegion ( ) const

Returns the current region in the stack.

PlotAxis casa::PlotAxesStack::currentXAxis ( ) const

Returns the x-axis for the current region in the stack.

PlotAxis casa::PlotAxesStack::currentYAxis ( ) const

Returns the y-axis for the current region in the stack.

bool casa::PlotAxesStack::isValid ( ) const

Returns whether the stack is valid (has size > 0) or not.

int casa::PlotAxesStack::lengthLimit ( ) const

Gets/Sets the length limit on this stack.

Values <= 1 mean no limit.

void casa::PlotAxesStack::move ( int  delta)

Moves the stack index the given delta.

If delta is negative, the index goes backwards; if delta is positive, the index goes forward. If delta is zero, the index goes to the base.

PlotRegion casa::PlotAxesStack::moveAndReturn ( int  delta)

Moves the stack index the given delta (see move()) and returns the current region.

void casa::PlotAxesStack::setBase ( const PlotRegion base,
PlotAxis  xAxis,
PlotAxis  yAxis 
)

Resets the stack and sets the stack base to the given.

void casa::PlotAxesStack::setLengthLimit ( int  lengthLimit)

Referenced by clearLengthLimit().

void casa::PlotAxesStack::shrinkStacks ( unsigned int  n)
private

Shrinks the region and axes stack to the given size, discarding the oldest UNLESS the stack index is in the elements to be discarded.

In this case, the element referenced by the index is also kept.

unsigned int casa::PlotAxesStack::size ( ) const

Returns the stack size.

std::vector<PlotRegion> casa::PlotAxesStack::stack ( ) const

Returns a copy of the stack.

std::vector<std::pair<PlotAxis, PlotAxis> > casa::PlotAxesStack::stackAxes ( ) const

Returns a copy of the stack axes.

The first item is for x, the second for y.

unsigned int casa::PlotAxesStack::stackIndex ( ) const

Returns the current stack index.

Member Data Documentation

std::vector<std::pair<PlotAxis, PlotAxis> > casa::PlotAxesStack::m_axes
private

Axes stack.

Definition at line 803 of file PlotOptions.h.

int casa::PlotAxesStack::m_lengthLimit
private

Length limit.

Definition at line 797 of file PlotOptions.h.

std::vector<PlotRegion> casa::PlotAxesStack::m_stack
private

Region stack.

Definition at line 800 of file PlotOptions.h.

unsigned int casa::PlotAxesStack::m_stackIndex
private

casacore::Stack index.

Definition at line 806 of file PlotOptions.h.


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