dbRender.h 44 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472
  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. // Classes for recording and retrieving render settings and render history.
  13. //
  14. // AcDbRenderSettings
  15. // AcDbMentalRayRenderSettings
  16. // AcDbRapidRTRenderSettings
  17. // AcDbRenderGlobal
  18. // AcDbRenderEntry
  19. //
  20. #pragma once
  21. #include "AcGiEnvironment.h"
  22. #ifdef SCENEDLLIMPEXP
  23. #undef SCENEDLLIMPEXP
  24. #endif
  25. #ifdef SCENEOE
  26. #define SCENEDLLIMPEXP __declspec( dllexport )
  27. #else
  28. // NOTE: Don't use __declspec( dllimport ) here, to avoid having vtables
  29. // allocated in the client DLL instead of the server DLL.
  30. #define SCENEDLLIMPEXP //__declspec( dllimport )
  31. #endif
  32. class AcDbImpRenderSettings;
  33. class AcDbImpRenderEnvironment;
  34. class AcDbImpRapidRTRenderEnvironment;
  35. class AcDbImpRenderGlobal;
  36. class AcDbImpMentalRayRenderSettings;
  37. /// <summary>
  38. /// Container for all properties relating to a generic high-fidelity renderer.
  39. /// A dictionary of these objects is resident in the database, in the named
  40. /// object dictionary as ACAD_RENDER_SETTINGS.
  41. /// In the user interface, the contents of this
  42. /// dictionary correspond to user-defined render presets (not predefined
  43. /// presets). For Postrio, these are actually AcDbMentalRayRenderSettings
  44. /// objects.
  45. ///
  46. /// The active render settings is stored separately in the named object dictionary
  47. /// as ACAD_RENDER_ACTIVE_SETTINGS.
  48. /// </summary>
  49. class SCENEDLLIMPEXP AcDbRenderSettings : public AcDbObject
  50. {
  51. public:
  52. ACRX_DECLARE_MEMBERS(AcDbRenderSettings);
  53. /// <summary>
  54. /// Default constructor.
  55. /// </summary>
  56. AcDbRenderSettings();
  57. /// <summary>
  58. /// Constructor with non-default AcDbImpRenderSettings
  59. /// </summary>
  60. AcDbRenderSettings(AcDbImpRenderSettings*);
  61. /// <summary>
  62. /// Destructor.
  63. /// </summary>
  64. virtual ~AcDbRenderSettings();
  65. virtual AcGiDrawable* drawable();
  66. /// <summary>
  67. /// Sets the name of the render settings.
  68. /// </summary>
  69. ///
  70. /// <returns>
  71. /// Returns Acad::eOk if a name with valid characters is provided.
  72. /// </returns>
  73. ///
  74. /// <remarks>
  75. /// This function does not check for duplicate names for render settings.
  76. /// </remarks>
  77. Acad::ErrorStatus setName(const AcString& strName);
  78. /// <summary>
  79. /// The user-defined name of the render settings.
  80. /// </summary>
  81. AcString name() const;
  82. /// <summary>
  83. /// Sets the description of the render settings.
  84. /// </summary>
  85. void setDescription(const AcString& strDes);
  86. /// <summary>
  87. /// The user-specified description of the render settings.
  88. /// </summary>
  89. AcString description() const;
  90. /// <summary>
  91. /// Sets the DisplayIndex of the render settings.
  92. /// DisplayIndex is used to determine the displaying order in the UI
  93. /// of the render settings stored in a dictionary.
  94. /// Render settings are displayed in the order from the smallest index to the largest.
  95. /// The indices can be negative and need not to form a contiguous sequence.
  96. /// DisplayIndex is not meant to be used as an Id.
  97. /// </summary>
  98. void setDisplayIndex(int idx);
  99. /// <summary>
  100. /// The DisplayIndex of the render settings.
  101. /// </summary>
  102. int displayIndex() const;
  103. /// <summary>
  104. /// Sets whether per-object materials are used.
  105. /// </summary>
  106. ///
  107. /// <remarks>
  108. /// If set to false, the global material is used for all objects. The
  109. /// default value is true.
  110. /// </remarks>
  111. void setMaterialsEnabled(bool bEnabled);
  112. /// <summary>
  113. /// Whether per-object materials are used.
  114. /// </summary>
  115. bool materialsEnabled() const;
  116. /// <summary>
  117. /// Sets the method used for sampling (filtering) image textures.
  118. /// </summary>
  119. ///
  120. /// <remarks>
  121. /// This does not apply to procedural textures. The default value is
  122. /// kMedium.
  123. /// </remarks>
  124. void setTextureSampling(bool bSampling);
  125. /// <summary>
  126. /// The method used for sampling (filtering) image textures.
  127. /// </summary>
  128. bool textureSampling() const;
  129. /// <summary>
  130. /// Whether back-facing faces are rendered.
  131. /// </summary>
  132. ///
  133. /// <remarks>
  134. /// The default value is true.
  135. /// </remarks>
  136. void setBackFacesEnabled(bool bEnabled);
  137. /// <summary>
  138. /// Whether back-facing faces are rendered.
  139. /// </summary>
  140. bool backFacesEnabled() const;
  141. /// <summary>
  142. /// Sets whether shadows are cast.
  143. /// Does not apply to RapidRT
  144. /// </summary>
  145. ///
  146. /// <remarks>
  147. /// The default value is true.
  148. /// </remarks>
  149. void setShadowsEnabled(bool bEnabled);
  150. /// <summary>
  151. /// Whether shadows are cast.
  152. /// </summary>
  153. bool shadowsEnabled() const;
  154. /// <summary>
  155. /// Sets the full file name on disk of the preview image.
  156. /// </summary>
  157. ///
  158. /// <returns>
  159. /// Returns Acad::eOk if the file name is valid.
  160. /// </returns>
  161. ///
  162. /// <remarks>
  163. /// If a blank name is provided, no preview image is associated with the
  164. /// render settings. The default value is blank.
  165. /// </remarks>
  166. Acad::ErrorStatus setPreviewImageFileName(const AcString& strFileName);
  167. /// <summary>
  168. /// The full file name on disk of the preview image.
  169. /// </summary>
  170. AcString previewImageFileName() const;
  171. /// <summary>
  172. /// Sets whether the diagnostic (checker) background is used for rendering.
  173. /// </summary>
  174. ///
  175. /// <remarks>
  176. /// If enabled, the diagnostic background overrides any user-defined
  177. /// background, such as a gradient. The default value is false.
  178. /// </remarks>
  179. void setDiagnosticBackgroundEnabled(bool bEnabled);
  180. /// <summary>
  181. /// Whether the diagnostic (checker) background is used for rendering.
  182. /// </summary>
  183. bool diagnosticBackgroundEnabled() const;
  184. /// <summary>
  185. /// Set whether the settings are predefined or not
  186. /// </summary>
  187. Acad::ErrorStatus setIsPredefined(bool bPredefined);
  188. /// <summary>
  189. /// Whether the settings are predefined or not
  190. /// </summary>
  191. bool isPredefined() const;
  192. // AcDbObject functions
  193. virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  194. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  195. virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler* pFiler);
  196. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  197. virtual Acad::ErrorStatus copyFrom(const AcRxObject* other);
  198. virtual bool operator==(const AcDbRenderSettings& settings);
  199. protected:
  200. // AcGiDrawable functions
  201. virtual Adesk::UInt32 subSetAttributes(AcGiDrawableTraits* pTraits);
  202. AcDbImpRenderSettings* mpImp;
  203. };
  204. /// <summary>
  205. /// Container for all properties relating to the mental ray renderer. See
  206. /// the base class AcDbRenderSettings for more information.
  207. /// </summary>
  208. class SCENEDLLIMPEXP AcDbMentalRayRenderSettings : public AcDbRenderSettings
  209. {
  210. public:
  211. ACRX_DECLARE_MEMBERS(AcDbMentalRayRenderSettings);
  212. /// <summary>
  213. /// Constructor.
  214. /// </summary>
  215. AcDbMentalRayRenderSettings();
  216. /// <summary>
  217. /// Destructor.
  218. /// </summary>
  219. virtual ~AcDbMentalRayRenderSettings();
  220. /// <summary>
  221. /// Sets the minimum and maximum numbers of samples to take when shading a
  222. /// pixel during rendering.
  223. /// </summary>
  224. ///
  225. /// <returns>
  226. /// Returns Acad::eOk if valid sampling values are provided.
  227. /// </returns>
  228. ///
  229. /// <param name="iMin">
  230. /// The minimum sampling rate, in the range -3 to 5. Values less than zero
  231. /// enable subsampling. -3 corresponds to one sample for every 64 pixel
  232. /// (1/64) and 5 corresponds to 1024 samples per pixel. iMin must be less
  233. /// than or equal to iMax. The default value is -1.
  234. /// </param>
  235. ///
  236. /// <param name="iMax">
  237. /// The maximum sampling rate, in the range -3 to 5. The default value is
  238. /// 0. See iMin for details.
  239. /// </param>
  240. Acad::ErrorStatus setSampling(int iMin, int iMax);
  241. /// <summary>
  242. /// The minimum and maximum numbers of samples to take when shading a
  243. /// pixel during rendering.
  244. /// </summary>
  245. void sampling(int& iMin, int& iMax) const;
  246. /// <summary>
  247. /// Sets the filtering parameters for combining multiple samples into a
  248. /// single pixel color.
  249. /// </summary>
  250. ///
  251. /// <returns>
  252. /// Returns Acad::eOk if valid filtering parameters are provided.
  253. /// </returns>
  254. ///
  255. /// <param name="eFilter">
  256. /// The filtering method (kernel) used to combine samples into a pixel
  257. /// color. The default value is kBox.
  258. /// </param>
  259. ///
  260. /// <param name="fWidth">
  261. /// The width of the filter area, in the range 0.0 to 8.0, in pixels. The
  262. /// default is 1.0.
  263. /// </param>
  264. ///
  265. /// <param name="fHeight">
  266. /// The height of the filter area, in the range 0.0 to 8.0, in pixels. The
  267. /// default is 1.0.
  268. /// </param>
  269. Acad::ErrorStatus setSamplingFilter(AcGiMrFilter eFilter, double fWidth,
  270. double fHeight);
  271. /// <summary>
  272. /// The filtering parameters for combining multiple samples into a single
  273. /// pixel color.
  274. /// </summary>
  275. void SamplingFilter(AcGiMrFilter& eFilter, double& fWidth, double& fHeight)
  276. const;
  277. /// <summary>
  278. /// Sets the threshold above which further samples will be taken, per-color
  279. /// channel.
  280. /// </summary>
  281. ///
  282. /// <returns>
  283. /// Returns Acad::eOk if valid values are provided for each color channel.
  284. /// </returns>
  285. ///
  286. /// <remarks>
  287. /// Each color channel value can be in the range 0.0 to 1.0. The default
  288. /// is 0.1 for each color channel.
  289. /// </remarks>
  290. Acad::ErrorStatus setSamplingContrastColor(float r, float g, float b,
  291. float a);
  292. /// <summary>
  293. /// The threshold above which further samples will be taken, per-color
  294. /// channel.
  295. /// </summary>
  296. void samplingContrastColor(float& r, float& g, float& b, float& a) const;
  297. /// <summary>
  298. /// Sets the method used to compute ray-traced shadows.
  299. /// </summary>
  300. ///
  301. /// <remarks>
  302. /// This only affects lights using ray-traced shadows. The default value
  303. /// is kSimple.
  304. /// </remarks>
  305. void setShadowMode(AcGiMrShadowMode eShadowMode);
  306. /// <summary>
  307. /// The method used to compute ray-traced shadows.
  308. /// </summary>
  309. AcGiMrShadowMode shadowMode() const;
  310. /// <summary>
  311. /// Whether shadow maps are computed.
  312. /// </summary>
  313. ///
  314. /// <remarks>
  315. /// This only affects lights using mapped shadows. The default value is
  316. /// true.
  317. /// </remarks>
  318. void setShadowMapsEnabled(bool bEnabled);
  319. /// <summary>
  320. /// Whether shadow maps are computed.
  321. /// </summary>
  322. bool shadowMapsEnabled() const;
  323. /// <summary>
  324. /// Whether ray-tracing is performed.
  325. /// </summary>
  326. ///
  327. /// <remarks>
  328. /// If ray-tracing is disabled, various effects such as reflection and
  329. /// refraction will not be computed. The default value is true.
  330. /// </remarks>
  331. void setRayTracingEnabled(bool bEnabled);
  332. /// <summary>
  333. /// Whether ray-tracing is performed.
  334. /// </summary>
  335. bool rayTracingEnabled() const;
  336. /// <summary>
  337. /// Sets the maximum trace depth (recursion level) for rays.
  338. /// </summary>
  339. ///
  340. /// <returns>
  341. /// Returns Acad::eOk if the ray trace depth values are valid.
  342. /// </returns>
  343. ///
  344. /// <param name="iReflection">
  345. /// The maximum recursion level of reflection rays, greater than or equal
  346. /// to 0. The default value is 2.
  347. /// </param>
  348. ///
  349. /// <param name="iRefraction">
  350. /// The maximum recursion level of refraction rays, greater than or equal
  351. /// to 0. The default value is 2.
  352. /// </param>
  353. ///
  354. /// <param name="iSum">
  355. /// The maximum recursion level of reflection and refraction rays,
  356. /// combined. The default value is 4.
  357. /// </param>
  358. Acad::ErrorStatus setRayTraceDepth(int iReflection, int iRefraction,
  359. int iSum);
  360. /// <summary>
  361. /// The maximum trace depth (recursion level) for rays.
  362. /// </summary>
  363. void rayTraceDepth(int& iReflection, int& iRefraction, int& iSum) const;
  364. /// <summary>
  365. /// Whether global illumination (using photon mapping) is computed.
  366. /// </summary>
  367. ///
  368. /// <remarks>
  369. /// Global illumination allows for indirect illumination effects such as
  370. /// color-bleeding. The default value is false.
  371. /// </remarks>
  372. void setGlobalIlluminationEnabled(bool bEnabled);
  373. /// <summary>
  374. /// Whether global illumination (using photon mapping) is computed.
  375. /// </summary>
  376. bool globalIlluminationEnabled() const;
  377. /// <summary>
  378. /// Sets the maximum number of photons near a render sample point to use
  379. /// for computing global illumination.
  380. /// </summary>
  381. ///
  382. /// <returns>
  383. /// Returns Acad::eOk if the photon count value is valid.
  384. /// </returns>
  385. ///
  386. /// <remarks>
  387. /// The indicated number of photons around each render sample are used to
  388. /// to compute global illumination at that point, within the area defined
  389. /// by setGIPhotonRadius(). This value must be must be greater than zero.
  390. /// The default value is 500.
  391. /// </remarks>
  392. Acad::ErrorStatus setGISampleCount(int iNum);
  393. /// <summary>
  394. /// The maximum number of photons near a render sample point to use for
  395. /// computing global illumination.
  396. /// </summary>
  397. int giSampleCount() const;
  398. /// <summary>
  399. /// Whether the user-defined photon sampling radius is used.
  400. /// </summary>
  401. ///
  402. /// <remarks>
  403. /// If the photon sampling radius is not used, a default radius based on
  404. /// the model extents is used. The default value is false.
  405. /// </remarks>
  406. void setGISampleRadiusEnabled(bool bEnabled);
  407. /// <summary>
  408. /// Whether the user-defined photon sampling radius is used.
  409. /// </summary>
  410. bool giSampleRadiusEnabled() const;
  411. /// <summary>
  412. /// Sets the radius of the area used to sample photons for global
  413. /// illumination.
  414. /// </summary>
  415. ///
  416. /// <returns>
  417. /// Returns Acad::eOk if the radius value is valid.
  418. /// </returns>
  419. ///
  420. /// <remarks>
  421. /// The indicated area around each render sample is searched for photons,
  422. /// up to the number of photons specified by setGIPhotonCount(). The
  423. /// radius is in model units, and must be greater than or equal to zero.
  424. /// The default value is 1.0.
  425. /// </remarks>
  426. Acad::ErrorStatus setGISampleRadius(double fRadius);
  427. /// <summary>
  428. /// The radius of the area used to sample photons for global illumination.
  429. /// </summary>
  430. double giSampleRadius() const;
  431. /// <summary>
  432. /// Sets the average number of GI photons to shoot for each light.
  433. /// </summary>
  434. ///
  435. /// <returns>
  436. /// Returns Acad::eOk if the photon count value is valid.
  437. /// </returns>
  438. ///
  439. /// <remarks>
  440. /// This value must be greater than zero. The default value is 10000.
  441. /// </remarks>
  442. Acad::ErrorStatus setGIPhotonsPerLight(int iNum);
  443. /// <summary>
  444. /// The average number of GI photons to shoot for each light.
  445. /// </summary>
  446. int giPhotonsPerLight() const;
  447. /// <summary>
  448. /// Sets the maximum trace depth (recursion level) for photon.
  449. /// </summary>
  450. ///
  451. /// <returns>
  452. /// Returns Acad::eOk if the photon trace depth values are valid.
  453. /// </returns>
  454. ///
  455. /// <param name="iReflection">
  456. /// The maximum recursion level of reflected photons, greater than or equal
  457. /// to 0. The default value is 5.
  458. /// </param>
  459. ///
  460. /// <param name="iRefraction">
  461. /// The maximum recursion level of refracted photons, greater than or equal
  462. /// to 0. The default value is 5.
  463. /// </param>
  464. ///
  465. /// <param name="iSum">
  466. /// The maximum recursion level of reflected and refracted photon,
  467. /// combined. The default value is 5.
  468. /// </param>
  469. Acad::ErrorStatus setPhotonTraceDepth(int iReflection, int iRefraction,
  470. int iSum);
  471. /// <summary>
  472. /// The maximum trace depth (recursion level) for photons.
  473. /// </summary>
  474. void photonTraceDepth(int& iReflection, int& iRefraction, int& iSum) const;
  475. /// <summary>
  476. /// Whether final gathering is applied.
  477. /// </summary>
  478. ///
  479. /// <remarks>
  480. /// Final gathering allows for indirect illumination effects such as
  481. /// color-bleeding, and can be combined with global illumination to enhance
  482. /// the effect of GI. The default value is false.
  483. /// </remarks>
  484. void setFinalGatheringEnabled(bool bEnabled);
  485. /// <summary>
  486. /// Whether final gathering is applied.
  487. /// </summary>
  488. bool finalGatheringEnabled() const;
  489. /// <summary>
  490. /// Whether final gathering is applied.
  491. /// </summary>
  492. ///
  493. /// <remarks>
  494. /// Final gathering allows for indirect illumination effects such as
  495. /// color-bleeding, and can be combined with global illumination to enhance
  496. /// the effect of GI. The default value is
  497. /// AcGiMrFinalGatheringMode::krFinalGatherAuto.
  498. /// </remarks>
  499. Acad::ErrorStatus setFinalGatheringMode(AcGiMrFinalGatheringMode mode);
  500. /// <summary>
  501. /// Whether final gathering is applied.
  502. /// </summary>
  503. AcGiMrFinalGatheringMode finalGatheringMode() const;
  504. /// <summary>
  505. /// Sets the number of final gather rays to be used for each final gather
  506. /// point.
  507. /// </summary>
  508. ///
  509. /// <returns>
  510. /// Returns Acad::eOk if the final gather ray count count value is valid.
  511. /// </returns>
  512. ///
  513. /// <remarks>
  514. /// The indicated number of rays are shot into the scene for each final
  515. /// gather point to compute indirect illumination. This value must be must
  516. /// be greater than zero. The default value is 1000.
  517. /// </remarks>
  518. Acad::ErrorStatus setFGRayCount(int iNum);
  519. /// <summary>
  520. /// Sets the number of final gather rays to be used for each final gather
  521. /// point.
  522. /// </summary>
  523. int fgRayCount() const;
  524. /// <summary>
  525. /// Sets the flags indicating the user-defined final gathering sampling
  526. /// radii are used, and what units they are defined in.
  527. /// </summary>
  528. ///
  529. /// <param name="bMin">
  530. /// The flag indicating whether the user-defined minimum radius is used,
  531. /// otherwise a default radius is applied. The default value is false.
  532. /// </param>
  533. ///
  534. /// <param name="bMax">
  535. /// The flag indicating whether the user-defined maximum radius is used,
  536. /// otherwise a default radius is applied. The default value is false.
  537. /// </param>
  538. ///
  539. /// <param name="bPixels">
  540. /// The flag indicating whether the user-defined radii are in pixel units.
  541. /// The default value is false.
  542. /// </param>
  543. void setFGRadiusState(bool bMin, bool bMax, bool bPixels);
  544. /// <summary>
  545. /// The flags indicating the user-defined final gathering sampling radii
  546. /// are used, and what units they are defined in.
  547. /// </summary>
  548. void fgSampleRadiusState(bool& bMin, bool& bMax, bool& bPixels) const;
  549. /// <summary>
  550. /// Sets the minimum and maximum radii of the area used to sample final
  551. /// gather points to compute indirect illumination.
  552. /// </summary>
  553. ///
  554. /// <returns>
  555. /// Returns Acad::eOk if the radius values are valid.
  556. /// </returns>
  557. ///
  558. /// <param name="fMin">
  559. /// The minimum final gather sample radius, in units defined by
  560. /// setFGRadiusState(). This value must be less than or equal to fMax, and
  561. /// greater than zero. The default values are 0.1 for model units and 0.5
  562. /// for pixel units.
  563. /// </param>
  564. ///
  565. /// <param name="fMax">
  566. /// The maximum final gather sample radius, in units defined by
  567. /// setFGRadiusState(). This value must be greater than or equal to fMin,
  568. /// and greater than zero. The default values are 1.0 for model units and
  569. /// 5.0 for pixel units.
  570. /// </param>
  571. Acad::ErrorStatus setFGSampleRadius(double fMin, double fMax);
  572. /// <summary>
  573. /// The minimum and maximum radii of the area used to sample final gather
  574. /// points to compute indirect illumination.
  575. /// </summary>
  576. void fgSampleRadius(double& fMin, double& fMax) const;
  577. /// <summary>
  578. /// Sets a physical scale factor to use with lights that are not physically based.
  579. /// Physical scale may be necessary to set to a non-default value when rendering
  580. /// with self-illuminating materials or extremely bright photometric lights in
  581. /// order to approximate the eye's response to the scene.
  582. /// </summary>
  583. ///
  584. /// <returns>
  585. /// Returns Acad::eOk if the luminance value is valid.
  586. /// </returns>
  587. ///
  588. /// <param name="fLuminance">
  589. /// The physical scale factor to use with lights that are not physically based.
  590. /// </param>
  591. ///
  592. /// <remarks>
  593. /// This value must be greater than zero and less than or equal to 200000.0.
  594. /// The default value is 1500.0.
  595. /// </remarks>
  596. Acad::ErrorStatus setLightLuminanceScale(double fLuminance);
  597. /// <summary>
  598. /// The physical scale factor to use with lights that are not physically based.
  599. /// </summary>
  600. double lightLuminanceScale() const;
  601. /// <summary>
  602. /// Sets the magnitude of indirect illumination.
  603. /// This parameter will effectively provide a global way to adjust the effect of GI.
  604. /// It multiplies the flux of every light as it pertains to photon emission.
  605. /// </summary>
  606. ///
  607. /// <returns>
  608. /// Returns Acad::eOk if the parameter value is valid.
  609. /// </returns>
  610. ///
  611. /// <remarks>
  612. /// This value must be greater than zero. The default value is 1.0.
  613. /// </remarks>
  614. Acad::ErrorStatus setEnergyMultiplier(float fScale);
  615. /// <summary>
  616. /// The magnitude of indirect illumination.
  617. /// </summary>
  618. float energyMultiplier() const;
  619. /// <summary>
  620. /// Sets the mode for rendering diagnostic images.
  621. /// </summary>
  622. ///
  623. /// <remarks>
  624. /// The default value is krOff.
  625. /// </remarks>
  626. void setDiagnosticMode(AcGiMrDiagnosticMode eDiagnosticMode);
  627. /// <summary>
  628. /// The mode for rendering diagnostic images.
  629. /// </summary>
  630. AcGiMrDiagnosticMode diagnosticMode() const;
  631. /// <summary>
  632. /// Set the coordinate system to use for the diagnostic grid including
  633. /// the distance between grid lines (size).
  634. /// </summary>
  635. ///
  636. /// <returns>
  637. /// Returns Acad::eOk if the specified grid size is valid.
  638. /// </returns>
  639. ///
  640. /// <remarks>
  641. /// The grid size must be greater than zero. The default mode is krObject
  642. /// and size is 10.0.
  643. /// </remarks>
  644. Acad::ErrorStatus setDiagnosticGridMode(
  645. AcGiMrDiagnosticGridMode eDiagnosticGridMode, float fSize);
  646. /// <summary>
  647. /// The coordinate system to use for the diagnostic grid including
  648. /// the distance between grid lines (size).
  649. /// </summary>
  650. void diagnosticGridMode(
  651. AcGiMrDiagnosticGridMode& eDiagnosticGridMode, float& fSize) const;
  652. /// <summary>
  653. /// Sets the type of photon information to visualize with the photon
  654. /// diagnostic mode.
  655. /// </summary>
  656. ///
  657. /// <remarks>
  658. /// The default value is krDensity.
  659. /// </remarks>
  660. void setDiagnosticPhotonMode(
  661. AcGiMrDiagnosticPhotonMode eDiagnosticPhotonMode);
  662. /// <summary>
  663. /// The type of photon information to visualize with the photon diagnostic
  664. /// mode.
  665. /// </summary>
  666. AcGiMrDiagnosticPhotonMode diagnosticPhotonMode() const;
  667. /// <summary>
  668. /// Sets the samples diagnostic mode.
  669. /// </summary>
  670. ///
  671. /// <remarks>
  672. /// The default value is false(off).
  673. /// </remarks>
  674. void setDiagnosticSamplesMode(bool bDiagnosticSamplesMode);
  675. /// <summary>
  676. /// The samples diagnostic mode.
  677. /// </summary>
  678. bool diagnosticSamplesMode() const;
  679. /// <summary>
  680. /// Sets the type of BSP information to visualize with the BSP diagnostic mode.
  681. /// </summary>
  682. ///
  683. /// <remarks>
  684. /// The default value is krDepth.
  685. /// </remarks>
  686. void setDiagnosticBSPMode(AcGiMrDiagnosticBSPMode eDiagnosticBSPMode);
  687. /// <summary>
  688. /// The type of BSP information to visualize with the BSP diagnostic mode.
  689. /// </summary>
  690. AcGiMrDiagnosticBSPMode diagnosticBSPMode() const;
  691. /// <summary>
  692. /// Sets whether to export an MI file after rendering.
  693. /// </summary>
  694. ///
  695. /// <remarks>
  696. /// If set to true, the file name specified with setExportMIFileName() is
  697. /// used to save the MI file. The default value is false.
  698. /// </remarks>
  699. void setExportMIEnabled(bool bEnabled);
  700. /// <summary>
  701. /// Whether to export an MI file after rendering.
  702. /// </summary>
  703. bool exportMIEnabled() const;
  704. /// <summary>
  705. /// Set the export to mi mode.
  706. /// </summary>
  707. ///
  708. /// <remarks>
  709. /// The default value is AcGiMrExportMIMode::krExportMIOff.
  710. /// </remarks>
  711. Acad::ErrorStatus setExportMIMode(AcGiMrExportMIMode eExportMIMode);
  712. /// <summary>
  713. /// The export to mi mode.
  714. /// </summary>
  715. AcGiMrExportMIMode exportMIMode() const;
  716. /// <summary>
  717. /// Sets full file name on disk to use for an exported MI file.
  718. /// </summary>
  719. ///
  720. /// <returns>
  721. /// Returns Acad::eOk if the file name is valid.
  722. /// </returns>
  723. ///
  724. /// <remarks>
  725. /// The default value is blank.
  726. /// </remarks>
  727. Acad::ErrorStatus setExportMIFileName(const AcString& strFileName);
  728. /// <summary>
  729. /// The full file name on disk to use for an exported MI file.
  730. /// </summary>
  731. AcString exportMIFileName() const;
  732. /// <summary>
  733. /// Sets the size of the image tiles to use when rendering.
  734. /// </summary>
  735. ///
  736. /// <returns>
  737. /// Returns Acad::eOk if the tile size is valid.
  738. /// </returns>
  739. ///
  740. /// <remarks>
  741. /// Smaller values increase rendering time, but provide more frequent
  742. /// updates during rendering.The size must be in the range 4 to 512, and
  743. /// has a default value of 32.
  744. /// </remarks>
  745. Acad::ErrorStatus setTileSize(int iTileSize);
  746. /// <summary>
  747. /// The size of the image tiles to use when rendering.
  748. /// </summary>
  749. int tileSize() const;
  750. /// <summary>
  751. /// Sets the sequence (order) used to render image tiles.
  752. /// </summary>
  753. ///
  754. /// <remarks>
  755. /// The default value is krHilbert.
  756. /// </remarks>
  757. void setTileOrder(AcGiMrTileOrder eTileOrder);
  758. /// <summary>
  759. /// The sequence (order) used to render image tiles.
  760. /// </summary>
  761. AcGiMrTileOrder tileOrder() const;
  762. /// <summary>
  763. /// Sets the maximum amount of memory (in MB) that the renderer will
  764. /// allocate for rendering.
  765. /// </summary>
  766. ///
  767. /// <returns>
  768. /// Returns Acad::eOk if the memory limit is valid.
  769. /// </returns>
  770. ///
  771. /// <remarks>
  772. /// After the memory limit is reached, the renderer will begin making
  773. /// performance tradeoffs to stay under the memory limit. The memory limit
  774. /// must be at least 128 MB, and the default value is 1048 MB.
  775. /// </remarks>
  776. Acad::ErrorStatus setMemoryLimit(int iMemoryLimit);
  777. /// <summary>
  778. /// The maximum amount of memory (in MB) that the renderer will allocate
  779. /// for rendering.
  780. /// </summary>
  781. int memoryLimit() const;
  782. /// <summary>
  783. /// The shadow sampling multiplier for area lights.
  784. /// </summary>
  785. enum ShadowSamplingMultiplier {
  786. /// <summary>
  787. /// Zero.
  788. /// </summary>
  789. kSamplingMultiplierZero = 0,
  790. /// <summary>
  791. /// One-eighth.
  792. /// </summary>
  793. kSamplingMultiplierOneEighth,
  794. /// <summary>
  795. /// One-fourth.
  796. /// </summary>
  797. kSamplingMultiplierOneFourth,
  798. /// <summary>
  799. /// One-half.
  800. /// </summary>
  801. kSamplingMultiplierOneHalf,
  802. /// <summary>
  803. /// One.
  804. /// </summary>
  805. kSamplingMultiplierOne,
  806. /// <summary>
  807. /// Two.
  808. /// </summary>
  809. kSamplingMultiplierTwo
  810. };
  811. /// <summary>
  812. /// Specifies the shadow sampling multiplier for area lights.
  813. /// </summary>
  814. ///
  815. /// <remarks>
  816. /// The default value is ShadowSamplingMultiplier::kSamplingMultiplierOne.
  817. /// </remarks>
  818. Acad::ErrorStatus setShadowSamplingMultiplier(
  819. AcDbMentalRayRenderSettings::ShadowSamplingMultiplier multiplier);
  820. /// <summary>
  821. /// The shadow sampling multiplier for area lights.
  822. /// </summary>
  823. AcDbMentalRayRenderSettings::ShadowSamplingMultiplier shadowSamplingMultiplier() const;
  824. // AcDbObject functions
  825. virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  826. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  827. virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler* pFiler);
  828. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  829. virtual bool operator==(const AcDbMentalRayRenderSettings& settings);
  830. Acad::ErrorStatus copyFrom(const AcRxObject* other);
  831. protected:
  832. // AcGiDrawable functions
  833. virtual Adesk::UInt32 subSetAttributes(AcGiDrawableTraits* pTraits);
  834. private:
  835. friend class AcDbImpMentalRayRenderSettings;
  836. Adesk::UInt32 baseSetAttributes(AcGiDrawableTraits* pTraits);
  837. AcDbImpMentalRayRenderSettings* mpImpMentalRay;
  838. };
  839. /// <summary>
  840. /// Container for all properties relating to the rapid RT renderer. See
  841. /// the base class AcDbRenderSettings for more information.
  842. /// </summary>
  843. class SCENEDLLIMPEXP AcDbRapidRTRenderSettings : public AcDbRenderSettings
  844. {
  845. public:
  846. ACRX_DECLARE_MEMBERS(AcDbRapidRTRenderSettings);
  847. /// <summary>
  848. /// Render, Target Quit Condition
  849. /// </summary>
  850. enum RenderTarget
  851. {
  852. /// <summary>
  853. /// By Render Level (iteration)
  854. /// </summary>
  855. krLevel = 0,
  856. /// <summary>
  857. /// By Render Time
  858. /// </summary>
  859. krTime = 1,
  860. /// <summary>
  861. /// Until user abort
  862. /// </summary>
  863. krInfinite = 2
  864. };
  865. /// <summary>
  866. /// Constructor.
  867. /// </summary>
  868. AcDbRapidRTRenderSettings();
  869. /// <summary>
  870. /// Destructor.
  871. /// </summary>
  872. virtual ~AcDbRapidRTRenderSettings();
  873. /// <summary>
  874. /// Set the render target of the RapidRT render settings.
  875. /// </summary>
  876. Acad::ErrorStatus setRenderTarget(RenderTarget target);
  877. /// <summary>
  878. /// Get the render target of the RapidRT render settings.
  879. /// </summary>
  880. RenderTarget renderTarget() const;
  881. /// <summary>
  882. /// Set the render level of the RapidRT render settings.
  883. /// </summary>
  884. Acad::ErrorStatus setRenderLevel(int level);
  885. /// <summary>
  886. /// Get the render level of the RapidRT render settings.
  887. /// </summary>
  888. int renderLevel() const;
  889. /// <summary>
  890. /// Set the render time of the RapidRT render settings.
  891. /// </summary>
  892. Acad::ErrorStatus setRenderTime(int time);
  893. /// <summary>
  894. /// Get the render time of the RapidRT render settings.
  895. /// </summary>
  896. int renderTime() const;
  897. /// <summary>
  898. /// Set the render lighting model of the RapidRT render settings.
  899. /// </summary>
  900. Acad::ErrorStatus setLightingModel(AcGiLightingMode model);
  901. /// <summary>
  902. /// Get the render lighting model of the RapidRT render settings.
  903. /// </summary>
  904. AcGiLightingMode lightingModel() const;
  905. /// <summary>
  906. /// Set the filter type of the RapidRT render settings.
  907. /// </summary>
  908. Acad::ErrorStatus setFilterType(AcGiFilterType type);
  909. /// <summary>
  910. /// Get the filter type of the RapidRT render settings.
  911. /// </summary>
  912. AcGiFilterType filterType() const;
  913. /// <summary>
  914. /// Set the filter width of the RapidRT render settings.
  915. /// </summary>
  916. Acad::ErrorStatus setFilterWidth(float width);
  917. /// <summary>
  918. /// Get the filter width of the RapidRT render settings.
  919. /// </summary>
  920. float filterWidth() const;
  921. /// <summary>
  922. /// Set the filter height of the RapidRT render settings.
  923. /// </summary>
  924. Acad::ErrorStatus setFilterHeight(float height);
  925. /// <summary>
  926. /// Get the filter height of the RapidRT render settings.
  927. /// </summary>
  928. float filterHeight() const;
  929. // AcDbObject functions
  930. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler);
  931. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  932. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* pFiler);
  933. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  934. virtual bool operator==(const AcDbRapidRTRenderSettings& settings);
  935. /// <summary>
  936. /// Copy all the render settings from an AcDbRapidRTRenderSettings object.
  937. /// </summary>
  938. Acad::ErrorStatus copyFrom(const AcRxObject* other);
  939. virtual Acad::ErrorStatus decomposeForSave(AcDb::AcDbDwgVersion ver, AcDbObject*& replaceObj,
  940. AcDbObjectId& replaceId, Adesk::Boolean& exchangeXData);
  941. protected:
  942. // AcGiDrawable functions
  943. virtual Adesk::UInt32 subSetAttributes(AcGiDrawableTraits* pTraits);
  944. };
  945. /// <summary>
  946. /// Container for environment-related properties, including fog / depth cue and
  947. /// the global environment image. One and only one of these objects is
  948. /// resident in the database, in the named object dictionary as ACAD_RENDER_ENVIRONMENT.
  949. /// </summary>
  950. class SCENEDLLIMPEXP AcDbRenderEnvironment : public AcDbObject
  951. {
  952. public:
  953. ACRX_DECLARE_MEMBERS(AcDbRenderEnvironment);
  954. /// <summary>
  955. /// Constructor.
  956. /// </summary>
  957. AcDbRenderEnvironment();
  958. /// <summary>
  959. /// Destructor.
  960. /// </summary>
  961. virtual ~AcDbRenderEnvironment();
  962. virtual AcGiDrawable* drawable();
  963. /// <summary>
  964. /// Sets whether a fog effect is applied to the rendered image.
  965. /// </summary>
  966. ///
  967. /// <remarks>
  968. /// The default value is false.
  969. /// </remarks>
  970. void setFogEnabled(bool bEnable);
  971. /// <summary>
  972. /// Whether a fog effect is applied to the rendered image.
  973. /// </summary>
  974. bool fogEnabled() const;
  975. /// <summary>
  976. /// Sets whether the fog affects the background.
  977. /// </summary>
  978. ///
  979. /// <remarks>
  980. /// The default value is false.
  981. /// </remarks>
  982. void setFogBackgroundEnabled(bool bEnable);
  983. /// <summary>
  984. /// Whether the fog affects the background.
  985. /// </summary>
  986. bool fogBackgroundEnabled() const;
  987. /// <summary>
  988. /// Sets the color of the fog effect.
  989. /// </summary>
  990. ///
  991. /// <remarks>
  992. /// The default value is medium gray: 128, 128, 128.
  993. /// </remarks>
  994. void setFogColor(const AcCmEntityColor& color);
  995. /// <summary>
  996. /// The color of the fog effect.
  997. /// </summary>
  998. AcCmEntityColor fogColor() const;
  999. /// <summary>
  1000. /// Sets the density of the fog effect.
  1001. /// </summary>
  1002. ///
  1003. /// <returns>
  1004. /// Returns Acad::eOk if the density values are valid.
  1005. /// </returns>
  1006. ///
  1007. /// <param name="dNear">
  1008. /// The density of the fog at the near distance specified with
  1009. /// setDistances(), expressed as a percentage in the range 0.0 to 100.0.
  1010. /// The value must be less than or equal to the density at the far
  1011. /// distance. The default value is 0.0 (no fog).
  1012. /// </param>
  1013. ///
  1014. /// <param name="dFar">
  1015. /// The density of the fog at the far distance specified with
  1016. /// setDistances(), expressed as a percentage in the range 0.0 to 100.0.
  1017. /// The value must be greater than or equal to the density at the near
  1018. /// distance. The default value is 100.0 (opaque fog).
  1019. /// </param>
  1020. Acad::ErrorStatus setFogDensity(double dNear, double dFar);
  1021. /// <summary>
  1022. /// The density of the fog effect.
  1023. /// </summary>
  1024. void fogDensity(double& dNear, double& dFar) const;
  1025. /// <summary>
  1026. /// Sets the near and far distances of the fog effect.
  1027. /// </summary>
  1028. ///
  1029. /// <returns>
  1030. /// Returns Acad::eOk if the distances are valid.
  1031. /// </returns>
  1032. ///
  1033. /// <param name="dNear">
  1034. /// The near distance of the fog, expressed as a percentage of the distance
  1035. /// between the camera and the far clipping plane. The value must be in
  1036. /// the range 0.0 to 100.0, and must be less than or equal to the far
  1037. /// distance. The default value is 0.0 (at the camera).
  1038. /// </param>
  1039. ///
  1040. /// <param name="dFar">
  1041. /// The far distance of the fog, expressed as a percentage of the distance
  1042. /// between the camera and the far clipping plane. The value must be in
  1043. /// the range 0.0 to 100.0, and must be greater than or equal to the near
  1044. /// distance. The default value is 100.0 (at the far clipping plane).
  1045. /// </param>
  1046. Acad::ErrorStatus setDistances(double dNear, double dFar);
  1047. /// <summary>
  1048. /// The near and far distances of the fog effect.
  1049. /// </summary>
  1050. void distances(double& dNear, double& dFar) const;
  1051. /// <summary>
  1052. /// Sets whether to use an image for the environment.
  1053. /// </summary>
  1054. ///
  1055. /// <remarks>
  1056. /// If set to true, the file name specified with
  1057. /// setEnvironmentImageFileName() is used as the environment image. The
  1058. /// The default value is false.
  1059. /// </remarks>
  1060. void setEnvironmentImageEnabled(bool bEnabled);
  1061. /// <summary>
  1062. /// Whether to use an image for the environment.
  1063. /// </summary>
  1064. bool environmentImageEnabled() const;
  1065. /// <summary>
  1066. /// Sets the full file name on disk of the environment image.
  1067. /// </summary>
  1068. ///
  1069. /// <returns>
  1070. /// Returns Acad::eOk if the file name is valid.
  1071. /// </returns>
  1072. ///
  1073. /// <remarks>
  1074. /// The default value is blank.
  1075. /// </remarks>
  1076. Acad::ErrorStatus setEnvironmentImageFileName(const AcString& strFileName);
  1077. /// <summary>
  1078. /// The full file name on disk of the environment image.
  1079. /// </summary>
  1080. AcString environmentImageFileName() const;
  1081. // AcDbObject functions
  1082. virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  1083. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  1084. virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler* pFiler);
  1085. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  1086. virtual bool operator==(const AcDbRenderEnvironment& environment);
  1087. protected:
  1088. // AcGiDrawable functions
  1089. virtual Adesk::UInt32 subSetAttributes(AcGiDrawableTraits* pTraits);
  1090. AcDbImpRenderEnvironment* mpImp;
  1091. };
  1092. /// <summary>
  1093. /// Container for all global rendering properties. One and only one of these
  1094. /// objects is resident in the database, in the named object dictionary as
  1095. /// ACAD_RENDER_GLOBAL.
  1096. /// </summary>
  1097. class SCENEDLLIMPEXP AcDbRenderGlobal : public AcDbObject
  1098. {
  1099. public:
  1100. ACRX_DECLARE_MEMBERS(AcDbRenderGlobal);
  1101. /// <summary>
  1102. /// The available types of view content to render (render procedures).
  1103. /// </summary>
  1104. enum Procedure
  1105. {
  1106. /// <summary>
  1107. /// Render the complete contents of the view.
  1108. /// </summary>
  1109. krView = 0,
  1110. /// <summary>
  1111. /// Render only the user-defined rectangular region of the view.
  1112. /// </summary>
  1113. krCrop,
  1114. /// <summary>
  1115. /// Render only the selected objects in the view.
  1116. /// Deprecated for RapidRT
  1117. /// </summary>
  1118. krSelected
  1119. };
  1120. /// <summary>
  1121. /// The available output targets for rendering.
  1122. /// </summary>
  1123. enum Destination
  1124. {
  1125. /// <summary>
  1126. /// The rendered image appears in the separate Render window.
  1127. /// </summary>
  1128. krWindow = 0,
  1129. /// <summary>
  1130. /// The rendered image appears directly in the current viewport.
  1131. /// </summary>
  1132. krViewport
  1133. };
  1134. /// <summary>
  1135. /// Constructor.
  1136. /// </summary>
  1137. AcDbRenderGlobal();
  1138. /// <summary>
  1139. /// Destructor.
  1140. /// </summary>
  1141. virtual ~AcDbRenderGlobal();
  1142. /// <summary>
  1143. /// Sets the type of view content to render (the procedure) and the desired
  1144. /// output target for rendering.
  1145. /// </summary>
  1146. ///
  1147. /// <remarks>
  1148. /// The default values are krView and krWindow.
  1149. /// </remarks>
  1150. void setProcedureAndDestination(Procedure eProcedure,
  1151. Destination eDestination);
  1152. /// <summary>
  1153. /// The type of view content to render (the procedure) and the desired
  1154. /// output target for rendering.
  1155. /// </summary>
  1156. void procedureAndDestination(Procedure& eProcedure,
  1157. Destination& eDestination) const;
  1158. /// <summary>
  1159. /// Internal Use Only. Please use setProcedureAndDestination()
  1160. /// for instead.
  1161. ///
  1162. /// Sets the type of view content to render (the procedure).
  1163. /// </summary>
  1164. ///
  1165. /// <remarks>
  1166. /// The default value is krView.
  1167. /// </remarks>
  1168. Acad::ErrorStatus setProcedure(Procedure eProcedure);
  1169. /// <summary>
  1170. /// Internal Use Only. Please use procedureAndDestination()
  1171. /// for instead.
  1172. ///
  1173. /// The type of view content to render (the procedure).
  1174. /// </summary>
  1175. Procedure procedure();
  1176. /// <summary>
  1177. /// Internal Use Only. Please use setProcedureAndDestination()
  1178. /// for instead.
  1179. ///
  1180. /// Sets the type of the desired output target for rendering.
  1181. /// </summary>
  1182. ///
  1183. /// <remarks>
  1184. /// The default value is krWindow.
  1185. /// </remarks>
  1186. Acad::ErrorStatus setDestination(Destination eDestination);
  1187. /// <summary>
  1188. /// Internal Use Only. Please use procedureAndDestination()
  1189. /// for instead.
  1190. ///
  1191. /// The type of the desired output target for rendering.
  1192. /// </summary>
  1193. Destination destination();
  1194. /// <summary>
  1195. /// Sets whether to save an image on disk after rendering.
  1196. /// </summary>
  1197. ///
  1198. /// <remarks>
  1199. /// If set to true, the file name specified with setSaveFileName() is used
  1200. /// to save the image. The default value is false.
  1201. /// </remarks>
  1202. void setSaveEnabled(bool bEnabled);
  1203. /// <summary>
  1204. /// Whether to save an image on disk after rendering.
  1205. /// </summary>
  1206. bool saveEnabled() const;
  1207. /// <summary>
  1208. /// Sets the full file name on disk with which to save the rendered image.
  1209. /// </summary>
  1210. ///
  1211. /// <returns>
  1212. /// Returns Acad::eOk if the file name is valid.
  1213. /// </returns>
  1214. ///
  1215. /// <remarks>
  1216. /// The default value is blank.
  1217. /// </remarks>
  1218. Acad::ErrorStatus setSaveFileName(const AcString& strFileName);
  1219. /// <summary>
  1220. /// The full file name on disk with which to save the rendered image.
  1221. /// </summary>
  1222. AcString saveFileName() const;
  1223. /// <summary>
  1224. /// Sets the dimensions of the rendered image.
  1225. /// </summary>
  1226. ///
  1227. /// <returns>
  1228. /// Returns Acad::eOk if the dimensions are valid.
  1229. /// </returns>
  1230. ///
  1231. /// <remarks>
  1232. /// Each dimension must be in the range 1 to 4096. The default values are
  1233. /// 640 and 480.
  1234. /// </remarks>
  1235. Acad::ErrorStatus setDimensions(int w, int h);
  1236. /// <summary>
  1237. /// The dimensions of the rendered image.
  1238. /// </summary>
  1239. void dimensions(int& w, int& h) const;
  1240. /// <summary>
  1241. /// Sets whether predefined (factory) presets appear before the user-
  1242. /// defined presets in the user interface.
  1243. /// </summary>
  1244. ///
  1245. /// <remarks>
  1246. /// The default value is true.
  1247. /// </remarks>
  1248. void setPredefinedPresetsFirst(bool bPredefinedPresetsFirst);
  1249. /// <summary>
  1250. /// Whether predefined (factory) presets appear before the user-defined
  1251. /// presets in the user interface.
  1252. /// </summary>
  1253. bool predefinedPresetsFirst() const;
  1254. /// <summary>
  1255. /// Sets whether settings / statistics are displayed in the user interface
  1256. /// with the higher level of detail.
  1257. /// </summary>
  1258. ///
  1259. /// <remarks>
  1260. /// The default value is true.
  1261. /// </remarks>
  1262. void setHighInfoLevel(bool bHighInfoLevel);
  1263. /// <summary>
  1264. /// Whether settings / statistics are displayed in the user interface with
  1265. /// the higher level of detail.
  1266. /// </summary>
  1267. bool highInfoLevel() const;
  1268. /// <summary>
  1269. /// Sets the exposure control type.
  1270. /// </summary>
  1271. ///
  1272. /// <remarks>
  1273. /// The default value is AcGiMrExposureType::krAutomatic.
  1274. /// </remarks>
  1275. Acad::ErrorStatus setExposureType(AcGiMrExposureType type);
  1276. /// <summary>
  1277. /// The exposure control type.
  1278. /// </summary>
  1279. AcGiMrExposureType exposureType() const;
  1280. // AcDbObject functions
  1281. virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  1282. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  1283. virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler* pFiler);
  1284. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  1285. Acad::ErrorStatus copyFrom( const AcRxObject* other );
  1286. private:
  1287. AcDbImpRenderGlobal* mpImp;
  1288. public:
  1289. bool operator==(const AcDbRenderGlobal& global);
  1290. AcString dimensionName() const;
  1291. };