PGPlot1d.h

Classes

PGPlot1d -- PGPLOT class interface according to Plot1d (full description)

class PGPlot1d : public Plot1d

Types

enum PGPlotLineStyle

LS_SOLID = 1
LS_DASHED
LS_DOT_DASH
LS_DOTTED
LS_DASH_3DOT

enum PGPlotFont

FNT_NORMAL = 1
FNT_ROMAN
FNT_ITALIC
FNT_SCRIPT

enum PGPlotPointStyle

PS_NONE
PS_DOT
PS_BOX
PS_TRIANGLE
PS_DIAMOND
PS_STAR
PS_VLINE
PS_HLINE
PS_CROSS
PS_CIRCLE
PS_SQUARE

Interface

Public Members
PGPlot1d(Widget parent)
static void resizeCB(Widget, PGPlot1d * p1d, XtPointer)
static void drawCB(Widget, PGPlot1d * p1d, XtPointer)
virtual void redraw()
virtual void clear()
Private Members
virtual Int addDataSet (Plot1dData * data, Plot1d::DataStyles)
Public Members
virtual Bool deleteDataSet(Int dataSetId)
Int string2colorIndex(const String &color)
virtual Int appendData(Int dataSetId, Double y)
virtual Int appendData (Int dataSetId, Double x, Double y)
virtual Int appendData (Int dataSetId, Vector <Double> y)
virtual Int appendData (Int dataSetId, Vector <Double> x, Vector <Double> y)
virtual Int removeDataPoint (Int dataSetId, Int where)
virtual void setDataStyle (Int dataSetId, DataStyles dataStyle)
virtual void setPlotTitleColor(const String& color)
virtual void setCursorColor(const String& color)
virtual void showSelections(Bool onOff)
virtual void setSelectionColor(const String& color)
virtual void setTopXAxis(Bool onOff)
virtual void setLeftY2Axis(Bool onOff)
virtual void setRightY1Axis(Bool onOff)
virtual void setXAxisColor(const String& color)
virtual void setY1AxisColor(const String& color)
virtual void setY2AxisColor(const String& color)
virtual void setXAxisLabelColor(const String& color)
virtual void setY1AxisLabelColor(const String& color)
virtual void setY2AxisLabelColor(const String& color)
virtual void setXAxisGridColor(const String& color)
virtual void setY1AxisGridColor(const String& color)
virtual void setY2AxisGridColor(const String& color)
virtual void setXAxisLineWidth(const Int newSize)
virtual void setY1AxisLineWidth(const Int newSize)
virtual void setY2XAxisLineWidth(const Int newSize)
virtual void setXAxisGrid(Bool onOff)
virtual void setY1AxisGrid(Bool onOff)
virtual void setY2AxisGrid(Bool onOff)
virtual void setXAxisGridLineWidth(const Int newSize)
virtual void setY1AxisGridLineWidth(const Int newSize)
virtual void setY2XAxisGridLineWidth(const Int newSize)
virtual void setLineColor (Int dataSetId, const String &color)
virtual void setLineStyle (Int dataSetId, LineStyles lineStyle)
virtual void setLineWidth (Int datasetId, Int newSize)
virtual void setPointColor (Int dataSetId, const String &color)
virtual void setPointStyle (Int dataSetId, PointStyles pointStyle)
virtual void setPointSize (Int dataSetId, Int newSize)
virtual void setXAxisPosition (Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)
void setYAxisPosition(Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)
virtual void setY1AxisPosition (Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)
virtual void setY2AxisPosition (Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)
void placeXMarker(Double x)
void placeYMarker(Double y)
String describeDataDisplayStyles()
virtual void reverseXAxis()
void reverseYAxis()
virtual void reverseY1Axis()
virtual void reverseY2Axis()
virtual void swapY1Y2()
virtual void setLegendGeometry (LegendGeometry newGeometry)
virtual Bool printGraphToPrinter()
virtual Bool printGraphToFile(String filename)
virtual void enableXMarker (int onOff)
virtual void enableYMarker (int onOff)
virtual void setXScale(Double x0, Double x1)
void setYScale(Double y0, Double y1)
virtual void setY1Scale(Double y0, Double y1)
virtual void setY2Scale(Double y0, Double y1)
void cursorInput(XmpCursorCallbackStruct * cursor)
static void cursorInputCB(Widget, XtPointer p1d, XtPointer cursor)
void armCursor(int mode, float x, float y)
void disarmCursor()
void setCursorInactiveMode(int mode)
void setCursorActiveMode(int mode)
void selectRegion(float x1, float x2, float y1, float y2)
static void leaveNotifyEH(Widget, XtPointer pthis, XEvent *, Boolean *)
void leaveNotify()
static void enterNotifyEH(Widget, XtPointer pthis, XEvent *, Boolean *)
void enterNotify()
static void motionNotifyEH(Widget, XtPointer pthis, XEvent *, Boolean *)
void motionNotify(int x, int y)
void setPrintCommand(const String & s)
const String & printCommand() const
Private Members
Int pickY1Style(int id)
Int pickY2Style(int id)
void setDataAttributes(PGPlot1dDataAttr * pda, Plot1dData::AssociatedYAxis whichYAxis)
void addStandardColors()
Int addColor(const String& s)
Int searchColor(const String& s)
void updateReadouts(float x1ro, float y1ro)
static void quitCB(Widget, XtPointer, XtPointer)
static void printCB(Widget, XtPointer, XtPointer)
static void fullViewCB(Widget, XtPointer, XtPointer)
static void clearSelectionsCB(Widget, XtPointer, XtPointer)
static void clearCB(Widget, XtPointer, XtPointer)
static void selectXAxisCB(Widget, XtPointer, XtPointer)
static void selectYAxisCB(Widget, XtPointer, XtPointer)
static void selectBoxCB(Widget, XtPointer, XtPointer)
static void setZoomDragModeCB(Widget, XtPointer, XtPointer)
static void setSelectDataDragModeCB(Widget, XtPointer, XtPointer)
void drawPage()
Bool openGraphicsDevice()
void closeGraphicsDevice()
Bool openPrinterDevice()
void closePrinterDevice()
Bool openPSFileDevice()
void closePSFileDevice()
PGPlot1dDataAttr * findPda(Int id)
void initializeWidgets(Widget parent)
void prepDataAttributes(Plot1dData * pd)
void prepY1Plot()
void prepY2Plot()
void drawXAxes()
void drawY1Axes()
void drawY2Axes()
void drawBottomXAxis()
void drawLeftY1Axis()
void drawRightY2Axis()
void drawXAxisGrid()
void drawY1AxisGrid()
void drawY2AxisGrid()
void drawY1Data()
void drawY2Data()
void drawTitle()
void drawIdString()
void drawSelections()
void drawPd(Plot1dData * pd)
void drawXYLines(const Vector<Double>& x, const Vector<Double>& y)
void drawXYPoints(const Vector<Double>& x, const Vector<Double>& y, uInt markerIndex)
void drawXYHistogram(const Vector<Double>& x, const Vector<Double>& y)
int DataSetId2DataSetIndex_(int DataSetId)

Description

Etymology

PGPlot1d is a portmanteaux of PGPLOT and Plot1d

Synopsis

Designed to support PGPLOT 5.1 by T. J. Pearson of Caltech

Thrown Exceptions

Example

Member Description

enum PGPlotLineStyle

enum PGPlotFont

enum PGPlotPointStyle

PGPlot1d(Widget parent)

- Construct PGPlot window inside given parent - initialize appropriate variables.

static void resizeCB(Widget, PGPlot1d * p1d, XtPointer)

static void drawCB(Widget, PGPlot1d * p1d, XtPointer)

virtual void redraw()

Redraw the display -Cycle through the list of associated data and draw each. Don't call this function within this hierarchy. Instead wrap drawing code with the redrawEnter()/redrawExit() pair to prevent nested and layered functions from calling redraw more than once.

virtual void clear()

Clear the display and erase all datasets -call cpgerase to erase the display

virtual Int addDataSet (Plot1dData * data, Plot1d::DataStyles)

virtual Bool deleteDataSet(Int dataSetId)

Delete a dataset by External Identification Number -

Int string2colorIndex(const String &color)

virtual Int appendData(Int dataSetId, Double y)

Append data to a given dataset

virtual Int appendData (Int dataSetId, Double x, Double y)

virtual Int appendData (Int dataSetId, Vector <Double> y)

virtual Int appendData (Int dataSetId, Vector <Double> x, Vector <Double> y)

virtual Int removeDataPoint (Int dataSetId, Int where)

Remove a single data item by dataset id with given index

virtual void setDataStyle (Int dataSetId, DataStyles dataStyle)

Change the style of the given dataset id

virtual void setPlotTitleColor(const String& color)

Plot title

virtual void setCursorColor(const String& color)

virtual void showSelections(Bool onOff)

virtual void setSelectionColor(const String& color)

virtual void setTopXAxis(Bool onOff)

Set axis preferences

virtual void setLeftY2Axis(Bool onOff)

virtual void setRightY1Axis(Bool onOff)

virtual void setXAxisColor(const String& color)

Set the axis attributes

virtual void setY1AxisColor(const String& color)

virtual void setY2AxisColor(const String& color)

virtual void setXAxisLabelColor(const String& color)

virtual void setY1AxisLabelColor(const String& color)

virtual void setY2AxisLabelColor(const String& color)

virtual void setXAxisGridColor(const String& color)

virtual void setY1AxisGridColor(const String& color)

virtual void setY2AxisGridColor(const String& color)

virtual void setXAxisLineWidth(const Int newSize)

virtual void setY1AxisLineWidth(const Int newSize)

virtual void setY2XAxisLineWidth(const Int newSize)

virtual void setXAxisGrid(Bool onOff)

virtual void setY1AxisGrid(Bool onOff)

virtual void setY2AxisGrid(Bool onOff)

virtual void setXAxisGridLineWidth(const Int newSize)

virtual void setY1AxisGridLineWidth(const Int newSize)

virtual void setY2XAxisGridLineWidth(const Int newSize)

virtual void setLineColor (Int dataSetId, const String &color)

Set the line attributes

virtual void setLineStyle (Int dataSetId, LineStyles lineStyle)

virtual void setLineWidth (Int datasetId, Int newSize)

virtual void setPointColor (Int dataSetId, const String &color)

Set the Point attributes

virtual void setPointStyle (Int dataSetId, PointStyles pointStyle)

virtual void setPointSize (Int dataSetId, Int newSize)

virtual void setXAxisPosition (Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)

Set the axis position strategy - ignored

void setYAxisPosition(Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)

virtual void setY1AxisPosition (Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)

virtual void setY2AxisPosition (Plot1d::AxisPlacementStrategy strategy, Double where = 0.0)

void placeXMarker(Double x)

Place Markers - ignored

void placeYMarker(Double y)

String describeDataDisplayStyles()

Query doesn't make sense if Plot1d defines the enums!

virtual void reverseXAxis()

Reverse the plot axes (global for widget) -swap the min and max values

void reverseYAxis()

virtual void reverseY1Axis()

virtual void reverseY2Axis()

virtual void swapY1Y2()

virtual void setLegendGeometry (LegendGeometry newGeometry)

Set the position of the legend - ignore for now

virtual Bool printGraphToPrinter()

Open postscript device and send to printer

virtual Bool printGraphToFile(String filename)

virtual void enableXMarker (int onOff)

"Markers" are pieces of the crosshair cursor - ignore for now

virtual void enableYMarker (int onOff)

virtual void setXScale(Double x0, Double x1)

set the scale - Clamp?

void setYScale(Double y0, Double y1)

virtual void setY1Scale(Double y0, Double y1)

virtual void setY2Scale(Double y0, Double y1)

void cursorInput(XmpCursorCallbackStruct * cursor)

X cursor input callback

static void cursorInputCB(Widget, XtPointer p1d, XtPointer cursor)

void armCursor(int mode, float x, float y)

void disarmCursor()

void setCursorInactiveMode(int mode)

void setCursorActiveMode(int mode)

void selectRegion(float x1, float x2, float y1, float y2)

static void leaveNotifyEH(Widget, XtPointer pthis, XEvent *, Boolean *)

void leaveNotify()

static void enterNotifyEH(Widget, XtPointer pthis, XEvent *, Boolean *)

void enterNotify()

static void motionNotifyEH(Widget, XtPointer pthis, XEvent *, Boolean *)

void motionNotify(int x, int y)

void setPrintCommand(const String & s)

const String & printCommand() const

Int pickY1Style(int id)

Int pickY2Style(int id)

void setDataAttributes(PGPlot1dDataAttr * pda, Plot1dData::AssociatedYAxis whichYAxis)

void addStandardColors()

Add standard suite of X colors

Int addColor(const String& s)

Add color to PGPlot's list of colors. Returns False if failed

Int searchColor(const String& s)

Return color index for given color or -1 if not found

void updateReadouts(float x1ro, float y1ro)

static void quitCB(Widget, XtPointer, XtPointer)

static void printCB(Widget, XtPointer, XtPointer)

static void fullViewCB(Widget, XtPointer, XtPointer)

static void clearSelectionsCB(Widget, XtPointer, XtPointer)

static void clearCB(Widget, XtPointer, XtPointer)

static void selectXAxisCB(Widget, XtPointer, XtPointer)

static void selectYAxisCB(Widget, XtPointer, XtPointer)

static void selectBoxCB(Widget, XtPointer, XtPointer)

static void setZoomDragModeCB(Widget, XtPointer, XtPointer)

static void setSelectDataDragModeCB(Widget, XtPointer, XtPointer)

void drawPage()

Bool openGraphicsDevice()

void closeGraphicsDevice()

Bool openPrinterDevice()

void closePrinterDevice()

Bool openPSFileDevice()

void closePSFileDevice()

PGPlot1dDataAttr * findPda(Int id)

void initializeWidgets(Widget parent)

void prepDataAttributes(Plot1dData * pd)

void prepY1Plot()

Insure that plot range set for y1 data

void prepY2Plot()

Insure that plot range set for y2 data

void drawXYLines(const Vector<Double>& x, const Vector<Double>& y)

Functions to draw various pieces of the graph

Double->Float for drawing

void drawXAxes()
void drawY1Axes()
void drawY2Axes()
void drawBottomXAxis()
void drawLeftY1Axis()
void drawRightY2Axis()
void drawXAxisGrid()
void drawY1AxisGrid()
void drawY2AxisGrid()
void drawY1Data()
void drawY2Data()
void drawTitle()
void drawIdString()
void drawSelections()
void drawPd(Plot1dData * pd)
void drawXYPoints(const Vector<Double>& x, const Vector<Double>& y, uInt markerIndex)
void drawXYHistogram(const Vector<Double>& x, const Vector<Double>& y)

Functions to draw various pieces of the graph

int DataSetId2DataSetIndex_(int DataSetId)

Convert a dataset Id to a dataset index. Returns the (0-based) index of the item in the dataSetList or -1 if not found