Index

PowerDoc Objects

Line

Overview

This object represents a simple straight line. Straight lines are frequently used to build various types of diagrams, charts, forms etc.

While constructing the Line object, an optional shadow may be specified. Also, depending on the pdLinePtr link, straight lines can be drawn solid or dashed, while their ends can be styled (flat, rounded, peak) or marked using special symbols (e.g. arrowheads or dots).

Designated Rendering Function: pdDrawLine (4)

pdLinePtr (1015)

Also appears in: Baseline, Library Polyline, Arc, Grid, 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.

pdShadowPtr (1016)

Also appears in: Typography (For Outline Fonts), Baseline, Row Boundary, Typographic Frame, Library Polyline, Library Shape, Rectangle, Circle/Ellipse, True Circle/Ellipse, Slice, Arc, Grid, 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, Rectangle, Circle/Ellipse, Pattern, Grid, 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, Rectangle, Circle/Ellipse, Pattern, Grid, 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

Example

C/C++

DT_ID_SLONG obj[3];

obj[0] = pdObjAdd(pd, 0, "Line Style");
obj[1] = pdObjAdd(pd, 0, "Line Definition");
obj[2] = pdObjAdd(pd, 0, "Line");

/* 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, "1500", PD_WORD_SIGNED);
pdPropAdd(pd, obj[1], pdLineSegment, "10", PD_WORD_UNSIGNED);
pdPropAdd(pd, obj[1], pdLineStart, "100", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[1], pdLineEnd, "100", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[1], pdLineStartSize, "10", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[1], pdLineStartTheta, "40", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[1], pdLineEndSize, "20", PD_BYTE_UNSIGNED);
pdPropAdd(pd, obj[1], pdLineEndTheta, "165", PD_BYTE_UNSIGNED);

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


/* Image placement */
pdImgAdd(pd, obj[2], 0, 50, 50, 0, 0, 0, pdDrawLine, 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("Line Style");
local obj_1 = o("Line Definition");
local obj_2 = o("Line");

/* Object Properties */

obj_0 + s(pdRGBT, "50641400");

obj_1 + l(pdStylePtr, obj_0);
obj_1 + i(pdLineThickness, 1500);
obj_1 + i(pdLineSegment, 10);
obj_1 + i(pdLineStart, 100);
obj_1 + i(pdLineEnd, 100);
obj_1 + i(pdLineStartSize, 10);
obj_1 + i(pdLineStartTheta, 40);
obj_1 + i(pdLineEndSize, 20);
obj_1 + i(pdLineEndTheta, 165);

obj_2 + l(pdLinePtr, obj_1);
obj_2 + i(pdDw, 600);
obj_2 + i(pdDh, 250);

/* Image Pinning */

obj_2.Pin(0, 50, 50, pdDrawLine);
 

Index