home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 13 / 13.iso / p / p024 / 15.img / AME2.LIB / APSOL.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-06-17  |  4.4 KB  |  213 lines

  1. /*    apsol.h
  2.  *    (C) Copyright 1988-1992 by Autodesk, Inc.
  3.  *
  4.  *    This program is copyrighted by Autodesk, Inc. and is  licensed
  5.  *    to you under the following conditions.  You may not distribute
  6.  *    or  publish the source code of this program in any form.   You
  7.  *    may  incorporate this code in object form in derivative  works
  8.  *    provided  such  derivative  works  are  (i.) are  designed and
  9.  *    intended  to  work  solely  with  Autodesk, Inc. products, and
  10.  *    (ii.)  contain  Autodesk's  copyright  notice  "(C)  Copyright
  11.  *    1988-1992 by Autodesk, Inc."
  12.  *
  13.  *    AUTODESK  PROVIDES THIS PROGRAM "AS IS" AND WITH  ALL  FAULTS.
  14.  *    AUTODESK  SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF  MER-
  15.  *    CHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK,  INC.
  16.  *    DOES  NOT  WARRANT THAT THE OPERATION OF THE PROGRAM  WILL  BE
  17.  *    UNINTERRUPTED OR ERROR FREE.
  18.  */
  19.  
  20. #define FALSE 0
  21. #define TRUE 1
  22.  
  23. #define AP_NORMAL 1
  24. #define AP_FAIL -1
  25. #define AP_BAD_INPUT -2
  26. #define AP_MEM_OUT -3
  27.  
  28. typedef  short ap_Status;
  29. typedef unsigned long ap_Solid;       /* Solid Identifier */
  30. typedef short ap_Bool;                /* Boolean Type */
  31. typedef ads_real ap_Real;             /* Real Declaration */
  32.  
  33. typedef  ads_real ap_Trans3d[4][4];   /*Rigid Motion Matrix */
  34.  
  35. typedef enum
  36. {
  37.     AP_DIFF = 0,
  38.     AP_INT,
  39.     AP_UN
  40. }Ap_bool;     /* Boolean OPerators */
  41.  
  42. typedef enum
  43. {
  44.     AP_BOX = 0,
  45.     AP_CON,
  46.     AP_CYL,
  47.     AP_SPH,
  48.     AP_TOR,
  49.     AP_FIL,
  50.     AP_CHA,
  51.     AP_BOO,
  52.     AP_EXT,
  53.     AP_REV,
  54.     AP_WED
  55. }Ap_solid;   /* Different Solid Types */
  56.  
  57.  
  58. typedef enum
  59. {
  60.     AP_PT_LINE = 0,
  61.     AP_PT_ARCEND   /* End of an Arc */
  62. } Appointtype;  /*Point Types for Sweep Solids */
  63.  
  64. typedef struct ap_swp_pts
  65. {
  66.     ap_Real x;
  67.     ap_Real y;
  68.     Appointtype type;
  69. }ap_Swp_pts;   /* Sweep Points */
  70.  
  71. struct apboxinfo
  72. {
  73.     ads_real x, y, z;
  74. };
  75.  
  76. struct apwedinfo 
  77. {
  78.     ads_real x, y, z;
  79. };
  80.  
  81. struct apcylinfo
  82. {
  83.     ads_real rx, ry, h;
  84. };
  85.  
  86. struct apconinfo
  87. {
  88.     ads_real rx, ry, h;
  89. };
  90.  
  91. struct apsphinfo
  92. {
  93.     ads_real r;
  94. };
  95.  
  96. struct aptorinfo 
  97. {
  98.     ads_real rmaj, rmin;
  99. };
  100.  
  101. struct apextinfo 
  102. {
  103.     ads_real h, taper;
  104.     long n;
  105.     ap_Swp_pts *pts;
  106. };
  107.  
  108. struct aprevinfo 
  109. {
  110.     ads_real ang;
  111.     ap_Bool xaxis;
  112.     long n;
  113.     ap_Swp_pts *pts;
  114. };
  115.  
  116. struct apbooinfo
  117. {
  118.     Ap_bool op;
  119.     ap_Solid op1;
  120.     ap_Solid op2;
  121. };
  122.  
  123. typedef enum
  124. {
  125.     AP_ST, /* straight fillet between two planar faces */
  126.     AP_CIRC /* circular fillet between cyl, con and pln */
  127. }Ap_filcha;
  128.  
  129. struct apfilinfo
  130. {
  131.     Ap_filcha type;
  132.     ads_real r;
  133. };
  134.  
  135. struct apchainfo
  136. {
  137.     Ap_filcha type;
  138.     ads_real d1, d2;
  139. };
  140.  
  141. /*
  142.  Union of all the different Solid 
  143.  Parameters 
  144.  */
  145. typedef union
  146. {
  147.     struct apboxinfo box;
  148.     struct apwedinfo wed;
  149.     struct apconinfo con;
  150.     struct apcylinfo cyl;
  151.     struct apsphinfo sph;
  152.     struct aptorinfo tor;
  153.     struct aprevinfo rev;
  154.     struct apchainfo cha;
  155.     struct apbooinfo boo;
  156.     struct apextinfo ext;
  157.     struct apfilinfo fil;
  158. }ap_Solidparam;
  159.  
  160. /*
  161.  * Solid Information of a Solid 
  162.  */
  163. typedef struct ap_solinfo
  164. {
  165.     Ap_solid s_type;   /* type of Solid */
  166.     ap_Bool s_iswire;  /* Representation Wireframe/Mesh */
  167.     ap_Solid s_parent; /* Solid Identifier of the parent of the solid */
  168.     ap_Bool s_isnull;  /* true if the solid is NULL */
  169.     ap_Trans3d s_mat;  /* Rigid Motion of the Solid */
  170.     short s_color;     /* Color of the Solid */ 
  171.     char s_matl[64];   /* the material of the solid */
  172.     ap_Solidparam s_param;  /* The Parameters of the Solid */
  173. }ap_Solinfo;
  174.  
  175. typedef enum
  176. {
  177.     AP_POSTMESH,
  178.     AP_POSTWIRE,
  179.     AP_UNPOST
  180. }Ap_posttype; /* different Posting Options */
  181.  
  182. typedef struct
  183. {
  184.     ap_Real x, std_x;
  185.     ap_Real y, std_y;
  186.     ap_Real z, std_z;
  187. }ap_Mppt;  /* A Massproperty Point For Inertias etc. */
  188.  
  189. typedef struct 
  190. {
  191.     ap_Real x1, x2;
  192.     ap_Real y1, y2;
  193.     ap_Real z1, z2;
  194. }ap_Extent;  /* Extents of the SOlid */
  195.  
  196. /*
  197.  * Structure storing the Massproperties of the Solid 
  198.  */
  199. typedef struct ap_mprop
  200. {
  201.     short sublevel;       /* Level of subdivision */
  202.     ap_Real mass;         /* Mass of the Solid */
  203.     ap_Real volume;       /* Volume of the Solid */
  204.     ap_Real std_vol;      /* Error in Massprop Volume */
  205.     ap_Extent box;        /* Extents of the Solid */
  206.     ap_Mppt centroid;     /* Centroid */
  207.     ap_Mppt momint;       /* Moments of Inertia */
  208.     ap_Mppt prodint;      /* Product of Inertia */
  209.     ads_point radgyr;     /* Radii of  Gyration */
  210.     ads_point prinmomt;   /* Principal Moments about the Centorid */
  211.     ads_point prindir[3]; /* Principal Directions of the respective PM */
  212. }ap_Mprop;
  213.