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

Widget to collect plot parameters and plot on the canvas. More...

#include <TBPlotter.qo.h>

Inheritance diagram for casa::TBPlotter:

Public Member Functions

 TBPlotter (TBBrowser *browser, PlotFactoryPtr factory)
 Constructor that takes the parent browser. More...
 
 ~TBPlotter ()
 
QProgressPaneladdProgressPanel (casacore::String label, bool hideable, bool cancelable)
 Adds a QProgressPanel to the plotter with the given parameters and returns it. More...
 
void removeProgressPanel (QProgressPanel *panel)
 Removes the given QProgressPanel from the plotter. More...
 

Protected Member Functions

void closeEvent (QCloseEvent *event)
 Capture when the window closes. More...
 

Private Slots

void tableChosen (QString name)
 Slot for when the user chooses a different table from the combobox. More...
 
void xChosen (int x)
 Slot for when the user chooses a field for the x-axis. More...
 
void yChosen (int y)
 Slot for when the user chooses a field for the y-axis. More...
 
void chosen (bool x, int i)
 Slot for code common to xChosen and yChosen. More...
 
void indexChosen (bool x)
 Slot for when [index] is chosen. More...
 
void indexReleased (bool x, int i)
 Slot for when [index] is deselected. More...
 
void plot ()
 Slot for the "Clear and Plot" button. More...
 
void overplot ()
 Slot for the "Overplot" button. More...
 
void openNewPlotter ()
 Opens a new TBPlotter window. More...
 
void tableOpened (casacore::String table, casacore::String fullpath)
 Slot for when a table is opened in the browser. More...
 
void tableClosed (casacore::String table)
 Slot for when a table is closed in the browser. More...
 
void clear ()
 Slot for the "Clear" button. More...
 
void allRows ()
 Slot for the "All Rows" button. More...
 
void setColor (QLineEdit *lineEdit)
 Slot to open a QColorDialog for the given line edit. More...
 
void setLineColor ()
 Convenience slot. More...
 
void setSymbolColor ()
 Convenience slot. More...
 
void exportImage ()
 Slot to export the current plot canvas to the image format specified by the QComboBox. More...
 
void filterRuleEntered (int i)
 Slot for when the user enters a filter rule for the table at the given index. More...
 
void filterRuleCleared (int i)
 Slot for when the user enters a filter rule for the table at the given index. More...
 
void gridChanged ()
 Slot for when the user changes the grid options. More...
 
void regionSelected (bool selected)
 
void selectLocate ()
 Slot for when the user clicks "locate". More...
 
void clearSelection ()
 Slot for when the user clears the currently selected region. More...
 

Private Member Functions

void doPlot (bool overplot=true)
 Collects the parameters and plots as indicated. More...
 
void enableRowIteration (bool visible)
 Show/Hide row iteration GUI when [index] is deselected/selected. More...
 

Private Attributes

TBBrowserbrowser
 Parent browser. More...
 
PlotFactoryPtr factory
 Plotter factory. More...
 
std::map< casacore::String,
std::vector< std::vector< int > * > > 
dimensions
 For each table the plotter knows about, the dimensions of the fields are kept for fast access. More...
 
std::vector< int > adjustedIndices
 Since only certain field types are plottable, adjustedIndices allows for translation between the index of the combobox (which contains only plottable fields) and the index in the table (which contains all fields). More...
 
PlotSlicer xSlice
 PlotSlicer for the x-axis. More...
 
PlotSlicer ySlice
 PlotSlicer for the y-axis. More...
 
std::vector< casacore::Stringtypes
 Types for the displayed plottable fields. More...
 
bool xValid
 Is true if the current selection for the x-axis is valid, false otherwise. More...
 
bool yValid
 Is true if the current selection for the x-axis is valid, false otherwise. More...
 
bool update
 Flag to indicate whether GUI-generated events are "genuine.". More...
 
TBPlotCanvasplotCanvas
 Plot canvas. More...
 
QStandardItemModel * xChooserModel
 Model for xChooser and yChooser to disable [index] selection. More...
 
QStandardItemModel * yChooserModel
 
bool isIndexPlot
 Flag to indicate whether index based plot is selected or not. More...
 

Detailed Description

Widget to collect plot parameters and plot on the canvas.

Synopsis

A TBPlotter consists of a TBPlotCanvas and other widgets to control plot parameters and other options. The TBPlotter has four sections in a vertical layout. The first section is the TBPlotCanvas. The second is the data parameters: which table and rows to use, which fields to plot, etc. The third is the graph format: scatter vs. line, point formatting, etc. The fourth are plotting tools such as saving as an image.

Definition at line 185 of file TBPlotter.qo.h.

Constructor & Destructor Documentation

casa::TBPlotter::TBPlotter ( TBBrowser browser,
PlotFactoryPtr  factory 
)

Constructor that takes the parent browser.

casa::TBPlotter::~TBPlotter ( )

Member Function Documentation

QProgressPanel* casa::TBPlotter::addProgressPanel ( casacore::String  label,
bool  hideable,
bool  cancelable 
)

Adds a QProgressPanel to the plotter with the given parameters and returns it.

void casa::TBPlotter::allRows ( )
privateslot

Slot for the "All Rows" button.

Sets the row selection to be all the rows in the currently selected table.

void casa::TBPlotter::chosen ( bool  x,
int  i 
)
privateslot

Slot for code common to xChosen and yChosen.

void casa::TBPlotter::clear ( )
privateslot

Slot for the "Clear" button.

See TBPlotCanvas::clearAndHideAxes().

void casa::TBPlotter::clearSelection ( )
privateslot

Slot for when the user clears the currently selected region.

void casa::TBPlotter::closeEvent ( QCloseEvent *  event)
protected

Capture when the window closes.

If the parameters dock widget is floating, close it manually.

void casa::TBPlotter::doPlot ( bool  overplot = true)
private

Collects the parameters and plots as indicated.

void casa::TBPlotter::enableRowIteration ( bool  visible)
private

Show/Hide row iteration GUI when [index] is deselected/selected.

void casa::TBPlotter::exportImage ( )
privateslot

Slot to export the current plot canvas to the image format specified by the QComboBox.

void casa::TBPlotter::filterRuleCleared ( int  i)
privateslot

Slot for when the user enters a filter rule for the table at the given index.

void casa::TBPlotter::filterRuleEntered ( int  i)
privateslot

Slot for when the user enters a filter rule for the table at the given index.

void casa::TBPlotter::gridChanged ( )
privateslot

Slot for when the user changes the grid options.

void casa::TBPlotter::indexChosen ( bool  x)
privateslot

Slot for when [index] is chosen.

void casa::TBPlotter::indexReleased ( bool  x,
int  i 
)
privateslot

Slot for when [index] is deselected.

void casa::TBPlotter::openNewPlotter ( )
privateslot

Opens a new TBPlotter window.

void casa::TBPlotter::overplot ( )
privateslot

Slot for the "Overplot" button.

See doPlot(true);

void casa::TBPlotter::plot ( )
privateslot

Slot for the "Clear and Plot" button.

See doPlot(false);

void casa::TBPlotter::regionSelected ( bool  selected)
privateslot
void casa::TBPlotter::removeProgressPanel ( QProgressPanel panel)

Removes the given QProgressPanel from the plotter.

void casa::TBPlotter::selectLocate ( )
privateslot

Slot for when the user clicks "locate".

void casa::TBPlotter::setColor ( QLineEdit *  lineEdit)
privateslot

Slot to open a QColorDialog for the given line edit.

Referenced by setLineColor(), and setSymbolColor().

void casa::TBPlotter::setLineColor ( )
inlineprivateslot

Convenience slot.

Definition at line 311 of file TBPlotter.qo.h.

References setColor().

void casa::TBPlotter::setSymbolColor ( )
inlineprivateslot

Convenience slot.

Definition at line 314 of file TBPlotter.qo.h.

References setColor().

void casa::TBPlotter::tableChosen ( QString  name)
privateslot

Slot for when the user chooses a different table from the combobox.

Updates the displayed options for the table.

void casa::TBPlotter::tableClosed ( casacore::String  table)
privateslot

Slot for when a table is closed in the browser.

Removes the table name from the list of opened tables.

void casa::TBPlotter::tableOpened ( casacore::String  table,
casacore::String  fullpath 
)
privateslot

Slot for when a table is opened in the browser.

Adds the table name to the list of opened tables.

void casa::TBPlotter::xChosen ( int  x)
privateslot

Slot for when the user chooses a field for the x-axis.

void casa::TBPlotter::yChosen ( int  y)
privateslot

Slot for when the user chooses a field for the y-axis.

Member Data Documentation

std::vector<int> casa::TBPlotter::adjustedIndices
private

Since only certain field types are plottable, adjustedIndices allows for translation between the index of the combobox (which contains only plottable fields) and the index in the table (which contains all fields).

So, for example, adjustedIndices[plottableIndex] = tableIndex.

Definition at line 224 of file TBPlotter.qo.h.

TBBrowser* casa::TBPlotter::browser
private

Parent browser.

Definition at line 210 of file TBPlotter.qo.h.

std::map<casacore::String, std::vector<std::vector<int>*> > casa::TBPlotter::dimensions
private

For each table the plotter knows about, the dimensions of the fields are kept for fast access.

So, for example, the dimensions of a field can be found with dimensions[tableName][columnIndex].

Definition at line 218 of file TBPlotter.qo.h.

PlotFactoryPtr casa::TBPlotter::factory
private

Plotter factory.

Definition at line 213 of file TBPlotter.qo.h.

bool casa::TBPlotter::isIndexPlot
private

Flag to indicate whether index based plot is selected or not.

Definition at line 258 of file TBPlotter.qo.h.

TBPlotCanvas* casa::TBPlotter::plotCanvas
private

Plot canvas.

Definition at line 247 of file TBPlotter.qo.h.

std::vector<casacore::String> casa::TBPlotter::types
private

Types for the displayed plottable fields.

Definition at line 233 of file TBPlotter.qo.h.

bool casa::TBPlotter::update
private

Flag to indicate whether GUI-generated events are "genuine.".

Definition at line 244 of file TBPlotter.qo.h.

QStandardItemModel* casa::TBPlotter::xChooserModel
private

Model for xChooser and yChooser to disable [index] selection.

Definition at line 254 of file TBPlotter.qo.h.

PlotSlicer casa::TBPlotter::xSlice
private

PlotSlicer for the x-axis.

Definition at line 227 of file TBPlotter.qo.h.

bool casa::TBPlotter::xValid
private

Is true if the current selection for the x-axis is valid, false otherwise.

If the axis is invalid, it cannot be used for plotting.

Definition at line 237 of file TBPlotter.qo.h.

QStandardItemModel* casa::TBPlotter::yChooserModel
private

Definition at line 255 of file TBPlotter.qo.h.

PlotSlicer casa::TBPlotter::ySlice
private

PlotSlicer for the y-axis.

Definition at line 230 of file TBPlotter.qo.h.

bool casa::TBPlotter::yValid
private

Is true if the current selection for the x-axis is valid, false otherwise.

If the axis is invalid, it cannot be used for plotting.

Definition at line 241 of file TBPlotter.qo.h.


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