dbxutil.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. //
  12. // DESCRIPTION: Header for homeless utilities exported to the API.
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. #ifndef AD_DBXUTIL_H
  16. #define AD_DBXUTIL_H 1
  17. #include "adesk.h"
  18. #include "acadstrc.h"
  19. #include "adesk.h"
  20. #include "adsdef.h"
  21. #include "dbidar.h"
  22. #include "dbid.h"
  23. #include "acutmem.h"
  24. #ifdef _ADESK_WINDOWS_
  25. #include "windows.h"
  26. #endif
  27. #include "acgi.h"
  28. #pragma pack (push, 8)
  29. class AcGeMatrix3d;
  30. class AcDbObject;
  31. class AcDbOle2Frame;
  32. class AcCmColor;
  33. class AcDbViewport;
  34. struct AcConstrainedGeometryDraggingInfo;
  35. // --------- Coordinate-system conversions ---------
  36. bool acdbWcs2Ucs(ads_point p, ads_point q, bool vec);
  37. bool acdbWcs2Ecs(ads_point p, ads_point q, ads_point norm, bool vec);
  38. bool acdbUcs2Wcs(ads_point p, ads_point q, bool vec);
  39. bool acdbUcs2Ecs(ads_point p, ads_point q, ads_point norm, bool vec);
  40. bool acdbEcs2Wcs(ads_point p, ads_point q, ads_point norm, bool vec);
  41. bool acdbEcs2Ucs(ads_point p, ads_point q, ads_point norm, bool vec);
  42. AcGeVector3d ucsXDir();
  43. AcGeVector3d ucsYDir();
  44. void ucsNormalVector(AcGeVector3d& ucsNormalVec);
  45. ACDB_PORT bool isMSpaceActive(AcDbDatabase* pDb);// Internal use only.
  46. // --------- Miscellaneous ---------
  47. AcDbObjectId acdbGetCurVportTableRecordId(AcDbDatabase* pDb);
  48. AcDbObjectId acdbGetCurVportId(AcDbDatabase* pDb);
  49. Acad::ErrorStatus acdbGetProxyInfo(AcDbObject *pObj, ACHAR*& dxfName,
  50. ACHAR*& className, ACHAR*& appName);
  51. bool acdbUcsMatrix(AcGeMatrix3d& mat, AcDbDatabase * pDb = NULL);
  52. Acad::ErrorStatus acdbGetExtnames(bool &value, AcDbDatabase *pDb);
  53. Acad::ErrorStatus acdbSetExtnames(AcDbDatabase *pDb, bool value);
  54. bool acdbGetPreviewBitmapFromDwg(const ACHAR* pszDwgfilename,
  55. HBITMAP* pPreviewBmp,
  56. HPALETTE* pRetPal);
  57. const ACHAR* acdbGetReservedString(AcDb::reservedStringEnumType reservedType,
  58. bool bGetLocalized = true);
  59. const ACHAR* acdbXlateReservedString(const ACHAR* strSource,
  60. bool bGetLocalized = true);
  61. bool acdbIsReservedString(const ACHAR* strString,
  62. AcDb::reservedStringEnumType reservedType);
  63. /// <summary>
  64. /// Verify that an object and an objectId belongs to the same database,
  65. /// and that no cross database references exist.
  66. /// For database resident objects the database of the objectId will be compared
  67. /// with the objects database.
  68. /// For non database resident objects the objects intended database will be
  69. /// used. If the object has no intended database it will be set by this function.
  70. /// </summary>
  71. /// <param name="pHostObject">The object holding the object Id.</param>
  72. /// <param name="objId">The object Id to validate.</param>
  73. /// <param name="es">Optional. Previous Acad::ErrorStatus.
  74. /// That allows you to compute multiple results and chain them
  75. /// while preserving the first bad error status.</param>
  76. /// <returns>
  77. /// Returns Acad::eOk if the operation completed sucessfully.
  78. /// Returns Acad::eWrongDatabase if the databases are different.
  79. /// Returns the 'es' argument directly if es != Acad::eOk
  80. /// </returns>
  81. Acad::ErrorStatus acdbValidateDbConsistency(AcDbObject* pHostObject,
  82. AcDbObjectId objId,
  83. Acad::ErrorStatus es = Acad::eOk);
  84. /// <summary>
  85. /// Verify that an object does not have cross database references.
  86. /// For database resident objects the database will be compared with the
  87. /// objects database.
  88. /// For non database resident objects the objects intended database will be
  89. /// used. If the object has no intended database it will be set by this function.
  90. /// </summary>
  91. /// <param name="pHostObject">The object holding the object Id.</param>
  92. /// <param name="pDatabase">The target database to validate.</param>
  93. /// <param name="es">Optional. Previous Acad::ErrorStatus.
  94. /// That allows you to compute multiple results and chain them
  95. /// while preserving the first bad error status.</param>
  96. /// <returns>
  97. /// Returns Acad::eOk if the operation completed sucessfully.
  98. /// Returns Acad::eWrongDatabase if the databases are different
  99. /// Returns the 'es' argument directly if es != Acad::eOk
  100. /// </returns>
  101. Acad::ErrorStatus acdbValidateDbConsistency(AcDbObject* pHostObject,
  102. AcDbDatabase* pDatabase,
  103. Acad::ErrorStatus es = Acad::eOk);
  104. /// <summary>
  105. /// Map the font that will be used given a font name.
  106. /// </summary>
  107. /// <param name="fontName">Input font name.</param>
  108. /// <returns>A mapped(substitute) font name or NULL if there is no substitution.
  109. /// </returns>
  110. ACDB_PORT const ACHAR* acdbGetMappedFontName(const ACHAR *fontName);
  111. /// <summary>
  112. /// Queue an entity in model space for regen if it is:
  113. /// 1) annotative, or
  114. /// 2) a block reference with some nested annotative entity
  115. /// 3) an attribute on an annotative block reference
  116. /// </summary>
  117. /// <param name="pDb">Input database to get the model space from.</param>
  118. /// <returns>Returns Acad::eOk if the operation completed sucessfully.</returns>
  119. Acad::ErrorStatus acdbQueueAnnotationEntitiesForRegen(AcDbDatabase* pDb);
  120. /// <summary>
  121. /// Determines whether the sysvar ANNOALLVISIBLE is set for the layout that
  122. /// owns the viewport whose objectId is viewportEntityId.
  123. /// </summary>
  124. /// <param name="viewportEntityId">Input objectId of a viewport whose owning layout is to be checked for ANNOALLVISIBLE.</param>
  125. /// <returns>Returns 1 if ANNOALLVISIBLE is set and 0 if ANNOALLVISIBLE is not set for the layout.</returns>
  126. bool acdbPSLayoutAnnoAllVisible(AcDbObjectId viewportEntityId);
  127. /// <summary>
  128. /// Determines whether the sysvar ANNOALLVISIBLE is set for the layout that
  129. /// owns the viewport pointed to by pVport.
  130. /// </summary>
  131. /// <param name="pVport">Input pointer to an AcDbViewport whose owning layout is to be checked for ANNOALLVISIBLE.</param>
  132. /// <returns>Returns 1 if ANNOALLVISIBLE is set and 0 if ANNOALLVISIBLE is not set for the layout.</returns>
  133. bool acdbPSLayoutAnnoAllVisible(AcDbViewport* pVport);
  134. /// <summary>
  135. /// This function returns the object ID of the AcDbViewport that was current before
  136. /// any draw methods are called on any entity in the database. The entity draw methods
  137. /// can manipulte what is the current viewport.
  138. /// </summary>
  139. /// <param name="pDb">Input database to get the object ID of the AcDbViewport from.</param>
  140. /// <param name="vpId">Output object ID of the AcDbViewport.</param>
  141. /// <returns>Returns Acad::eOk if completed sucessfully.</returns>
  142. Acad::ErrorStatus acdbGetCurUserViewportId(AcDbDatabase* pDb, AcDbObjectId& vpId);
  143. ////////////////////////////////////////////////////////////////////////
  144. // class AcDbAnnotationScale
  145. ////////////////////////////////////////////////////////////////////////
  146. /// <summary>
  147. /// AcDbAnnotationScale is a helper class.
  148. /// By instantiating a local variable to use this class, the constructor of the class,
  149. /// saves off the current value of the sysvar, ANNOAUTOSCALE, and sets ANNOAUTOSCALE
  150. /// to zero. Then when the local variable goes out of scope the destructor of this
  151. /// class returns ANNOAUTOSCALE to its original value.
  152. /// </summary>
  153. ///
  154. class AcDbDisableAnnoAutoScale
  155. {
  156. public:
  157. AcDbDisableAnnoAutoScale ();
  158. ~AcDbDisableAnnoAutoScale ();
  159. private:
  160. short mSaveAnnoAutoScale;
  161. short mSaveAnnoAutoScaleLayout;
  162. };
  163. // acdbGetUnitsConversion
  164. //
  165. // Obtains the double value that represents the differnce in scale between two
  166. // AcDb::UnitsValue enumerations. The returned conversion factor provides the
  167. // multiplier needed to convert units measured in "from" units to the units
  168. // measured in "to" units.
  169. //
  170. // toValue = conversionFactor * fromValue
  171. //
  172. // (For example, if the "to" units are millimeters and the "from" units are
  173. // inches the conversion factor is 25.4).
  174. //
  175. // Returns eOk if succesful. Returns eInvalidInput if either of the UnitsValue
  176. // enums are invalid.
  177. Acad::ErrorStatus acdbGetUnitsConversion (AcDb::UnitsValue from,
  178. AcDb::UnitsValue to,
  179. double& conversionFactor);
  180. // See if a filename has a corresponding .dwk file next to it.
  181. bool ADESK_STDCALL acdbDwkFileExists(const ACHAR *pszFileName);
  182. // Returns number of ids that were queued for regen.
  183. //
  184. int ADESK_STDCALL acdbQueueForRegen(const AcDbObjectId *pIdArray,
  185. int nNumIds);
  186. // --------- Dynamic Dimension dimstyle manipulations ---------
  187. AcDbObjectId acdbGetDynDimStyleId( AcDbDatabase* pDb = NULL );
  188. // --------- View and Viewport Management ---------------------
  189. // This function creates a view from the given viewport. It is a view of
  190. // the viewport in its layout. The size of the view are stretched to
  191. // include any associated label block as well as some desirable padding
  192. // around the sum of the viewport and label block extents.
  193. Acad::ErrorStatus
  194. acdbCreateViewByViewport( AcDbDatabase *pDb,
  195. AcDbObjectId viewportId,
  196. const ACHAR* name,
  197. const ACHAR* categoryName,
  198. AcDbObjectId labelBlockId,
  199. AcDbObjectId& view);
  200. // OLE
  201. // Below is a wrapper for AcDbImpOle2Frame::hitTest(..) to make it
  202. // accessible from within the coreads\acadapp arx app for OLE object
  203. // face selection support. It returns Acad::eOk if the passed pickpoint
  204. // is within the bounds of the OLE object, any other return value should
  205. // be interpreted as if the pickpoint is not within the bounds of the
  206. // object.
  207. Acad::ErrorStatus
  208. acdbOleHitTest(const AcDbOle2Frame* pOleEnt,
  209. const AcGePoint3d& wvpt,
  210. const AcGeVector3d& wvwdir);
  211. Acad::ErrorStatus
  212. acdbOleGetRotationMatrix(const AcDbOle2Frame* pOleEnt,
  213. AcGeMatrix3d& rotMat);
  214. // Original width and height is used in
  215. // calculating reset scale
  216. Acad::ErrorStatus
  217. acdbOleGetOriginalWidthHeight(const AcDbOle2Frame* pOleEnt,
  218. double& width,
  219. double& height);
  220. Acad::ErrorStatus
  221. acdbOleSetOriginalWidthHeight(const AcDbOle2Frame* pOleEnt,
  222. const double width,
  223. const double height);
  224. // Selected font name, point size and size in Acad units
  225. // is to persist the selected font name from the
  226. // OLE Text Size dialog
  227. Acad::ErrorStatus
  228. acdbOleGetSelectedFontName(const AcDbOle2Frame* pOleEnt,
  229. ACHAR*& fontName);
  230. Acad::ErrorStatus
  231. acdbOleSetSelectedFontName(const AcDbOle2Frame* pOleEnt,
  232. const ACHAR* fontName);
  233. Acad::ErrorStatus
  234. acdbOleGetSelectedFontPointSize(const AcDbOle2Frame* pOleEnt,
  235. int& pointSize);
  236. Acad::ErrorStatus
  237. acdbOleSetSelectedFontPointSize(const AcDbOle2Frame* pOleEnt,
  238. const int pointSize);
  239. Acad::ErrorStatus
  240. acdbOleGetSelectedTextSizeInAcadUnits(const AcDbOle2Frame* pOleEnt,
  241. double& sizeInAcadUnits);
  242. Acad::ErrorStatus
  243. acdbOleSetSelectedTextSizeInAcadUnits(const AcDbOle2Frame* pOleEnt,
  244. const double sizeInAcadUnits);
  245. // Originally selected font name, point size and size in Acad units
  246. // is to support Reset.
  247. Acad::ErrorStatus
  248. acdbOleGetOriginalSelectedFontName(const AcDbOle2Frame* pOleEnt,
  249. ACHAR*& fontName);
  250. Acad::ErrorStatus
  251. acdbOleSetOriginalSelectedFontName(const AcDbOle2Frame* pOleEnt,
  252. const ACHAR* fontName);
  253. Acad::ErrorStatus
  254. acdbOleGetOriginalSelectedFontPointSize(const AcDbOle2Frame* pOleEnt,
  255. int& pointSize);
  256. Acad::ErrorStatus
  257. acdbOleSetOriginalSelectedFontPointSize(const AcDbOle2Frame* pOleEnt,
  258. const int pointSize);
  259. Acad::ErrorStatus
  260. acdbOleGetOriginalSelectedTextSizeInAcadUnits(const AcDbOle2Frame* pOleEnt,
  261. double& sizeInAcadUnits);
  262. Acad::ErrorStatus
  263. acdbOleSetOriginalSelectedTextSizeInAcadUnits(const AcDbOle2Frame* pOleEnt,
  264. const double sizeInAcadUnits);
  265. // Dimension text background fill utility functions (for internal use)
  266. //
  267. // pObj must be a AcDbDimension or AcDbDimStyleTableRecord derived object
  268. // which stores dim text background fill in xData.
  269. // bgFlag = 0: No fill for dimension text
  270. // bgFlag = 1: Use Acad drawing background color for dim text fill
  271. // bgFlag = 2: Use specified color for dim text fill
  272. // Internal use only.
  273. bool
  274. acdbGetDimTextBackground(AcDbObject *pObj,
  275. int& bgFlag,
  276. AcCmColor& bgColor);
  277. // Internal use only.
  278. bool
  279. acdbSetDimTextBackground(AcDbObject *pObj,
  280. int bgFlag,
  281. AcCmColor* pBgColor,
  282. bool autoClearOverride = true);
  283. // Internal use only.
  284. bool
  285. acdbGetDimExtensionLength(AcDbObject *pObj,
  286. double& fValue);
  287. // Internal use only.
  288. bool
  289. acdbSetDimExtensionLength(AcDbObject *pObj,
  290. double fValue,
  291. bool autoClearOverride = true);
  292. // Internal use only.
  293. bool
  294. acdbGetFixedLengthExtLineEnabled(AcDbObject *pObj,
  295. int& nValue);
  296. // Internal use only.
  297. bool
  298. acdbSetFixedLengthExtLineEnabled(AcDbObject *pObj,
  299. int nValue,
  300. bool autoClearOverride=true);
  301. // Internal use only.
  302. bool
  303. acdbGetArcLengthSymbolPlacement(AcDbObject *pObj,
  304. int& nValue);
  305. // Internal use only.
  306. bool
  307. acdbSetArcLengthSymbolPlacement(AcDbObject *pObj,
  308. int nValue,
  309. bool autoClearOverride = true);
  310. // Internal use only.
  311. bool
  312. acdbGetDimLineLinetype(AcDbObject *pObj,
  313. AcDbObjectId& oidValue);
  314. // Internal use only.
  315. bool
  316. acdbSetDimLineLinetype(AcDbObject *pObj,
  317. AcDbObjectId oidValue,
  318. bool autoClearOverride = true);
  319. // Internal use only.
  320. bool
  321. acdbGetDimExt1Linetype(AcDbObject *pObj,
  322. AcDbObjectId& oidValue);
  323. // Internal use only.
  324. bool
  325. acdbSetDimExt1Linetype(AcDbObject *pObj,
  326. AcDbObjectId oidValue,
  327. bool autoClearOverride = true);
  328. // Internal use only.
  329. bool
  330. acdbGetDimExt2Linetype(AcDbObject *pObj,
  331. AcDbObjectId& oidValue);
  332. // Internal use only.
  333. bool
  334. acdbSetDimExt2Linetype(AcDbObject *pObj,
  335. AcDbObjectId oidValue,
  336. bool autoClearOverride = true);
  337. // Internal use only.
  338. bool
  339. acdbGetLargeRadDimJogAngle(AcDbObject *pObj,
  340. double& fJogAngle);
  341. // Internal use only.
  342. bool
  343. acdbSetLargeRadDimJogAngle(AcDbObject *pObj,
  344. double fJogAngle,
  345. bool autoClearOverride = true);
  346. // Internal use only.
  347. bool
  348. acdbGetDimFlipArrow(AcDbObject *pObj,
  349. int& nValue);
  350. // Internal use only.
  351. bool
  352. acdbSetDimFlipArrow(AcDbObject *pObj,
  353. int nValue,
  354. bool autoClearOverride = true);
  355. // Internal use only.
  356. bool
  357. acdbGetDimTextDirection(AcDbObject *pObj,
  358. int& nValue);
  359. // Internal use only.
  360. bool
  361. acdbSetDimTextDirection(AcDbObject *pObj,
  362. int nValue,
  363. bool autoClearOverride = true);
  364. // Internal use only.
  365. bool
  366. acdbGetDimFlipArrowWhich(AcDbObject *pObj,
  367. int& nValue);
  368. // Internal use only.
  369. bool
  370. acdbSetDimFlipArrowWhich(AcDbObject *pObj,
  371. int nValue,
  372. bool autoClearOverride = true);
  373. // get/set a flag for dimstyle, linetype and layer object to exempt from
  374. // CAD STANDARD check.
  375. // pObj: pointer to AcDbObject
  376. // bitFlags = 0x00: No Exemption
  377. // bitFlags = 0x01: Exempt from CAD Standard check
  378. //
  379. bool acdbGetExemptCheckFlag(AcDbObject *pObj, int& bitFlags);
  380. bool acdbSetExemptCheckFlag(AcDbObject *pObj, int bitFlags);
  381. // Spago "DIMJAG" feature extension.
  382. // Internal use only.
  383. bool
  384. acdbGetDimJogSymbolSize(AcDbObject *pObj,
  385. int& dimJagFlag,
  386. double& dimJagSize);
  387. // Internal use only.
  388. bool
  389. acdbSetDimJogSymbolSize(AcDbObject *pObj,
  390. int dimJagFlag,
  391. const double dimJagSize,
  392. bool autoClearOverride = true);
  393. // Internal use only.
  394. bool
  395. acdbGetDimJogSymbolPosition(AcDbObject *pObj,
  396. int& dimJagFlag,
  397. AcGePoint3d& pos);
  398. // Internal use only.
  399. bool
  400. acdbSetDimJogSymbolPosition(AcDbObject *pObj,
  401. int& dimJagFlag,
  402. const AcGePoint3d& pos,
  403. bool autoClearOverride = true);
  404. // Spago "DIMRADIUS" arc extension.
  405. // Internal use only.
  406. bool
  407. acdbGetRadialExtensionAngles(AcDbObject *pObj,
  408. int& dimExtFlag,
  409. double& dimExtAng1,
  410. double& dimExtAng2);
  411. // Internal use only.
  412. bool
  413. acdbSetRadialExtensionAngles(AcDbObject *pObj,
  414. int dimExtFlag,
  415. double dimExtAng1,
  416. double dimExtAng2);
  417. // Spago "DIMANGULAR" quadrant extension.
  418. // Internal use only.
  419. bool
  420. acdbGetDimAngExtOn(AcDbObject *pObj,
  421. int& dimExtFlag);
  422. // Internal use only.
  423. bool
  424. acdbSetDimAngExtOn(AcDbObject *pObj,
  425. int dimExtFlag);
  426. // Spago Tolerance Dimension Alignment extension.
  427. // Internal use only.
  428. bool
  429. acdbGetDimTolAlign(AcDbObject *pObj,
  430. int& dimTolAlignFlag);
  431. // Internal use only.
  432. bool
  433. acdbSetDimTolAlign(AcDbObject *pObj,
  434. int dimTolAlignFlag,
  435. bool autoClearOverride = true);
  436. // Spago "DIMBREAK" feature extension.
  437. // Internal use only.
  438. bool
  439. acdbGetDimBreakSize(AcDbObject *pObj,
  440. double& dimBreakSize);
  441. // Internal use only.
  442. bool
  443. acdbSetDimBreakSize(AcDbObject *pObj,
  444. double dimBreakSize,
  445. bool autoClearOverride = true);
  446. // Visual Style from viewport
  447. AcDbObjectId acdbGetViewportVisualStyle();
  448. Acad::ErrorStatus acdbSetViewportVisualStyle(AcDbObjectId visualStyleId);
  449. // Internal use only.
  450. ACDB_PORT int
  451. acdbGetVisualStyleIndexById(AcDbObjectId visualStyleId);
  452. // Internal use only.
  453. ACDB_PORT int
  454. acdbGetVisualStyleIndexByName(const TCHAR * visualStyleName);
  455. // Internal use only.
  456. ACDB_PORT Acad::ErrorStatus
  457. acdbGetVisualStyleIdByIndex(AcDbObjectId& visualStyleId, int visualStyleIndex);
  458. // acdbForceTextAdjust()
  459. // Forces the text to be adjusted in all text objects in the objectid array.
  460. // objIds: input array of AcDbObjectId objects whose text will be adjusted.
  461. // Supported objects are AcDbText, AcDbBlockReference and AcDbBlockTableRecord.
  462. Acad::ErrorStatus acdbForceTextAdjust(const AcDbObjectIdArray& objIds);
  463. // Returns true if this object is in a long transaction.
  464. bool acdbIsInLongTransaction(AcDbObjectId id);
  465. /// <summary>
  466. /// This API can be used to push the dragging info of an constraint
  467. /// geometry into the AutoCAD dragger. Basically, it allows client
  468. /// to add additional sub entities that needs to be transformed
  469. /// along with actual sub entities that are moved through grip or
  470. /// stretch operation.
  471. /// This API should be used only when host application is AutoCAD.
  472. /// Also, this should be called only during the dragging.
  473. /// </summary>
  474. /// <param name="pDraggingInfo"> dragging info of the constraint geometry
  475. /// </param>
  476. /// <returns> Error Status. For cases where host application is not
  477. /// a AutoCAD and it's not in the middle of dragger, it would return
  478. /// eNotApplicable.
  479. /// </returns>
  480. ACDB_PORT Acad::ErrorStatus acdbAddConstrainedGeometryDraggingInfo(
  481. const AcConstrainedGeometryDraggingInfo* pDraggingInfo);
  482. /// <summary>
  483. /// This function takes an AcDbCurve and returns an AcGeCurve3d that is
  484. /// geometrically identical to the AcDbCurve.
  485. /// </summary>
  486. /// <param name="dbCurve">Input reference to an AcDbCurve.</param>
  487. /// <param name="pGeCurve">Output pointer to an AcGeCurve3d object that is
  488. /// geometrically identical to dbCurve. The caller of this function is
  489. /// responsible for deleting this AcGeCurve3d object.</param>
  490. /// <param name="tol">Optional input tolerance.</param>
  491. /// <returns>Returns eOk if successful.</returns>
  492. Acad::ErrorStatus acdbConvertAcDbCurveToGelibCurve(const AcDbCurve* dbCurve,
  493. AcGeCurve3d*& pGeCurve, const AcGeTol& tol = AcGeContext::gTol);
  494. /// <summary>
  495. /// This function takes an AcGeCurve3d and returns an AcDbCurve that is
  496. /// geometrically identical to the AcGeCurve3d.
  497. /// </summary>
  498. /// <param name="geCurve">Input reference to an AcGeCurve3d.</param>
  499. /// <param name="pDbCurve">Output pointer to an AcDbCurve object that is
  500. /// geometrically identical to geCurve. The caller of this function is
  501. /// responsible for deleting this AcDbCurve object or adding it to the
  502. /// database.</param>
  503. /// <param name="normal">Optional normal vector. If this parameter is
  504. /// supplied then it must be a valid vector that is perpendicular to the
  505. /// input geCurve, and this vector will become the normal vector of
  506. /// the output pDbCurve. If this parameter is not supplied, then this
  507. /// function will compute the normal vector itself.</param>
  508. /// <param name="tol">Optional input tolerance.</param>
  509. /// <returns>Returns eOk if successful.</returns>
  510. Acad::ErrorStatus acdbConvertGelibCurveToAcDbCurve(const AcGeCurve3d& geCurve,
  511. AcDbCurve*& pDbCurve, AcGeVector3d* normal = NULL, const AcGeTol& tol = AcGeContext::gTol);
  512. /// <summary>
  513. /// This function takes an AcGeCurve3d and sets the specified AcDbCurve
  514. /// to be geometrically identical to the AcGeCurve3d.
  515. /// </summary>
  516. /// <param name="geCurve">Input reference to an AcGeCurve3d.</param>
  517. /// <param name="pDbCurve">Pointer to an existing AcDbCurve object that must
  518. /// be open for write and of a compatible type to the AcGeCurve3d.</param>
  519. /// <param name="normal">Optional normal vector. If this parameter is
  520. /// supplied then it must be a valid vector that is perpendicular to the
  521. /// input geCurve, and this vector will become the normal vector of
  522. /// the output pDbCurve. If this parameter is not supplied, then this
  523. /// function will compute the normal vector itself.</param>
  524. /// <param name="tol">Optional input tolerance.</param>
  525. /// <returns>Returns eOk if successful.</returns>
  526. Acad::ErrorStatus acdbAssignGelibCurveToAcDbCurve(const AcGeCurve3d& geCurve,
  527. AcDbCurve* pDbCurve, AcGeVector3d* normal = NULL, const AcGeTol& tol = AcGeContext::gTol);
  528. #pragma pack (pop)
  529. #endif // AD_DBXUTIL_H