home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1997 January
/
Chip_1997-01_cd.bin
/
ms95
/
disk21
/
dir03
/
f011360.re_
/
f011360.re
Wrap
Text File
|
1996-04-02
|
17KB
|
509 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. |
| |
+----------------------------------------------------------------------*/
/*----------------------------------------------------------------------+
| |
| mslstyle.h -- MicroStation line style structures and constants |
| |
| $Workfile: mslstyle.h $
| $Revision: 6.0 $
| $Date: Thu Oct 21 10:41:54 1993 $
| |
+----------------------------------------------------------------------*/
#ifndef __mslstyleH__
#define __mslstyleH__
/*----------------------------------------------------------------------+
| |
| Header File Dependencies |
| |
+----------------------------------------------------------------------*/
#include "basedefs.h"
#include "rscdefs.h"
#include "basetype.h"
/*----------------------------------------------------------------------+
| |
| Constants |
| |
+----------------------------------------------------------------------*/
#define STYLELINK_ID 0x79f9 /* Attribute ID (rad50 'STY') */
#define LC_MAX_STROKES 32 /* Max strokes in line code */
#define LS_MAX_DESCR 128 /* Resource description length */
#define LS_MAX_NAME 64 /* Maximum name length */
#define LSTYPE_Internal 0
#define LSID_DEFAULT 0
#define LSID_HARDWARE 0x80000000
#define LSID_HWMASK 0x0000000f
#define LSATTR_UNITMASK 0x00000003
#define LSATTR_UNITMASTER 0x00000000 /* Units = master units */
#define LSATTR_UNITUOR 0x00000001 /* Unit def in world coords */
#define LSATTR_UNITDEV 0x00000002 /* Unit def in device coords */
/*======================================================================+
| |
| mdlLineStyle_ function options |
| |
+======================================================================*/
/*-----------------------------------------------------------------------
mdlLineStyle_query options
-----------------------------------------------------------------------*/
#define LSQUERY_RSCFILEHANDLE 1
#define LSQUERY_RSCFILENAME 2
#define LSQUERY_RANGE 3
#define LSQUERY_NAMEMAP 4
#define LSQUERY_IDMAP 5
/*-----------------------------------------------------------------------
mdlLineStyle_nameQuery options
-----------------------------------------------------------------------*/
#define LSQUERY_FILEMASK 0x000000ff
#define LSQUERY_STYLEID 0x80000000
/*-----------------------------------------------------------------------
mdlLineStyle_nameDelete options
-----------------------------------------------------------------------*/
#define LSNAME_FREECOMPONENTS 0x00000001
/*-----------------------------------------------------------------------
mdlLineStyle_getElementDescr options
-----------------------------------------------------------------------*/
#define LSOPT_SETGG 0x01
/*----------------------------------------------------------------------+
| |
| Macros |
| |
+----------------------------------------------------------------------*/
#define LC_RSCSIZE(n) (sizeof(LineCodeRsc) + (((n)-1) * sizeof(LineCodeStroke)))
#define LP_RSCSIZE(n) (sizeof(LinePointRsc) + (((n)-1) * sizeof(PointSymInfo)))
#define LS_RSCSIZE(n) (sizeof(LineStyleRsc) + (((n)-1) * sizeof(ComponentInfo)))
/*======================================================================+
| |
| Structure typedefs for Line Style API functions |
| |
+======================================================================*/
/*----------------------------------------------------------------------+
| |
| Line Style params structure. |
| |
| Modifier options are applied to the "modifiers" structure member |
| and can be combined using the bitwise OR ("|") operator. | |
| |
+----------------------------------------------------------------------*/
#define STYLEMOD_SCALE 0x01 /* scale present */
#define STYLEMOD_DSCALE 0x02 /* dash scale present */
#define STYLEMOD_GSCALE 0x04 /* gap scale present */
#define STYLEMOD_SWIDTH 0x08 /* start width present */
#define STYLEMOD_EWIDTH 0x10 /* end width present */
#define STYLEMOD_DISTPHASE 0x20 /* distance phase present */
#define STYLEMOD_FRACTPHASE 0x40 /* fraction phase present */
#define STYLEMOD_RESPHASE 0x80 /* phase mode reserved */
/*-----------------------------------------------------------------------
The modifiers in the second byte apply only in 3d
-----------------------------------------------------------------------*/
#define STYLEMOD_NORMAL 0x0100 /* surface normal present */
#define STYLEMOD_RMATRIX 0x0200 /* rotation matrix present */
#define STYLEMOD_NOSEGMODE 0x80000000 /* disable single segment */
#ifndef resource
typedef struct
{
ULong modifiers; /* see STYLEMOD_... above */
ULong reserved;
double scale; /* Applied to all length values */
double dashScale; /* Applied to adjustable dash strokes */
double gapScale; /* Applied to adjustable gap strokes */
double startWidth; /* Taper start width */
double endWidth; /* Taper end width */
double distPhase; /* Phase shift by distance */
double fractPhase; /* Phase shift by fraction */
DPoint3d normal;
RotMatrix rMatrix;
} StyleParam, LineStyleParams;
/*----------------------------------------------------------------------+
| |
| LineStyleNameInfo |
| |
| Information returned from the mdlLineStyle_nameQuery function |
| |
+----------------------------------------------------------------------*/
typedef struct
{
ULong rscFile; /* Resource file handle */
ULong rscType; /* Resource type */
ULong rscID; /* Resource ID */
ULong attributes; /* Name Attributes */
long styleID; /* Style ID for MASTERFILE */
} LineStyleNameInfo;
#endif
/*======================================================================+
| |
| Resource structures |
| |
+======================================================================*/
/*----------------------------------------------------------------------+
| |
| Line style name map resource structures. |
| |
| The line style name map resources use the same structure as |
| StringLists but they are always stored in packed little-endian |
| format. |
| |
+----------------------------------------------------------------------*/
#ifdef resource
typedef StringList LineStyleNames;
resourceclass LineStyleNames RTYPE_LineStyleNames;
#endif
/*----------------------------------------------------------------------+
| |
| Line Style Resource |
| RTYPE_LineStyle |
| |
| This resource definition is used for the "Compound" line style |
| component. It can be defined in a resource text file using the |
| type RTYPE_LineStyle. |
| |
| For the first release, only the following fields are used. |
| |
| descr |
| nComp |
| component[n].type |
| component[n].id |
| component[n].offset |
| |
| Make sure all other fields are set to zero to insure compatibility |
| with future versions |
| |
+----------------------------------------------------------------------*/
typedef struct
{
ULong type;
ULong id;
ULong lReserved1, lReserved2, lReserved3, lReserved4;
double offset;
double dReserved1;
double dReserved2;
double dReserved3;
} ComponentInfo;
typedef struct
{
char descr[LS_MAX_DESCR];
ULong lHdr1, lHdr2, auxType, auxID, lRes1, lRes2;
double dReserved1;
double dReserved2;
ULong lRes3;
#ifdef resource
ComponentInfo component[];
#else
ULong nComp;
ComponentInfo component[1];
#endif
} LineStyleRsc;
#ifdef resource
resourceclass LineStyleRsc RTYPE_LineStyle;
#endif
/*----------------------------------------------------------------------+
| |
| Line Code Resource |
| RTYPE_LineCode |
| |
| This resource defines the line code component of the line style. |
| In the user documentation, this is referred to as the "stroke |
| pattern" component. |
| |
| For the first release, only the following fields are used. |
| |
| descr |
| phase |
| options |
| maxIterate |
| nStrokes |
| stroke[n].length |
| stroke[n].width |
| stroke[n].endWidth |
| stroke[n].strokeMode |
| stroke[n].widthMode |
| |
| Make sure all other fields are set to zero to insure compatibility |
| with future versions |
| |
+----------------------------------------------------------------------*/
/* Values for "options" member */
#define LCOPT_NONE 0x00000000
#define LCOPT_AUTOPHASE 0x00000001
#define LCOPT_RES1 0x00000002
#define LCOPT_RES2 0x00000004
#define LCOPT_ITERATION 0x00000008 /* Uses iteration limit */
#define LCOPT_SEGMENT 0x00000010 /* Single segment mode */
/* Values for strokeMode */
#define LCSTROKE_DASH 0x01
#define LCSTROKE_GAP 0x00
#define LCSTROKE_RAY 0x02
#define LCSTROKE_SCALE 0x04 /* Stroke can be scaled */
#define LCSTROKE_SDASH 0x05 /* Short for dash and scale */
#define LCSTROKE_SGAP 0x04 /* Short for gap and scale */
#define LCSTROKE_SINVERT 0x08 /* Invert stroke in first code */
#define LCSTROKE_EINVERT 0x10 /* Invert stroke in last code */
/* Values for widthMode */
#define LCWIDTH_NONE 0x00
#define LCWIDTH_LEFT 0x01
#define LCWIDTH_RIGHT 0x02
#define LCWIDTH_FULL 0x03
#define LCWIDTH_TAPER 0x04
#define LCWIDTH_TAPEREND 0x08
/*-----------------------------------------------------------------------
0 - Standard closed polygon (rectangle) strokes.
1 - No end cap. The stroke is displayed as two parallel lines.
2 - The end of the stroke is extended by half the stroke width.
3...
If cap mode is >= 3, the cap is stroked as an arc and the value of
capMode indicates the number of vectors in the arc.
-----------------------------------------------------------------------*/
#define LCCAP_CLOSED 0
#define LCCAP_OPEN 1
#define LCCAP_EXTENDED 2
#define LCCAP_HEXAGON 3
#define LCCAP_OCTAGON 4
#define LCCAP_DECAGON 5
#define LCCAP_ARC 30
typedef struct
{
double length; /* Stroke length */
double width; /* Stroke width (or start width) */
double endWidth; /* End width of tapered stroke */
double dReserved;
long lReserved1;
long lReserved2;
long lReserved3;
byte strokeMode; /* bit 0: dash | gap dash */
/* bit 1: trace mode | linear ray */
/* bit 2: scale mode | off on */
/* bit 3: start invert */
/* bit 4: end invert */
byte widthMode; /* bit 0: left half | off on */
/* bit 1: right half | off on */
/* bit 2: in taper | no yes */
/* bit 3: end taper | no yes */
byte capMode;
byte bReserved;
} StrokeData, LineCodeStroke;
typedef struct
{
char descr[LS_MAX_DESCR];
ULong lHdr1, lHdr2, auxType, auxID;
double phase;
double orgAngle;
double endAngle;
double dReserved1, dReserved2, dReserved3;
ULong options;
ULong maxIterate;
ULong lReserved;
#ifdef resource
StrokeData stroke[];
#else
ULong nStrokes;
StrokeData stroke[1];
#endif
} LineCodeRsc;
#ifdef resource
resourceclass LineCodeRsc RTYPE_LineCode;
#endif
/*----------------------------------------------------------------------+
| |
| Line Point Resource |
| RTYPE_LinePoint |
| |
| For the first release, only the following fields are used. |
| |
| descr |
| lcType |
| lcID |
| maxIterate |
| nStrokes |
| symbol[n].symType |
| symbol[n].symID |
| symbol[n].strokeNo |
| symbol[n].mod1 |
| |
| Make sure all other fields are set to zero to insure compatibility |
| with future versions |
| |
| mod1 field is defined as follows |
| |
| Bits 0-1 |
| 0 - Ignore strokeNo - no point at stroke |
| 1 - Point at origin of strokeNo |
| 2 - Point at end of strokeNo |
| 3 - Point at center of strokeNo |
| |
| Bit 2 |
| Point at line origin if set |
| |
| Bit 3 |
| Point at line end if set |
| |
| Bit 4 |
| Point at each vertex if set |
| |
+----------------------------------------------------------------------*/
/* Values for "mod1" */
#define LCPOINT_NONE 0x0000 /* No point symbol */
#define LCPOINT_ORIGIN 0x0001 /* Symbol at origin of stroke */
#define LCPOINT_END 0x0002 /* Symbol at end of stroke */
#define LCPOINT_CENTER 0x0003 /* Symbol at center of stroke */
#define LCPOINT_ONSTROKE 0x0003 /* test mask */
#define LCPOINT_LINEORG 0x0004 /* Symbol at origin of element */
#define LCPOINT_LINEEND 0x0008 /* Symbol at end of element */
#define LCPOINT_LINEVERT 0x0010 /* Symbol at each vertex */
#define LCPOINT_ADJROT 0x0020 /* Adjust rotation left->right */
#define LCPOINT_ABSROT 0x0040 /* Angles not relative to line */
/* 0x0080 unused */
#define LCPOINT_NOSCALE 0x0100 /* No scale on variable strokes*/
#define LCPOINT_NOCLIP 0x0200 /* No clip on partial strokes */
#define LCPOINT_NOPARTIAL 0x0400 /* No partial strokes */
#define LCPOINT_PROJECT 0x0800 /* Project partial origin */
/* 0x1000 unused */
/* 0x2000 unused */
#define LCPOINT_COLOR 0x4000 /* Use color from symbol */
#define LCPOINT_WEIGHT 0x8000 /* Use weight from symbol */
typedef struct
{
ULong symType;
ULong symID;
UShort strokeNo;
UShort mod1;
ULong mod2;
double xOffset;
double yOffset;
double zOffset;
double xAngle;
double yAngle;
double zAngle;
double xScale;
double yScale;
double zScale;
} PointSymInfo, PointSymRscInfo;
typedef struct
{
char descr[LS_MAX_DESCR];
ULong lHdr1, lHdr2, auxType, auxID;
double dReserved1;
ULong lcType;
ULong lcID;
ULong lReserved1;
#ifdef resource
PointSymInfo symbol[]; /* Point symbol info */
#else
ULong nSym; /* Number of point symbols */
PointSymInfo symbol[1]; /* Point symbol components */
#endif
} LinePointRsc;
#ifdef resource
resourceclass LinePointRsc RTYPE_LinePoint;
#endif
/*----------------------------------------------------------------------+
| |
| Point Symbol Resource |
| RTYPE_PointSym |
| |
| Only the following fields are used. |
| |
| descr |
| range |
| symFlags |
| nBytes |
| |
| Make sure all other fields are set to zero to insure compatibility |
| with future versions |
| |
+----------------------------------------------------------------------*/
/* Values for "symFlags" */
#define LSSYM_3D 0x01 /* 3d symbol */
typedef struct
{
DPoint3d low;
DPoint3d high;
} SymbolRange;
typedef struct
{
struct
{
char descr[LS_MAX_DESCR];
ULong lHdr1, lHdr2, auxType, auxID;
SymbolRange range;
DPoint3d offset;
double scale;
double dReserve[12];
} header;
ULong symFlags;
#ifndef resource
ULong nBytes;
byte symBuf[8];
#else
byte symBuf[];
#endif
} PointSymRsc;
#ifdef resource
resourceclass PointSymRsc RTYPE_PointSym;
#endif
#endif