dbsurf.h 51 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // DESCRIPTION:
  12. //
  13. // The AcDbSurface class is the interface class for representing
  14. // ASM surfaces inside AutoCAD.
  15. #pragma once
  16. #include "dbmain.h"
  17. #include "dbsubeid.h"
  18. #include "gepnt3d.h"
  19. #include "gevec3d.h"
  20. #include "dbbody.h"
  21. #include "dbRevolveOptions.h"
  22. #include "dbSweepOptions.h"
  23. #include "dbLoftOptions.h"
  24. #include "acdbGeomRef.h"
  25. #pragma pack(push, 8)
  26. class AcDbLoftProfile;
  27. class AcDbBlendOptions;
  28. class AcDbNurbSurface;
  29. class AcDb3dProfile;
  30. class AcDbRevolvedSurface;
  31. class AcDbExtrudedSurface;
  32. class AcDbSweptSurface;
  33. typedef AcArray<AcDbNurbSurface*> AcDbNurbSurfaceArray;
  34. class AcDbSurface: public AcDbEntity
  35. {
  36. public:
  37. /// <summary>
  38. /// Control the internal wireframe quilt display when the "edge mode" is
  39. /// set to Isolines in any of the Visual Styles.
  40. /// </summary>
  41. ///
  42. enum WireframeType {
  43. /// <summary>
  44. /// The quilt representation is controlled by the SURFV and SURFU
  45. /// at creation time for surfaces.
  46. /// </summary>
  47. ///
  48. kIsolines = 0,
  49. /// <summary>
  50. /// The quilt representation is based on the projection of
  51. /// the knot structure of surface.
  52. /// </summary>
  53. ///
  54. kIsoparms = 1
  55. };
  56. /// <summary>
  57. /// Defines possible edge extension types as input for extendEdges or
  58. /// createExtendSurface methods.
  59. /// </summary>
  60. ///
  61. enum EdgeExtensionType {
  62. /// <summary> Edges will be extended. </summary>
  63. kExtendEdge = 0x000,
  64. /// <summary> Edges will be stretched. </summary>
  65. kStretchEdge = 0x001,
  66. };
  67. AcDbSurface();
  68. virtual ~AcDbSurface();
  69. ACDB_DECLARE_MEMBERS(AcDbSurface);
  70. // Create a swept surface from 2D entity with thickness
  71. // or a planar surface from a closed curve or a region.
  72. static Acad::ErrorStatus createFrom ( const AcDbEntity* pFromEntity,
  73. AcDbSurface*& pNewSurface );
  74. /// <summary>
  75. /// Creates an extruded surface from the given profile using the specified options
  76. /// and adds the surface to the current database.
  77. /// </summary>
  78. /// <param name="pSweep">
  79. /// Input profile to be extruded. This may be an entity such as a curve or
  80. /// planar surface or it may be an edge or set of connected edges.
  81. /// </param>
  82. /// <param name="directionVec">
  83. /// Input direction of extrusion. This vector must not be zero-length.
  84. /// </param>
  85. /// <param name="sweepOptions">
  86. /// Input sweep options.
  87. /// </param>
  88. /// <param name="newExtrudedSurface">
  89. /// Pointer to the extruded surface if created successfully.
  90. /// </param>
  91. /// <returns>
  92. /// eOk if successful.
  93. /// </returns>
  94. ///
  95. ACDB_PORT static Acad::ErrorStatus createExtrudedSurface ( AcDb3dProfile *pSweep,
  96. const AcGeVector3d& directionVec,
  97. AcDbSweepOptions& sweepOptions,
  98. AcDbExtrudedSurface*& newExtrudedSurface );
  99. /// <summary>
  100. /// Creates an extruded surface from the given profile using the specified options
  101. /// and adds the surface to the current database.
  102. /// </summary>
  103. /// <param name="pSweep">
  104. /// Input profile to be extruded. This may be an entity such as a curve or
  105. /// planar surface or it may be an edge or set of connected edges.
  106. /// </param>
  107. /// <param name="directionVec">
  108. /// Input direction of extrusion. This vector must not be zero-length.
  109. /// </param>
  110. /// <param name="sweepOptions">
  111. /// Input sweep options.
  112. /// </param>
  113. /// <param name="bAssociativeEnabled">
  114. /// Specifies whether extruded surface associativity is enabled.
  115. /// </param>
  116. /// <param name="newExtrudedSurfaceId">
  117. /// ObjectId to the extruded surface if created successfully.
  118. /// </param>
  119. /// <returns>
  120. /// eOk if successful.
  121. /// </returns>
  122. ///
  123. ACDB_PORT static Acad::ErrorStatus createExtrudedSurface ( AcDb3dProfile *pSweep,
  124. const AcGeVector3d& directionVec,
  125. AcDbSweepOptions& sweepOptions,
  126. bool bAssociativeEnabled,
  127. AcDbObjectId& newExtrudedSurfaceId );
  128. /// <summary>
  129. /// Creates a revolved surface from the given profile using the specified options.
  130. /// </summary>
  131. /// <param name="pRev">
  132. /// Input profile to be revolved. This may be an entity such as a curve or
  133. /// planar surface or it may be an edge or set of connected edges.
  134. /// </param>
  135. /// <param name="axisPnt">
  136. /// Any point on the axis of revolution.
  137. /// </param>
  138. /// <param name="axisDir">
  139. /// Direction vector of the axis of revolution. This vector must not be zero-length.
  140. /// </param>
  141. /// <param name="revAngle">
  142. /// Angle through which the profile is to be revolved. This angle is taken to be
  143. /// counter-clockwise about the axis of revolution.
  144. /// </param>
  145. /// <param name="startAngle">
  146. /// Starting angle of the profile. If this parameter is 0.0 then the profile will
  147. /// be revolved from its current position. This angle is taken to be
  148. /// counter-clockwise about the axis of revolution.
  149. /// </param>
  150. /// <param name="revolveOptions">
  151. /// Input revolve options.
  152. /// </param>
  153. /// <param name="newRevolvedSurface">
  154. /// Pointer to new revolved surface if created successfully.
  155. /// </param>
  156. /// <returns>
  157. /// eOk if successful.
  158. /// </returns>
  159. ///
  160. ACDB_PORT static Acad::ErrorStatus createRevolvedSurface ( AcDb3dProfile *pRev,
  161. const AcGePoint3d& axisPnt,
  162. const AcGeVector3d& axisDir,
  163. double revAngle, double startAngle,
  164. AcDbRevolveOptions& revolveOptions,
  165. AcDbRevolvedSurface*& newRevolvedSurface );
  166. /// <summary>
  167. /// Creates a revolved surface from the given profile using the specified options.
  168. /// </summary>
  169. /// <param name="pRev">
  170. /// Input profile to be revolved. This may be an entity such as a curve or
  171. /// planar surface or it may be an edge or set of connected edges.
  172. /// </param>
  173. /// <param name="axisPnt">
  174. /// Any point on the axis of revolution.
  175. /// </param>
  176. /// <param name="axisDir">
  177. /// Direction vector of the axis of revolution. This vector must not be zero-length.
  178. /// </param>
  179. /// <param name="revAngle">
  180. /// Angle through which the profile is to be revolved. This angle is taken to be
  181. /// counter-clockwise about the axis of revolution.
  182. /// </param>
  183. /// <param name="startAngle">
  184. /// Starting angle of the profile. If this parameter is 0.0 then the profile will
  185. /// be revolved from its current position. This angle is taken to be
  186. /// counter-clockwise about the axis of revolution.
  187. /// </param>
  188. /// <param name="revolveOptions">
  189. /// Input revolve options.
  190. /// </param>
  191. /// <param name="bAssociativeEnabled">
  192. /// Specifies whether revolved surface associativity is enabled.
  193. /// </param>
  194. /// <param name="newRevolvedSurface">
  195. /// Pointer to new revolved surface if created successfully.
  196. /// </param>
  197. /// <returns>
  198. /// eOk if successful.
  199. /// </returns>
  200. ///
  201. ACDB_PORT static Acad::ErrorStatus createRevolvedSurface ( AcDb3dProfile *pRev,
  202. const AcGePoint3d& axisPnt,
  203. const AcGeVector3d& axisDir,
  204. double revAngle, double startAngle,
  205. AcDbRevolveOptions& revolveOptions,
  206. bool bAssociativeEnabled,
  207. AcDbObjectId& newSurfaceId );
  208. /// <summary>
  209. /// Creates a revolved surface from the given profile using the specified options.
  210. /// </summary>
  211. /// <param name="pRev">
  212. /// Input profile to be revolved. This may be an entity such as a curve or
  213. /// planar surface or it may be an edge or set of connected edges.
  214. /// </param>
  215. /// <param name="pAxis">
  216. /// Profile which is either a line or a linear edge of a surface or solid.
  217. /// </param>
  218. /// <param name="flipAxisDirection">
  219. /// True if the direction of the axis should be taken in the opposite direction of
  220. /// the entity defined by pAxis.
  221. /// </param>
  222. /// <param name="revAngle">
  223. /// Angle through which the profile is to be revolved. This angle is taken to be
  224. /// counter-clockwise about the axis of revolution.
  225. /// </param>
  226. /// <param name="startAngle">
  227. /// Starting angle of the profile. If this parameter is 0.0 then the profile will
  228. /// be revolved from its current position. This angle is taken to be
  229. /// counter-clockwise about the axis of revolution.
  230. /// </param>
  231. /// <param name="flipAxisDirection">
  232. /// This parameter is only relevant when pAxisEnt is non-null.
  233. /// In this case this parameter specifies
  234. /// </param>
  235. /// <param name="revolveOptions">
  236. /// Input revolve options.
  237. /// </param>
  238. /// <param name="newRevolvedSurface">
  239. /// Pointer to te new revolved surface if created successfully.
  240. /// </param>
  241. /// <returns>
  242. /// eOk if successful.
  243. /// </returns>
  244. ///
  245. ACDB_PORT static Acad::ErrorStatus createRevolvedSurface ( AcDb3dProfile *pRev,
  246. AcDb3dProfile *pAxis,
  247. bool flipAxisDirection,
  248. double revAngle, double startAngle,
  249. AcDbRevolveOptions& revolveOptions,
  250. AcDbRevolvedSurface*& newRevolvedSurface );
  251. /// <summary>
  252. /// Creates a revolved surface from the given profile using the specified options.
  253. /// </summary>
  254. /// <param name="pRev">
  255. /// Input profile to be revolved. This may be an entity such as a curve or
  256. /// planar surface or it may be an edge or set of connected edges.
  257. /// </param>
  258. /// <param name="pAxis">
  259. /// Profile which is either a line or a linear edge of a surface or solid.
  260. /// </param>
  261. /// <param name="flipAxisDirection">
  262. /// True if the direction of the axis should be taken in the opposite direction of
  263. /// the entity defined by pAxis.
  264. /// </param>
  265. /// <param name="revAngle">
  266. /// Angle through which the profile is to be revolved. This angle is taken to be
  267. /// counter-clockwise about the axis of revolution.
  268. /// </param>
  269. /// <param name="startAngle">
  270. /// Starting angle of the profile. If this parameter is 0.0 then the profile will
  271. /// be revolved from its current position. This angle is taken to be
  272. /// counter-clockwise about the axis of revolution.
  273. /// </param>
  274. /// <param name="flipAxisDirection">
  275. /// This parameter is only relevant when pAxisEnt is non-null.
  276. /// In this case this parameter specifies
  277. /// </param>
  278. /// <param name="revolveOptions">
  279. /// Input revolve options.
  280. /// </param>
  281. /// <param name="bAssociativeEnabled">
  282. /// Specifies whether revolved surface associativity is enabled.
  283. /// </param>
  284. /// <param name="newRevolvedSurfaceId">
  285. /// ObjectId to te new revolved surface if created successfully.
  286. /// </param>
  287. /// <returns>
  288. /// eOk if successful.
  289. /// </returns>
  290. ///
  291. ACDB_PORT static Acad::ErrorStatus createRevolvedSurface ( AcDb3dProfile *pRev,
  292. AcDb3dProfile *pAxis,
  293. bool flipAxisDirection,
  294. double revAngle, double startAngle,
  295. AcDbRevolveOptions& revolveOptions,
  296. bool bAssociativeEnabled,
  297. AcDbObjectId& newRevolvedSurfaceId );
  298. /// <summary>
  299. /// Creates a swept surface from the given profile using the specified options.
  300. /// </summary>
  301. /// <param name="pSweep">
  302. /// Input profile to be swept. This may be an entity such as a curve or
  303. /// planar surface or it may be an edge or set of connected edges.
  304. /// </param>
  305. /// <param name="pPath">
  306. /// Input profile along which pSweep is to be swept. This must be a curve or
  307. /// an edge.
  308. /// </param>
  309. /// <param name="sweepOptions">
  310. /// Input sweep options.
  311. /// </param>
  312. /// <param name="newSweptSurface">
  313. /// Pointer to the new swept surface if created successfully.
  314. /// </param>
  315. /// <returns>
  316. /// eOk if successful.
  317. /// </returns>
  318. ///
  319. ACDB_PORT static Acad::ErrorStatus createSweptSurface ( AcDb3dProfile *pSweep,
  320. AcDb3dProfile *pPath,
  321. AcDbSweepOptions& sweepOptions,
  322. AcDbSweptSurface*& newSweptSurface);
  323. /// <summary>
  324. /// Creates a swept surface from the given profile using the specified options.
  325. /// </summary>
  326. /// <param name="pSweep">
  327. /// Input profile to be swept. This may be an entity such as a curve or
  328. /// planar surface or it may be an edge or set of connected edges.
  329. /// </param>
  330. /// <param name="pPath">
  331. /// Input profile along which pSweep is to be swept. This must be a curve or
  332. /// an edge.
  333. /// </param>
  334. /// <param name="sweepOptions">
  335. /// Input sweep options.
  336. /// </param>
  337. /// <param name="bAssociativeEnabled">
  338. /// Specifies whether swept surface associativity is enabled.
  339. /// </param>
  340. /// <param name="newSurfaceId">
  341. /// Object id of swept surface if created successfully.
  342. /// </param>
  343. /// <returns>
  344. /// eOk if successful.
  345. /// </returns>
  346. ///
  347. ACDB_PORT static Acad::ErrorStatus createSweptSurface ( AcDb3dProfile *pSweep,
  348. AcDb3dProfile *pPath,
  349. AcDbSweepOptions& sweepOptions,
  350. bool bAssociativeEnabled,
  351. AcDbObjectId& newSurfaceId );
  352. /// <summary>
  353. /// Creates a lofted surface from the given profiles using the specified options
  354. /// and adds it to the current database. The cross sections, guides, and path
  355. /// may be entities such as curves or points, or they may be edges or sets of
  356. /// connected edges. The cross sections must be either all open or all closed.
  357. /// If the cross sections are all closed, then this function will accept a point
  358. /// entity as the first and/or last list entry. Each profile in the guides list
  359. /// must intersect each of the cross-section profiles, so the guides form a
  360. /// net-like structure with the cross-sections. Both the cross-section profiles
  361. /// and the guide profiles will lie on the resulting surface. If any guide profiles
  362. /// are passed in this list, then pPath should be null. If pPath is non-null, then
  363. /// the resulting surface will follow the shape of this profile as much as possible.
  364. /// This profile does not need to intersect the cross-section profiles and does not
  365. /// even need to be near the cross sections.
  366. /// </summary>
  367. /// <param name="crossSections">
  368. /// Input array of profiles to be used as cross sections for the lofting operation.
  369. /// </param>
  370. /// <param name="guides">
  371. /// Input optional array of guide profiles.
  372. /// </param>
  373. /// <param name="pPath">
  374. /// Input optional path profile.
  375. /// </param>
  376. /// <param name="loftOptions">
  377. /// Input loft options.
  378. /// </param>
  379. /// <param name="newSurface">
  380. ///Pointer to the new lofted surface if created successfully.
  381. /// </param>
  382. /// <returns>
  383. /// eOk if successful.
  384. /// </returns>
  385. ///
  386. ACDB_PORT static Acad::ErrorStatus createLoftedSurface ( const AcArray<AcDbLoftProfile*>& crossSections,
  387. const AcArray<AcDbLoftProfile*>& guides,
  388. AcDbLoftProfile *pPath, AcDbLoftOptions& loftOptions,
  389. AcDbSurface*& newSurface );
  390. /// <summary>
  391. /// Creates a lofted surface from the given profiles using the specified options
  392. /// and adds it to the current database. The cross sections, guides, and path
  393. /// may be entities such as curves or points, or they may be edges or sets of
  394. /// connected edges. The cross sections must be either all open or all closed.
  395. /// If the cross sections are all closed, then this function will accept a point
  396. /// entity as the first and/or last list entry. Each profile in the guides list
  397. /// must intersect each of the cross-section profiles, so the guides form a
  398. /// net-like structure with the cross-sections. Both the cross-section profiles
  399. /// and the guide profiles will lie on the resulting surface. If any guide profiles
  400. /// are passed in this list, then pPath should be null. If pPath is non-null, then
  401. /// the resulting surface will follow the shape of this profile as much as possible.
  402. /// This profile does not need to intersect the cross-section profiles and does not
  403. /// even need to be near the cross sections.
  404. /// </summary>
  405. /// <param name="crossSections">
  406. /// Input array of profiles to be used as cross sections for the lofting operation.
  407. /// </param>
  408. /// <param name="guides">
  409. /// Input optional array of guide profiles.
  410. /// </param>
  411. /// <param name="pPath">
  412. /// Input optional path profile.
  413. /// </param>
  414. /// <param name="loftOptions">
  415. /// Input loft options.
  416. /// </param>
  417. /// <param name="bAssociativeEnabled">
  418. /// Specifies whether lofted surface associativity is enabled.
  419. /// </param>
  420. /// <param name="newSurfaceId">
  421. /// Object id of lofted surface if created successfully.
  422. /// </param>
  423. /// <returns>
  424. /// eOk if successful.
  425. /// </returns>
  426. ///
  427. ACDB_PORT static Acad::ErrorStatus createLoftedSurface ( const AcArray<AcDbLoftProfile*>& crossSections,
  428. const AcArray<AcDbLoftProfile*>& guides,
  429. AcDbLoftProfile *pPath, AcDbLoftOptions& loftOptions,
  430. bool bAssociativeEnabled,
  431. AcDbObjectId& newSurfaceId );
  432. /// <summary>
  433. /// Creates a network surface and adds it to the current database.
  434. /// A network surface is similar to a lofted surface where the u profiles are
  435. /// cross sections and the v profiles are guides. But unlike the lofted surface,
  436. /// the v profiles do not need to intersect the u profiles. If the two sets of
  437. /// profiles do not all intersect then in general the profiles will not lie on
  438. /// the resulting surface.
  439. /// </summary>
  440. /// <param name="crossSections">
  441. /// Input array of u-direction profiles.
  442. /// </param>
  443. /// <param name="guides">
  444. /// Input array of v-direction profiles.
  445. /// </param>
  446. /// <param name="newSurface">
  447. /// Pointer to the new network surface if created successfully.
  448. /// </param>
  449. /// <returns>
  450. /// eOk if successful.
  451. /// </returns>
  452. ///
  453. ACDB_PORT static Acad::ErrorStatus createNetworkSurface ( const AcArray<AcDb3dProfile*>& uProfiles,
  454. const AcArray<AcDb3dProfile*>& vProfiles,
  455. AcDbSurface*& newSurface);
  456. /// <summary>
  457. /// Creates a network surface and adds it to the current database.
  458. /// A network surface is similar to a lofted surface where the u profiles are
  459. /// cross sections and the v profiles are guides. But unlike the lofted surface,
  460. /// the v profiles do not need to intersect the u profiles. If the two sets of
  461. /// profiles do not all intersect then in general the profiles will not lie on
  462. /// the resulting surface.
  463. /// </summary>
  464. /// <param name="crossSections">
  465. /// Input array of u-direction profiles.
  466. /// </param>
  467. /// <param name="guides">
  468. /// Input array of v-direction profiles.
  469. /// </param>
  470. /// <param name="bAssociativeEnabled">
  471. /// Specifies whether network surface associativity is enabled.
  472. /// </param>
  473. /// <param name="newSurfaceId">
  474. /// Object id of network surface if created successfully.
  475. /// </param>
  476. /// <returns>
  477. /// eOk if successful.
  478. /// </returns>
  479. ///
  480. ACDB_PORT static Acad::ErrorStatus createNetworkSurface ( const AcArray<AcDb3dProfile*>& uProfiles,
  481. const AcArray<AcDb3dProfile*>& vProfiles,
  482. bool bAssociativeEnabled,
  483. AcDbObjectId& newSurfaceId );
  484. /// <summary>
  485. /// Create patch surface by specifying one of the following:
  486. /// + edges which must form a closed loop.
  487. /// + profile curves which must form a closed loop
  488. /// The API doesn't support mixing the two yet.
  489. ///
  490. /// The constraintIds are optional which specify the objectID of curve or point
  491. /// to be passed by the patch surface as constraint.
  492. /// Continuity and bulge only apply to boundary edges, not the constraint curves.
  493. ///
  494. /// </summary>
  495. /// <param name="pathRef">
  496. /// Input edge reference which can be edges of entities or proflie curves
  497. /// </param>
  498. /// <param name="constraintIds">
  499. /// Optional contrainted curve or point.
  500. /// </param>
  501. /// <param name="continuity">
  502. /// Optional continuity for patch created with edges
  503. /// </param>
  504. /// <param name="bulge">
  505. /// Optional bulge for patch created with edges
  506. /// </param>
  507. /// <param name="newSurface">
  508. /// Pointer to the new patch surface if created successfully.
  509. /// </param>
  510. /// <returns>
  511. /// eOk if successful.
  512. /// </returns>
  513. ///
  514. ACDB_PORT static Acad::ErrorStatus createPatchSurface ( const AcDbPathRef& pathRef,
  515. const AcDbObjectIdArray& constraintIds,
  516. int continuity,
  517. double bulge,
  518. AcDbSurface*& newSurface);
  519. /// <summary>
  520. /// Create an associative patch surface by specifying one of the following:
  521. /// + edges which must form a closed loop.
  522. /// + profile curves which must form a closed loop
  523. /// The API doesn't support mixing the two yet.
  524. ///
  525. /// The constraintIds are optional which specify the objectID of curve or point
  526. /// to be passed by the patch surface as constraint.
  527. /// Continuity and bulge only apply to boundary edges, not the constraint curves.
  528. ///
  529. /// </summary>
  530. /// <param name="pathRef">
  531. /// Input edge reference which can be edges of entities or proflie curves
  532. /// </param>
  533. /// <param name="constraintIds">
  534. /// Optional contrainted curve or point.
  535. /// </param>
  536. /// <param name="continuity">
  537. /// Optional continuity for patch created with edges
  538. /// </param>
  539. /// <param name="bulge">
  540. /// Optional bulge for patch created with edges
  541. /// </param>
  542. /// <param name="bAssociativeEnabled">
  543. /// Specifies whether patch surface associativity is enabled.
  544. /// </param>
  545. /// <param name="newSurfaceId">
  546. /// Object id of patch surface if created successfully.
  547. /// </param>
  548. /// <returns>
  549. /// eOk if successful.
  550. /// </returns>
  551. ///
  552. ACDB_PORT static Acad::ErrorStatus createPatchSurface ( const AcDbPathRef& pathRef,
  553. const AcDbObjectIdArray& constraintIds,
  554. int continuity,
  555. double bulge,
  556. bool bAssociativeEnabled,
  557. AcDbObjectId& newSurfaceId);
  558. /// <summary>
  559. /// Creates a blend surface from the given profiles using the specified options
  560. /// and adds it to the current database. The startProfile and endProfile must
  561. /// be edges or a set of connected edges.
  562. /// </summary>
  563. /// <param name="startProfile">
  564. /// Input profile to be used as the start for blend operation.
  565. /// </param>
  566. /// <param name="endProfile">
  567. /// Input profile to be used as the end for blend operation.
  568. /// </param>
  569. /// <param name="blendOptions">
  570. /// Input blend options.
  571. /// </param>
  572. /// <param name="blendSurface">
  573. /// Pointer to the blend surface if created successfully.
  574. /// </param>
  575. /// <returns>
  576. /// eOk if successful.
  577. /// </returns>
  578. ///
  579. ACDB_PORT static Acad::ErrorStatus createBlendSurface ( AcDbLoftProfile* startProfile,
  580. AcDbLoftProfile* endProfile,
  581. AcDbBlendOptions* blendOptions,
  582. AcDbSurface*& blendSurface);
  583. /// <summary>
  584. /// Creates a blend surface from the given profiles using the specified options
  585. /// and adds it to the current database. The startProfile and endProfile must
  586. /// be edges or a set of connected edges.
  587. /// </summary>
  588. /// <param name="startProfile">
  589. /// Input profile to be used as the start for blend operation.
  590. /// </param>
  591. /// <param name="endProfile">
  592. /// Input profile to be used as the end for blend operation.
  593. /// </param>
  594. /// <param name="blendOptions">
  595. /// Input blend options.
  596. /// </param>
  597. /// <param name="bAssociativeEnabled">
  598. /// Specifies whether blend surface associativity is enabled.
  599. /// </param>
  600. /// <param name="newSurfaceId">
  601. /// Object id of blend surface if created successfully.
  602. /// </param>
  603. /// <returns>
  604. /// eOk if successful.
  605. /// </returns>
  606. ///
  607. ACDB_PORT static Acad::ErrorStatus createBlendSurface ( AcDbLoftProfile* startProfile,
  608. AcDbLoftProfile* endProfile,
  609. AcDbBlendOptions* blendOptions,
  610. bool bAssociativeEnabled,
  611. AcDbObjectId& blendSurfaceId);
  612. /// <summary>
  613. /// Creates a tangent surface between two surface edges with constant radius
  614. /// and trim or no trim the original surfaces to it.
  615. /// </summary>
  616. /// <param name="surfId1">
  617. /// Input objectID of the first source surface.
  618. /// </param>
  619. /// <param name="pickPt1">
  620. /// Input 3D point specifying the side on the first source surface you want to
  621. /// keep after filleting.
  622. /// </param>
  623. /// <param name="surfId2">
  624. /// Input objectID of the second source surface.
  625. /// </param>
  626. /// <param name="pickPt2">
  627. /// Input 3D point specifying the side on the second source surface you want to
  628. /// keep after filleting.
  629. /// </param>
  630. /// <param name="radius">
  631. /// Input positive value specifying radius for fillet operation.
  632. /// </param>
  633. /// <param name="trimMode">
  634. /// Input flag specifying enum value of kTrimNone, kTrimFirst, kTrimSecond or
  635. /// kTrimBoth.
  636. /// </param>
  637. /// <param name="projDir">
  638. /// Input 3D vector specifying the projection (view) direction for pick points.
  639. /// This vector is used for calculation of the projection point on the source
  640. /// surfaces for pickPt1 and pickPt2.
  641. /// </param>
  642. /// <param name="filletSurface">
  643. /// Pointer to the fillet surface if created successfully.
  644. /// </param>
  645. /// <returns>
  646. /// eOk if successful.
  647. /// </returns>
  648. ///
  649. ACDB_PORT static Acad::ErrorStatus createFilletSurface ( const AcDbObjectId& surfId1,
  650. const AcGePoint3d& pickPt1,
  651. const AcDbObjectId& surfId2,
  652. const AcGePoint3d& pickPt2,
  653. double radius,
  654. AcDb::FilletTrimMode trimMode,
  655. const AcGeVector3d& projDir,
  656. AcDbSurface*& filletSurface);
  657. /// <summary>
  658. /// Creates a tangent surface between two surface edges with constant radius
  659. /// and trim or no trim the original surfaces to it.
  660. /// </summary>
  661. /// <param name="surfId1">
  662. /// Input objectID of the first source surface.
  663. /// </param>
  664. /// <param name="pickPt1">
  665. /// Input 3D point specifying the side on the first source surface you want to
  666. /// keep after filleting.
  667. /// </param>
  668. /// <param name="surfId2">
  669. /// Input objectID of the second source surface.
  670. /// </param>
  671. /// <param name="pickPt2">
  672. /// Input 3D point specifying the side on the second source surface you want to
  673. /// keep after filleting.
  674. /// </param>
  675. /// <param name="radius">
  676. /// Input positive value specifying radius for fillet operation.
  677. /// </param>
  678. /// <param name="trimMode">
  679. /// Input flag specifying enum value of kTrimNone, kTrimFirst, kTrimSecond or
  680. /// kTrimBoth.
  681. /// </param>
  682. /// <param name="projDir">
  683. /// Input 3D vector specifying the projection (view) direction for pick points.
  684. /// This vector is used for calculation of the projection point on the source
  685. /// surfaces for pickPt1 and pickPt2.
  686. /// </param>
  687. /// <param name="bAssociativeEnabled">
  688. /// Specifies whether filltet surface associativity is enabled.
  689. /// </param>
  690. /// <param name="newSurfaceId">
  691. /// Object id of fillet surface if created successfully.
  692. /// </param>
  693. /// <returns>
  694. /// eOk if successful.
  695. /// </returns>
  696. ///
  697. ACDB_PORT static Acad::ErrorStatus createFilletSurface ( const AcDbObjectId& surfId1,
  698. const AcGePoint3d& pickPt1,
  699. const AcDbObjectId& surfId2,
  700. const AcGePoint3d& pickPt2,
  701. double radius,
  702. AcDb::FilletTrimMode trimMode,
  703. const AcGeVector3d& projDir,
  704. bool bAssociativeEnabled,
  705. AcDbObjectId& filletSurfaceId);
  706. /// <summary>
  707. /// Creates an offset surface.
  708. /// </summary>
  709. /// <param name="pInputSurface">
  710. /// Original input surface to be offset.
  711. /// </param>
  712. /// <param name="offsetDistance">
  713. /// Input distance to offset the input surface.
  714. /// </param>
  715. /// <param name="offsetSurface">
  716. /// Pointer to the new offset surface if created successfully.
  717. /// </param>
  718. /// <returns>
  719. /// eOk if successful.
  720. /// </returns>
  721. ///
  722. ACDB_PORT static Acad::ErrorStatus createOffsetSurface ( AcDbEntity* pInputSurface,
  723. double offsetDistance,
  724. AcDbEntity*& offsetSurface);
  725. /// <summary>
  726. /// Creates an offset surface and adds it to the current database.
  727. /// </summary>
  728. /// <param name="pInputSurface">
  729. /// Original input surface to be offset.
  730. /// </param>
  731. /// <param name="offsetDistance">
  732. /// Input distance to offset the input surface.
  733. /// </param>
  734. /// <param name="bAssociativeEnabled">
  735. /// Specifies whether patch surface associativity is enabled.
  736. /// </param>
  737. /// <param name="offsetSurfaceId">
  738. /// Object id of offset surface if created successfully.
  739. /// </param>
  740. /// <returns>
  741. /// eOk if successful.
  742. /// </returns>
  743. ///
  744. ACDB_PORT static Acad::ErrorStatus createOffsetSurface ( AcDbEntity* pInputSurface,
  745. double offsetDistance,
  746. bool bAssociativeEnabled,
  747. AcDbObjectId& offsetSurfaceId);
  748. /// <summary>
  749. /// Creates an extend surface from the given set of edges from a surface
  750. /// and adds the surface to the current database. All input edges
  751. /// should be connected and coming from same surface.
  752. /// </summary>
  753. /// <param name="sourceSurface">
  754. /// Surface id from which edges needs to be extended to create extend surface.
  755. /// </param>
  756. /// <param name="edges">
  757. /// Input full sub-entity paths of the edges, that needs to be extended.
  758. /// </param>
  759. /// <param name="extDist">
  760. /// Input distance by which surface needs to be extended.
  761. /// </param>
  762. /// <param name="extOption">
  763. /// Extension option, if edges needs to be extended or stretched.
  764. /// </param>
  765. /// <param name="bAssociativeEnabled">
  766. /// Specifies whether extend surface associativity is enabled.
  767. /// </param>
  768. /// <param name="newExtendSurfaceId">
  769. /// ObjectId to the extend surface if created successfully.
  770. /// </param>
  771. /// <returns>
  772. /// Acad::eOk if successful.
  773. /// </returns>
  774. ///
  775. ACDB_PORT static Acad::ErrorStatus createExtendSurface ( AcDbObjectId sourceSurface,
  776. const AcArray<AcDbSubentId>& edges,
  777. double extDist,
  778. EdgeExtensionType extOption,
  779. bool bAssociativeEnabled,
  780. AcDbObjectId& newExtendSurfaceId );
  781. /// <summary>
  782. /// Trims a surface with given cutting surfaces/curves. A surface can be trimmed by other surfaces
  783. /// or curves. When curves are used, the actual trimming boundary is formed by projecting the curves
  784. /// onto the surface, so the additional information of project direction needs to be provided.
  785. /// </summary>
  786. /// <param name="blankSurfaceId">
  787. /// Original input surface to be trimmed.
  788. /// </param>
  789. /// <param name="toolIds">
  790. /// array of ids of cutting entities that their bodies will be directly used to trim the
  791. /// surface without further treatment such as projection.
  792. /// </param>
  793. /// <param name="toolCurveIds">
  794. /// array of ids of cutting curves that will be used to trim the surface by first
  795. /// projecting them to the surface
  796. /// </param>
  797. /// <param name="projVectors">
  798. /// array of projection direction of each cutting curve in toolCurveIds, so the length of projVectors
  799. /// should be equal to the length of toolCurveIds
  800. /// </param>
  801. /// <param name="pickPoint">
  802. /// pick point that is used to specify which area of a surface should be trimmed.
  803. /// </param>
  804. /// <param name="viewVector">
  805. /// when using pick point to find out which area to trim, caller should also specify the view direction
  806. /// which will be used form a ray starting from the pick point in the view direction and see which area
  807. /// is hit by the ray first.
  808. /// </param>
  809. /// <param name="bAutoExtend">
  810. /// If this option is set then when a tool body consists of a single face with analytic geometry,
  811. /// the underlying geometry will be extended as much as possible to make sure the surface is trimmed.
  812. /// The tool body supplied will not be modified.
  813. /// </param>
  814. /// <param name="bAssociativeEnabled">
  815. /// Specifies whether the surface trimming operation should be associative.
  816. /// </param>
  817. /// <returns>
  818. /// eOk if successful.
  819. /// </returns>
  820. ///
  821. ACDB_PORT static Acad::ErrorStatus trimSurface( const AcDbObjectId &blankSurfaceId,
  822. const AcDbObjectIdArray &toolIds,
  823. const AcDbObjectIdArray &toolCurveIds,
  824. const AcArray<AcGeVector3d> projVectors,
  825. const AcGePoint3d& pickPoint,
  826. const AcGeVector3d& viewVector,
  827. bool bAutoExtend,
  828. bool bAssociativeEnabled);
  829. // Convert planar surface to region. Return separate region for each face.
  830. virtual Acad::ErrorStatus convertToRegion ( AcArray<AcDbEntity*>& regions );
  831. // Create a 3DSOLID by thickening the surface by a
  832. // specified amount.
  833. virtual Acad::ErrorStatus thicken(double thickness,
  834. bool bBothSides, AcDb3dSolid*& pSolid) const;
  835. virtual Acad::ErrorStatus createInterferenceObjects(
  836. AcArray<AcDbEntity*>& interferenceObjects,
  837. AcDbEntity* pEntity, unsigned int flags ) const;
  838. virtual Acad::ErrorStatus booleanUnion(const AcDbSurface* pSurface2,
  839. AcDbSurface*& pNewSurface);
  840. virtual Acad::ErrorStatus booleanSubtract(const AcDbSurface* pSurface2,
  841. AcDbSurface*& pNewSurface);
  842. virtual Acad::ErrorStatus booleanSubtract(const AcDb3dSolid* pSolid,
  843. AcDbSurface*& pNewSurface);
  844. virtual Acad::ErrorStatus booleanIntersect(const AcDbSurface* pSurface2,
  845. AcArray<AcDbEntity*>& intersectionEntities);
  846. virtual Acad::ErrorStatus booleanIntersect(const AcDb3dSolid* pSolid,
  847. AcArray<AcDbEntity*>& intersectionEntities);
  848. virtual Acad::ErrorStatus imprintEntity(const AcDbEntity* pEntity);
  849. virtual Acad::ErrorStatus createSectionObjects(const AcGePlane& sectionPlane,
  850. AcArray<AcDbEntity*>& sectionObjects) const;
  851. virtual Acad::ErrorStatus sliceByPlane(const AcGePlane& slicePlane,
  852. AcDbSurface*& pNegHalfSurface, AcDbSurface*& pNewSurface);
  853. virtual Acad::ErrorStatus sliceBySurface(
  854. const AcDbSurface* pSlicingSurface, AcDbSurface*& pNegHalfSurface,
  855. AcDbSurface*& pNewSurface);
  856. virtual Acad::ErrorStatus chamferEdges(
  857. const AcArray<AcDbSubentId *> &edgeSubentIds,
  858. const AcDbSubentId& baseFaceSubentId,
  859. double baseDist, double otherDist);
  860. virtual Acad::ErrorStatus filletEdges(
  861. const AcArray<AcDbSubentId *> &edgeSubentIds,
  862. const AcGeDoubleArray& radius,
  863. const AcGeDoubleArray& startSetback,
  864. const AcGeDoubleArray& endSetback);
  865. /// <summary>
  866. /// This method creates associative chamfers at the specified edges of the
  867. /// surface based on input bAssociativeEnabled.
  868. /// </summary>
  869. /// <param name="edgeSubentIds">
  870. /// Input object ids of edges at which the chamfer will be applied.
  871. /// </param>
  872. /// <param name="baseFaceSubentId">
  873. /// Input object id of the base face where the chamfer will be applied.
  874. /// </param>
  875. /// <param name="baseDist">
  876. /// Input chamfer distance on the base face.
  877. /// </param>
  878. /// <param name="otherDist">
  879. /// Input chamfer distance on the other faces.
  880. /// </param>
  881. /// <param name="bAssociativeEnabled">
  882. /// A flag to indicate whether chamfer needs to be associative.
  883. /// </param>
  884. /// <returns>
  885. /// eOk if successful.
  886. /// </returns>
  887. ///
  888. ACDB_PORT Acad::ErrorStatus chamferEdges(
  889. const AcArray<AcDbSubentId *> &edgeSubentIds,
  890. const AcDbSubentId& baseFaceSubentId,
  891. double baseDist, double otherDist, bool bAssociativeEnabled);
  892. /// <summary>
  893. /// This method creates associative fillets at the specified edges of the
  894. /// surface based on input bAssociativeEnabled.
  895. /// </summary>
  896. /// <param name="edgeSubentIds">
  897. /// Input object ids of the edges where the fillet will be applied.
  898. /// </param>
  899. /// <param name="radius">
  900. /// Input fillet radius.
  901. /// </param>
  902. /// <param name="bAssociativeEnabled">
  903. /// A flag to indicate whether chamfer needs to be associative.
  904. /// </param>
  905. /// <returns>
  906. /// eOk if successful.
  907. /// </returns>
  908. ///
  909. ACDB_PORT Acad::ErrorStatus filletEdges(
  910. const AcArray<AcDbSubentId *> &edgeSubentIds,
  911. double radius, bool bAssociativeEnabled);
  912. virtual Acad::ErrorStatus setSubentColor(const AcDbSubentId& subentId,
  913. const AcCmColor& color);
  914. virtual Acad::ErrorStatus getSubentColor(const AcDbSubentId& subentId,
  915. AcCmColor& color) const;
  916. virtual Acad::ErrorStatus setSubentMaterial(const AcDbSubentId& subentId,
  917. const AcDbObjectId& matId);
  918. virtual Acad::ErrorStatus getSubentMaterial(const AcDbSubentId& subentId,
  919. AcDbObjectId& matId) const;
  920. virtual Acad::ErrorStatus setSubentMaterialMapper(const AcDbSubentId& subentId,
  921. const AcGiMapper& mapper);
  922. virtual Acad::ErrorStatus getSubentMaterialMapper(const AcDbSubentId& subentId,
  923. AcGiMapper& mapper) const;
  924. virtual Acad::ErrorStatus getArea(double& area) const;
  925. ACDB_PORT virtual void dragStatus(const AcDb::DragStat);
  926. virtual void* ASMBodyCopy(bool bDeepCopy = false) const; // INTERNAL USE ONLY
  927. virtual void const * getLockedASMBody(); // INTERNAL USE ONLY
  928. virtual void unlockASMBody(); // INTERNAL USE ONLY
  929. virtual void* getLockedWritableASMBody(); // INTERNAL USE ONLY
  930. virtual void commitWritableASMBody(); // INTERNAL USE ONLY
  931. virtual Acad::ErrorStatus setASMBody(const void* modelerBody); // INTERNAL USE ONLY
  932. virtual AcDbSubentId internalSubentId(void* ent) const; // INTERNAL USE ONLY
  933. virtual void* internalSubentPtr(const AcDbSubentId& id) const; // INTERNAL USE ONLY
  934. // AcDbObject methods
  935. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* filer);
  936. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* filer) const;
  937. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* filer);
  938. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* filer) const;
  939. virtual Adesk::UInt16 uIsolineDensity() const;
  940. virtual Acad::ErrorStatus setUIsolineDensity(Adesk::UInt16 numIsolines);
  941. virtual Adesk::UInt16 vIsolineDensity() const;
  942. virtual Acad::ErrorStatus setVIsolineDensity(Adesk::UInt16 numIsolines);
  943. /// <summary>
  944. /// Get WireframeType.
  945. /// </summary>
  946. /// <returns>
  947. /// WireframeType.
  948. /// </returns>
  949. ///
  950. ACDB_PORT WireframeType getWireframeType() const;
  951. /// <summary>
  952. /// Set WireframeType.
  953. /// </summary>
  954. /// <param name="type">
  955. /// WireframeType to set.
  956. /// </param>
  957. /// <returns>
  958. /// eOk if successful.
  959. /// </returns>
  960. ///
  961. ACDB_PORT Acad::ErrorStatus setWireframeType(WireframeType type);
  962. /// <summary>
  963. /// Return the perimeter of surface.
  964. /// </summary>
  965. /// <param name="perimeter">
  966. /// Perimeter of surface.
  967. /// </param>
  968. /// <returns>
  969. /// eOk if successful.
  970. /// </returns>
  971. ///
  972. ACDB_PORT Acad::ErrorStatus getPerimeter(double& perimeter) const;
  973. // advanced surface methods
  974. //
  975. /// <summary>
  976. /// Get creation action body ID.
  977. /// </summary>
  978. /// <returns>
  979. /// Creation action body id.
  980. /// </returns>
  981. ///
  982. AcDbObjectId ACDB_PORT creationActionBodyId() const;
  983. /// <summary>
  984. /// Get moddification action body IDs.
  985. /// </summary>
  986. /// <param name="modificationActionBodyIds">
  987. /// An array to store the returned action body IDs.
  988. /// </param>
  989. /// <returns>
  990. /// eOk if successful.
  991. /// </returns>
  992. ///
  993. Acad::ErrorStatus ACDB_PORT modificationActionBodyIds(AcDbObjectIdArray& modificationActionBodyIds) const;
  994. /// <summary>
  995. /// Extends the edges of this surface by mergeing the extended/stretched
  996. /// edges to existing surface.
  997. /// </summary>
  998. /// <param name="edges">
  999. /// Input full sub-entity paths of the edges, that needs to be extended.
  1000. /// </param>
  1001. /// <param name="extDist">
  1002. /// Input distance by which surface needs to be extended.
  1003. /// </param>
  1004. /// <param name="extOption">
  1005. /// Extension option, if edges needs to be extended or stretched.
  1006. /// </param>
  1007. /// <param name="bAssociativeEnabled">
  1008. /// Specifies whether extend surface associativity is enabled.
  1009. /// </param>
  1010. /// <returns>
  1011. /// Acad::eOk if successful.
  1012. /// </returns>
  1013. ///
  1014. ACDB_PORT Acad::ErrorStatus extendEdges(AcDbFullSubentPathArray& edges,
  1015. double extDist, EdgeExtensionType extOption, bool bAssociativeEnabled);
  1016. /// <summary>
  1017. /// Ray test with the surface. This function will create a ray starting
  1018. /// from rayBasePoint with ray direction defined by rayDir. The rayRadius
  1019. /// defines the tolerance during the intersection check. The returned
  1020. /// subentities could be faces/edges/vertices.
  1021. /// </summary>
  1022. /// <param name="rayBasePoint">
  1023. /// Input base point of the ray.
  1024. /// </param>
  1025. /// <param name="rayDir">
  1026. /// Input ray direction.
  1027. /// </param>
  1028. /// <param name="rayRadius">
  1029. /// input tolerance during the intersection check.
  1030. /// </param>
  1031. /// <param name="subEntIds">
  1032. /// Returned array including faces, edges and vertices.
  1033. /// </param>
  1034. /// <param name="parameters">
  1035. /// Returned array of doubles indicating the intersection
  1036. /// parameter on the ray with the returned subentities.
  1037. /// The smaller of the parameter, the closer to the base point.
  1038. /// </param>
  1039. /// <returns>
  1040. /// Return Acad::eOk if successful.
  1041. /// </returns>
  1042. ///
  1043. Acad::ErrorStatus ACDB_PORT rayTest(const AcGePoint3d& rayBasePoint, const AcGeVector3d& rayDir,
  1044. double rayRadius, AcArray<AcDbSubentId>& subEntIds, AcGeDoubleArray& parameters) const;
  1045. // TODO: need to add the work for multi-face body case.
  1046. /// <summary>
  1047. /// Convert to nurb surfaces. The caller should free the returned nurb surface.
  1048. /// </summary>
  1049. /// <param name="nsArray">
  1050. /// The generated Nurb Surface array
  1051. /// </param>
  1052. /// <returns>
  1053. /// Return Acad::eOk if successful.
  1054. /// </returns>
  1055. ///
  1056. Acad::ErrorStatus ACDB_PORT convertToNurbSurface(AcDbNurbSurfaceArray& nsArray);
  1057. // AcDbEntity override
  1058. virtual Acad::ErrorStatus getPlane(AcGePlane& plane,
  1059. AcDb::Planarity& planarity) const;
  1060. protected:
  1061. // AcDbEntity methods
  1062. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  1063. public:
  1064. /// <summary>
  1065. /// This method creates non-database resident entities
  1066. /// by projecting the given entity along the projection direction
  1067. /// to this surface.
  1068. /// </summary>
  1069. /// <param name="pEntityToProject">
  1070. /// Pointer to the entity to be projected.
  1071. /// </param>
  1072. /// <param name="projectionDirection">
  1073. /// Vector specifying the direction of the projection.
  1074. /// </param>
  1075. /// <param name="projectedEntities">
  1076. /// Array of pointers to non-database resident entities created
  1077. /// by the projection of the given entity along the projection
  1078. /// direction to this 3D solid.
  1079. /// </param>
  1080. /// <returns>
  1081. /// <para>Acad::eOk if successful.</para>
  1082. /// <para>Acad::eInvalidInput if the given entity pointer is NULL or an unsupported type.</para>
  1083. /// <para>Acad::eGeneralModelingFailure if the projection fails to generate valid results.</para>
  1084. /// </returns>
  1085. /// <remarks>When an AcDbPoint is given as the entity to be projected,
  1086. /// the result of the projection will be an AcDbPoint representing
  1087. /// the nearest point on the surface.
  1088. /// </remarks>
  1089. /// <example>
  1090. /// <![CDATA[// Project a circle onto a box
  1091. /// AcDbCircle* pCircle = new AcDbCircle(AcGePoint3d(3.0,3.0,7.0),AcGeVector3d(-0.537925, -0.651525, -0.534932), 1.0);
  1092. /// // TODO: create planesurf from a circle
  1093. /// pBox->createBox(20.0,20.0,1.0);
  1094. /// AcArray<AcDbEntity*> projectedEntities;
  1095. /// Acad::ErrorStatus es = pBox->projectOnToBody(pCircle,
  1096. /// AcGeVector3d(0.0,0.0,1.0), projectedEntities);]]>
  1097. /// </example>
  1098. /// <seealso cref="AcArray, AcDbPoint" />
  1099. ///
  1100. Acad::ErrorStatus projectOnToSurface(const AcDbEntity* pEntityToProject,
  1101. const AcGeVector3d& projectionDirection,
  1102. AcArray<AcDbEntity*>& projectedEntities) const;
  1103. /// <summary>
  1104. /// This method is used by AutoCAD to determine whether or not to use
  1105. /// cached graphics for the object. If the method returns true, then
  1106. /// cached graphics will be used. The default implementation is to
  1107. /// return true. Only database resident entities can use graphics
  1108. /// caching, so this method is not called for entities not in an AcDbDatabase.
  1109. /// </summary>
  1110. ACDB_PORT virtual bool usesGraphicsCache();
  1111. };
  1112. #pragma pack(pop)