[shapedef.txt 4/95 Digital Insight] This file describes how to define custom object shapes and arrow types for Robochart. --- Where To Define Shapes The complete default library of shapes and arrows are defined in the file named in environment variable RCHT_SHAPES. Normally, this is the file "shapedef" in the Robochart installation directory. To replace this library, create your own version of the shapedef file and point RCHT_SHAPES to that file before starting Robochart. To override individual shape (but not arrow) definitions, you can put them into your configuration file (normally ~/.rchart) - this happens automatically when you use the online shape definition window. --- File Format Blank lines and comments (starting with "#") are ignored. Vector shape definitions require five consecutive lines: shape v [] icon data attach points outline definition fill definition Image shape definitions require four lines: shape i [] icon data attach points image filename Arrow definitions require three lines: arrow icon data definition = 0-255 for shapes, 0-29 for arrows = a (automatic), m (manual), or b (bus) attachment mode and are default width and height in pixels. Default size for image shapes is the original image size. = n for numberable objects --- Icon Data Icons are defined as a string of 64 hex characters indicating the 16x16-pixel X11-style bitmap image. The rcicon utility can be used to generate bitmaps in this format (using the X11 bitmap program). --- Coordinate Space Object attach points, outlines, and fill are defined in terms of a 128-unit wide by 128-unit high region, with the origin at the upper left corner. This region is scaled to fit the width and height of each object. For example, if a certain diagram object is exactly 64 pixels wide and 64 pixels high, each unit in definition space corresponds to a half-pixel of screen space for that object. (0,0) --------------- (128,0) | | | | | | | | | | | | | | | | | | (0,128) ------------- (128,128) Arrow definitions are in pixel units, defined in terms of a line approaching from the right (positive X) reaching an object at the origin, with positive Y going down. ---+ | (10,10) | / |/ +------------------- (0,0) | \ | (10,-10) ---+ --- Attach Points Attach points form a list of X,Y coordinate pairs, separated by white space and/or commas, terminated by a newline or "#". If no attach points are defined for a shape, a default set of 16 points spaced around the rectangular boundary are used. The standard shape library includes shapes with a reduced number of attach points, which are convenient for drawing objects on a rigid grid. --- Outline Commands Vector shape outline commands are a list of single-character (upper-case) commands followed by numeric parameters, separated by white space and/or commas, terminated by a newline or "#". The commands are: M x,y - move to x,y L x,y - draw line to x,y P x,y [x,y]... - draw closed polygon with specified vertices A x,y w,h a1 a2 - draw elliptical arc inside the bounding rectangle (x,y) [upper left] + (w,h) [width, height]; starting at angle a1 (degrees counterclockwise from "3 o-clock") and continuing for a2 degrees counterclockwise. --- Fill Commands Vector shape fill commands are a list of single-character (upper-case) commands followed by numeric parameters, separated by white space and/or commas, terminated by a newline or "#". The commands are: P x,y [x,y]... - fill closed polygon with specified vertices A x,y w,h a1 a2 - fill elliptical arc (see above for parameters) C x,y w,h a1 a2 - clip elliptical arc (see above for parameters) This is used "cut away" a curved region. It may not work correctly in MIF or HPGL output formats. --- Image Files Image shape filenames are pathnames for monochrome image files in any of the following formats: X11 ASCII bitmap file XView/IconEdit ASCII bitmap file Sun raster file (raw or compressed) --- Arrow Commands Arrow (flow end) commands are a list of single-character (upper-case) commands followed by numeric parameters, separated by white space and/or commas, terminated by a newline or "#". The commands are: M x,y - move to x,y L x,y - draw line to x,y P x,y [x,y]... - draw closed hollow polygon with specified vertices F x,y [x,y]... - draw closed filled polygon with specified vertices H x,y r - draw hollow circle, center at x,y, radius r S x,y r - draw solid (filled) circle, center at x,y, radius r