AcGiEnvironment.h 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  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. // This API extends AcGi to support backgrounds, environmental objects
  12. // and render settings
  13. //
  14. #pragma once
  15. #include "acgi.h"
  16. #include "AcGiLightTraits.h"
  17. #pragma pack (push, 8)
  18. #ifdef ACGIENVIRONMENT_IMPL
  19. #define ACGIENV_IMPEXP __declspec(dllexport)
  20. #else
  21. #define ACGIENV_IMPEXP __declspec(dllimport)
  22. #endif
  23. class ACDB_PORT AcGiSolidBackgroundTraits : public AcGiNonEntityTraits
  24. //
  25. // This class enables solid background definitions to be elaborated to
  26. // AcGi implementations
  27. //
  28. {
  29. public:
  30. ACRX_DECLARE_MEMBERS(AcGiSolidBackgroundTraits);
  31. // solid background
  32. virtual void setColorSolid (const AcCmEntityColor & color) = 0;
  33. virtual AcCmEntityColor colorSolid (void) const = 0;
  34. };
  35. class ACDB_PORT AcGiGradientBackgroundTraits : public AcGiNonEntityTraits
  36. //
  37. // This class enables gradient background definitions to be elaborated to
  38. // AcGi implementations
  39. //
  40. {
  41. public:
  42. ACRX_DECLARE_MEMBERS(AcGiGradientBackgroundTraits);
  43. virtual void setColorTop (const AcCmEntityColor & color) = 0;
  44. virtual AcCmEntityColor colorTop (void) const = 0;
  45. virtual void setColorMiddle (const AcCmEntityColor & color) = 0;
  46. virtual AcCmEntityColor colorMiddle (void) const = 0;
  47. virtual void setColorBottom (const AcCmEntityColor & color) = 0;
  48. virtual AcCmEntityColor colorBottom (void) const = 0;
  49. virtual void setHorizon (double horizon) = 0;
  50. virtual double horizon (void) const = 0;
  51. virtual void setHeight (double height) = 0;
  52. virtual double height (void) const = 0;
  53. virtual void setRotation (double rotation) = 0;
  54. virtual double rotation (void) const = 0;
  55. };
  56. class ACDB_PORT AcGiImageBackgroundTraits : public AcGiNonEntityTraits
  57. //
  58. // This class enables image background definitions to be elaborated to
  59. // AcGi implementations
  60. //
  61. {
  62. public:
  63. ACRX_DECLARE_MEMBERS(AcGiImageBackgroundTraits);
  64. virtual void setImageFilename (const ACHAR* filename) = 0;
  65. virtual const ACHAR * imageFilename (void) const = 0;
  66. virtual void setFitToScreen (bool bFitToScreen) = 0;
  67. virtual bool fitToScreen (void) const = 0;
  68. virtual void setMaintainAspectRatio (bool bMaintainAspectRatio) = 0;
  69. virtual bool maintainAspectRatio (void) const = 0;
  70. virtual void setUseTiling (bool bUseTiling) = 0;
  71. virtual bool useTiling (void) const = 0;
  72. virtual void setXOffset (double xOffset) = 0;
  73. virtual double xOffset (void) const = 0;
  74. virtual void setYOffset (double yOffset) = 0;
  75. virtual double yOffset (void) const = 0;
  76. virtual void setXScale (double xScale) = 0;
  77. virtual double xScale (void) const = 0;
  78. virtual void setYScale (double yScale) = 0;
  79. virtual double yScale (void) const = 0;
  80. };
  81. class ACDB_PORT AcGiGroundPlaneBackgroundTraits : public AcGiNonEntityTraits
  82. //
  83. // This class enables ground plane background definitions to be elaborated to
  84. // AcGi implementations
  85. //
  86. {
  87. public:
  88. ACRX_DECLARE_MEMBERS(AcGiGroundPlaneBackgroundTraits);
  89. virtual void setColorSkyZenith (const AcCmEntityColor & color) = 0;
  90. virtual AcCmEntityColor colorSkyZenith (void) const = 0;
  91. virtual void setColorSkyHorizon (const AcCmEntityColor & color) = 0;
  92. virtual AcCmEntityColor colorSkyHorizon (void) const = 0;
  93. virtual void setColorUndergroundHorizon (const AcCmEntityColor & color) = 0;
  94. virtual AcCmEntityColor colorUndergroundHorizon (void) const = 0;
  95. virtual void setColorUndergroundAzimuth (const AcCmEntityColor & color) = 0;
  96. virtual AcCmEntityColor colorUndergroundAzimuth (void) const = 0;
  97. virtual void setColorGroundPlaneNear (const AcCmEntityColor & color) = 0;
  98. virtual AcCmEntityColor colorGroundPlaneNear (void) const = 0;
  99. virtual void setColorGroundPlaneFar (const AcCmEntityColor & color) = 0;
  100. virtual AcCmEntityColor colorGroundPlaneFar (void) const = 0;
  101. };
  102. /// <summary>
  103. /// This class enables sky background definitions to be elaborated to
  104. /// AcGi implementations.
  105. /// </summary>
  106. ///
  107. class ACDB_PORT AcGiSkyBackgroundTraits : public AcGiNonEntityTraits
  108. {
  109. public:
  110. ACRX_DECLARE_MEMBERS(AcGiSkyBackgroundTraits);
  111. /// <summary>
  112. /// Sets the sky parameters for this light.
  113. /// </summary>
  114. ///
  115. /// <param name="params">
  116. /// An AcGiSkyParameters object that contains the sky properties used
  117. /// by this background.
  118. /// </param>
  119. virtual void setSkyParameters(const AcGiSkyParameters& params) = 0;
  120. /// <summary>
  121. /// Provides access to sky parameters for this light.
  122. /// </summary>
  123. ///
  124. /// <param name="params">
  125. /// An AcGiSkyParameters object that contains the sky properties used
  126. /// by this background.
  127. /// </param>
  128. virtual void skyParameters(AcGiSkyParameters& params) const = 0;
  129. };
  130. /// <summary>
  131. /// This class enables IBL background definitions to be elaborated to
  132. /// AcGi implementations.
  133. /// </summary>
  134. ///
  135. class ACDB_PORT AcGiIBLBackgroundTraits : public AcGiNonEntityTraits
  136. {
  137. public:
  138. ACRX_DECLARE_MEMBERS(AcGiIBLBackgroundTraits);
  139. /// <summary>
  140. /// Sets whether IBL is currently active
  141. /// </summary>
  142. /// <param name="name">
  143. /// True if active
  144. /// </param>
  145. virtual void setEnable (const bool bEnable) = 0;
  146. /// <summary>
  147. /// Gets whether IBL is currently active
  148. /// </summary>
  149. /// <returns>
  150. /// True if active
  151. /// </returns>
  152. virtual bool enable (void) const = 0;
  153. /// <summary>
  154. /// Sets the image used for IBL
  155. /// </summary>
  156. /// <param name="name">
  157. /// Name of IBL image
  158. /// </param>
  159. virtual void setIBLImageName (const AcString& name) = 0;
  160. /// <summary>
  161. /// Gets the image used for IBL
  162. /// </summary>
  163. /// <returns>
  164. /// Name of IBL image
  165. /// </returns>
  166. virtual AcString IBLImageName (void) const = 0;
  167. /// <summary>
  168. /// Sets the rotation value for the IBL image
  169. /// -180 to 180 degrees
  170. /// </summary>
  171. /// <param name="rotation">
  172. /// Rotation value in degrees (-180 to 180)
  173. /// </param>
  174. virtual void setRotation (const double rotation) = 0;
  175. /// <summary>
  176. /// Gets the rotation value for the IBL image
  177. /// </summary>
  178. /// <returns>
  179. /// Rotation value in degrees
  180. /// </returns>
  181. virtual double rotation (void) const = 0;
  182. /// <summary>
  183. /// Sets whether to display the IBL image as the background
  184. /// </summary>
  185. /// <param name="bdisplay">
  186. /// Set to true to display IBL image in background
  187. /// </param>
  188. virtual void setDisplayImage (const bool bdisplay) = 0;
  189. /// <summary>
  190. /// Gets whether to display the IBL image as the background
  191. /// </summary>
  192. /// <returns>
  193. /// True if IBL image is to be displayed as background
  194. /// </returns>
  195. virtual bool displayImage (void) const = 0;
  196. /// <summary>
  197. /// Sets the background to display when DisplayImage is set to false
  198. /// Limited to 2D backgrounds only - Solid, Gradient, Image
  199. /// </summary>
  200. /// <param name="bg">
  201. /// Background db Id
  202. /// </param>
  203. virtual void setSecondaryBackground (const AcDbObjectId bg) = 0;
  204. /// <summary>
  205. /// Gets the background to display when DisplayImage is set to false
  206. /// </summary>
  207. /// <returns>
  208. /// Background db Id
  209. /// </returns>
  210. virtual AcDbObjectId secondaryBackground (void) const = 0;
  211. };
  212. class AcGiMaterialTexture;
  213. class ACDB_PORT AcGiRenderEnvironmentTraits : public AcGiNonEntityTraits
  214. //
  215. // This class enables render environment definitions to be elaborated to
  216. // AcGi implementations
  217. //
  218. {
  219. public:
  220. ACRX_DECLARE_MEMBERS(AcGiRenderEnvironmentTraits);
  221. virtual void setEnable (const bool bEnable) = 0;
  222. virtual bool enable (void) const = 0;
  223. virtual void setIsBackground (const bool bEnable) = 0;
  224. virtual bool isBackground (void) const = 0;
  225. virtual void setFogColor (const AcCmEntityColor & color) = 0;
  226. virtual AcCmEntityColor fogColor (void) const = 0;
  227. virtual void setNearDistance (const double nearDist) = 0;
  228. virtual double nearDistance (void) const = 0;
  229. virtual void setFarDistance (const double farDist) = 0;
  230. virtual double farDistance (void) const = 0;
  231. virtual void setNearPercentage (const double nearPct) = 0;
  232. virtual double nearPercentage (void) const = 0;
  233. virtual void setFarPercentage (const double farPct) = 0;
  234. virtual double farPercentage (void) const = 0;
  235. virtual void setEnvironmentMap (const AcGiMaterialTexture * map) = 0;
  236. virtual AcGiMaterialTexture * environmentMap (void) const = 0;
  237. };
  238. class ACDB_PORT AcGiRenderSettingsTraits : public AcGiNonEntityTraits
  239. {
  240. public:
  241. ACRX_DECLARE_MEMBERS(AcGiRenderSettingsTraits);
  242. virtual void setMaterialEnabled(bool enabled) = 0;
  243. virtual bool materialEnabled() const = 0;
  244. virtual void setTextureSampling(bool enabled) = 0;
  245. virtual bool textureSampling() const = 0;
  246. virtual void setBackFacesEnabled(bool enabled) = 0;
  247. virtual bool backFacesEnabled() const = 0;
  248. virtual void setShadowsEnabled(bool enabled) = 0;
  249. virtual bool shadowsEnabled() const = 0;
  250. virtual void setDiagnosticBackgroundEnabled(bool enabled) = 0;
  251. virtual bool diagnosticBackgroundEnabled() const = 0;
  252. // Model scale relative to meters. For example, if model is drawn in mm,
  253. // scaleFactor is 0.001.
  254. virtual void setModelScaleFactor (double scaleFactor) = 0;
  255. virtual double modelScaleFactor (void) const = 0;
  256. };
  257. // The available filtering methods (kernels) used to combine samples into
  258. // a pixel color.
  259. //
  260. typedef enum {
  261. krBox = 0,
  262. krTriangle,
  263. krGauss,
  264. krMitchell,
  265. krLanczos
  266. } AcGiMrFilter;
  267. // The available methods for computing ray-traced shadows.
  268. //
  269. typedef enum {
  270. krSimple = 0,
  271. krSorted,
  272. krSegments
  273. } AcGiMrShadowMode;
  274. typedef enum {
  275. krOff = 0,
  276. krGrid,
  277. krPhoton,
  278. krSamples,
  279. krBSP
  280. } AcGiMrDiagnosticMode;
  281. typedef enum {
  282. krObject = 0,
  283. krWorld,
  284. krCamera
  285. } AcGiMrDiagnosticGridMode;
  286. typedef enum {
  287. krDensity = 0,
  288. krIrradiance
  289. } AcGiMrDiagnosticPhotonMode;
  290. typedef enum {
  291. krDepth = 0,
  292. krSize
  293. } AcGiMrDiagnosticBSPMode;
  294. typedef enum {
  295. krHilbert = 0,
  296. krSpiral,
  297. krLeftToRight,
  298. krRightToLeft,
  299. krTopToBottom,
  300. krBottomToTop
  301. } AcGiMrTileOrder;
  302. typedef enum {
  303. krAutomatic = 0,
  304. krLogarithmic
  305. } AcGiMrExposureType;
  306. typedef enum {
  307. krFinalGatherOff = 0,
  308. krFinalGatherOn,
  309. krFinalGatherAuto
  310. } AcGiMrFinalGatheringMode;
  311. typedef enum {
  312. krExportMIOff = 0,
  313. krExportMIWithRender,
  314. krExportMIOnly
  315. } AcGiMrExportMIMode;
  316. class ACDB_PORT AcGiMentalRayRenderSettingsTraits : public AcGiRenderSettingsTraits
  317. {
  318. public:
  319. ACRX_DECLARE_MEMBERS(AcGiMentalRayRenderSettingsTraits);
  320. virtual void setSampling(int min, int max) = 0;
  321. virtual void sampling(int& min, int& max) const = 0;
  322. virtual void setSamplingFilter(AcGiMrFilter filter, double width, double height) = 0;
  323. virtual void SamplingFilter(AcGiMrFilter& filter, double& width, double& height) const = 0;
  324. virtual void setSamplingContrastColor(float r, float g, float b, float a) = 0;
  325. virtual void samplingContrastColor(float& r, float& g, float& b, float& a) const = 0;
  326. virtual void setShadowMode(AcGiMrShadowMode mode) = 0;
  327. virtual AcGiMrShadowMode shadowMode() const = 0;
  328. virtual void setShadowMapEnabled(bool enabled) = 0;
  329. virtual bool shadowMapEnabled() const = 0;
  330. virtual void setRayTraceEnabled(bool enabled) = 0;
  331. virtual bool rayTraceEnabled() const = 0;
  332. virtual void setRayTraceDepth(int reflection, int refraction, int sum) = 0;
  333. virtual void rayTraceDepth(int& reflection, int& refraction, int& sum) const = 0;
  334. virtual void setGlobalIlluminationEnabled(bool enabled) = 0;
  335. virtual bool globalIlluminationEnabled() const = 0;
  336. virtual void setGISampleCount(int num) = 0;
  337. virtual int giSampleCount() const = 0;
  338. virtual void setGISampleRadiusEnabled(bool enabled) = 0;
  339. virtual bool giSampleRadiusEnabled() const = 0;
  340. virtual void setGISampleRadius(double radius) = 0;
  341. virtual double giSampleRadius() const = 0;
  342. virtual void setGIPhotonsPerLight(int num) = 0;
  343. virtual int giPhotonsPerLight() const = 0;
  344. virtual void setPhotonTraceDepth(int reflection, int refraction, int sum) = 0;
  345. virtual void photonTraceDepth(int& reflection, int& refraction, int& sum) const = 0;
  346. virtual void setFinalGatheringEnabled(bool enabled) = 0;
  347. virtual bool finalGatheringEnabled() const = 0;
  348. virtual void setFGRayCount(int num) = 0;
  349. virtual int fgRayCount() const = 0;
  350. virtual void setFGRadiusState(bool bMin, bool bMax, bool bPixels) = 0;
  351. virtual void fgSampleRadiusState(bool& bMin, bool& bMax, bool& bPixels) = 0;
  352. virtual void setFGSampleRadius(double min, double max) = 0;
  353. virtual void fgSampleRadius(double& min, double& max) const = 0;
  354. virtual void setLightLuminanceScale(double luminance) = 0;
  355. virtual double lightLuminanceScale() const = 0;
  356. virtual void setDiagnosticMode(AcGiMrDiagnosticMode mode) = 0;
  357. virtual AcGiMrDiagnosticMode diagnosticMode() const = 0;
  358. virtual void setDiagnosticGridMode(AcGiMrDiagnosticGridMode mode, float fSize) = 0;
  359. virtual void diagnosticGridMode(AcGiMrDiagnosticGridMode& mode, float& fSize) const = 0;
  360. virtual void setDiagnosticPhotonMode(AcGiMrDiagnosticPhotonMode mode) = 0;
  361. virtual AcGiMrDiagnosticPhotonMode diagnosticPhotonMode() const = 0;
  362. virtual void setDiagnosticBSPMode(AcGiMrDiagnosticBSPMode mode) = 0;
  363. virtual AcGiMrDiagnosticBSPMode diagnosticBSPMode() const = 0;
  364. virtual void setExportMIEnabled(bool enabled) = 0;
  365. virtual bool exportMIEnabled() const = 0;
  366. virtual void setExportMIFileName(const ACHAR* miName) = 0;
  367. virtual const ACHAR* exportMIFileName() const = 0;
  368. virtual void setTileSize(int size) = 0;
  369. virtual int tileSize() const = 0;
  370. virtual void setTileOrder(AcGiMrTileOrder order) = 0;
  371. virtual AcGiMrTileOrder tileOrder() const = 0;
  372. virtual void setMemoryLimit(int limit) = 0;
  373. virtual int memoryLimit() const = 0;
  374. virtual void setEnergyMultiplier(float fScale) = 0;
  375. virtual float energyMultiplier() const = 0;
  376. virtual void setProgressMonitor(void* pMonitor) = 0;
  377. virtual const void* progressMonitor(void) const = 0;
  378. virtual void setExposureType(AcGiMrExposureType type) = 0;
  379. virtual AcGiMrExposureType exposureType() const = 0;
  380. virtual void setFinalGatheringMode(AcGiMrFinalGatheringMode mode) = 0;
  381. virtual AcGiMrFinalGatheringMode finalGatheringMode() const = 0;
  382. virtual void setShadowSamplingMultiplier(double multiplier) = 0;
  383. virtual double shadowSamplingMultiplier() const = 0;
  384. virtual void setExportMIMode(AcGiMrExportMIMode mode) = 0;
  385. virtual AcGiMrExportMIMode exportMIMode() const = 0;
  386. };
  387. /// <summary>
  388. /// Render Quit Conditions
  389. /// </summary>
  390. typedef enum
  391. {
  392. /// <summary>
  393. /// Use render iteration as a quit condition
  394. /// The corresponding render level value needs to be set
  395. /// </summary>
  396. krEQuitByRenderLevel = 0,
  397. /// <summary>
  398. /// Use render time as a quit condition
  399. /// The corresponding target render time needs to be set
  400. /// </summary>
  401. krEQuitByRenderTime
  402. }AcGiQuitCondition;
  403. /// <summary>
  404. /// Lighting Mode.
  405. /// </summary>
  406. typedef enum
  407. {
  408. /// <summary>
  409. /// Global illumination off.
  410. /// Glossy reflection and refraction off.
  411. /// Simplified strategy for reflections/refractions to reduce noise.
  412. /// The trade off is that reflections and refractions may be less accurate compared to the Basic and Advanced lighting modes.
  413. /// </summary>
  414. krESimplistic = 0,
  415. /// <summary>
  416. /// Global illumination (indirect diffuse lighting) on.
  417. /// Glossy reflection and refraction off.
  418. /// </summary>
  419. krEBasic,
  420. /// <summary>
  421. /// Global illumination (indirect diffuse lighting) on.
  422. /// Glossy reflection and refraction on.
  423. /// </summary>
  424. krEAdvanced
  425. }AcGiLightingMode;
  426. /// <summary>
  427. /// Filter Type.
  428. /// </summary>
  429. typedef enum
  430. {
  431. /// <summary>
  432. /// Box filter type
  433. /// Default size: 1.0
  434. /// </summary>
  435. krEBox = 0,
  436. /// <summary>
  437. /// Triangle filter type
  438. /// Default size: 2.0
  439. /// </summary>
  440. krETriangle,
  441. /// <summary>
  442. /// Gaussian filter type
  443. /// Default size: 3.0
  444. /// </summary>
  445. krEGaussian,
  446. /// <summary>
  447. /// Lanczos filter type
  448. /// Default size: 4.0
  449. /// </summary>
  450. krELanczos,
  451. /// <summary>
  452. /// Mitchell filter type
  453. /// Default size: 4.0
  454. /// </summary>
  455. krEMitchell
  456. }AcGiFilterType;
  457. /// <summary>
  458. /// Abstract interface class that controls all the rendering settings.
  459. /// </summary>
  460. class ACDB_PORT AcGiRapidRTRenderSettingsTraits : public AcGiNonEntityTraits
  461. {
  462. public:
  463. ACRX_DECLARE_MEMBERS(AcGiRapidRTRenderSettingsTraits);
  464. /// <summary>
  465. /// Two general options are provided to control the rendering quality.
  466. /// One is by rendering time, the other by rendering level.
  467. /// For either option, the bigger value set, the better quality we can get, which also means longer rendering time.
  468. /// This function is to set the option.
  469. /// /summary>
  470. /// <param name="quitCondition">Set the quit condition that controls the rendering option, either by time or by level. </param>
  471. /// <returns>void</returns>
  472. virtual void setQuitCondition(AcGiQuitCondition quitCondition) = 0;
  473. /// <summary>Get the quit condition</summary>
  474. /// <returns>Return the quit condition</returns>
  475. virtual AcGiQuitCondition quitCondition() const = 0;
  476. /// <summary>
  477. /// If choosing to use the option of render time to control render quality, we can use this function to set the desired rendering time.
  478. /// </summary>
  479. /// <param name="renderTime">Desired render time to be set, which is by second. The range is from 1 minute to 1440 minutes.</param>
  480. /// <returns>void</returns>
  481. virtual void setDesiredRenderTime(int renderTime) = 0;
  482. /// <summary>Get the desired render time.</summary>
  483. /// <returns>Return the desired render time.</returns>
  484. virtual int desiredRenderTime() const = 0;
  485. /// <summary>If choosing to use the option of render level to control render quality, we can use this function to set the desired rendering level.</summary>
  486. /// <param name="renderLevel">Desired render level to be set. The range is from 1 to 50.</param>
  487. /// <returns>void</returns>
  488. virtual void setDesiredRenderLevel(int renderLevel) = 0;
  489. /// <summary>Get the desired render level.</summary>
  490. /// <returns>Return the desired render level.</returns>
  491. virtual int desiredRenderLevel() const = 0;
  492. /// <summary>
  493. /// Turn on basic lighting or advanced lighting according the lighting mode set.
  494. /// Basic lighting uses ambient occlusion and a simpler model for ambient light and IBL.
  495. /// Advanced lighting uses full global illumination and a more advanced model for ambient light and IBL.
  496. /// </summary>
  497. /// <param name="mode">Desired lighting mode to be set.</param>
  498. /// <returns>void</returns>
  499. virtual void setLightingMode(AcGiLightingMode mode) = 0;
  500. /// <summary>Get the lighting mode being set.</summary>
  501. /// <returns>Return the lighting mode being set.</returns>
  502. virtual AcGiLightingMode lightingMode() const = 0;
  503. /// <summary>
  504. /// Set the filter type applied to the image samples when super sampling. Different filter type favors different filter width / height.
  505. /// </summary>
  506. /// <param name="filterInfo">Filter type to be set.</param>
  507. /// <returns>void</returns>
  508. virtual void setFilterType(AcGiFilterType filterInfo) = 0;
  509. /// <summary>Get the current filter type.</summary>
  510. /// <returns>Return the current filter type.</returns>
  511. virtual AcGiFilterType filterType() const = 0;
  512. /// <summary>
  513. /// Sets the filter width. 1.0 means one pixel (image sample).
  514. /// Recommended default sizes: box = 1.0, triangle = 2.0, Gaussian = 3.0, Lanczos = 4.0, Mitchell = 4.0
  515. /// </summary>
  516. /// <param name="width">Filter width to be set.</param>
  517. /// <returns>void</returns>
  518. virtual void setFilterWidth(float width) = 0;
  519. /// <summary>Get the current filter width.</summary>
  520. /// <returns>Return the current filter width.</returns>
  521. virtual float filterWidth() const = 0;
  522. /// <summary>
  523. /// Sets the filter height. 1.0 means one pixel (image sample).
  524. /// Recommended default sizes: box = 1.0, triangle = 2.0, Gaussian = 3.0, Lanczos = 4.0, Mitchell = 4.0
  525. /// </summary>
  526. /// <param name="height">Filter height to be set.</param>
  527. /// <returns>void</returns>
  528. virtual void setFilterHeight(float height) = 0;
  529. /// <summary>
  530. /// Get the current filter height
  531. /// </summary>
  532. /// <returns>Current filter height</returns>
  533. virtual float filterHeight() const = 0;
  534. };
  535. /// <summary>
  536. /// Container class for all tone operator parameters.
  537. /// </summary>
  538. ///
  539. class ACDB_PORT AcGiToneOperatorParameters : public AcRxObject
  540. {
  541. public:
  542. ACRX_DECLARE_MEMBERS(AcGiToneOperatorParameters);
  543. AcGiToneOperatorParameters();
  544. virtual ~AcGiToneOperatorParameters();
  545. AcGiToneOperatorParameters& operator=(const AcGiToneOperatorParameters& params);
  546. bool operator==(const AcGiToneOperatorParameters& params) const;
  547. /// <summary>
  548. /// Indicates whether or not the tone operator is active.
  549. /// </summary>
  550. ///
  551. /// <param name="active">
  552. /// If true, the tone operator is active.
  553. /// </param>
  554. virtual void setIsActive(bool active);
  555. /// <summary>
  556. /// Is the tone operator active?
  557. /// </summary>
  558. ///
  559. /// <returns>
  560. /// True if the tone operator is active.
  561. /// </returns>
  562. virtual bool isActive() const;
  563. /// <summary>
  564. /// Reserved for future use.
  565. /// </summary>
  566. virtual void setChromaticAdaptation(bool enable);
  567. /// <summary>
  568. /// Reserved for future use.
  569. /// </summary>
  570. virtual bool chromaticAdaptation() const;
  571. /// <summary>
  572. /// Reserved for future use.
  573. /// </summary>
  574. virtual void setColorDifferentiation(bool enable);
  575. /// <summary>
  576. /// Reserved for future use.
  577. /// </summary>
  578. virtual bool colorDifferentiation() const;
  579. /// <summary>
  580. /// Sets the reference white color
  581. /// </summary>
  582. /// <param name="color">Reference White</param>
  583. virtual void setWhiteColor(const AcCmColor& color);
  584. /// <summary>
  585. /// Gets the reference white color
  586. /// </summary>
  587. virtual AcCmColor whiteColor() const;
  588. /// <summary>
  589. /// Specifies if the background should be processed by exposure control at render time.
  590. /// </summary>
  591. ///
  592. /// <param name="processBG">
  593. /// Set to true to enable background processing, otherwise false.
  594. /// </param>
  595. ///
  596. /// <remarks>
  597. /// Only applies if the tone operator is active.
  598. /// </remarks>
  599. virtual void setProcessBackground(bool processBG);
  600. /// <summary>
  601. /// Is background processing enabled?
  602. /// </summary>
  603. ///
  604. /// <returns>
  605. /// True if background processing is enabled.
  606. /// </returns>
  607. ///
  608. /// <remarks>
  609. /// Only applies if the tone operator is active.
  610. /// </remarks>
  611. virtual bool processBackground() const;
  612. /// <summary>
  613. /// Sets the brightness for the tone operator.
  614. /// </summary>
  615. ///
  616. /// <param name="brightness">
  617. /// The brightness for the tone operator.
  618. /// </param>
  619. ///
  620. /// <returns>
  621. /// Returns true if a valid brightness value is passed in.
  622. /// </returns>
  623. ///
  624. /// <remarks>
  625. /// This value only applies if the tone operator is active.
  626. /// </remarks>
  627. virtual bool setBrightness(double brightness);
  628. /// <summary>
  629. /// The brightness for the tone operator.
  630. /// </summary>
  631. ///
  632. /// <returns>
  633. /// The brightness for the tone operator.
  634. /// </returns>
  635. ///
  636. /// <remarks>
  637. /// Only applies if the tone operator is active.
  638. /// </remarks>
  639. virtual double brightness() const;
  640. /// <summary>
  641. /// Sets the contrast for the tone operator.
  642. /// </summary>
  643. ///
  644. /// <param name="contrast">
  645. /// The contrast for the tone operator.
  646. /// </param>
  647. ///
  648. /// <returns>
  649. /// Returns true if a valid contrast value is passed in.
  650. /// </returns>
  651. ///
  652. /// <remarks>
  653. /// This value only applies if the tone operator is active.
  654. /// </remarks>
  655. virtual bool setContrast(double contrast);
  656. /// <summary>
  657. /// The contrast for the tone operator.
  658. /// </summary>
  659. ///
  660. /// <returns>
  661. /// The contrast for the tone operator.
  662. /// </returns>
  663. ///
  664. /// <remarks>
  665. /// Only applies if the tone operator is active.
  666. /// </remarks>
  667. virtual double contrast() const;
  668. /// <summary>
  669. /// Sets the mid tones for the tone operator.
  670. /// </summary>
  671. ///
  672. /// <param name="midTones">
  673. /// The mid tones for the tone operator.
  674. /// </param>
  675. ///
  676. /// <returns>
  677. /// Returns true if a valid midtones value is passed in.
  678. /// </returns>
  679. ///
  680. /// <remarks>
  681. /// This value only applies if the tone operator is active.
  682. /// </remarks>
  683. virtual bool setMidTones(double midTones);
  684. /// <summary>
  685. /// The mid tones for the tone operator.
  686. /// </summary>
  687. ///
  688. /// <returns>
  689. /// The mid tones for the tone operator.
  690. /// </returns>
  691. ///
  692. /// <remarks>
  693. /// Only applies if the tone operator is active.
  694. /// </remarks>
  695. virtual double midTones() const;
  696. /// <summary>
  697. /// The exterior daylight mode.
  698. /// </summary>
  699. enum ExteriorDaylightMode {
  700. /// <summary>
  701. /// Off.
  702. /// </summary>
  703. kDaylightOff = 0,
  704. /// <summary>
  705. /// On.
  706. /// </summary>
  707. kDaylightOn,
  708. /// <summary>
  709. /// Auto - key off of the sun/sky background status.
  710. /// </summary>
  711. kDaylightAuto
  712. };
  713. /// <summary>
  714. /// Indicates whether or not exterior daylight is enabled.
  715. /// </summary>
  716. ///
  717. /// <param name="mode">
  718. /// If kDaylightOff, daylight is disabled. If kDaylightOn, daylight is enabled. If kDaylightAuto, exterior daylight is enabled if a sky background or a sun light is enabled.
  719. /// </param>
  720. ///
  721. /// <returns>
  722. /// Returns true if a valid exterior daylight mode is passed in.
  723. /// </returns>
  724. ///
  725. /// <remarks>
  726. /// This value only applies if the tone operator is active.
  727. /// </remarks>
  728. virtual bool setExteriorDaylight(ExteriorDaylightMode mode);
  729. /// <summary>
  730. /// Is exterior daylight enabled?
  731. /// </summary>
  732. ///
  733. /// <returns>
  734. /// True if exterior daylight is enabled.
  735. /// </returns>
  736. ///
  737. /// <remarks>
  738. /// Only applies if the tone operator is active.
  739. /// </remarks>
  740. virtual ExteriorDaylightMode exteriorDaylight() const;
  741. /// <summary>
  742. /// Copies member data from source object
  743. /// </summary>
  744. ///
  745. /// <returns>
  746. /// Acad::eOk if copy is successful
  747. /// </returns>
  748. virtual Acad::ErrorStatus copyFrom(const AcRxObject* other) override;
  749. private:
  750. bool mbIsActive;
  751. bool mbChromaticAdaptation;
  752. bool mbColorDifferentiation;
  753. AcCmColor mWhiteColor;
  754. bool mbProcessBackground;
  755. double mBrightness;
  756. double mContrast;
  757. double mMidTones;
  758. ExteriorDaylightMode mExteriorDaylight;
  759. };
  760. /// <summary>
  761. /// Container class for all photographic exposure parameters.
  762. /// </summary>
  763. /// <remarks>
  764. /// Properties defined here used by RENDERENGINE=1.
  765. /// Base class properties used by RENDERENGINE=0.
  766. /// </remarks>
  767. class ACDB_PORT AcGiPhotographicExposureParameters : public AcGiToneOperatorParameters
  768. {
  769. public:
  770. ACRX_DECLARE_MEMBERS(AcGiPhotographicExposureParameters);
  771. AcGiPhotographicExposureParameters();
  772. virtual ~AcGiPhotographicExposureParameters();
  773. AcGiPhotographicExposureParameters& operator=(const AcGiPhotographicExposureParameters& params);
  774. bool operator==(const AcGiPhotographicExposureParameters& params) const;
  775. /// <summary>
  776. /// Sets Exposure Value for photographic exposure parameters.
  777. /// This value is a combination of a camera's shutter speed (exposure time) and f-number (depth of field)
  778. /// and determines the amount of motion blur in a scene.
  779. /// </summary>
  780. ///
  781. /// <param name="exposure">
  782. /// Exposure Value for photographic exposure parameters.
  783. /// </param>
  784. bool setExposure(double exposure);
  785. /// <summary>
  786. /// Gets Exposure for photographic exposure parameters.
  787. /// </summary>
  788. ///
  789. /// <returns>
  790. /// Exposure for photographic exposure parameters
  791. /// </returns>
  792. double exposure(void) const;
  793. /// <summary>
  794. /// Sets White Point for photographic exposure parameters in Kelvins
  795. /// Affects the chromaticity of a scene
  796. /// </summary>
  797. ///
  798. /// <param name="whitePoint">
  799. /// Temperature of White Point in Kelvins
  800. /// </param>
  801. bool setWhitePoint(double whitePoint);
  802. /// <summary>
  803. /// Gets White Point for photographic exposure parameters
  804. /// </summary>
  805. ///
  806. /// <returns>
  807. /// Temperature of White Point in Kelvins
  808. /// </returns>
  809. double whitePoint(void) const;
  810. /// <summary>
  811. /// Calculates and returns a RGB approximation of the White Point (using CIE 1964 10 degree)
  812. /// </summary>
  813. /// <returns>Approximated RGB color to White Point</returns>
  814. AcCmColor whitePointToColor(void) const;
  815. /// <summary>
  816. /// Sets exact brightness and updates exposure calculated from brightness
  817. /// </summary>
  818. virtual bool setBrightness (double) override;
  819. /// <summary>
  820. /// Copies member data from source object
  821. /// </summary>
  822. ///
  823. /// <returns>
  824. /// Acad::eOk if copy is successful
  825. /// </returns>
  826. virtual Acad::ErrorStatus copyFrom (const AcRxObject*) override;
  827. public:
  828. /// <summary>
  829. /// Converts EV to a calibrated Brightness value
  830. /// </summary>
  831. /// <param name="exp">Exposure Value</param>
  832. /// <returns>Brightness value</returns>
  833. static double convertExposureToBrightness (double exp);
  834. /// <summary>
  835. /// Converts Brightness value to EV
  836. /// </summary>
  837. /// <param name="brt">Brightness Value</param>
  838. /// <returns>Exposure value</returns>
  839. static double convertBrightnessToExposure (double brt);
  840. private:
  841. double mExposure;
  842. double mWhitePoint;
  843. };
  844. #pragma pack (pop)