Home Up

SXY/COM Reference Guide

This manual aims to list all SXY Classes and its methods.

Enumerations

SimpleGraphType

This enumeration defines an application graph configuration.

typedef enum { 
  LINEAR_SIMPLE_GRAPH = 0, 
  SEMILOG_SIMPLE_GRAPH, 
  LOG_SIMPLE_GRAPH, 
  TIME_LINEAR_SIMPLE_GRAPH, 
  TIME_LOG_SIMPLE_GRAPH 
} 
SimpleGraphType; 

SimpleGraphLayout

This enumeration defines then axes configuration layout

typedef enum { 
  HALF_CROSS_LAYOUT = 0, 
  QUARTER_CROSS_LAYOUT, 
  TYPICAL_LAYOUT, 
  DEPTH_LAYOUT 
} 
SimpleGraphLayout; 

SimpleCurveMasks

This enumeration lists the set of available masks to draw for an applications data curve.

typedef enum { 
  SIMPLE_CURVE_MARK_MASK = 0, 
  SIMPLE_CURVE_LINE_MASK, 
  SIMPLE_CURVE_LINEAR_MASK, 
  SIMPLE_CURVE_PARABOLIC_MASK 
} 
SimpleCurveMasks; 

AxisScaleOrientation

This enumeration defines the set of axis scale orientation

typedef enum{ 
  ALIGNED = 0, 
  ROTATED 
} 
AxisScaleOrientation; 

AxisTitleStyle

This enumeration describes the axis label position (relative to axis).

typedef enum{ 
  AT_MIDDLE = 0, 
  AT_END, 
  AT_END_ROTATED 
} 
AxisTitleStyle; 

Pre-defined Colors

This enumeration stands for a list of predefined standard colors.

typedef enum { 
  SXY_RED = 0xFF0000L, 
  SXY_DARK_RED = 0x800000L, 
  SXY_GREEN = 0x00FF00L, 
  SXY_DARK_GREEN = 0x008000L, 
  SXY_BLUE = 0x0000FFL, 
  SXY_DARK_BLUE = 0x000080L, 
  SXY_YELLOW = 0xFFFF00L, 
  SXY_DARK_YELLOW = 0x808000L, 
  SXY_MAGENTA = 0xFF00FFL, 
  SXY_DARK_MAGENTA = 0x800080L, 
  SXY_CYAN = 0x00FFFFL, 
  SXY_DARK_CYAN = 0x008080L, 
  SXY_WHITE = 0xFFFFFFL, 
  SXY_BLACK = 0x000000L, 
  SXY_DARK_GRAY = 0x808080L, 
  SXY_GRAY = 0xC0C0C0L 
} 
SXY_Color; 

Events

Events correspond to messages that are sent to the client application whenever something happens to a graph. The communication is done through a single callback tagged with the event name. This is done by a client function called genericEvent.

void genericEvent(SimpleGraph graph, string event_name);  

This function has two parameters:

bulletgraph: the origin graph;
bulletevent_name: a string that represent the event tag.

Classes

SXYCOM_Application

This class represents a client application and offers methods for building graphs and curves.

Graph Creation

bulletSimpleGraph createSimpleGraph(SimpleGraphType t, int width, int height, string theme) : builds a new graph dialog whose type is defined by parameter t (see SimpleGraphType enumeration for details). The dialog dimension is defined by a (width x height) pixels rectangle and the dialog look and feel is determined by the selected scheme (whose name is defined by parameter theme). See SXYCOM tutorial for complete theme specification.

Curve Creation

bulletArrayCurve createArrayCurve(void) : creates a new curve whose id (see getId() curve method) can be used to attach or detach curves to a graph;

Process Finish

bulletvoid Quit(void) : closes all SXY graphs and finishes SXYCOM process;

ArrayCurve

This class represents a graph curve.

Curve Identification

bulletint getId(void) : returns a curve identification that should be used to attach or detach a curve into a graph;

Title Adjustment

bulletvoid setTitle(string txt) : sets the curve title to txt;
bulletstring getTitle(void) : returns the curve title;

Color Adjustment

bulletlong getColor(void) : returns the curve color;
bulletvoid setColor(long col) : sets the curve color to col;
bulletvoid setRGBColor(long red, long green, long blue) : sets the curve color based on a RGB color definition. The parameters red, green and blue correspond to R, G and B components respectively;

Mask Visibility

bulletvoid setMaskVisibility(SimpleCurveMasks m, boolean flag) : sets the desired mask (parameter m) visibility to the state defined by flag;
bulletboolean getMaskVisibility(SimpleCurveMasks m) : returns the visibility flag for the mask defined by m;

Data Query

bulletdouble getLimitsXmin(void) : returns the horizontal minimum value for the curve;
bulletdouble getLimitsYmin(void) : returns the vertical minimum value for the curve;
bulletdouble getLimitsXmax(void) : returns the horizontal maximum value for the curve;
bulletdouble getLimitsYmax(void) : returns the vertical maximum value for the curve;
bulletdouble getCurveNumPoints(void) : returns the number of data points for the curve;
bulletdouble getCurvePointX(int n) : return the horizontal coordinate for the n-th data point;
bulletdouble getCurvePointY(int n) : return the vertical coordinate for the n-th data point;

Data Adjustment

bulletvoid writePoint(int n, double x, double y) : replaces coordinate of the n-th point of the curve for the x,y);
bulletvoid removePointAt(int n) : removes the n-th point of the curve;
bulletvoid insertPointAt(int n, double x, double y) : inserts a new (x,y) point after the n-th point of the curve;
bulletvoid insertPoint(double x, double y) : Inserts a new point (x,y) at the end of the curve
bulletvoid insertHole(void) : inserts a hole in the end of the curve;
bulletvoid insertHoleAt(int n) : inserts a hole after the n-th point of the curve
bulletvoid invalidateCurvePoint(int n) : invalidate the n-th data point
bulletboolean isInvalidPoint(int n) : returns the validity flag for the n-th data point;
bulletboolean isInvalidValue(double v) : returns a flag indicating the invalidity of the numeric value v ;
bulletint getCurveSize(void) : returns the number of curve points;

User-Edition Adjustment

bulletboolean isReadOnly(void) : tells whether the curve can be manipulated by the user;
bulletvoid setReadOnly(boolean ro) : sets whether the curve can be manipulated by the user (based on the read-only ro parameter flag);

SimpleGraph

This class is responsible for dealing with dialog graph.

Scales Adjustment

bulletdouble getScalesXmin(void) : returns the horizontal minimum scale for the graph;
bulletdouble getScalesYmin(void) : returns the vertical minimum scale for the graph;
bulletdouble getScalesXmax(void) : returns the horizontal maximum scale for the graph;
bulletdouble getScalesYmax(void) : returns the vertical maximum scale for the graph;
bulletvoid setScales(double xmin, double xmax, double ymin, double ymax) : sets the graph scales with the values defined by the parameters;

Grid Scales Adjustment

bulletdouble getGridScalesXmin(void) : returns the horizontal minimum scale for the grid;
bulletdouble getGridScalesYmin(void) : returns the vertical minimum scale for the grid;
bulletdouble getGridScalesXmax(void) : returns the horizontal maximum scale for the grid;
bulletdouble getGridScalesYmax(void) : returns the grid maximum vertical scale;
bulletvoid setGridScales(double xmin, double xmax, double ymin, double ymax) : sets the grid scales with the values defined by the parameters;

Graph Label Adjustment

bulletvoid setTitle(string title) : sets the graph title with the string title;
bulletvoid setSubTitle(string title) : sets the graph subtitle with the string subtitle;
bulletstring getTitle(void) : returns the string for the graph title;
bulletstring getSubTitle(void) : returns the string for the graph subtitle;

Axis Label Adjustment

bulletvoid setHorizontalAxisTitle(string title) : sets the horizontal axis label with the string title;
bulletvoid setVerticalAxisTitle(string title) : sets the vertical axis label with the string title;
bulletstring getHorizontalAxisTitle(void) : returns the horizontal axis
bulletstring getVerticalAxisTitle(void) : returns the title of the vertical axis;
bulletvoid setHorizontalAxisTitleStyle(AxisTitleStyle sty) : sets the horizontal axis label style based on the enumeration parameter sty;
bulletvoid setVerticalAxisTitleStyle(AxisTitleStyle sty) : sets the vertical axis label style based on the enumeration parameter sty;
bulletAxisTitleStyle getHorizontalAxisTitleStyle(void) : returns the horizontal axis label style (see AxisTitleStyle enumeration);
bulletAxisTitleStyle getVerticalAxisTitleStyle(void) : returns the vertical axis label style (see AxisTitleStyle enumeration);
bulletvoid setHorizontalAxisScaleOrientation(AxisScaleOrientation ori) : sets the horizontal axis scale orientation (see AxisScaleOrientation);
bulletvoid setVerticalAxisScaleOrientation(AxisScaleOrientation ori) : sets the horizontal axis scale orientation (see AxisScaleOrientation);
bulletAxisScaleOrientation getHorizontalAxisScaleOrientation(void) : returns the scale orientation of the horizontal axis;
bulletAxisScaleOrientation getVerticalAxisScaleOrientation(void) : returns the scale orientation of the vertical axis;

Zoom Scaling

bulletvoid setZoom(double xratio, double yratio) : sets the specified zoom ratio to the current graph scales. If the a ratio value is less than 1 (one), the result will be a zoom out; otherwise the result is a zoom in. The horizontal and vertical factors are independent and are set by the xratio and yratio parameters respectively;
bulletvoid fitHorizontalScale(void) : adjust the horizontal scale to fit all curves' data points;
bulletvoid fitVerticalScale(void) : adjust the vertical scale to fit all curves' data points;
bulletvoid fitAllScales(void) : adjust all graph scales to fit all curve points;

Axis Layout

bulletvoid setAxesLayout(SimpleGraphLayout new_layout) : adjusts the axis position based on the new_layout parameters (see SimpleGraphLayout enumeration for details);

Axes and Grids Steps

bulletdouble getHorizontalAxisStep(void) : returns the horizontal axis step;
bulletdouble getVerticalAxisStep(void) : returns the vertical axis step;
bulletvoid setAxesSteps(double sx, double sy) : sets both horizontal and vertical steps to sx and sy respectively;
bulletdouble getHorizontalGridStep(void) :  returns the horizontal grid step;
bulletdouble getVerticalGridStep(void) : returns the vertical grid step;
bulletvoid setGridsSteps(double sx, double sy) : sets both horizontal and vertical steps to sx and sy respectively;

Grid Automatic Multiple Steps

bulletdouble getHorizontalGridAutoMultipleStep(void) : returns the horizontal automatic step;
bulletdouble getVerticalGridAutoMultipleStep(void) : returns the vertical automatic step;
bulletvoid setGridsAutoMultipleSteps(double smx, double smy) : sets the grids automatic steps to smx and smy (horizontal and vertical grids respectively);

Graph Drawing

bulletvoid redrawGraph(void) : invalidate to current graph drawing thus causing a full repaint;
bulletvoid printGraph(boolean ask) : send the graph drawing to the printer. If the ask parameter flag is set, the graph will show a printer configuration dialog;
bulletvoid copyGraph(int width, int height) : copies the current graph drawing to clipboard (width x height pixels dimension);

Curve Attach and Detach

bulletvoid attachCurveById(int id) : attaches a curve to the graph, supplied the id of the curve;
bulletvoid detachCurveById(int id) : detaches a curve of the graph, supplied the id of the curve;

Graph Dialog Manipulation

bulletvoid destroyGraph(void) : destroys the graph window;
bulletvoid showGraph(void) : shows the graph window;
bulletvoid hideGraph(void) : hides the graph window, but does not destroy it;

Dialog Graph Labeling

bulletvoid setWindowTitle(string title) : sets the title of the window to title;
bulletvoid setStatusLine(string msg) : sets the of the status line dialog to msg;

 

by André Luiz Clinio and Vinícius Almendra
This paged was last updated in 20/10/03 13:48