home *** CD-ROM | disk | FTP | other *** search
/ Chip 1997 January / Chip_1997-01_cd.bin / ms95 / disk22 / dir01 / f011890.re_ / f011890.re
Text File  |  1996-04-02  |  13KB  |  477 lines

  1. /*----------------------------------------------------------------------+
  2. |                                    |
  3. |  Copyright (c) 1992-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. |   Current Revision:                            |
  18. |   $Workfile:   mscons.fdf  $
  19. |   $Revision:   6.1  $  $Date:   29 Jun 1995 14:26:26  $
  20. |                                    |
  21. +----------------------------------------------------------------------*/
  22. #ifndef __msconsFDF__
  23. #define __msconsFDF__
  24.  
  25. /*----------------------------------------------------------------------+
  26. |                                    |
  27. |   Header File Dependencies                        |
  28. |                                    |
  29. +----------------------------------------------------------------------*/
  30. #include <mscons.h>
  31. #include <msslvr.h>
  32. #include <mdlbspln.h>
  33.  
  34. /*======================================================================+
  35. |                                    |
  36. |   Major Public Code Section                        |
  37. |                                    |
  38. +======================================================================*/
  39.  
  40. /*-----------------------------------------------------------------------
  41.         Frames
  42. -----------------------------------------------------------------------*/
  43.  
  44. ConsFrame *mdlConsFrame_createPoint
  45. (                /* <=  this */
  46. ConsFrame       *pThis,        /* <=   */
  47. DPoint3d    *p        /*  => initial location */
  48. );
  49.  
  50. ConsFrame *mdlConsFrame_createLine
  51. (                /* <=  this */
  52. ConsFrame       *pThis,        /* <=   */
  53. DPoint3d    *p1,        /*  => initial location of one point on line */
  54. DPoint3d    *p2        /*  => ""           another point on line */
  55. );
  56.  
  57. ConsFrame *mdlConsFrame_createEllipse
  58. (                /* <=  this */
  59. ConsFrame       *pThis,        /* <=   */
  60. DPoint3d    *c,        /*  => initial location of center */
  61. double        r,        /*  =>        primary radius */
  62. double        r2,        /*  =>        secondary radius */
  63. double        zr        /*  =>        rotation (about z-axis) */
  64. );
  65.  
  66. ConsFrame *mdlConsFrame_createCircle
  67. (                /* <=  this */
  68. ConsFrame       *pThis,        /* <=   */
  69. DPoint3d    *c,        /*  => initial location of center */
  70. double        r        /*  =>          radius */
  71. );
  72.  
  73. ConsFrame *mdlConsFrame_createBspline
  74. (                /* <=  this */
  75. ConsFrame       *pThis,        /* <=  */
  76. MSBsplineCurve  *pCurve        /*  => */
  77. );
  78.  
  79. ConsFrame *mdlConsFrame_createBsplineCell
  80. (                /* <=  this */
  81. ConsFrame       *pThis,        /* <=  */
  82. MSBsplineCurve  *pCurve,    /*  => */
  83. Dpoint3d    *pCenter,       /*  => */
  84. double        angle        /*  => */
  85. );
  86.  
  87. int    mdlConsFrame_isUnderDetermined
  88. (                /* <=  TRUE or FALSE */
  89. ConsFrame       *pThis        
  90. );
  91.  
  92.  
  93. /*-----------------------------------------------------------------------
  94.         Parameters
  95. -----------------------------------------------------------------------*/
  96.  
  97. ConsParm *mdlConsParm_create
  98. (                /* <=  this or NULL if error */
  99. ConsParm    *pThis,        /* <=  */
  100. char        *name,        /*  => parm's identifier */
  101. double        value,        /*  => initial value */
  102. int        units        /*  => */
  103. );
  104.  
  105. ConsParm *mdlConsParm_setUnits
  106. (                /* <=  this or NULL if units don't set */
  107. ConsParm    *pThis,        /* <=> */
  108. int        u        /*  => */
  109. );
  110.  
  111. /*-----------------------------------------------------------------------
  112.         Constraints:
  113. -----------------------------------------------------------------------*/
  114.  
  115. Constraint *mdlConstraint_createPointLocation
  116. (                /* <=  this */
  117. Constraint      *pThis,        /* <=  */
  118. ConsFrame       *pPoint        /*  => */
  119. );
  120.  
  121. Constraint *mdlConstraint_createRadius
  122. (                /* <=  this */
  123. Constraint      *pThis,        /* <=  */
  124. ConsFrame       *pEllipse,    /*  => ellipse (or simple circle) */
  125. int        ri        /*  => CONS_ELLIPSE_R or CONS_ELLIPSE_R2 */
  126. );
  127.  
  128. Constraint *mdlConstraint_createDiameter
  129. (                /* <=  this */
  130. Constraint      *pThis,        /* <=  */
  131. ConsFrame       *pEllipse,    /*  => ellipse (or simple circle) */
  132. int        ri        /*  => CONS_ELLIPSE_R or CONS_ELLIPSE_R2 */
  133. );
  134.  
  135. Constraint *mdlConstraint_createPointOn
  136. (                /* <=  this */
  137. Constraint      *pThis,        /* <=  */
  138. ConsFrame       *pPoint,    /*  => */
  139. ConsFrame       *pC        /*  => line, ellipse */
  140. );
  141.  
  142. Constraint *mdlConstraint_createConcentric
  143. (                /* <=  this */
  144. Constraint      *pThis,        /* <=  */
  145. ConsFrame       *pPoint,    /*  => */
  146. ConsFrame       *pPoint2    /*  => */
  147. );
  148.  
  149. Constraint *mdlConstraint_createIntersection
  150. (                /* <=  this */
  151. Constraint      *pThis,        /* <=  */
  152. ConsFrame       *pPoint,    /*  => */
  153. ConsFrame       *pC,        /*  => line, ellipse */
  154. ConsFrame       *pC1        /*  => line, ellipse */
  155. );
  156.  
  157. Constraint *mdlConstraint_createDistance
  158. (                /* <=  this */
  159. Constraint      *pThis,        /* <=  */
  160. ConsFrame       *pPoint,    /*  => */
  161. ConsFrame       *pPoint2    /*  => */
  162. );
  163.  
  164. Constraint *mdlConstraint_createPCDistance
  165. (                /* <=  this */
  166. Constraint      *pThis,        /* <=  */
  167. ConsFrame       *pPoint,    /*  => */
  168. ConsFrame       *pFrame        /*  => */
  169. );
  170.  
  171. Constraint *mdlConstraint_createOffset
  172. (                /* <=  this */
  173. Constraint      *pThis,        /* <=  */
  174. ConsFrame       *pFrame,    /*  => */
  175. ConsFrame       *pFrame2,    /*  => */
  176. int        attr        /*  => attribute of frames to relate */
  177. );
  178.  
  179. Constraint *mdlConstraint_createLLDistance
  180. (                /* <=  this */
  181. Constraint      *pThis,        /* <=  */
  182. ConsFrame       *pLine,        /*  => */
  183. ConsFrame       *pLine2        /*  => */
  184. );
  185.  
  186. Constraint *mdlConstraint_createAngle
  187. (                /* <=  this */
  188. Constraint      *pThis,        /* <=  */
  189. ConsFrame       *pLine,        /*  => */
  190. ConsFrame       *pLine2,    /*  => */
  191. Dpoint3d    angle[3]    /*  => center, startpoint, endpoint of angle to measure
  192. */
  193. );
  194.  
  195. Constraint *mdlConstraint_createAngleX
  196. (                /* <=  this */
  197. Constraint      *pThis,        /* <=  */
  198. ConsFrame       *pLine,        /*  => */
  199. boolean        fromX        /*  => TRUE: measure angle from x-axis; else: from y-axis */
  200. );
  201.  
  202. Constraint *mdlConstraint_createParallel
  203. (                /* <=  this */
  204. Constraint      *pThis,        /* <=  */
  205. ConsFrame       *pLine,        /*  => */
  206. ConsFrame       *pLine2        /*  => */
  207. );
  208.  
  209. Constraint *mdlConstraint_createPerpendicular
  210. (                /* <=  this */
  211. Constraint      *pThis,        /* <=  */
  212. ConsFrame       *pLine,        /*  => */
  213. ConsFrame       *pLine2        /*  => */
  214. );
  215.  
  216. Constraint *mdlConstraint_createIOTangent
  217. (                /* <=  this */
  218. Constraint      *pThis,        /* <=  */
  219. ConsFrame       *pCircle,    /*  => */
  220. ConsFrame       *pCurve2    /*  => */
  221. );
  222.  
  223. Constraint *mdlConstraint_createTangent
  224. (                /* <=  this */
  225. Constraint      *pThis,        /* <=  */
  226. ConsFrame       *pCurve,    /*  => */
  227. ConsFrame       *pCurve2,    /*  => */
  228. Dpoint3d    *pHint        /*  => optional: about where point of tan is */
  229. );
  230.  
  231. Constraint *mdlConstraint_createPinPoint
  232. (                /* <=  this */
  233. Constraint      *pThis,        /* <=  */
  234. ConsFrame       *pF,        /*  => */
  235. Dpoint3d    *pIPoint    /*  => initial point location */
  236. );
  237.  
  238. Constraint *mdlConstraint_createLockFrame
  239. (                /* <=  this */
  240. Constraint      *pThis,        /* <=  */
  241. ConsFrame       *pFrame        /*  => */
  242. );
  243.  
  244. Constraint *mdlConstraint_createLockVar
  245. (                /* <=  this */
  246. Constraint      *pThis,        /* <=  */
  247. Var        *pVar        /*  => */
  248. );
  249.  
  250. Constraint *mdlConstraint_createAssignment
  251. (                /* <= this */
  252. Constraint      *pThis,        /* <=  Assignment constraint to define */
  253. Constraint      *pTarget,       /* <=> Dim. constraint to which parm is assigned */
  254. ConsParm    *pParm        /*  => Parameter to assign to it */
  255. );
  256.  
  257. Constraint *mdlConstraint_createMatch
  258. (                /* <=  this */
  259. Constraint      *pThis,        /* <=  */
  260. ConsFrame       *pFrame,    /*  => */
  261. ConsFrame       *pFrame2    /*  => */
  262. );
  263.  
  264. ConsFrame *mdlConstraint_getTarget
  265. (                /* <=  i'th target ConsFrame */
  266. Constraint      *pThis,        /*  => */
  267. int        i        /*  => */
  268. );
  269.  
  270. int    mdlConstraint_rGroup
  271. (                /* <=  redundancy group of 1st redundant eqn */
  272. Constraint      *pThis
  273. );
  274.  
  275. int    mdlConstraint_flipInsideOutside
  276. (                /* <=  ERROR if not appropriate */
  277. Constraint      *pThis        /* <=> constraint to modify */
  278. );
  279.  
  280. int    mdlConstraint_chooseSolution
  281. (                /* <=  ERROR if not appropriate */
  282. Constraint      *pThis,        /* <=> constraint to modify */
  283. Dpoint3d    *pPoint        /*  => point close to desired solution */
  284. );
  285.  
  286. void    mdlConstraint_setWeak
  287. (
  288. Constraint      *pThis,        /* <=> constraint to modify */
  289. boolean        isWeak        /*  => attribute value */
  290. );
  291.  
  292. void    mdlConstraint_setPostCheck
  293. (
  294. Constraint      *pThis,        /* <=> constraint to modify */
  295. boolean        isPostCheck    /*  => attribute value */
  296. );
  297.  
  298. /*-----------------------------------------------------------------------
  299.         Algebraic Equation Constraints:
  300. -----------------------------------------------------------------------*/
  301.  
  302. ConsEquation *mdlConsEquation_create
  303. (
  304. ConsEquation    *pThis,        /* <= */
  305. boolean        isCheck        /*  => is this a post-check? */
  306. );
  307.  
  308. int    mdlConsEquation_parse
  309. (                /*  => SUCCESS or ERROR */
  310. ConsEquation    *pThis,        /* <=  empty equation ... parsed */
  311. char        *str        /*  => */
  312. );
  313.  
  314. int    mdlConsEquation_resolve
  315. (                /* <=  SUCCESS or ERROR */
  316. ConsEquation    *pThis,        /* <=  parsed equation ... resolved */
  317. ConsModel       *pModel        /*  => model in which to look for vars */
  318. );
  319.  
  320. int    mdlConsEquation_gen
  321. (                /* <=  SUCCESS or ERROR */
  322. ConsEquation    *pThis        /* <=  resolved equation ... made ready for computing */
  323. );
  324.  
  325. /*-----------------------------------------------------------------------
  326.         Attachments:
  327. -----------------------------------------------------------------------*/
  328.  
  329. ConsAttachment *mdlConsAttachment_create
  330. (                /* <= this */
  331. ConsAttachment  *pThis,        /* <= */
  332. int        typ,        /*  => */
  333. Cons        *targets[],     /*  => */
  334. int        nTargets    /*  => */
  335. );
  336.  
  337.  
  338. /*-----------------------------------------------------------------------
  339.         Model:
  340. -----------------------------------------------------------------------*/
  341.  
  342.  
  343. void     *mdlConsMod_add
  344. (                /* <= pNode */
  345. ConsModel       *pThis,        /* <=> */
  346. void        *pNode        /* <=> */
  347. );
  348.  
  349. void     mdlConsMod_concat
  350. (
  351. ConsModel       *pThis,        /* <=> */
  352. ConsModel       *pModel2    /*  => */
  353. );
  354.  
  355. void     *mdlConsMod_drop
  356. (                /* <= pNode */
  357. ConsModel       *pThis,        /* <=> */
  358. void        *pNode        /*  => */
  359. );
  360.  
  361. ConsModel *mdlConsMod_create
  362. (                /* <=   this */
  363. ConsModel       *pThis        /* <=   */
  364. );
  365.  
  366. void     mdlConsMod_destroy
  367. (
  368. ConsModel       *pThis
  369. );
  370.  
  371. void     mdlConsMod_destroyNodes
  372. (
  373. ConsModel       *pThis
  374. );
  375.  
  376. void    mdlConsMod_chooseSolution
  377. (
  378. ConsModel       *pThis,        /* <=> */
  379. boolean        unused         /*  => */
  380. );
  381.  
  382. int    mdlConsMod_solve
  383. (                /* <=  SUCCESS, ERROR or -3 (NOP) */
  384. ConsModel       *pThis        /* <=> (status, pCheck set) */
  385. );
  386.  
  387. int    mdlConsMod_validate
  388. (                /* <=  SUCCESS if not inconsistencies; else ERROR */
  389. ConsModel       *pThis        /*  => (validateStatus, dof set) */
  390. );
  391.  
  392. int    mdlConsMod_dof
  393. (                /* <=  degrees of freedom in system */
  394. ConsModel       *pThis        /*  => */
  395. );
  396.  
  397. void    mdlConsMod_backupVars
  398. (
  399. ConsModel       *pThis
  400. );
  401.  
  402. void    mdlConsMod_restoreVars
  403. (
  404. ConsModel       *pThis
  405. );
  406.  
  407. void    mdlConsMod_apply
  408. (
  409. ConsModel       *pThis,        /*  => */
  410. void        (*fp) (),       /*  => */
  411. void        *arg        /*  => */
  412. );
  413.  
  414. boolean    mdlConsMod_isFound
  415. (                /* <= TRUE or FALSE */
  416. ConsModel       *pThis,        /*  => */
  417. void        *pNode        /*  => */
  418. );
  419.  
  420. int    mdlConsMod_transform
  421. (
  422. ConsModel       *pThis,        /* <=> */
  423. Transform       *pTransform     /*  => */
  424. );
  425.  
  426. int    mdlConsMod_offset
  427. (
  428. ConsModel       *pThis,        /* <=> */
  429. Dpoint3d    *pOff        /*  => */
  430. );
  431.  
  432. void    mdlConsMod_mirror
  433. (
  434. ConsModel       *pThis,        /*  => */
  435. Dpoint3d    *pO,        /*  => start of line of symmetry */
  436. RotMatrix       *pRot        /*  => orientation of line of symmetry */
  437. );
  438.  
  439. /*-----------------------------------------------------------------------
  440.         Constraints, Frames, etc.
  441. -----------------------------------------------------------------------*/
  442.  
  443. Dpoint3d *mdlCons_getPoint
  444. (                /* <= pPoint if successful; else NULL */
  445. Dpoint3d    *pPoint,    /* <=  location of object */
  446. Cons            *pThis        /*  => Constraint or cons1Frame to query */
  447. );
  448.  
  449. RotMatrix *mdlCons_getRMatrix
  450. (                /* <= pRot */
  451. RotMatrix       *pRot,        /* <=  RMatrix describing object's geometry */
  452. Cons        *pThis        /*  => */
  453. );
  454.  
  455. int    mdlCons_isChanged
  456. (                /* <=  TRUE or FALSE */
  457. Cons            *pThis
  458. );
  459.  
  460. Var     *mdlCons_getVar
  461. (                /* <=  i-th variable or NULL if out of range */
  462. Cons            *pThis,        /*  => */
  463. int        i        /*  => */
  464. );
  465.  
  466. int    mdlCons_isOperational
  467. (                /* <=  TRUE or FALSE */
  468. Cons            *pThis
  469. );
  470.  
  471. void    mdlCons_destroy
  472. (
  473. Cons           *pThis        /* <=> */
  474. );
  475.  
  476. #endif
  477.