WXP C++ Library Version 6.74.9
|
This class plots to a device independent graphics interface. More...
#include "../include/Graph.h"
Public Member Functions | |
Graph () | |
Graph (const char *device, const char *param) | |
~Graph () | |
int | init () |
int | setDevice (const char *device, const char *params) |
int | getDevice (String &str) |
int | open () |
int | open (const char *dev, const char *params) |
bool | isOpen () |
int | close () |
int | update () |
int | manage () |
int | unmanage () |
bool | isManaged () |
void | callback (const char *ev_str, const char *ev_data, const void *data) |
int | doCallback (const char *ev_str, const char *ev_data) |
int | addCallback (const char *ev, Listener *list, const void *data) |
int | setFixed (bool val) |
int | setSize (float width, float height) |
int | setOffset (float rx, float ry) |
int | setInverse (bool val) |
bool | getInverse () |
int | setBackground (const char *str) |
int | setIcon (bool val) |
int | setTitle (const char *str) |
int | setTran (int num) |
int | setViewportAspect (Rect &limit, float aspect, int halign, int valign) |
int | setViewportAspect (Rect &limit, float aspect) |
int | setViewport (int num, Rect &rect) |
int | setViewport (Rect &rect) |
int | getViewport (Rect &rect) |
Rect | getViewport () |
int | getDeviceViewport (Rect &rect) |
Rect | getDeviceViewport () |
int | getMaxViewport (Rect &rect) |
Rect | getMaxViewport () |
int | setWindow (int num, Rect &rect) |
int | setWindow (Rect &rect) |
int | getWindow (Rect &rect) |
Rect | getWindow () |
int | getTran () |
int | activateTran () |
int | activateTran (int val) |
int | tranPlotView (float x1, float y1, float &x2, float &y2) |
int | tranPlotWindow (float x1, float y1, float &x2, float &y2) |
int | tranPlotWindow (Point &pt1, Point &pt2) |
int | tranWindow (int tran1, float x1, float y1, int tran2, float &x2, float &y2) |
int | tranWindow (int tran1, Point &pt1, int tran2, Point &pt2) |
int | clear () |
int | clearRect (Rect &rect) |
int | allocColor (float red, float grn, float blu) |
int | allocColor (RGB &rgb) |
int | drawLine (float x1, float y1, float x2, float y2) |
int | drawLine (Point &p1, Point &p2) |
int | drawLine (Points &data) |
int | drawRect (float x1, float y1, float x2, float y2) |
int | drawRect (Rect &rect) |
int | drawCircle (float x1, float y1, float rad) |
int | drawCircle (Point &pt, float rad) |
int | setLineColor (int index) |
int | setLineWidth (float width) |
int | setLineStyle (int style) |
int | drawFill (Rect &rect) |
int | drawFill (Points &data) |
int | drawFillarea (Points &data) |
int | setFillColor (int index) |
int | setFillStyle (int index) |
int | drawMarkLine (float x, float y, float size) |
int | drawMark (float x, float y) |
int | drawMark (Point pt) |
int | setMarkColor (int index) |
int | setMarkSize (float size) |
int | setMarkType (int type) |
int | setMarkWeight (float weight) |
int | drawText (float ox, float oy, const char *string) |
int | drawText (Point pt, const char *string) |
int | drawFormText (float x, float y, const char *format,...) |
int | drawFormText (Point pt, const char *format,...) |
int | setTextColor (int color) |
int | setFontSpec () |
int | setFont (const char *str) |
int | setTextBoxColor (int index) |
int | setDropColor (int index) |
int | setDropShadow (int val) |
int | getDropShadow () |
int | setDropWidth (int val) |
int | setTextExpansion (float expansion) |
int | setTextWeight (float weight) |
int | setTextHeight (float height) |
int | setTextDirection (float x, float y) |
int | setTextAlign (int hor, int vert) |
int | setTextCharWidth (float space) |
int | setTextSpacing (float space) |
int | setSymbol (const char *file) |
int | drawSymbol (float ox, float oy, const char *string, float size) |
int | drawSymbol (Point pt, const char *string, float size) |
int | setImageAlign (int h, int v) |
int | drawImage (Image &image, float x, float y) |
int | drawImage (Image &image, int color, float x, float y) |
int | getImage (Image &image) |
int | setCursor (int type) |
bool | isLooping () |
int | getFrame () |
int | setFrame (int ind) |
int | newFrame () |
int | deleteFrame (int ind) |
int | getNumFrames () |
int | bell () |
int | message (const char *str,...) |
int | printTran () |
virtual void | callback (const char *ev_str, const char *ev_data, const void *data)=0 |
Static Public Attributes | |
static const int | DEVICE_NONE = 0 |
static const int | DEVICE_WINDOW = 1 |
static const int | DEVICE_POSTSCRIPT = 2 |
static const int | DEVICE_HPGL = 3 |
static const int | DEVICE_METAFILE = 4 |
Static Public Attributes inherited from WXP::GraphAttr | |
static const int | HALIGN_NORMAL = 0 |
static const int | HALIGN_LEFT = 1 |
static const int | HALIGN_CENTER = 2 |
static const int | HALIGN_RIGHT = 3 |
static const int | VALIGN_NORMAL = 0 |
static const int | VALIGN_TOP = 1 |
static const int | VALIGN_CAP = 2 |
static const int | VALIGN_HALF = 3 |
static const int | VALIGN_BASE = 4 |
static const int | VALIGN_BOTTOM = 5 |
static const int | MARK_NONE = 0 |
static const int | MARK_POINT = 1 |
static const int | MARK_PLUS = 2 |
static const int | MARK_STAR = 3 |
static const int | MARK_O = 4 |
static const int | MARK_CIRCLE = 4 |
static const int | MARK_X = 5 |
static const int | MARK_SQUARE = 6 |
static const int | MARK_TRIANGLE = 7 |
static const int | MARK_DOT = 8 |
static const int | MARK_INVTRIANGLE = 9 |
static const int | MARK_LIGHT = 10 |
static const int | VIEW_HLEFT = 1 |
static const int | VIEW_HCENTER = 2 |
static const int | VIEW_HRIGHT = 3 |
static const int | VIEW_VBOTTOM = 1 |
static const int | VIEW_VCENTER = 2 |
static const int | VIEW_VTOP = 3 |
static const int | IMAGE_HLEFT = 1 |
static const int | IMAGE_HCENTER = 2 |
static const int | IMAGE_HRIGHT = 3 |
static const int | IMAGE_VBOTTOM = 1 |
static const int | IMAGE_VCENTER = 2 |
static const int | IMAGE_VTOP = 3 |
static const int | TRAN_MAX = 0 |
static const int | TRAN_PLOT = 1 |
static const int | CURSOR_X = 0 |
static const int | CURSOR_PTR = 1 |
static const int | CURSOR_MOVE = 2 |
static const int | CURSOR_LOOP = 3 |
static const int | CURSOR_STOP = 4 |
static const int | CURSOR_DRAW = 5 |
static const int | CURSOR_RECT = 6 |
static const int | CURSOR_PLUS = 6 |
static const int | CURSOR_TEXT = 7 |
static const int | CURSOR_WAIT = 8 |
This class plots to a device independent graphics interface.
Graph::Graph | ( | ) |
Constructor. Initializes class values
Graph::Graph | ( | const char * | device, |
const char * | params | ||
) |
Constructor. Opens device with specified parameters
device | Device to open (display, postscript, hpgl) |
params | A character string of device parameters |
References setDevice().
Graph::~Graph | ( | ) |
Destructor
References close().
int Graph::activateTran | ( | ) |
Activates the current transformation. This sets the clipping rectangle on the specific device.
Referenced by callback().
int Graph::activateTran | ( | int | val | ) |
Activates a specific transformation.
val | The transformation to activate |
int Graph::addCallback | ( | const char * | ev, |
Listener * | list, | ||
const void * | data | ||
) |
int Graph::allocColor | ( | float | red, |
float | grn, | ||
float | blu | ||
) |
Allocates a color within the device.
red | Red value (0-1) |
grn | Green value (0-1) |
blu | Blue value (0-1) |
Referenced by WXP::Plot::allocColor(), and WXP::Plot::setColorMap().
int Graph::allocColor | ( | RGB & | rgb | ) |
Allocates a color within the device.
rgb | The RGB component colors |
References WXP::RGB::blu, WXP::RGB::grn, and WXP::RGB::red.
int Graph::bell | ( | ) |
Sends a bell command to device
Referenced by WXP::Plot::callback().
|
virtual |
Internal event callback to redraw window
ev_str | Event name |
ev_data | Event specific data |
data | User specific data for the event |
Implements WXP::Listener.
References activateTran(), and WXP::StrLib::equal().
int Graph::clear | ( | ) |
Clears the window of all graphics
int Graph::clearRect | ( | Rect & | rect | ) |
Clears a rectangular region
rect | The region to clear |
References WXP::GTran::tranWindowPlotX(), WXP::GTran::tranWindowPlotY(), WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
int Graph::close | ( | ) |
Closes the window
Referenced by WXP::Plot::callback(), WXP::Plot::close(), and ~Graph().
int Graph::deleteFrame | ( | int | ind | ) |
Deletes a frame in the loop
ind | Index of the frame to delete |
int Graph::doCallback | ( | const char * | ev_str, |
const char * | ev_data | ||
) |
Forces the triggering of callbacks
ev_str | Type of event (can be random) |
ev_data | Any extra data specific to event |
Referenced by WXP::Plot::callback().
int Graph::drawCircle | ( | float | x1, |
float | y1, | ||
float | rad | ||
) |
Draws a circle
x1 | X point of center |
y1 | Y point of center |
rad | Radius of circle |
References WXP::Points::add(), and WXP::Const::DRC.
Referenced by drawCircle(), and WXP::Plot::drawCircle().
int Graph::drawCircle | ( | Point & | pt, |
float | rad | ||
) |
Draws a circle
pt | Center point |
rad | Radius of circle |
References drawCircle(), WXP::Point::x, and WXP::Point::y.
int Graph::drawFill | ( | Points & | data | ) |
Draws a filled area to the window
data | Points array defining polygon |
References WXP::Points::add(), WXP::Points::clear(), WXP::Points::getNum(), WXP::Points::getX1(), WXP::Points::getY1(), and WXP::GTran::tranWindowPlotY().
int Graph::drawFill | ( | Rect & | rect | ) |
Draws a filled rect to the window
rect | Rectangle coordinates |
References WXP::Points::add(), WXP::Points::clear(), WXP::Rect::getXMax(), WXP::Rect::getXMin(), WXP::Rect::getYMax(), WXP::Rect::getYMin(), and WXP::GTran::tranWindowPlotY().
Referenced by WXP::Plot::drawFill(), WXP::Plot::drawFill(), drawFillarea(), and drawSymbol().
int Graph::drawFillarea | ( | Points & | data | ) |
int Graph::drawFormText | ( | float | x, |
float | y, | ||
const char * | format, | ||
... | |||
) |
Draws formatted text to the window
x | X point to draw the text |
y | Y point to draw the text |
format | Format of text to plot |
References drawText().
int Graph::drawFormText | ( | Point | pt, |
const char * | format, | ||
... | |||
) |
Draws formatted text to the window
pt | Point to draw the text |
format | Format of text to plot |
References drawText(), WXP::Point::x, and WXP::Point::y.
int Graph::drawImage | ( | Image & | image, |
float | x, | ||
float | y | ||
) |
Draws an image to the window at a specific location
image | Image to draw to window |
x | X location of upper left corner |
y | Y location of upper left corner |
References WXP::GTran::tranWindowPlotX(), and WXP::GTran::tranWindowPlotY().
int Graph::drawImage | ( | Image & | image, |
int | color, | ||
float | x, | ||
float | y | ||
) |
Draws an image to the window at a specific location using a transparent color
image | Image to draw to window |
color | Transparent color value |
x | X location of upper left corner |
y | Y location of upper left corner |
References WXP::GTran::tranWindowPlotX(), and WXP::GTran::tranWindowPlotY().
int Graph::drawLine | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Draws a line between two points
x1 | First X value |
y1 | First Y value |
x2 | Second X value |
y2 | Second Y value |
Referenced by WXP::Plot::drawLine(), drawLine(), WXP::Plot::drawLine(), WXP::Plot::drawLine(), WXP::Plot::drawSpline(), and drawSymbol().
Draws a line between two points
p1 | First point |
p2 | Second point |
References drawLine(), WXP::Point::x, and WXP::Point::y.
int Graph::drawLine | ( | Points & | data | ) |
Draws a line between a set of points
data | The set of points |
References WXP::Points::add(), WXP::Points::clear(), WXP::Points::getNum(), WXP::Points::getX1(), WXP::Points::getY1(), WXP::Points::offset(), and WXP::GTran::tranWindowPlotY().
int Graph::drawMark | ( | float | x, |
float | y | ||
) |
Draws a marker. This manages drawing the marker and calls drawMarkLine to do actual plotting.
x | X location of marker |
y | Y location of marker |
References drawMarkLine(), WXP::GTran::tranWindowPlotX(), and WXP::GTran::tranWindowPlotY().
Referenced by WXP::Plot::drawMark(), WXP::Plot::drawMark(), and drawMark().
int Graph::drawMark | ( | Point | pt | ) |
Draws a marker
pt | Location of marker |
References drawMark(), WXP::Point::x, and WXP::Point::y.
int Graph::drawMarkLine | ( | float | x, |
float | y, | ||
float | size | ||
) |
Draws a marker at a specific location
x | X location of marker |
y | Y location of marker |
size | Size of marker |
References WXP::Points::add(), and WXP::Points::clear().
Referenced by drawMark().
int Graph::drawRect | ( | float | x1, |
float | y1, | ||
float | x2, | ||
float | y2 | ||
) |
Draws a rectangle between two points
x1 | First X value |
y1 | First Y value |
x2 | Second X value |
y2 | Second Y value |
References WXP::Points::add().
Referenced by WXP::Plot::drawRect(), drawRect(), and WXP::Plot::drawRect().
int Graph::drawRect | ( | Rect & | rect | ) |
Draws a rectangle
rect | Rectangle coordinates |
References drawRect(), WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
int Graph::drawSymbol | ( | float | rx, |
float | ry, | ||
const char * | string, | ||
float | size | ||
) |
Draws a symbol to the window
rx | X location of symbol |
ry | Y location of symbol |
string | String defining symbol to plot |
size | Size of symbol |
References WXP::Points::add(), WXP::Points::clear(), drawFill(), drawLine(), WXP::Point::x, and WXP::Point::y.
Referenced by drawSymbol().
int Graph::drawSymbol | ( | Point | pt, |
const char * | string, | ||
float | size | ||
) |
Draws a symbol
pt | Location of symbol |
string | String defining symbol to plot |
size | Size of symbol |
References drawSymbol(), WXP::Point::x, and WXP::Point::y.
int Graph::drawText | ( | float | rx, |
float | ry, | ||
const char * | string | ||
) |
Draws text to the window. This handles both hard and soft fonts. Soft fonts go to drawTextLine for output. Hard fonts get rendered to the device in Device::drawText
rx | X location of text |
ry | Y location of text |
string | Text to draw |
References WXP::StrLib::copy(), WXP::Strings::getNum(), WXP::Strings::getString(), WXP::Point::set(), WXP::GTran::tranWindowPlotX(), and WXP::GTran::tranWindowPlotY().
Referenced by drawFormText(), WXP::Plot::drawFormText(), drawFormText(), WXP::Plot::drawText(), and drawText().
int Graph::drawText | ( | Point | pt, |
const char * | string | ||
) |
Draws text to the window
References drawText(), WXP::Point::x, and WXP::Point::y.
int Graph::getDevice | ( | String & | str | ) |
Gets the device specifications
str | Specification string |
Rect Graph::getDeviceViewport | ( | ) |
Gets the device viewport/clip rectangle
int Graph::getDeviceViewport | ( | Rect & | rect | ) |
Gets the device viewport/clip rectangle
rect | The viewport |
int Graph::getDropShadow | ( | ) |
Gets drop shadow scale value. This is the amount of drop shadowing to appear. 0 means no shadowing.
int Graph::getFrame | ( | ) |
int Graph::getImage | ( | Image & | image | ) |
Retrieves an image from the window
image | Image class to put window snapshot |
bool Graph::getInverse | ( | ) |
Gets the inverse setting
Rect Graph::getMaxViewport | ( | ) |
Gets the maximum possible viewport on the display
References WXP::GTran::getNdc().
int Graph::getMaxViewport | ( | Rect & | rect | ) |
Gets the maximum possible viewport on the display
rect | The viewport |
References WXP::GTran::getNdc().
int Graph::getNumFrames | ( | ) |
Returns the number of frames in the loop
Referenced by WXP::Plot::callback().
int Graph::getTran | ( | ) |
Gets the current transformation number
Referenced by WXP::Plot::drawFill(), WXP::Plot::drawLine(), and WXP::Plot::drawLine().
Rect Graph::getViewport | ( | ) |
int Graph::getViewport | ( | Rect & | rect | ) |
Gets the current viewport
rect | The viewport rectangle |
References WXP::GTran::getViewport().
Rect Graph::getWindow | ( | ) |
Gets the current window coordinates.
References WXP::GTran::getWindow().
int Graph::getWindow | ( | Rect & | rect | ) |
Gets the current window coordinates.
rect | The limits of the window |
References WXP::GTran::getWindow().
int Graph::init | ( | ) |
Initializes the class values
Referenced by open().
bool Graph::isLooping | ( | ) |
|
inline |
Returns true if window managed
bool Graph::isOpen | ( | ) |
Returns whether graphics interface is open.
int Graph::manage | ( | ) |
Manages the window. Goes into a loop waiting for device events
Referenced by WXP::Plot::manage().
int Graph::message | ( | const char * | format, |
... | |||
) |
Outputs a message to the device
format | Format (see sprintf) |
int Graph::newFrame | ( | ) |
Creates a new frame on the device to plot to. Print devices its a new page. Display devices its a new frame in a loop.
rsecs | Seconds since 1/1/1970 (Unix time) |
int Graph::open | ( | ) |
Opens a window for drawing
References WXP::FileTool::addPath(), WXP::String::get(), WXP::Wxp::getDatabasePath(), and init().
Referenced by open().
int Graph::open | ( | const char * | dev, |
const char * | params | ||
) |
Opens a window for drawing
References open(), and setDevice().
int Graph::printTran | ( | ) |
Prints the transformation matrices
int Graph::setBackground | ( | const char * | str | ) |
Sets the background color
str | String specifying color name |
int Graph::setCursor | ( | int | type | ) |
Sets the cursor type
int Graph::setDevice | ( | const char * | dev, |
const char * | params | ||
) |
Sets the device and its parameters
References WXP::StrLib::equal(), WXP::Strings::equal(), and WXP::Strings::getNum().
int Graph::setDropColor | ( | int | index | ) |
Sets drop color. This is the color of the drop shadowing on drawing primitives
index | Color index |
int Graph::setDropShadow | ( | int | val | ) |
Sets drop shadow scale value. This is the amount of drop shadowing to appear. 0 means no shadowing.
val | Drop shadow value |
Referenced by WXP::Plot::setLine(), and WXP::Plot::setLine().
int Graph::setDropWidth | ( | int | val | ) |
Sets drop shadow width. This is the width of lines to be drawn in the drop shadowing.
val | Line width |
int Graph::setFillColor | ( | int | index | ) |
Sets the fill color
index | Color index |
Referenced by WXP::Plot::setFill(), WXP::Plot::setFill(), WXP::Plot::setFillColor(), and WXP::Plot::setFillColor().
int Graph::setFillStyle | ( | int | index | ) |
Sets the fill style
index | Fill pattern index |
Referenced by WXP::Plot::setFill(), WXP::Plot::setFill(), and WXP::Plot::setFillStyle().
int Graph::setFixed | ( | bool | val | ) |
Sets whether the window is fixed in size
val | 1=fixed, 0=adjustable |
int Graph::setFont | ( | const char * | str | ) |
Sets up fonts. Takes font specification and searches for font name in wxp.fnl file. Then, determines if font is hard or soft font.
If soft font, reads in WXP font file. If hard font, calls setFontSpec
str | Font specification string |
References WXP::FileTool::addPath(), WXP::StrLib::copy(), WXP::StrLib::equal(), WXP::String::get(), WXP::Wxp::getDatabasePath(), WXP::File::getLine(), WXP::StrLib::index(), WXP::File::isOpen(), WXP::File::open(), WXP::Wxp::outWarning(), and setFontSpec().
Referenced by WXP::Plot::setText().
int Graph::setFontSpec | ( | ) |
Sets up hardware fonts
References WXP::StrLib::copy(), WXP::GTran::getWindow(), WXP::StrLib::index(), WXP::Wxp::outDebug(), WXP::StrLib::splice(), WXP::Rect::ymax, and WXP::Rect::ymin.
Referenced by setFont(), and setTextHeight().
int Graph::setFrame | ( | int | ind | ) |
Specified the current drawing frame
ind | Index of the frame to draw to |
Referenced by WXP::Plot::callback().
int Graph::setIcon | ( | bool | val | ) |
Sets up icon mode. This will attempt to open window in iconic state
val | True if icon |
int Graph::setImageAlign | ( | int | h, |
int | v | ||
) |
Specifies alignment of image (default LEFT, BOTTOM)
h | Horizontal alignment (IMAGE_HLEFT, IMAGE_HCENTER, IMAGE_HRIGHT) |
v | Vertical alignment (IMAGE_VTOP, IMAGE_VCENTER, IMAGE_VBOTTOM) |
int Graph::setInverse | ( | bool | val | ) |
Sets up inverse tag. This will invert default foreground and background colors.
val | True for inverse |
int Graph::setLineColor | ( | int | index | ) |
Sets the line color
index | Color index |
Referenced by WXP::Plot::setLine(), WXP::Plot::setLine(), WXP::Plot::setLineColor(), and WXP::Plot::setLineColor().
int Graph::setLineStyle | ( | int | style | ) |
Sets the line style
style | Style index |
Referenced by WXP::Plot::setLine(), WXP::Plot::setLine(), and WXP::Plot::setLineStyle().
int Graph::setLineWidth | ( | float | width | ) |
Sets the line width
width | Line width scale factor |
Referenced by WXP::Plot::setLine(), WXP::Plot::setLine(), and WXP::Plot::setLineWidth().
int Graph::setMarkColor | ( | int | index | ) |
int Graph::setMarkSize | ( | float | size | ) |
Sets marker size
size | Size of marker in plot coordinates |
Referenced by WXP::Plot::setMark().
int Graph::setMarkType | ( | int | type | ) |
Sets the marker type
type | Marker type index |
int Graph::setMarkWeight | ( | float | weight | ) |
int Graph::setOffset | ( | float | rx, |
float | ry | ||
) |
Sets the offset of the window on the screen
rx | X location |
ry | Y location |
int Graph::setSize | ( | float | width, |
float | height | ||
) |
Sets the size of the window
width | Width in pixels |
height | Height in pixels |
int Graph::setSymbol | ( | const char * | file | ) |
Sets up the symbol set to use. This will read the symbols in from file.
file | Filename of symbol data |
References WXP::FileTool::addPath(), WXP::StrLib::copy(), WXP::StrLib::equal(), WXP::String::get(), and WXP::Wxp::getDatabasePath().
int Graph::setTextAlign | ( | int | hor, |
int | vert | ||
) |
Sets the text alignment
hor | Horizontal alignment: HALIGN_LEFT, HALIGN_CENTER, HALIGN_RIGHT |
vert | Vertical alignment: VALIGN_CAP, VALIGN_TOP, VALIGN_HALF, VALIGN_BOTTOM, VALIGN_BASE |
Referenced by WXP::Plot::setText().
int Graph::setTextBoxColor | ( | int | index | ) |
Sets text box color. This is the color of a box surrounding text (unimplemented)
index | Color index |
int Graph::setTextCharWidth | ( | float | width | ) |
Sets the text character width. This is used if a fixed spacing is needed for text such as use in tables, etc.
width | Character width |
Referenced by WXP::Plot::setText().
int Graph::setTextColor | ( | int | index | ) |
Sets the text color
index | Color index |
Referenced by WXP::Plot::setText(), WXP::Plot::setTextColor(), and WXP::Plot::setTextColor().
int Graph::setTextDirection | ( | float | x, |
float | y | ||
) |
Sets text direction in terms of an up vector.
x | Vector X value |
y | Vector Y value |
Referenced by WXP::Plot::setText(), and WXP::Plot::setTextDirection().
int Graph::setTextExpansion | ( | float | expansion | ) |
Sets the text horizontal expansion factor
expansion | Expansion scale factor (def=1) |
Referenced by WXP::Plot::setText().
int Graph::setTextHeight | ( | float | height | ) |
Sets the text height
height | Height of text in plot coordinates |
References setFontSpec().
Referenced by WXP::Plot::setText().
int Graph::setTextSpacing | ( | float | space | ) |
Sets text spacing. This is the amount of space between each character
space | Spacing value |
int Graph::setTextWeight | ( | float | weight | ) |
Sets text line width factor. This is the width used in drawing soft font text.
width | Line width |
Referenced by WXP::Plot::setText().
int Graph::setTitle | ( | const char * | str | ) |
Sets the window title
str | Window title |
int Graph::setTran | ( | int | val | ) |
Sets the current tranformation number
val | Transform number |
int Graph::setViewport | ( | int | num, |
Rect & | rect | ||
) |
Sets the viewport for a specific transformation
num | The transformation number |
rect | The rectangle specifying viewport extent |
References WXP::GTran::setViewport().
int Graph::setViewport | ( | Rect & | rect | ) |
Sets the viewport for the current transformation
rect | The rectangle specifying viewport extent |
References WXP::GTran::setViewport().
int Graph::setViewportAspect | ( | Rect & | limit, |
float | aspect | ||
) |
Sets the viewport based on drawing area specifics. The output is the largest area centered within limit of an area with aspect ratio aspect.
limit | Outer limit of drawing area |
aspect | Aspect ratio of plot |
References setViewportAspect().
int Graph::setViewportAspect | ( | Rect & | limit, |
float | aspect, | ||
int | halign, | ||
int | valign | ||
) |
Sets the viewport based on drawing area specifics. The output is the largest area within limit of an area with aspect ratio aspect.
limit | Outer limit of drawing area |
aspect | Aspect ratio of plot |
halign | Horizontal alignment of area |
valign | Vertical alignment of area |
References WXP::GTran::getNdc(), WXP::Wxp::isDebug(), WXP::Rect::print(), WXP::GTran::setViewport(), WXP::Rect::xmax, WXP::Rect::xmin, WXP::Rect::ymax, and WXP::Rect::ymin.
Referenced by setViewportAspect().
int Graph::setWindow | ( | int | num, |
Rect & | rect | ||
) |
Sets the window coordinate system for the viewport
num | The transformation number to set |
rect | The limits of the window |
References WXP::GTran::setWindow().
int Graph::setWindow | ( | Rect & | rect | ) |
Sets the window coordinate system for the current viewport
rect | The limits of the window |
References WXP::GTran::setWindow().
int Graph::tranPlotView | ( | float | x1, |
float | y1, | ||
float & | x2, | ||
float & | y2 | ||
) |
Converts plot coordinates to view coordinates
x1 | The X plot coordinate |
y1 | The Y plot coordinate |
x2 | The X view coordinate |
y2 | The Y view coordinate |
References WXP::GTran::tranPlotNdcX(), and WXP::GTran::tranPlotNdcY().
int Graph::tranPlotWindow | ( | float | x1, |
float | y1, | ||
float & | x2, | ||
float & | y2 | ||
) |
Converts plot coordinates to window coordinates
x1 | The X plot coordinate |
y1 | The Y plot coordinate |
x2 | The X window coordinate |
y2 | The Y window coordinate |
References WXP::GTran::tranPlotWindowX(), and WXP::GTran::tranPlotWindowY().
Referenced by tranPlotWindow().
Converts plot coordinates to window coordinates
pt1 | The plot coordinate |
pt2 | The window coordinate |
References tranPlotWindow(), WXP::Point::x, and WXP::Point::y.
int Graph::tranWindow | ( | int | tran1, |
float | x1, | ||
float | y1, | ||
int | tran2, | ||
float & | x2, | ||
float & | y2 | ||
) |
Converts window coordinates from one transformation to another
tran1 | The initial transformation |
x1 | The initial X window coordinate |
y1 | The initial Y window coordinate |
tran2 | The final transformation |
x2 | The X window coordinate |
y2 | The Y window coordinate |
References WXP::GTran::tranPlotWindowX(), WXP::GTran::tranPlotWindowY(), WXP::GTran::tranWindowPlotX(), and WXP::GTran::tranWindowPlotY().
Referenced by tranWindow().
Converts window coordinates from one transformation to another
tran1 | The initial transformation |
pt1 | The initial window coordinates |
tran2 | The final transformation |
pt2 | The window coordinates |
References tranWindow(), WXP::Point::x, and WXP::Point::y.
int Graph::unmanage | ( | ) |
Unmanages the window and returns control back to the program
Referenced by WXP::Plot::callback().
int Graph::update | ( | ) |
Update the window.
Referenced by WXP::Plot::update().