home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk21
/
dir01
/
f011160.re_
/
f011160.re
Wrap
Text File
|
1996-04-02
|
23KB
|
659 lines
/*----------------------------------------------------------------------+
| |
| Copyright (c) 1985-93; Bentley Systems, Inc., All rights reserved. |
| |
| "MicroStation", "MDL", and "MicroCSL" are trademarks of Bentley |
| Systems, Inc. |
| |
| Limited permission is hereby granted to reproduce and modify this |
| copyrighted material provided that the resulting code is used only |
| in conjunction with Bentley Systems products under the terms of the |
| license agreement provided therein, and that this notice is retained |
| in its entirety in any such reproduction or modification. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| mdl.h -- Main include file for MDL applications. Defines |
| structures and constants used by MDL library functions. |
| |
| $Workfile: mdl.h $
| $Revision: 6.14 $
| $Date: 10 Nov 1995 14:02:22 $
| |
+----------------------------------------------------------------------*/
#if !defined (__mdlH__)
#define __mdlH__
#if !defined (__basedefsH__)
# include <basedefs.h>
#endif
#if !defined (__basetypeH__)
# include <basetype.h>
#endif
/*----------------------------------------------------------------------+
| |
| Replace the obsolete names with the new names |
| |
+----------------------------------------------------------------------*/
#if defined (mdl)
#define cmd_name cmdName
#define cmd_number cmdNumber
#endif
/*----------------------------------------------------------------------+
| |
| const and volatile are not supported by the MDL compiler |
| |
+----------------------------------------------------------------------*/
#if defined (mdl)
# if !defined (const)
# define const
# endif
# if !defined (volatile)
# define volatile
# endif
#endif
/*----------------------------------------------------------------------+
| |
| MDL function pointers are longs when viewed by native code |
| |
+----------------------------------------------------------------------*/
#if defined (mdl)
typedef int (*MdlFunctionP)();
#else
typedef unsigned long MdlFunctionP;
#endif
typedef struct neutralFunctionPointer
{
NativeFuncP nativeFuncP;
MdlFunctionP mdlFuncP;
void *mdlDescP;
} NeutralFunctionPointer;
/*----------------------------------------------------------------------+
| |
| Constants for standard views |
| |
+----------------------------------------------------------------------*/
#define STDVIEW_TOP 1
#define STDVIEW_BOTTOM 2
#define STDVIEW_LEFT 3
#define STDVIEW_RIGHT 4
#define STDVIEW_FRONT 5
#define STDVIEW_BACK 6
#define STDVIEW_ISO 7
/*----------------------------------------------------------------------+
| |
| Text creation routine parameters |
| |
+----------------------------------------------------------------------*/
#define TXT_NO_TRANSFORM 0x8000
#define TXT_BY_TILE_SIZE 1
#define TXT_BY_MULT 2
#define TXT_BY_TEXT_SIZE 3
#define TXT_BY_WIDTH_ASPECT 4
/* Text Justifications */
#define TXTJUST_LT 0 /* Left Top */
#define TXTJUST_LC 1 /* Left Center */
#define TXTJUST_LB 2 /* Left Bottom */
#define TXTJUST_LMT 3 /* Left Margin Top */
#define TXTJUST_LMC 4 /* Left Margin Center */
#define TXTJUST_LMB 5 /* Left Margin Bottom */
#define TXTJUST_CT 6 /* Center Top */
#define TXTJUST_CC 7 /* Center Center */
#define TXTJUST_CB 8 /* Center Bottom */
#define TXTJUST_RMT 9 /* Right Margin Top */
#define TXTJUST_RMC 10 /* Right Margin Center */
#define TXTJUST_RMB 11 /* Right Margin Bottom */
#define TXTJUST_RT 12 /* Right Top */
#define TXTJUST_RC 13 /* Right Center */
#define TXTJUST_RB 14 /* Right Bottom */
#define TXTJUST_LU 15 /* Left Cap */
#define TXTJUST_LD 16 /* Left Descender */
#define TXTJUST_LMU 17 /* Left Margin Cap */
#define TXTJUST_LMD 18 /* Left Margin Descender */
#define TXTJUST_CU 19 /* Center Cap */
#define TXTJUST_CD 20 /* Center Descender */
#define TXTJUST_RMU 21 /* Right Margin Cap */
#define TXTJUST_RMD 22 /* Right Margin Descender */
#define TXTJUST_RU 23 /* Right Cap */
#define TXTJUST_RD 24 /* Right Descender */
#define TXTJUST_NONE 127 /* no justfication */
/*** Text Font Info Defines Below ***/
/* Text Symbol Type */
#define TXTFONT_NORMAL 0 /* Normal font */
#define TXTFONT_SYMBOL 1 /* Symbol font */
/* Text Vector Size */
#define TXTFONT_BYTEVEC 1 /* 8-bits used for vector */
#define TXTFONT_WORDVEC 2 /* 16-bits used for vector */
/* Text Representation Size */
#define TXTFONT_BYTEREP 0 /* 8-bits represents font */
#define TXTFONT_WORDREP 1 /* 16-bits represents font */
/* Text Type */
#define TXTFONT_VECTOR 0 /* Vector font */
#define TXTFONT_RASTER 1 /* Raster font */
/*** Text Direction ***/
#define TXTDIR_HORIZONTAL 0x0
#define TXTDIR_MLINERTOL 0x2 /* draw vertical multi-line text
from right to left */
#define TXTDIR_VERTICAL 0x4 /* draw a string vertical */
#define TXTDIR_RIGHTLEFT 0x8 /* draw a string right to left */
/*** Text Fitting Mode ***/
#define TXTFIT_VARIABLESIZE 0
#define TXTFIT_FIXEDSIZE 1
#if !defined (__textH__)
typedef struct textDrawFlags
{
#if !defined (BITFIELDS_REVERSED)
UShort interCharSpacing:1;
UShort fixedWidthSpacing:1;
UShort underline:1;
UShort slant:1;
UShort vertical:1;
UShort rightToLeft:1; /* draw text from right to left */
UShort reverseMline:1; /* vertical multi-line arranged R to L */
UShort kerning:1;
UShort unused:8;
#else
UShort unused:8;
UShort kerning:1;
UShort reverseMline:1; /* vertical multi-line arranged R to L */
UShort rightToLeft:1; /* draw text from right to left */
UShort vertical:1;
UShort slant:1;
UShort underline:1;
UShort fixedWidthSpacing:1;
UShort interCharSpacing:1;
#endif
} TextDrawFlags;
#endif
typedef struct mstextsize
{
double width;
double height;
} MSTextSize;
#if !defined (macintosh)
typedef MSTextSize TextSize;
#endif
typedef struct textSizeParam
{
int mode;
MSTextSize size;
double aspectRatio;
} TextSizeParam;
typedef struct textParam
{
int font;
int just;
int style;
int viewIndependent;
} TextParam;
typedef struct textParamWide
{
int font;
int just;
int style;
int viewIndependent;
int nodeNumber; /* for textnode only */
double slant; /* valid if flags.slant = 1 */
double lineSpacing; /* for textnode only */
double characterSpacing; /* if fixedWidth/interCharSpacing */
double underlineSpacing; /* valid if flags.underline */
TextDrawFlags flags;
} TextParamWide;
typedef struct textEDField
{
byte start;
byte len;
byte just;
} TextEDField;
typedef struct textEDParam
{
int numEDFields;
TextEDField *edField;
} TextEDParam;
typedef struct textScale
{
double x; /* magnification of vectors within tile */
double y; /* magnification of vectors within tile */
} TextScale;
typedef struct textFlags
{
UShort upper:1; /* upper case */
UShort lower:1; /* lower case */
UShort fract:1; /* fractions */
UShort intl:1; /* international */
UShort fast:1; /* fast */
UShort space:1; /* space char defined? */
UShort filled:1; /* filled font */
UShort reserved:3; /* reserved */
} TextFlags;
typedef struct textStyleInfo
{
int font;
short style;
} TextStyleInfo;
typedef struct textFontInfo
{
TextFlags lettersType; /* upper, lower, fractions, intl */
byte charType; /* symbol or normal */
byte vectorSize; /* byte or word */
byte graphicType; /* rastor or vector */
byte charSize; /* 8 or 16 bit representation of font */
short tileSize; /* size of "tile" making up characters */
long dataSize; /* size of file including header */
Point2d origin; /* origin of char in the "tile" */
TextScale scale; /* scale factor of font */
} TextFontInfo;
/*----------------------------------------------------------------------+
| |
| Defines for mdlElement_getFilePos & mdlElement_setFilePos routines. |
| |
+----------------------------------------------------------------------*/
#define FILEPOS_EOF 0
#define FILEPOS_CURRENT 1
#define FILEPOS_FIRST_ELE 2
#define FILEPOS_NEXT_ELE 3
#define FILEPOS_WORKING_SET 4
#define FILEPOS_WORKING_WINDOW 5
#define FILEPOS_COMPONENT 6
/*----------------------------------------------------------------------+
| |
| Defines for mdlElmdscr_ routines |
| |
+----------------------------------------------------------------------*/
#define ELMD_ELEMENT (1<<0)
#define ELMD_PRE_HDR (1<<1)
#define ELMD_POST_HDR (1<<2)
#define ELMD_PRE_NESTEDHDR (1<<3)
#define ELMD_POST_NESTEDHDR (1<<4)
#define ELMD_ALL_ONCE (ELMD_ELEMENT | ELMD_PRE_HDR | ELMD_PRE_NESTEDHDR)
#define ELMD_HDRS_ONCE (ELMD_PRE_HDR | ELMD_PRE_NESTEDHDR)
/*----------------------------------------------------------------------+
| |
| Parameters for mdlModify_ routines |
| |
+----------------------------------------------------------------------*/
typedef struct mdlCopyParamsTag
{
int reserved1;
int reserved2;
void *reserved3;
} MdlCopyParams;
#define MODIFY_ORIG (1<<1)
#define MODIFY_COPY 0
#define MODIFY_DRAWINHILITE (1<<3)
#define MODIFY_DONTDRAWNEW (1<<4)
#define MODIFY_DONTERASEORIG (1<<5)
#define MODIFY_REQUEST_NOHEADERS 0
#define MODIFY_REQUEST_HEADERS (1<<0)
#define MODIFY_REQUEST_ONLYONE (1<<1)
#define MODIFY_STATUS_NOCHANGE 0
#define MODIFY_STATUS_REPLACE (1<<0)
#define MODIFY_STATUS_DELETE (1<<1)
#define MODIFY_STATUS_ABORT (1<<2)
#define MODIFY_STATUS_FAIL (1<<3)
#define MODIFY_STATUS_REPLACEDSCR (1<<4)
#define MODIFY_STATUS_MODIFIED (1<<5)
#define MODIFY_STATUS_DONTDELETEROWS (1<<6)
#define MODIFY_STATUS_ERROR (MODIFY_STATUS_FAIL | MODIFY_STATUS_ABORT)
/*----------------------------------------------------------------------+
| |
| Defines for mdlView_getDisplayControls() & |
| mdlView_setDisplayControls() |
| |
+----------------------------------------------------------------------*/
#define VIEWCONTROL_FAST_CURVE 0
#define VIEWCONTROL_FAST_TEXT 1
#define VIEWCONTROL_FAST_FONT 2
#define VIEWCONTROL_LINE_WEIGHTS 3
#define VIEWCONTROL_PATTERNS 4
#define VIEWCONTROL_TEXT_NODES 5
#define VIEWCONTROL_ED_FIELDS 6
#define VIEWCONTROL_GRID 9
#define VIEWCONTROL_LEV_SYMB 10
#define VIEWCONTROL_POINTS 11
#define VIEWCONTROL_CONSTRUCTION 12
#define VIEWCONTROL_DIMENSIONS 13
#define VIEWCONTROL_AREA_FILL 16
#define VIEWCONTROL_RASTER_TEXT 17
#define VIEWCONTROL_AUX_DISPLAY 18
#define VIEWCONTROL_CAMERA 22
#define VIEWCONTROL_RENDERMODE 23
#define VIEWCONTROL_BACKGROUND 26
#define VIEWCONTROL_REF_BOUND 27
#define VIEWCONTROL_FAST_BOUND_CLIP 28
#define VIEWCONTROL_DEPTH_CUE 29
#define VIEWCONTROL_NO_DYNAMICS 30
#define VIEWMODE_WIREFRAME 0
#define VIEWMODE_CROSSSECTION 1
#define VIEWMODE_WIREMESH 2
#define VIEWMODE_HIDDENLINE 3
#define VIEWMODE_FILLEDHLINE 4
#define VIEWMODE_CONTANTSHADE 5
#define VIEWMODE_SMOOTHSHADE 6
#define VIEWMODE_PHONGSHADE 7
/*----------------------------------------------------------------------+
| |
| Defines for mdlParams_getActive() & mdlParams_setActive() |
| |
+----------------------------------------------------------------------*/
#define ACTIVEPARAM_COLOR 1
#define ACTIVEPARAM_COLOR_BY_NAME 2
#define ACTIVEPARAM_LINESTYLE 3
#define ACTIVEPARAM_LINEWEIGHT 4
#define ACTIVEPARAM_LEVEL 5
#define ACTIVEPARAM_ANGLE 6
#define ACTIVEPARAM_FONT 7
#define ACTIVEPARAM_GRIDUNITS 8
#define ACTIVEPARAM_GRIDREF 9
#define ACTIVEPARAM_TEXTHEIGHT 10
#define ACTIVEPARAM_TEXTWIDTH 11
#define ACTIVEPARAM_UNITROUNDOFF 12
#define ACTIVEPARAM_TEXTJUST 13
#define ACTIVEPARAM_NODEJUST 14
#define ACTIVEPARAM_CELLNAME 15
#define ACTIVEPARAM_LINELENGTH 16
#define ACTIVEPARAM_LINESPACING 17
#define ACTIVEPARAM_TERMINATOR 18
#define ACTIVEPARAM_TAGINCREMENT 19
#define ACTIVEPARAM_TAB 20
#define ACTIVEPARAM_STREAMDELTA 21
#define ACTIVEPARAM_STREAMTOLERANCE 22
#define ACTIVEPARAM_STREAMANGLE 23
#define ACTIVEPARAM_STREAMAREA 24
#define ACTIVEPARAM_POINT 25
#define ACTIVEPARAM_KEYPOINT 26
#define ACTIVEPARAM_PATTERNDELTA 27
#define ACTIVEPARAM_PATTERNANGLE 28
#define ACTIVEPARAM_PATTERNSCALE 29
#define ACTIVEPARAM_PATTERNCELL 30
#define ACTIVEPARAM_AREAMODE 31
#define ACTIVEPARAM_AXISANGLE 32
#define ACTIVEPARAM_CLASS 33
#define ACTIVEPARAM_CAPMODE 34
#define ACTIVEPARAM_GRIDMODE 35
#define ACTIVEPARAM_GRIDRATIO 36
#define ACTIVEPARAM_FILLMODE 37
#define ACTIVEPARAM_SCALE 38
#define ACTIVEPARAM_TERMINATORSCALE 39
#define ACTIVEPARAM_DIMCOMPAT 40
#define ACTIVEPARAM_MLINECOMPAT 41
#define ACTIVEPARAM_AXISORIGIN 42
#define ACTIVEPARAM_PATTERNTOLERANCE 43
#define ACTIVEPARAM_LINESTYLENAME 44
#define ACTIVEPARAM_LINESTYLEPARAMS 45
#define ACTIVEPARAM_FILLCOLOR 46
#define ACTIVEPARAM_SNAPOVERRIDE 47
/* NOTE: changed from ACTIVELOCK_SNAPMODE to ACTIVEPARAM_SNAPMODE after V5.0 */
/* NOTE: ACTIVELOCK_SNAPMODE CANNOT be used with mdlParams_setLock !! */
#define ACTIVEPARAM_SNAPMODE 501
#define ACTIVELOCK_SNAPMODE ACTIVEPARAM_SNAPMODE
/*----------------------------------------------------------------------+
| |
| Defines for mdlParams_getLock() & mdlParams_setLock() |
| |
+----------------------------------------------------------------------*/
#define ACTIVELOCK_ASSOCIATION 500
#define ACTIVELOCK_SNAP 501
#define ACTIVELOCK_GRID 502
#define ACTIVELOCK_UNIT 503
#define ACTIVELOCK_BORESITE 504
#define ACTIVELOCK_ANGLE 505
#define ACTIVELOCK_TEXTNODE 506
#define ACTIVELOCK_AXIS 507
#define ACTIVELOCK_SCALE 508
#define ACTIVELOCK_GRAPHGROUP 509
#define ACTIVELOCK_LEVEL 510
#define ACTIVELOCK_FENCEOVERLAP 511
#define ACTIVELOCK_FENCECLIP 512
#define ACTIVELOCK_FENCEVOID 513
#define ACTIVELOCK_CELLSTRETCH 514
#define ACTIVELOCK_SELECTION 515
#define ACTIVELOCK_CONSTRUCTION 516
#define ACTIVELOCK_ISOMETRIC 517
#define ACTIVELOCK_DEPTH 518
/*----------------------------------------------------------------------+
| |
| Defines for mdlOutput_printf. |
| |
+----------------------------------------------------------------------*/
#define MSG_MESSAGE 0
#define MSG_ERROR 1
#define MSG_PROMPT 2
#define MSG_STATUS 3
#define MSG_COMMAND 4
#define MSG_KEYIN 5
/*----------------------------------------------------------------------+
| |
| Defines for mdlWindow_ routines |
| |
+----------------------------------------------------------------------*/
#if !defined (MSWINDOW) && !defined (_MSWINDOW_TYPEDEF_)
# if defined (mdl) || !defined (vax)
typedef void MSWindow;
# define _MSWINDOW_TYPEDEF_
# else
# define MSWindow void
# endif
#endif
/*----------------------------------------------------------------------+
| |
| Constants for dimension and multiline points |
| |
+----------------------------------------------------------------------*/
#define POINT_CHECK 0
#define POINT_ASSOC 1
#define POINT_STD 2
/* Arc association options */
#define ASSOC_ARC_ANGLE 0
#define ASSOC_ARC_CENTER 1
#define ASSOC_ARC_START 2
#define ASSOC_ARC_END 3
/*----------------------------------------------------------------------+
| |
| Constants for mdlMline functions |
| |
+----------------------------------------------------------------------*/
#define MLBREAK_FROM_JOINT 0x8000
#define MLBREAK_TO_JOINT 0x4000
#define MLBREAK_STD 0
#define MLCAP_NONE 0x0
#define MLCAP_LINE 0x1
#define MLCAP_OUTER_ARCS 0x2
#define MLCAP_INNER_ARCS 0x4
#define MLCAP_CLOSE 0x8
#define SHIFT_BREAKS 0x2
#define REMOVE_ASSOC 0x4
#define MLJOIN_CLOSE 0
#define MLJOIN_OPEN 1
#define MLJOIN_MERGE 2
/*----------------------------------------------------------------------+
| |
| Constants for mdlLevel functions |
| |
+----------------------------------------------------------------------*/
#define DUPLICATE_GROUP 2227
#define DUPLICATE_LEVEL 2228
/*----------------------------------------------------------------------+
| |
| Constants for mdlText functions |
| |
+----------------------------------------------------------------------*/
#define FRACTIONS (1<<1)
#define INTERNATIONAL (1<<2)
#define CONTROL (1<<3)
/*----------------------------------------------------------------------+
| |
| Constants for mdlState_startFenceCommand |
| |
+----------------------------------------------------------------------*/
#define FENCE_NO_CLIP 0
#define FENCE_CLIP_ORIG 1
#define FENCE_CLIP_COPY 3
/*----------------------------------------------------------------------+
| |
| Constants for mdlSystem_loadMdlProgramExtended |
| |
+----------------------------------------------------------------------*/
#define LOADPROGRAM_APPLICATION_CLASS 1
#define LOADPROGRAM_MESSAGES 2
#define LOADPROGRAM_DEBUGGER 3
#define LOADPROGRAM_STARTUP_STRING 4
#define LOADPROGRAM_PARENT_NAME 5
#define LOADPROGRAM_STARTUP_TYPE 6
/*----------------------------------------------------------------------+
| |
| Constants for mdlRefFile_getParameters / setParameters |
| |
+----------------------------------------------------------------------*/
#define REFERENCE_DISPLAY 1
#define REFERENCE_SNAP 2
#define REFERENCE_LOCATE 3
#define REFERENCE_SLOTACTIVE 4
#define REFERENCE_SCALELINESTYLES 5
#define REFERENCE_FILENOTFOUND 6
#define REFERENCE_FILENAME 7
#define REFERENCE_DESCRIPTION 8
#define REFERENCE_LOGICAL 9
#define REFERENCE_SCALE 10
#define REFERENCE_ROTATION 11
#define REFERENCE_LEVELFLAGS 12
#define REFERENCE_ATTACHNAME 13
#define REFERENCE_UNITDESC 14
#define REFERENCE_SCALE_MASTERUNITS 15
#define REFERENCE_RESERVEDA 16
#define REFERENCE_COMPLETE_PATH_STORED 17
#define REFERENCE_HIDDEN_LINE 18
#define REFERENCE_DISPLAY_HIDDEN 19
#define REFERENCE_CLIP_ROTATE 20
/*----------------------------------------------------------------------+
| |
| Constant for MicroStation BASIC linkage ID |
| |
+----------------------------------------------------------------------*/
#define LINKAGEID_BASIC 43797
/*----------------------------------------------------------------------+
| |
| Constants and typedefs for mdlPattern_ functions |
| |
+----------------------------------------------------------------------*/
#define PATTERN_ID 32040 /* Pattern linkage ID */
/*-----------------------------------------------------------------------
Each member of the PatternParams structure has a corresponding bit in
the "modifiers" member that indicates whether or not the member is used.
For example, if "rMatrix" is to be used, set the appropriate bit in
the modifiers member using the bitwise OR operator
(.modifiers |= PATMOD_RMATRIX). If the "rMatrix" member is to be ignored,
clear the appropriate bit in "modofiers" (.modifiers &= ~PATMOD_RMATRIX).
-----------------------------------------------------------------------*/
typedef struct
{
RotMatrix rMatrix; /* pattern coordinate system */
DPoint3d offset; /* offset from element origin */
double space1; /* primary (row) spacing */
double angle1; /* angle of first hatch or pattern */
double space2; /* secondary (column) spacing */
double angle2; /* angle of second hatch */
double scale; /* pattern scale */
ULong tolerance; /* pattern tolerance */
ULong cell; /* radix50 pattern cell name */
ULong modifiers; /* pattern modifiers bit field */
int minLine; /* min line of multi-line element */
int maxLine; /* max line of multi-line element */
int status; /* - internal use only */
byte color; /* pattern / hatch color */
byte weight; /* pattern / hatch weight */
byte style; /* pattern / hatch style */
} PatternParams;
#define PATMOD_SPACE1 0x0001 /* patternParams.space1 present */
#define PATMOD_ANGLE1 0x0002 /* patternParams.angle1 present */
#define PATMOD_SPACE2 0x0004 /* patternParams.space2 present */
#define PATMOD_ANGLE2 0x0008 /* patternParams.angle2 present */
#define PATMOD_SCALE 0x0010 /* patternParams.scale present */
#define PATMOD_CELL 0x0020 /* patternParams.cell present */
#define PATMOD_TOLERANCE 0x0040 /* patternParams.tolerance present */
#define PATMOD_STYLE 0x0080 /* patternParams.style present */
#define PATMOD_WEIGHT 0x0100 /* patternParams.weight present */
#define PATMOD_COLOR 0x0200 /* patternParams.color present */
#define PATMOD_SNAP 0x0400 /* set if pattern is snappable */
#define PATMOD_RMATRIX 0x0800 /* patternParams.rMatrix present */
#define PATMOD_OFFSET 0x1000 /* patternParams.offset present */
#define PATTERN_HATCH 0x0
#define PATTERN_CROSSHATCH 0x1
#define PATTERN_AREA 0x2
/*----------------------------------------------------------------------+
| |
| Constants for mdlTextFile_ functions |
| |
+----------------------------------------------------------------------*/
#define TEXTFILE_READ 0
#define TEXTFILE_WRITE 1
#define TEXTFILE_APPEND 2
#define TEXTFILE_DEFAULT 0x0
#define TEXTFILE_KEEP_NEWLINE 0x1
#define TEXTFILE_NO_NEWLINE 0x1
#endif /* __mdlH__ */