Functions | |
void | Define_Glyph (const char *name, int data_size, const char *data) |
void | UnDefine_Glyph (char const *name) |
void Define_Glyph | ( | const char * | name, | |
int | data_size, | |||
const char * | data | |||
) |
Describes a set of simple geometries which can be later used to define a custom marker, edge or line style.
name | Name of the custom marker, edge, or line style. | |
data_size | Size of data | |
data | Glyph definition described below. |
The data block header consists of three char values. The first is the nominal radius that defines the radius of the glyph for the purpose of sizing and selection while the second two numbers are the x and y offsets respectively. These offsets allow users to position the glyph relative to the actual insertion point.
The second block in the data block consists of a series of codes which may have optional arguments. Both the codes and their arguments are chars. The various codes and their associated arguments are:
------------------------------------------------------------ "n" where n is a signed char "n>1" A polyline consisting of n points. This code is then followed by a list of n (x, y) pairs which define the polyline within the glyph canvas. "1" A dot. This code is followed by the (x,y) location of the object within the glyph canvas. "0" Termination of glyph definition. This must be at the end of all glyph definitions. "-1" Start fill. Closed geometry subsequent to this will be filled. "-2" Restart fill. "-3" End fill. "-4" Ellipse. This code is followed by 2 (x,y) which define the lower left and upper right corner of the rectangle which contains the ellipse within the glyph canvas. "-5" Circular arc. This code is followed by 3 (x,y) pairs which define the start, an intermediary, and the end point of a circular arc on the glyph canvas. "-6" Infinite line. This code is followed by 2 (x,y) pairs which are located on the line segment within the glyph canvas. "-7" Infinite ray. This code is followed by 2 (x,y) pairs the first of which defines the start point of the ray and the second of which is located which are located on the ray on the glyph canvas. "-8" Start contrast color. The geometry subsequent to this will be colored according to the owning geometries contrast color setting. "-9" Start normal color. The geometry subsequent to this will be colored according to the owning geometries' color setting. "-10" Start RGB color. The geometry subsequent to this will be colored with the rgb value that is defined in the (r,g,b) triplet which is defined in the values immediately following this code. "-11" Start indexed color. The color of the geometry subsequent to this is the index which is defined in the value immediately following this code. ------------------------------------------------------------
A simple examples:
const char crosshairs[] = {10, 0, 0, 2, -10, 0, 10, 0, 2, 0, -10, 0, 10, 0} HC_Open_Segment("?Picture"); HC_Define_Glyph ("crosshairs", sizeof(crosshairs), crosshairs); HC_Set_Marker_Symbol("crosshairs"); HC_Insert_Marker(-0.5, 0.0, 0.0); HC_Close_Segment();
void UnDefine_Glyph | ( | char const * | name | ) |
Removes the glyph definintion established in a previous call to Define_Glyph().
name | Name of the custom marker, edge, or line style. |