42 #include <qwt_plot_picker.h>
52 class ExternalAxisWidget;
56 class QPAxis :
public QFrame,
public QPExportCanvas,
public AxisListener {
59 friend class QPAxesCache;
60 friend class QPDrawThread;
61 friend class QPLayeredCanvas;
62 friend class QPPlotItem;
63 friend class QPPlotter;
86 QPAxis(
PlotAxis axis, QPPlotter* parent, QwtPlot* associatedPlot,
87 bool leftAxisInternal,
bool bottomAxisInternal,
88 bool rightAxisInternal );
96 bool legendShown()
const{
return false;};
99 void showLegend(
bool , LegendPosition ){}
102 LegendPosition legendPosition()
const {
107 void setLegendPosition(LegendPosition ){}
114 virtual void setMinimumSizeHint(
int width,
int height );
117 void setLegendLine(
const PlotLine& ){}
125 void setLegendFill(
const PlotAreaFill& ){}
133 void setLegendFont(
const PlotFont& ){}
136 virtual void setCommonAxes(
bool ,
bool ){}
139 std::pair<int, int>
size()
const;
140 virtual void setMinimumSize(
int width,
int height ){
141 QFrame::setMinimumSize( width, height );
164 void setTitleFont(
const PlotFont& font);
170 void setBackground(
const PlotAreaFill& areaFill);
181 void refresh(
int drawLayersFlag);
185 bool isQWidget()
const {
return true; }
204 std::pair<bool,SortDirection> axisScaleSortDirection(
PlotAxis axis)
const;
210 bool axisReferenceValueSet(
PlotAxis axis)
const;
213 double axisReferenceValue(
PlotAxis axis)
const;
216 void setAxisReferenceValue(
PlotAxis axis,
bool on,
double value = 0);
219 bool cartesianAxisShown(
PlotAxis axis)
const;
223 bool show =
true,
bool hideNormalAxis =
true);
235 void setAxisFont(
PlotAxis axis,
const PlotFont& font);
248 void setAxisRange(
PlotAxis axis,
double from,
double to);
254 void setAxesRanges(
PlotAxis xAxis,
double xFrom,
double xTo,
255 PlotAxis yAxis,
double yFrom,
double yTo);
258 bool axesAutoRescale()
const;
261 void setAxesAutoRescale(
bool autoRescale =
true);
267 bool axesRatioLocked()
const;
270 void setAxesRatioLocked(
bool locked =
true);
274 int cachedAxesStackSizeLimit()
const;
277 void setCachedAxesStackSizeLimit(
int sizeInKilobytes);
280 std::pair<int, int> cachedAxesStackImageSize()
const;
283 void setCachedAxesStackImageSize(
int width,
int height);
293 std::vector<PlotItemPtr> allPlotItems()
const;
299 unsigned int numPlotItems()
const;
305 void removePlotItems(
const std::vector<PlotItemPtr>& items);
308 void clearPlotItems();
313 virtual void setNotUsed(){}
323 void releaseDrawing();
326 bool drawingIsHeld()
const;
330 void setSelectLineShown(
bool shown =
true);
340 bool gridShown(
bool* xMajor = NULL,
bool* xMinor = NULL,
341 bool* yMajor = NULL,
bool* yMinor = NULL)
const;
344 void showGrid(
bool xMajor,
bool xMinor,
bool yMajor,
bool yMinor);
350 void setGridMajorLine(
const PlotLine& line);
356 void setGridMinorLine(
const PlotLine& line);
361 bool autoIncrementColors()
const;
364 void setAutoIncrementColors(
bool autoInc =
true);
367 bool exportToFile(
const PlotExportFormat& format);
386 PlotCoordinate convertCoordinate(
const PlotCoordinate& coord,
387 PlotCoordinate::System newSystem = PlotCoordinate::WORLD)
const;
397 PlotFactory* implementationFactory()
const;
398 virtual bool print( QPrinter& printer );
399 virtual QImage grabImageFromCanvas(
const PlotExportFormat& format );
400 virtual bool print( QPainter* painter,
PlotAreaFillPtr paf,
double widgetWidth,
401 double widgetHeight,
int axisWidth,
int axisHeight,
int rowIndex,
int colIndex,
403 virtual bool printRect( QPainter* painter, QRect rect);
404 virtual const QPalette& palette()
const;
405 virtual QPalette::ColorRole backgroundRole()
const;
406 virtual bool isAxis()
const {
409 virtual bool isVertical()
const {
410 bool vertical =
false;
421 void setQPPlotter(QPPlotter* parent);
428 void logObject(
const casacore::String& className,
void* address,
bool creation,
451 std::vector<PlotLogObject> m_queuedLogs;
455 bool m_axesRatioLocked;
458 std::vector<double> m_axesRatios;
467 ExternalAxisWidget* axisWidget;
471 PlotCoordinate globalPosToPixelCoord(
int x,
int y);
472 PlotCoordinate globalPosToPixelCoord(QMouseEvent* event) {
473 return globalPosToPixelCoord(event->globalX(),
event->globalY()); }
474 PlotCoordinate globalPosToPixelCoord(QWheelEvent* event) {
475 return globalPosToPixelCoord(event->globalX(),
event->globalY()); }
483 static unsigned int axisIndex(
PlotAxis a);
484 static PlotAxis axisIndex(
unsigned int i);
488 virtual int canvasWidth()
const{
491 virtual int canvasHeight()
const {
casacore::CountedPtr< PlotAreaFill > PlotAreaFillPtr
casacore::CountedPtr< PlotLine > PlotLinePtr
unsigned int PlotAxisBitset
Set of bit flags to indicate combinations of sides, used (as of this writing) for indicating which ax...
void show(const variant &v)
virtual void setSelectLine(PlotLinePtr line)
Sets the selection line to the given.
PlotCursor
Enum for cursors.
PlotAxis
Enum for the four plot axes.
casacore::CountedPtr< PlotFont > PlotFontPtr
casacore::CountedPtr< PlotLogger > PlotLoggerPtr
std::pair< double, double > prange_t
Typedef for range, which is two doubles (min and max).
casacore::CountedPtr< PlotItem > PlotItemPtr
AngleFormat
Enum for angle formats.
String: the storage and methods of handling collections of characters.
PlotAxisScale
Enum for possible axis scales.
PlotCanvasLayer
The canvas is composed of multiple layers, where changing/adding items from one layer will not affect...
LatticeExprNode value(const LatticeExprNode &expr)
This function returns the value of the expression without a mask.