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 | Friends | List of all members
casa::PlotMSPage Class Reference

Represents a single page of PlotCanvases, arranged in a grid. More...

#include <PlotMSPage.h>

Public Member Functions

 PlotMSPage (const PlotMSPage &copy)
 Copy constructor. More...
 
 ~PlotMSPage ()
 Destructor. More...
 
unsigned int canvasRows () const
 Returns the number of rows/columns of the canvas grid on this page. More...
 
unsigned int canvasCols () const
 
void disown (PlotMSPlot *plot)
 Erase all trace of this plot. More...
 
void clearCanvas (int row, int col)
 Erase all traces of a plot at the specific location including removing axes and title. More...
 
void clearCanvases ()
 Remove axes and titles from all the canvases. More...
 
PlotMSPageoperator= (const PlotMSPage &copy)
 Copy operator. More...
 
bool isSpot (int rowIndex, int colIndex, PlotMSPlot *plot) const
 Returns true if the canvas at (rowIndex, colIndex) does not yet have a plot or if it already has the plot passed in; return false otherwise. More...
 
std::pair< int, int > findEmptySpot () const
 Returns the <rowIndex,colIndex> of the first available canvas that does not yet have a plot. More...
 
bool isOwner (int rowIndex, int colIndex, PlotMSPlot *plot) const
 Returns whether or not the plot is the owner of a canvas located at the given rowIndex and colIndex. More...
 

Private Member Functions

void resize (unsigned int nrows, unsigned int ncols)
 Resizes the grid to the given number of rows and columns. More...
 
 PlotMSPage (PlotMSPages &parent)
 Constructor. More...
 
bool disown (int row, int col)
 Returns true if the canvas at the given row and col was disowned; false otherwise. More...
 
PlotCanvasPtr canvas (unsigned int row, unsigned int col)
 Returns the canvas at the given row and column, or NULL if invalid. More...
 
QList< PlotMSPlot * > owner (unsigned int row, unsigned int col) const
 Returns the owner plot(s) at the given row and column, or an empty list if invalid or there is no owner for that canvas. More...
 
bool setOwner (unsigned int row, unsigned int col, PlotMSPlot *plot)
 Sets the owner for the canvas at the given row and column to the given plot; returns true for success, false otherwise. More...
 
bool isOwned (unsigned int row, unsigned int col)
 Returns true if the canvas at the given row and column exists and is owned, false otherwise. More...
 
bool disown (unsigned int row, unsigned int col, PlotMSPlot *plot)
 Sets the canvas at the given row and column to be owned by no one. More...
 
void setupPage ()
 Sets up this page on the plotter. More...
 

Private Attributes

PlotMSPagesitsParent_
 Parent. More...
 
std::vector< std::vector
< PlotCanvasPtr > > 
itsCanvases_
 Canvases grid. More...
 
std::vector< std::vector
< QList< PlotMSPlot * > > > 
itsCanvasOwners_
 Owner grid. More...
 

Friends

class PlotMSPlot
 
class PlotMSPages
 

Detailed Description

Represents a single page of PlotCanvases, arranged in a grid.

Definition at line 43 of file PlotMSPage.h.

Constructor & Destructor Documentation

casa::PlotMSPage::PlotMSPage ( const PlotMSPage copy)

Copy constructor.

casa::PlotMSPage::~PlotMSPage ( )

Destructor.

casa::PlotMSPage::PlotMSPage ( PlotMSPages parent)
private

Constructor.

Member Function Documentation

PlotCanvasPtr casa::PlotMSPage::canvas ( unsigned int  row,
unsigned int  col 
)
private

Returns the canvas at the given row and column, or NULL if invalid.

unsigned int casa::PlotMSPage::canvasCols ( ) const
unsigned int casa::PlotMSPage::canvasRows ( ) const

Returns the number of rows/columns of the canvas grid on this page.

void casa::PlotMSPage::clearCanvas ( int  row,
int  col 
)

Erase all traces of a plot at the specific location including removing axes and title.

void casa::PlotMSPage::clearCanvases ( )

Remove axes and titles from all the canvases.

void casa::PlotMSPage::disown ( PlotMSPlot plot)

Erase all trace of this plot.

bool casa::PlotMSPage::disown ( int  row,
int  col 
)
private

Returns true if the canvas at the given row and col was disowned; false otherwise.

bool casa::PlotMSPage::disown ( unsigned int  row,
unsigned int  col,
PlotMSPlot plot 
)
private

Sets the canvas at the given row and column to be owned by no one.

All items are removed from the canvas. Returns true for success, false for failure.

std::pair<int,int> casa::PlotMSPage::findEmptySpot ( ) const

Returns the <rowIndex,colIndex> of the first available canvas that does not yet have a plot.

Returns <-1,-1> if there are no canvases without plots.

bool casa::PlotMSPage::isOwned ( unsigned int  row,
unsigned int  col 
)
private

Returns true if the canvas at the given row and column exists and is owned, false otherwise.

bool casa::PlotMSPage::isOwner ( int  rowIndex,
int  colIndex,
PlotMSPlot plot 
) const

Returns whether or not the plot is the owner of a canvas located at the given rowIndex and colIndex.

bool casa::PlotMSPage::isSpot ( int  rowIndex,
int  colIndex,
PlotMSPlot plot 
) const

Returns true if the canvas at (rowIndex, colIndex) does not yet have a plot or if it already has the plot passed in; return false otherwise.

PlotMSPage& casa::PlotMSPage::operator= ( const PlotMSPage copy)

Copy operator.

QList<PlotMSPlot*> casa::PlotMSPage::owner ( unsigned int  row,
unsigned int  col 
) const
private

Returns the owner plot(s) at the given row and column, or an empty list if invalid or there is no owner for that canvas.

For overplotting, there could be multiple owners of the canvas at the given location.

void casa::PlotMSPage::resize ( unsigned int  nrows,
unsigned int  ncols 
)
private

Resizes the grid to the given number of rows and columns.

bool casa::PlotMSPage::setOwner ( unsigned int  row,
unsigned int  col,
PlotMSPlot plot 
)
private

Sets the owner for the canvas at the given row and column to the given plot; returns true for success, false otherwise.

If the given canvas is already owned, it must first be disowned by its old owner.

void casa::PlotMSPage::setupPage ( )
private

Sets up this page on the plotter.

Friends And Related Function Documentation

friend class PlotMSPages
friend

Definition at line 47 of file PlotMSPage.h.

friend class PlotMSPlot
friend

Definition at line 46 of file PlotMSPage.h.

Member Data Documentation

std::vector<std::vector<PlotCanvasPtr > > casa::PlotMSPage::itsCanvases_
private

Canvases grid.

Definition at line 96 of file PlotMSPage.h.

std::vector<std::vector<QList<PlotMSPlot*> > > casa::PlotMSPage::itsCanvasOwners_
private

Owner grid.

Definition at line 99 of file PlotMSPage.h.

PlotMSPages* casa::PlotMSPage::itsParent_
private

Parent.

Definition at line 93 of file PlotMSPage.h.


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