ProcessViewBrowser-ServerProgramming
Functions
Graphics

Functions

int pvSetZoomX (PARAM *p, int id, float zoom)
 
int pvSetZoomY (PARAM *p, int id, float zoom)
 
int gWriteFile (const char *file)
 
int gCloseFile ()
 
int gBeginDraw (PARAM *p, int id)
 
int gBox (PARAM *p, int x, int y, int w, int h)
 
int gRect (PARAM *p, int x, int y, int w, int h)
 
int gEndDraw (PARAM *p)
 
int gLineTo (PARAM *p, int x, int y)
 
int gBufferedLine (PARAM *p)
 
int gLine (PARAM *p, float *x, float *y, int n)
 
int gMoveTo (PARAM *p, int x, int y)
 
int gRightYAxis (PARAM *p, float start, float delta, float end, int draw)
 
int gSetColor (PARAM *p, int r, int g, int b)
 
int gSetWidth (PARAM *p, int w)
 
int gSetStyle (PARAM *p, int style)
 
int gDrawArc (PARAM *p, int x, int y, int w, int h, int start_angle, int angle_length)
 
int gDrawPie (PARAM *p, int x, int y, int w, int h, int start_angle, int angle_length)
 
int gDrawPolygon (PARAM *p, int *x, int *y, int n)
 
int gSetFont (PARAM *p, const char *family, int size, int weight, int italic)
 
int gSetLinestyle (PARAM *p, int style)
 
int gText (PARAM *p, int x, int y, const char *text, int alignment)
 
int gTextInAxis (PARAM *p, float x, float y, const char *text, int alignment)
 
int gSetFloatFormat (PARAM *p, const char *text)
 
int gXAxis (PARAM *p, float start, float delta, float end, int draw)
 
int gYAxis (PARAM *p, float start, float delta, float end, int draw)
 
int gXGrid (PARAM *p)
 
int gYGrid (PARAM *p)
 
int gBoxWithText (PARAM *p, int x, int y, int w, int h, int fontsize, const char *xlabel, const char *ylabel, const char *rylabel)
 
int gComment (PARAM *p, const char *comment)
 
int gPlaySVG (PARAM *p, const char *filename)
 
int gSocketPlaySVG (PARAM *p, const char *svgstring)
 
int gTranslate (PARAM *p, float x, float y)
 
int gRotate (PARAM *p, float angle)
 
int gScale (PARAM *p, float sx, float sy)
 
int pvSetSelector (PARAM *p, int id, int state)
 
int pvPrintSvgOnPrinter (PARAM *p, int id)
 

Detailed Description

These are the graphis routines usable with pyQDrawWidget()

Function Documentation

◆ gBeginDraw()

int gBeginDraw ( PARAM p,
int  id 
)
Call this function before you start drawing the widget.

◆ gBox()

int gBox ( PARAM p,
int  x,
int  y,
int  w,
int  h 
)
Draws a rectangle frame. Later you can use it's coordinates to draw xAxis, yAxiy and ryAxis.

◆ gBoxWithText()

int gBoxWithText ( PARAM p,
int  x,
int  y,
int  w,
int  h,
int  fontsize,
const char *  xlabel,
const char *  ylabel,
const char *  rylabel 
)
This is a convenience function that draws a box and write the xlabel ylabel and rylabel
in the given font.
If one of the text parameters is NULL no text is drawn for that item.

◆ gBufferedLine()

int gBufferedLine ( PARAM p)
Draw a line in a Axis.
See pvXYAllocate
See also Linestyle.

◆ gCloseFile()

int gCloseFile ( )
Call this function after you have written graphical commands to a file.

◆ gComment()

int gComment ( PARAM p,
const char *  comment 
)
Write a comment in the metafile

◆ gDrawArc()

int gDrawArc ( PARAM p,
int  x,
int  y,
int  w,
int  h,
int  start_angle,
int  angle_length 
)
Draw an arc. For circle write:
  gDrawArc(p,x-radius/2,y-radius/2,radius/2,radius/2,0,360);

◆ gDrawPie()

int gDrawPie ( PARAM p,
int  x,
int  y,
int  w,
int  h,
int  start_angle,
int  angle_length 
)
Draw an pie (filled part of a circle) . For filled circle write:
  gDrawArc(p,x-radius/2,y-radius/2,radius/2,radius/2,0,360);

◆ gDrawPolygon()

int gDrawPolygon ( PARAM p,
int *  x,
int *  y,
int  n 
)
x,y is an array with the edge points.
n is the number of points

◆ gEndDraw()

int gEndDraw ( PARAM p)
Call this function when you are finished with drawing.

◆ gLine()

int gLine ( PARAM p,
float *  x,
float *  y,
int  n 
)
Draw a line in a Axis n=number of values in x,y.
See also Linestyle.

◆ gLineTo()

int gLineTo ( PARAM p,
int  x,
int  y 
)
Draw a line from the actual position to x,y.

◆ gMoveTo()

int gMoveTo ( PARAM p,
int  x,
int  y 
)
Move to x,y.

◆ gPlaySVG()

int gPlaySVG ( PARAM p,
const char *  filename 
)
Play SVG file
You have to download the file first using:
int pvDownloadFile(PARAM *p, const char *filename);
Attention:
This is a deprecated function.
It only works with the Qt3 version of pvbrowser client.
Now use rlSvgAnumator from rllib.

◆ gRect()

int gRect ( PARAM p,
int  x,
int  y,
int  w,
int  h 
)
Draws a filled rectangle.

◆ gRightYAxis()

int gRightYAxis ( PARAM p,
float  start,
float  delta,
float  end,
int  draw 
)
Draw a Axis on the right side of the diagram.
It starts with start in steps of delta until end is reached.

◆ gRotate()

int gRotate ( PARAM p,
float  angle 
)
Rotate the graphic
Rotates the coordinate system angle degrees counterclockwise.

◆ gScale()

int gScale ( PARAM p,
float  sx,
float  sy 
)
Scale the graphic

◆ gSetColor()

int gSetColor ( PARAM p,
int  r,
int  g,
int  b 
)
Set the drawing color.

◆ gSetFloatFormat()

int gSetFloatFormat ( PARAM p,
const char *  text 
)
Set the format in which the Axis is drawn.
default: "%f"
For example set
"%5.2f"
if you want two digits behind the .

◆ gSetFont()

int gSetFont ( PARAM p,
const char *  family,
int  size,
int  weight,
int  italic 
)
Set a font. For the availabe fonts see Definitions (Events, Fonts, Colors ...)

◆ gSetLinestyle()

int gSetLinestyle ( PARAM p,
int  style 
)
Set the linestyle of a line in the Axis. You can draw a simple line or a line with centered symbols.

◆ gSetStyle()

int gSetStyle ( PARAM p,
int  style 
)
style = PenStyle.

◆ gSetWidth()

int gSetWidth ( PARAM p,
int  w 
)
Set the line width

◆ gSocketPlaySVG()

int gSocketPlaySVG ( PARAM p,
const char *  svgstring 
)
Play SVG string over the socket
Attention:
This is a deprecated function.
It only works with the Qt3 version of pvbrowser client.
Now use rlSvgAnumator from rllib.

◆ gText()

int gText ( PARAM p,
int  x,
int  y,
const char *  text,
int  alignment 
)
Draw a text at x,y.
For alignment see Definitions (Events, Fonts, Colors ...)

◆ gTextInAxis()

int gTextInAxis ( PARAM p,
float  x,
float  y,
const char *  text,
int  alignment 
)
Draw a text at x,y in Axis.
For alignment see Definitions (Events, Fonts, Colors ...)

◆ gTranslate()

int gTranslate ( PARAM p,
float  x,
float  y 
)
Translate the graphic

◆ gWriteFile()

int gWriteFile ( const char *  file)
Call this function before you write graphical commands to a file.

◆ gXAxis()

int gXAxis ( PARAM p,
float  start,
float  delta,
float  end,
int  draw 
)
Draw a Axis on the bottom of the diagram.
It starts with start in steps of delta until end is reached.

◆ gXGrid()

int gXGrid ( PARAM p)
Draw a grid orthogonal to the x-axis in the diagram.

◆ gYAxis()

int gYAxis ( PARAM p,
float  start,
float  delta,
float  end,
int  draw 
)
Draw a Axis on the left side of the diagram.
It starts with start in steps of delta until end is reached.

◆ gYGrid()

int gYGrid ( PARAM p)
Draw a grid orthogonal to the y-axis in the diagram.

◆ pvPrintSvgOnPrinter()

int pvPrintSvgOnPrinter ( PARAM p,
int  id 
)
Print the SVG on the QDraw widget on a printer

◆ pvSetSelector()

int pvSetSelector ( PARAM p,
int  id,
int  state 
)
Set Selector in QDraw Widget 0|1
default 1

◆ pvSetZoomX()

int pvSetZoomX ( PARAM p,
int  id,
float  zoom 
)
Zoom the image in X direction. (default: zoom=1.0)
If zoom < 0.0 then keep aspect ratio, factor = |zoom|.

◆ pvSetZoomY()

int pvSetZoomY ( PARAM p,
int  id,
float  zoom 
)
Zoom the image in Y direction. (default: zoom=1.0)
If zoom < 0.0 then keep aspect ratio, factor = |zoom|.