Navigation:  »No topics above this level«

DPLOT Structure

Print this Topic Previous pageReturn to chapter overviewNext page

The DPLOT structure contains format information for a graph: number of curves, number of points in each curve, line and symbol styles used, etc. It is used in calls to DPlot_Plot, DPlot_PlotToRect, and DPlot_PlotBitmap. This structure is defined in the header/include file accompanying the various source examples, and shown below using standard C syntax.

/* Structure used to send data to DPLOT via DDE */

 

#define DPLOT_DDE_VERSION 4

/* Version 2 of the DPLOT structure is obsolete and not recommended for use unless it is 

             imperative that your program be compatible with DPlot versions older than 1.8.

   Version 3 of the DPLOT structure allows up to 100 curves and increases the number of allowable

             characters in the legend from 40 to 80 characters each, number of characters in 

             curve labels from 5 to 40 characters each.

   Version 4 of the DPLOT structure adds a 4th title line and increases the number of allowable

             characters in the title lines and X, Y axis labels from 80 to 200 characters.

             Version 2.1 or later of DPlot or DPlot Jr is required.

*/

 

#if DPLOT_DDE_VERSION<3

 

#define MAXC 20

 

typedef struct tagDPLOT

{

    DWORD Version;           // Caller must set this to DPLOT_DDE_VERSION

    DWORD hwnd;              // handle of client application window

                             // (Use DWORD rather than HWND)

    DWORD DataFormat;        // XY pairs, DX and Y, etc.

    DWORD MaxCurves;         // maximum number of curves (must be <= 20)

                             // = NX for DataFormat = DATA_3D

                             //   ignore for DataFormat = DATA_3DR

    DWORD MaxPoints;         // maximum number of points/curve

                             // = NY for DataFormat = DATA_3D

                             // = 3 * number of points for DATA_3DR

    DWORD NumCurves;         // actual number of curves, always 1 for

                             //   DATA_3D or DATA_3DR

    DWORD Scale;             // scaling code (Linear, Log, etc.)

    float LegendX;           // left coord of legend, expressed as a ratio

                             //    of plot size (0->1)

    float LegendY;           // top coord of legend

    DWORD NP[MAXC];          // actual number of points in each curve;

                             //   cannot exceed MaxPoints.

                        // For DATA_3DR files, return number of nodes in NP[0]

    DWORD LineType[MAXC];    // line types (see codes below)

    DWORD SymbolType[MAXC];  // symbol types (see codes below)

    DWORD SizeofExtraInfo;   // Extra information following X,Y data

    char  Legend[MAXC+1][40];// Legend[0] is the caption for the legend.

                             // Legend[n] is the legend for the n'th curve.

    char  Label[MAXC][5];    // Strings displayed beside the last data point

                             //   in a curve.

    char  Title[3][80];      // Three title lines.

    char  XAxis[80];         // X Axis label.

    char  YAxis[80];         // Y Axis label.

} DPLOT;

 

#else

 

#define MAXC 100

 

#if DPLOT_DDE_VERSION==3

 

typedef struct tagDPLOT

{

    DWORD Version;           // Caller must set this to DPLOT_DDE_VERSION

    DWORD hwnd;              // handle of client application window

                             // (Use DWORD rather than HWND)

    DWORD DataFormat;        // XY pairs, DX and Y, etc.

    DWORD MaxCurves;         // maximum number of curves (must be <= 100)

                             // = NX for DataFormat = DATA_3D

                             //   ignore for DataFormat = DATA_3DR

    DWORD MaxPoints;         // maximum number of points/curve

                             // = NY for DataFormat = DATA_3D

                             // = 3 * number of points for DATA_3DR

    DWORD NumCurves;         // actual number of curves, always 1 for

                             //   DATA_3D or DATA_3DR

    DWORD Scale;             // scaling code (Linear, Log, etc.)

    float LegendX;           // left coord of legend, expressed as a ratio

                             //    of plot size (0->1)

    float LegendY;           // top coord of legend

    DWORD NP[MAXC];          // actual number of points in each curve;

                             //   cannot exceed MaxPoints.

                        // For DATA_3DR files, return number of nodes in NP[0]

    DWORD LineType[MAXC];    // line types (see codes below)

    DWORD SymbolType[MAXC];  // symbol types (see codes below)

    DWORD SizeofExtraInfo;   // Extra information following X,Y data

    char  Legend[MAXC+1][80];// Legend[0] is the caption for the legend.

                             // Legend[n] is the legend for the n'th curve.

    char  Label[MAXC][40];   // Strings displayed beside the last data point

                             //   in a curve.

    char  Title[3][80];      // Three title lines.

    char  XAxis[80];         // X Axis label.

    char  YAxis[80];         // Y Axis label.

} DPLOT;

 

#endif

#if DPLOT_DDE_VERSION==4

 

typedef struct tagDPLOT

{

    DWORD Version;           // Caller must set this to DPLOT_DDE_VERSION

    DWORD hwnd;              // handle of client application window

                             // (Use DWORD rather than HWND)

    DWORD DataFormat;        // XY pairs, DX and Y, etc.

    DWORD MaxCurves;         // maximum number of curves (must be <= 100)

                             // = NX for DataFormat = DATA_3D

                             //   ignore for DataFormat = DATA_3DR

    DWORD MaxPoints;         // maximum number of points/curve

                             // = NY for DataFormat = DATA_3D

                             // = 3 * number of points for DATA_3DR

    DWORD NumCurves;         // actual number of curves, always 1 for

                             //   DATA_3D or DATA_3DR

    DWORD Scale;             // scaling code (Linear, Log, etc.)

    float LegendX;           // left coord of legend, expressed as a ratio

                             //    of plot size (0->1)

    float LegendY;           // top coord of legend

    DWORD NP[MAXC];          // actual number of points in each curve;

                             //   cannot exceed MaxPoints.

                        // For DATA_3DR files, return number of nodes in NP[0]

    DWORD LineType[MAXC];    // line types (see codes below)

    DWORD SymbolType[MAXC];  // symbol types (see codes below)

    DWORD SizeofExtraInfo;   // Extra information following X,Y data

    char  Legend[MAXC+1][80];// Legend[0] is the caption for the legend.

                             // Legend[n] is the legend for the n'th curve.

    char  Label[MAXC][40];   // Strings displayed beside the last data point

                             //   in a curve.

    char  Title[4][200];     // Four title lines.

    char  XAxis[200];        // X Axis label.

    char  YAxis[200];        // Y Axis label.

} DPLOT;

#endif

#endif

 

// DataFormat graph-type and data organization codes

#define DATA_XYXY         0     // One or more sets of X,Y data

#define DATA_DXY          1     // One or more X,Y curves. Constant spacing in X and same number of points in all curves.

#define DATA_XYYY         2     // One or more X,Y curves. All curves have the same X values.

#define DATA_3D           3     // Z values on a rectangular grid

#define DATA_3DR          4     // Random X,Y,Z values

#define DATA_IMAGE        5     // Used only by DPlot - there's no way to SEND DPlot an image

#define DATA_1D           6     // One or more groups of Y values.

#define DATA_3DS          7     // 3D scatter plot

#define DATA_4D           8     // 4D surface plot

#define DATA_4DS          9     // 4D scatter plot

// Scale codes:

#define SCALE_LINEARX_LINEARY     1

#define SCALE_LINEARX_LOGY        2

#define SCALE_LOGX_LINEARY        3

#define SCALE_LOGX_LOGY           4

#define SCALE_TRIPARTITE          5

#define SCALE_LINEARX_PROBABILITY 6

#define SCALE_GRAINSIZE_DIST      7

#define SCALE_POLAR               8

#define SCALE_BARCHART            9

#define SCALE_LOGX_PROBABILITY   10

#define SCALE_PROBX_LINEARY      11

#define SCALE_PROBX_LOGY         12

#define SCALE_PROBX_PROBY        13

#define SCALE_TRIANGLE_PLOT      14    // X and Y specified, Z inferred from X+Y+Z=100

#define SCALE_N185               15    // N1.85 hydraulic scale

#define SCALE_MERCATOR           16    // Mercator projection

// Unit-specific scaling codes ... combine with above values using OR operator

#define UNITS_DEFAULT                   0

#define UNITS_TRIPARTITE_INCHES      UNITS_DEFAULT   // Velocity (Y) in inches/sec

#define UNITS_TRIPARTITE_FEET        0x00000100L     //                 feet/sec

#define UNITS_TRIPARTITE_MILLIMETERS 0x00000200L     //                 mm/sec

#define UNITS_TRIPARTITE_CENTIMETERS 0x00000300L     //                 cm/sec

#define UNITS_TRIPARTITE_METERS      0x00000400L     //                 meters/sec

#define UNITS_GRAINSIZE_MILLIMETERS  UNITS_DEFAULT   // Grain sizes (X) in mm

#define UNITS_GRAINSIZE_INCHES       0x00000100L     //                    inches

#define UNITS_POLAR_RADIANS          UNITS_DEFAULT   // Rotation (X) in radians

#define UNITS_POLAR_DEGREES          0x00000100L     //                 degrees

#define UNITS_USERDEFINED            0x00007F00L

// Line styles:

#define LINESTYLE_NONE        0

#define LINESTYLE_SOLID       1

#define LINESTYLE_LONGDASH    2

#define LINESTYLE_DOTTED      3

#define LINESTYLE_DASHDOT     4

#define LINESTYLE_MEDDASH     5

#define LINESTYLE_DASHDOTDOT  6

#define LINESTYLE_DASHDOTDOTDOT 7

// Symbol styles (search DPLOT.HLP for "SymbolType" for other symbol types)

#define SYMBOLSTYLE_NONE         0

#define SYMBOLSTYLE_DOT          1

#define SYMBOLSTYLE_CROSS        2

#define SYMBOLSTYLE_ASTERISK     3

#define SYMBOLSTYLE_X            4

#define SYMBOLSTYLE_SQUARE       5

#define SYMBOLSTYLE_DIAMOND      6

#define SYMBOLSTYLE_TRIANGLE     7

#define SYMBOLSTYLE_OCTAGON      8

#define SYMBOLSTYLE_ITRIANGLE    9

#define SYMBOLSTYLE_HEXAGON     10

#define SYMBOLSTYLE_PENTAGON    11

#define SYMBOLSTYLE_STAR        12

#define SYMBOLSTYLE_FILL        0x00000100L  // May be combined with styles above

 

 


Page url: http://www.dplot.com/lib/index.htm?dplotstruct.htm