Index

PowerDoc Objects

Grid

Overview

This objects represents a simple grid. In Power Engine API, a grid is a tabular structure representing rows and/or columns. Grids are typically used to draw tables, matrices and similar structures.

Designated Rendering Function: pdDrawGrid (12)

Note 1: pdNw, pdPosArrX_08, pdPosArrX_16, pdPosArrX_24 and pdPosArrX_32 cannot be used at the same time. pdPosArrX_32 takes precedence over pdPosArrX_24. pdPosArrX_24 takes precedence over pdPosArrX_16. pdPosArrX_16 takes precedence over pdPosArrX_08. Finally, pdPosArrX_08 takes precedence over pdNw.

Note 2: pdNh, pdPosArrY_08, pdPosArrY_16, pdPosArrY_24 and pdPosArrY_32 cannot be used at the same time. pdPosArrY_32 takes precedence over pdPosArrY_24. pdPosArrY_24 takes precedence over pdPosArrY_16. pdPosArrY_16 takes precedence over pdPosArrY_08. Finally, pdPosArrY_08 takes precedence over pdNh.

Note 3: If pdPosArrX_08, pdPosArrX_16, pdPosArrX_24 or pdPosArrX_32 is used, the grid will contain n manually positioned vertical grid lines, where n is the number of elements in the array. Each element then specifies the X coordinate of the corresponding vertical grid line). If pdNw is used, the grid will contain pdNw vertical grid lines that are equally spaced apart.

Note 4: If pdPosArrY_08, pdPosArrY_16, pdPosArrY_24 or pdPosArrY_32 is used, the grid will contain n manually positioned horizontal grid lines, where n is the number of elements in the array. Each element then specifies the Y coordinate of the corresponding horizontal grid line). If pdNh is used, the will grid contain pdNh horizontal grid lines that are equally spaced apart.

Note 5: Although pdLinePtr and pdOutlinePtr are both key links, they are not mandatory. This means it is possible to construct a grid that has no border or has no inner grid lines. Also, pdBodyPtr is not mandatory either. This means it is possible to construct a grid that has no body, only an outline and/or inner grid lines and/or a shadow.

pdLinePtr (1015)

Also appears in: Baseline, Library Polyline, Line, Arc, Polyline (also Bezier and B-Spline curve)

Link to the Line Definition (Full) or Line Definition (Standard) object.

This link supplies parameters necessary to render the body of a line. In the context of the Grid object, this link supplies the parameters necessary to render the grid lines.

pdOutlinePtr (1014)

Also appears in: Typography (For Outline Fonts), Row Boundary, Typographic Frame, Library Shape, Rectangle, Circle/Ellipse, True Circle/Ellipse, Slice, Custom Shape or Polygon

Link to the Outline Definition object.

This link supplies parameters necessary to render the outline of an object.

pdBodyPtr (1013)

Also appears in: Typography (For Outline Fonts), Row Boundary, Typographic Frame, Library Shape, Rectangle, Circle/Ellipse, True Circle/Ellipse, Slice, Pattern, Custom Shape or Polygon, Gradient, Gradient (As Fast Rectangle)

Link to the Surface Definition object.

This link supplies style attributes for the body of an object. Style attributes include color, transparency, pattern fills, special effects (e.g. blur, emboss, pattern fill) etc.

pdShadowPtr (1016)

Also appears in: Typography (For Outline Fonts), Baseline, Row Boundary, Typographic Frame, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, True Circle/Ellipse, Slice, Arc, Custom Shape or Polygon, Polyline (also Bezier and B-Spline curve)

Link to the Shadow Definition object.

Used to render the shadow of a line, shape or some other object.

Properties

pdDw (1029)   PD_LONG_SIGNED

Also appears in: PowerFont Record, PowerFont, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, Pattern, Gradient, Gradient (As Fast Rectangle), Gradient (As Inverter), Bitmap Image, Library Bitmap Image, 3D Model

In general, this property represents the width of a line, shape or some other object in document units. Most objects assume a positive width. However, some objects (e.g. lines) can have either a positive or a negative width. In these cases, this property also indicates the direction.

This property may also be used for some other more specific purposes. For example, in PowerFonts it refers to the font's base width (or horizontal units per em-square). Similarly, in PowerFont records this property serves as the advance width of a glyph.

Sample values:

500 = Width of 500 document units
-200 = Width of -200 document units

pdDh (1030)   PD_LONG_SIGNED

Also appears in: PowerFont, Library Polyline, Library Shape, Line, Rectangle, Circle/Ellipse, Pattern, Gradient, Gradient (As Fast Rectangle), Gradient (As Inverter), Bitmap Image, Library Bitmap Image, 3D Model

In general, this property represents the height of a line, shape or other object in document units. Most objects assume a positive height. But some objects (e.g. lines) can have either a positive or a negative height. In these cases, the height property also indicates the direction.

This property may also be used for some other more specific purposes. For example, in PowerFonts this property refers to the font's base height (or vertical units per em-square).

Sample values:

400 = Height of 400 document units
-100 = Height of -100 document units

pdPosArrX_08 (1149)   PD_ARR_BYTE_SIGNED

Supported Compression Methods: 006

Also appears in: Text Layout (Manual)

An array containing X coordinates for manual positioning (variable length, 1 byte per coordinate).

Same as pdPosArrX_32 but uses 1 byte per coordinate.

pdPosArrX_16 (1148)   PD_ARR_WORD_SIGNED

Supported Compression Methods: 004

Also appears in: Text Layout (Manual)

An array containing X coordinates for manual positioning (variable length, 2 bytes per coordinate).

Same as pdPosArrX_32 but uses 2 bytes per coordinate.

pdPosArrX_24 (1147)   PD_ARR_TRIO_SIGNED

Supported Compression Methods: 002

Also appears in: Text Layout (Manual)

An array containing X coordinates for manual positioning (variable length, 3 bytes per coordinate).

Same as pdPosArrX_32 but uses 3 bytes per coordinate.

pdPosArrX_32 (1103)   PD_ARR_LONG_SIGNED

Supported Compression Methods: 000

Also appears in: Text Layout (Manual)

An array containing X coordinates for manual positioning (variable length, 4 bytes per coordinate).

When used in the context of the Text Layout (Manual) object, pdPosArrX_32 is an array containing X coordinates or relative deltas needed to manually position the corresponding letters (i.e. characters or glyphs). The length of the array should be the same as the number of letters. If the array is shorter, any missing coordinates will assume the value 0. If the array is longer, any extra coordinates will be ignored. All X coordinates and relative deltas are specified in 1/256 document units (i.e. they are document units multiplied by 256). This provides the extra precision needed for precise text layout. Whether a value is an absolute X coordinate or relative delta depends on the corresponding instruction in the pdPosArrI.

When used in the context of the Grid object, pdPosArrX_32 is an array containing X coordinates needed to manually position the vertical grid lines, relative to the grid's origin. The length of the array equals the number of vertical grid lines. All X coordinates are in document units. They must be non-negative and must not exceed the width of the Grid object.

Sample values:

0, 12800, 25600, -16000, 15360, 15360, 15360, 29360, 15360, 25600, 25600, 25600, 25600

pdPosArrY_08 (1152)   PD_ARR_BYTE_SIGNED

Supported Compression Methods: 006

Also appears in: Text Layout (Manual)

An array containing Y coordinates for manual positioning (variable length, 1 byte per coordinate).

Same as pdPosArrY_32 but uses 1 byte per coordinate.

pdPosArrY_16 (1151)   PD_ARR_WORD_SIGNED

Supported Compression Methods: 004

Also appears in: Text Layout (Manual)

An array containing Y coordinates for manual positioning (variable length, 2 bytes per coordinate).

Same as pdPosArrY_32 but uses 2 bytes per coordinate.

pdPosArrY_24 (1150)   PD_ARR_TRIO_SIGNED

Supported Compression Methods: 002

Also appears in: Text Layout (Manual)

An array containing Y coordinates for manual positioning (variable length, 3 bytes per coordinate).

Same as pdPosArrY_32 but uses 3 bytes per coordinate.

pdPosArrY_32 (1104)   PD_ARR_LONG_SIGNED

Supported Compression Methods: 000

Also appears in: Text Layout (Manual)

An array containing Y coordinates for manual positioning (variable length, 4 bytes per coordinate).

When used in the context of the Text Layout (Manual) object, pdPosArrY_32 is an array containing Y coordinates or relative deltas needed to manually position the corresponding letters (i.e. characters or glyphs). The length of the array should be the same as the number of letters. If the array is shorter, any missing coordinates will assume the value 0. If the array is longer, any extra coordinates will be ignored. All Y coordinates and relative deltas are specified in 1/256 document units (i.e. they are document units multiplied by 256). This provides the extra precision needed for precise text layout. Whether a value is an absolute Y coordinate or relative delta depends on the corresponding instruction in the pdPosArrI.

When used in the context of the Grid object, pdPosArrY_32 is an array containing Y coordinates needed to manually position the horizontal grid lines, relative to the grid's origin. The length of the array equals the number of horizontal grid lines. All Y coordinates are in document units. They must be non-negative and must not exceed the height of the Grid object.

Sample values:

0, 6400, -6400, 25600, 0, 0, 0, 0, 55600

pdNw (1039)   PD_WORD_UNSIGNED

Also appears in: Bitmap Image Data, Pattern Fill Definition

Number of items in horizontal direction. Depending on the context, the items can be pixels, rows, grid lines etc.

pdNh (1040)   PD_WORD_UNSIGNED

Also appears in: Bitmap Image Data, Pattern Fill Definition

Number of items in vertical direction. Depending on the context, the items can be pixels, rows, grid lines etc.

pdEdges (1132)   PD_BYTE_UNSIGNED

Also appears in: Rectangle

Reserved for future use.

Example

C/C++

DT_ID_SLONG obj[4];

obj[0] = pdObjAdd(pd, 0, "Grid Style");
obj[1] = pdObjAdd(pd, 0, "Grid Border");
obj[2] = pdObjAdd(pd, 0, "Grid Lines");
obj[3] = pdObjAdd(pd, 0, "Grid");

/* Properties for object 0 */
pdPropAdd(pd, obj[0], pdRGBT, "50641400", PD_HEX);

/* Properties for object 1 */
pdLinkAdd(pd, obj[1], pdStylePtr, obj[0]);
pdPropAdd(pd, obj[1], pdLineThickness, "300", PD_WORD_SIGNED);

/* Properties for object 2 */
pdLinkAdd(pd, obj[2], pdStylePtr, obj[0]);
pdPropAdd(pd, obj[2], pdLineThickness, "100", PD_WORD_SIGNED);

/* Properties for object 3 */
pdLinkAdd(pd, obj[3], pdOutlinePtr, obj[1]);
pdLinkAdd(pd, obj[3], pdLinePtr, obj[2]);
pdPropAdd(pd, obj[3], pdDw, "600", PD_LONG_SIGNED);
pdPropAdd(pd, obj[3], pdDh, "250", PD_LONG_SIGNED);
pdPropAdd(pd, obj[3], pdNw, "5", PD_WORD_UNSIGNED);
pdPropAdd(pd, obj[3], pdNh, "3", PD_WORD_UNSIGNED);


/* Image placement */
pdImgAdd(pd, obj[3], 0, 50, 50, 0, 0, 0, pdDrawGrid, DV_NULL);

INTEGRAL DSL

/* Lambda shortcuts */

local o = @(label = "") CDTObj(::my.doc, label); /* to make object */
local p = @(id, str, len = PD_DEFAULT) CDTProp(id, str, len); /* to add property - general */
local s = @(id, str) CDTPropStr(id, str); /* to add property - string */
local i = @(id, num) CDTPropInt(id, num); /* to add property - integer */
local l = @(id, obj) CDTLink(id, obj); /* to add link */

/* Objects */

local obj_0 = o("Grid Style");
local obj_1 = o("Grid Border");
local obj_2 = o("Grid Lines");
local obj_3 = o("Grid");

/* Object Properties */

obj_0 + s(pdRGBT, "50641400");

obj_1 + l(pdStylePtr, obj_0);
obj_1 + i(pdLineThickness, 300);

obj_2 + l(pdStylePtr, obj_0);
obj_2 + i(pdLineThickness, 100);

obj_3 + l(pdOutlinePtr, obj_1);
obj_3 + l(pdLinePtr, obj_2);
obj_3 + i(pdDw, 600);
obj_3 + i(pdDh, 250);
obj_3 + i(pdNw, 5);
obj_3 + i(pdNh, 3);

/* Image Pinning */

obj_3.Pin(0, 50, 50, pdDrawGrid);
 

Index