home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 January / Chip_1997-01_cd.bin / ms95 / disk22 / dir04 / f010830.re_ / f010830.re
Text File  |  1996-04-02  |  7KB  |  311 lines

  1. /*----------------------------------------------------------------------+
  2. |                                    |
  3. |  Copyright (c) 1985-93;  Bentley Systems, Inc., All rights reserved.    |
  4. |                                    |
  5. | "MicroStation", "MDL", and "MicroCSL" are trademarks of Bentley    |
  6. |  Systems, Inc.                            |
  7. |                                    |
  8. |  Limited permission is hereby granted to reproduce and modify this    |
  9. |  copyrighted material provided that the resulting code is used only     |
  10. |  in conjunction with Bentley Systems products under the terms of the    |
  11. |  license agreement provided therein, and that this notice is retained    |
  12. |  in its entirety in any such reproduction or modification.        |
  13. |                                    |
  14. +----------------------------------------------------------------------*/
  15. /*----------------------------------------------------------------------+
  16. |                                    |
  17. |   basetype.h -- Basic Type definitions for MicroStation/MDL          |
  18. |                                    |
  19. |   $Workfile:   basetype.h  $
  20. |   $Revision:   5.30  $
  21. |          $Date:   17 Oct 1994 11:15:44  $
  22. |                                    |
  23. +----------------------------------------------------------------------*/
  24. #if !defined (__basetypeH__)
  25. #define __basetypeH__
  26.  
  27. typedef unsigned long    ULong;
  28. typedef unsigned short    UShort;
  29. typedef unsigned int    UInt;
  30. typedef unsigned char    UChar;
  31. typedef int            BoolInt;        /* TRUE or FALSE values only   */
  32. typedef int            StatusInt;      /* zero always means success   */
  33.  
  34. #if !defined (NO_BOOLEAN_TYPE)
  35. typedef    int        boolean;
  36. #endif
  37.  
  38. typedef int        ErrorCode;  /* 0 means no error, see also mdlerrs.h */
  39.  
  40. /* --------------------------------------------------------------------------
  41.    Use PFuncInt/PFuncVoid to cast to "pointer to function returning int/void"
  42.    (the older typedefs Pfi/Pfv are retained for source compatibility).
  43.    -------------------------------------------------------------------------- */    
  44. #if !defined (resource)
  45. typedef int    (*PFuncInt)();
  46. typedef void    (*PFuncVoid)();
  47. typedef int    (*Pfi)();
  48. typedef void    (*Pfv)();
  49. #endif
  50.  
  51. typedef ULong        Offset_t;
  52.  
  53. typedef struct versionnumber
  54.     {
  55.     UShort   release:8;
  56.     UShort   major:8;
  57.     UShort   minor:8;
  58.     UShort   subMinor:8;
  59.     } VersionNumber;
  60.  
  61. typedef struct point2d
  62.     {
  63.     long    x;
  64.     long    y;
  65.     } Point2d;
  66.  
  67. typedef struct point3d
  68.     {
  69.     long    x;
  70.     long    y;
  71.     long    z;
  72.     } Point3d;
  73.  
  74. typedef struct dpoint2d
  75.     {
  76.     double    x;
  77.     double    y;
  78.     } Dpoint2d, DPoint2d;
  79.  
  80. typedef struct dpoint3d
  81.     {
  82.     double    x;
  83.     double    y;
  84.     double    z;
  85.     } Dpoint3d, DPoint3d;
  86.  
  87. typedef struct spoint2d
  88.     {
  89.     short    x;
  90.     short    y;
  91.     } Spoint2d, SPoint2d;
  92.  
  93. typedef struct uspoint2d
  94.     {
  95.     unsigned short  x;
  96.     unsigned short  y;
  97.     } Uspoint2d;
  98.  
  99. typedef struct spoint3d
  100.     {
  101.     short    x;
  102.     short    y;
  103.     short    z;
  104.     } Spoint3d, SPoint3d;
  105.  
  106. typedef struct uspoint3d
  107.     {
  108.     unsigned short  x;
  109.     unsigned short  y;
  110.     unsigned short  z;
  111.     } Uspoint3d;
  112.  
  113. typedef struct upoint2d
  114.     {
  115.     unsigned long   x;
  116.     unsigned long   y;
  117.     } Upoint2d;
  118.  
  119. typedef struct upoint3d
  120.     {
  121.     unsigned long   x;
  122.     unsigned long   y;
  123.     unsigned long   z;
  124.     } Upoint3d;
  125.  
  126. typedef struct vector2d
  127.     {
  128.     Point2d    org;
  129.     Point2d    end;
  130.     } Vector2d;
  131.  
  132. typedef struct vector3d
  133.     {
  134.     Point3d    org;
  135.     Point3d    end;
  136.     } Vector3d;
  137.  
  138. typedef struct svector2d
  139.     {
  140.     SPoint2d    org;
  141.     SPoint2d    end;
  142.     } Svector2d, SVector2d;
  143.  
  144. typedef struct svector3d
  145.     {
  146.     SPoint3d    org;
  147.     SPoint3d    end;
  148.     } Svector3d, SVector3d;
  149.  
  150. typedef struct dvector2d
  151.     {
  152.     DPoint2d    org;
  153.     DPoint2d    end;
  154.     } Dvector2d, DVector2d;
  155.  
  156. typedef struct dvector3d
  157.     {
  158.     DPoint3d    org;
  159.     DPoint3d    end;
  160.     } Dvector3d, DVector3d;
  161.  
  162. typedef struct extent
  163.     {
  164.     SPoint2d    origin;        /* upper left */
  165.     short    width;
  166.     short    height;
  167.     } Sextent;
  168.  
  169. typedef struct bsirect
  170.     {
  171.     Point2d origin;
  172.     Point2d corner;
  173.     } BSIRect;
  174.  
  175. #if !defined (__NORECTANGLE__)
  176. typedef struct bsirect Rectangle;
  177. #endif
  178.  
  179. typedef struct srectangle
  180.     {
  181.     SPoint2d    origin;
  182.     SPoint2d    corner;
  183.     } Srectangle;
  184.  
  185. typedef struct drectangle
  186.     {
  187.     DPoint2d    origin;
  188.     DPoint2d    corner;
  189.     } Drectangle;
  190.  
  191. typedef struct urectangle
  192.     {
  193.     Uspoint2d    origin;
  194.     Uspoint2d    corner;
  195.     } Urectangle;
  196.  
  197. typedef struct transform3d
  198.     {
  199.     double    element[3][3];
  200.     } Transform3d;
  201.  
  202. typedef struct transform2d
  203.     {
  204.     double    element[2][2];
  205.     } Transform2d;
  206.  
  207. typedef struct assocpoint
  208.     {
  209.     ULong        tagValue;
  210.     unsigned char   assoc[7];
  211.     unsigned char   assocType;
  212.     } AssocPoint;
  213.  
  214. #if !defined (resource)
  215. typedef struct dpoint3dlist
  216.     {
  217.     long        numPoints;
  218.     DPoint3d    *points;
  219.     } DPoint3dList;
  220.  
  221. typedef union rotMatrix
  222.     {
  223.     double    form2d[2][2];
  224.     double    form3d[3][3];
  225.     } RotMatrix;
  226.  
  227. typedef union transform
  228.     {
  229.     double    form2d[2][3];
  230.     double    form3d[3][4];
  231.     } Transform;
  232.  
  233. typedef union types_u
  234.     {
  235.     char        c;
  236.     unsigned char   uc;
  237.     short        s;
  238.     unsigned short  us;
  239.     long        l;
  240.     unsigned long   ul;
  241.     int            i;
  242.     float        f;
  243.     double        d;
  244.     char        *pc;
  245.     }
  246. Types_u;
  247.  
  248.  
  249. typedef struct pointList
  250.     {
  251.     int            numPoints;
  252.     Dpoint3d        *points;
  253.     } PointList;
  254.  
  255.  
  256.  
  257. typedef struct polygonLink    PolygonLink;
  258.  
  259. struct polygonLink
  260.     {
  261.     Dpoint3d        *vertexP;
  262.     int            nVertices;
  263.     PolygonLink        *nextP;
  264.     };
  265.  
  266.  
  267. #endif
  268.  
  269. /*----------------------------------------------------------------------+
  270. |                                    |
  271. |   Color Structures                            |
  272. |                                    |
  273. +----------------------------------------------------------------------*/
  274. typedef struct rgbColorDef
  275.     {
  276.     unsigned char   red;
  277.     unsigned char   green;
  278.     unsigned char   blue;
  279.     } RGBColorDef;
  280.  
  281. typedef struct hsvcolordef
  282.     {
  283.     int        hue;        /* red=0, yellow, green, cyan, blue, magenta */
  284.                 /* 0 -> 360 */
  285.     int        saturation;        /* 0=white, 100=no white, tints */
  286.     int        value;        /* 0=black, 100=no black, shades */
  287.     } HSVColorDef;
  288.  
  289. typedef struct RGBFACTOR
  290.     {
  291.     double red;            /* 0.0 < intensity < 1.0 */
  292.     double green;        /* 0.0 < intensity < 1.0 */
  293.     double blue;        /* 0.0 < intensity < 1.0 */
  294.     } RGBFactor;
  295.  
  296. typedef struct rgbColorShort
  297.     {
  298.     UShort  red;
  299.     UShort  green;
  300.     UShort  blue;
  301.     } RGBColorShort;
  302.  
  303. #if !defined (resource)
  304. typedef int (*NativeFuncP)();
  305. #if defined (mdl)
  306. #pragma     pointerToNative NativeFuncP;
  307. #endif
  308. #endif
  309.  
  310. #endif        /* __basetypeH__ */
  311.