/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #ifndef _ODTV_GSDEVICE_H_INCLUDED_ #define _ODTV_GSDEVICE_H_INCLUDED_ #include "Tv.h" #include "TvIObject.h" #include "TvGsView.h" #include "TvUserData.h" #include "Gi/GiRasterImage.h" #include "TvHighlightStyle.h" class OdTvGsDeviceId; /** \details A data type that represents a window handle. */ typedef void* OSWindowHandle; /** \details A data type that represents a window GL context. */ typedef void* OSWindowGLContext; /** \details This class is a functor used by OdTvGsDevice for checking whether the vectorization process should be aborted. */ class ODTV_EXPORT OdTvRegenAbort { public: /** \details Checks whether the vectorization process should be aborted. \returns Returns true if and only if the vectorization process should be aborted. */ virtual bool regenAbort() const = 0; /** \details Application operator. \returns Returns true if and only if the vectorization process should be aborted. */ bool operator()() const { return regenAbort(); } }; /** \details This class is an interface for the custom Partial Viewing objects priority calculation. \remarks Implementation has to be thread-safe. */ class ODTV_EXPORT OdTvObjectPriorityCalculator { public: /** \details Retrives the object priority. \param viewId [in] View that is processed. \param extents [in] Object extents. \param objectHandle [in] Object handle. \returns A float value that contains the object's priority value. \remarks The viewId parameter can be empty. */ virtual float getPriority( OdTvGsViewId viewId, const OdGeExtents3d& extents, OdUInt64 objectHandle ) = 0; }; /** \details This class is an interface for the object that encapsulates GUI display windows. \remarks OdTvGsDevice objects own, update, and refresh one or more 'OdTvGsView' objects. In addition, they respond to operating system notifications, such as a window resize, forwarded by the graphics system client. \sa */ class ODTV_EXPORT OdTvGsDevice : public OdTvHandledIObject { public: /** \details Defines the device names. */ enum Name { kOpenGLES2 = 0, // OpenGL ES2 device. kOpenGL = 1, // OpenGL device. kBitmap = 2, // Bitmap device. kDirectX = 3, // DirectX device (Windows only). kGDI = 4, // GDI device (Windows only). kMetal = 5, // Metal device (MacOS/iOS only). kCustom = 6 // Any custom device. }; /** \details Defines the get/set properties for a device object. \sa */ enum Options { kBadOption = -1, // Bad (invalid) option. // Common options kDoubleBufferEnabled = 0, // Boolean value. The option enables an additional intermediate off-screen buffer to avoid a blinking effect during on-screen rendering. kBlocksCache = 1, // Boolean value. The option enables caching of a hierarchical block structure. kEnableMultithread = 2, // Boolean value. The option enables multithreading. kMaxRegenThreads = 3, // Int value. This property can be used to specify the number of threads for multithread vectorization. kEnableSoftwareHLR = 4, // Boolean value. 2D vectorization devices support HiddenLine rendering mode using the software hidden lines removal algorithm. // This property enables vectorization of viewports with HiddenLine rendering mode using its algorithm. kDiscardBackFaces = 5, // Boolean value. This property enables back-face culling. kUseTTFCache = 6, // Boolean value. TrueType fonts cache is useful for rendering drawings that contain a lot of text. // If TrueType fonts cache is enabled, each font character used inside the drawing is cached as a separate metafile. kUseDynamicSubEntHlt = 7, // Boolean value. The subentity highlighting mode enables the ability to cache geometry markers for entity geometry parts. kForcePartialUpdate = 8, // Boolean value. Off-screen vectorization devices disable partial update mode. This property can be used to turn on partial update mode in this case. // Forcing of partial update is useful for tests, and in the case of multithread vectorization it is necessary for off-screen rendering. kClearScreen = 9, // Boolean value. This property can be set to "false" to prevent surface filling by the background color. kRegenCoef = 10, // Double value (read only). An application can use this device property to detect if truncation (64-bit floating to 32-bit floating) // takes place and initiate geometry regeneration. The truncation coefficient is returned in pixels. kUseLutPalette = 11, // Int value. Sets bit flags that instruct a vectorization device how to process raster images with a palette. //GLES2 and OpenGL specific options kUseVisualStyles = 12, // Boolean value. The option enables the usage of visual styles during vectorization and rendering processes. // If visual styles usage is disabled, the renderer uses the Render Mode setting instead. kUseOverlayBuffers = 13, // Boolean value. The option enables the usage of overlay buffers during rendering processes. kAlternativeHlt = 14, // UInt value. Sets bit flags that set a highlighting mode. kAlternativeHltColor = 15, // UInt value. Sets bit flags that set a highlighting color. kUseSceneGraph = 16, // Boolean value. Sets bit flags that set using a scene graph. kUseCompositeMetafiles = 17, // Boolean value. Sets bit flags that set using composite metafiles. kGeometryShaderUsage = 18, // Boolean value. Sets bit flags that set using geometry shaders. kCreateGLContext = 19, // Boolean value. Set to 'false' to set using an externally created current GL context. kBlendingMode = 20, // Int value. Blending Mode value. kDelaySceneGraphProc = 21, // Boolean value. Indicates that it is need to delay the processing of the scene graph until this flag will be changed to false. Default value - false. kAntiAliasLevel = 22, // Double value. Anti-aliasing level. kAntiAliasLevelExt = 23, // Double value. Anti-aliasing level multiplier. kAntiAliasHltLevelExt = 24, // Double value. Anti-aliasing hightlight level multiplier. kShadowsRenderMode = 25, //UInt value. Sets bit flags that enables/disables shadow generation features kVsmShadowsAmount = 26, //Double value. Gives the ability to minimize the light-bleeding effect caused by edges of occlusion objects displaced a large length from other occlusion objects inside a scene. kShadowMapSoftnessOverride = 27, //UInt value. Overrides light softness property. kShadowMapSizeOverride = 28, //UInt value. Overrides light shadow map size property. kFXAAEnable = 29, // Boolean value. Sets bit flags that set FXAA enabled. Ignored when kSMAAEnable option is true kAAQuality = 30, // UInt value. Overrides AA quality property. From 0 to 5 for FXAA, from 0 to 3 for SMAA kAA2dEnable = 31, // Boolean value. Sets bit flags that set FXAA or SMAA for 2d enabled. kSSAOEnable = 32, // Boolean value. Sets bit flags that set using SSAO. kSSAOLoops = 33, // Int value. SSAO loops value. kSSAORadius = 34, // Double value. SSAO radius value. In the case of 'kSSAODynamicRadius = false', the right way is to make it dependent from the models extents. kSSAOPower = 35, // Double value. SSAO power value. kSSAOBlurRadius = 36, // Int value. SSAO blur radius value. kUseGPUSelection = 37, // Boolean value. Enables GPU selection kSceneGraphCachesMode = 38, // UInt value. Sets Block and TTF caches supporting mode for the Scene Graph //( 0 - none; 1 - Support Block Cache; 2 - Support TTF Cache; 3 - Support both ) (only GLES2). kSSAODynamicRadius = 39, // Boolean value. Sets a bit flag that enables SSAO dynamic radius computation. Is 'On' by default. kD3DSurface = 40, // OdIntPtr value. D3DSurface value. Only for DirectX device. kSMAAEnable = 41, // Boolean value. Sets a bit flag that enables SMAA. kTextAAEnable = 42, // Boolean value. Enables antialiasing for text. Required kUseTTFCache. Also regeneration is required when changed. kTextAAClearTypeEnable = 43, // Boolean value. Enables ClearType effect for text antialiasing kTextAANumSamples = 44, // UInt value. Controls a number of samples in fragment shader for textAA. Default is 16 (16x16 samples) kTextAATextureSize = 45, // UInt value. Texture size for character in textAA. Default is 64 (64x64 texture) kTextAAAdditionalThickness = 46, // UInt value. Additional thickness for character in pixels in textAA. Default is 0, maximum is 64 kLightSourcesLimit = 47, // UInt value. Limit of light sources used in the graphic scene. kForceOffscreenSceneGraph = 48, // Boolean value. This property can be used to enable work of Scene Graph without ForcePartialUpdate. Bitmap GLES2 device only. kSceneGraphPurgeGrouppedRenders = 49, // Boolean value. This property allows to control ability to purge internal scene graph data after unionizing (only GLES2 and Metal). // It is better to set this option before initial vectorization, in other cases the result can be undefined. kDegradationLevel = 50, // UInt value. Set of flags from OdTrRndDegradationMask enumration controls visibility of most expensive rendering properties. kAsyncReadback = 51, // UInt value. Sets async readback mode for the devices which was setuped to render to the bitmap (buffer). Allow to enable double buffer with Pixel Buffer Object. //( 0 - Double Buffer and PBO disabled; 1 - Support Double Buffer; 2 - Support Double Buffer and PBO; ) (only GLES2). kRendererDriverInfo = 52, // OdAnsiString value. Returns renderer version, driver vendor and additional render driver information for current vectorization module. // The completeness of information may differ for different vectorization modules. OpenGL only. kBlockInstancing = 53, // Boolean value. Enables blocks instancing. Makes sense if kBlocksCache os ON kLineweightOptimization = 54, // UInt value. 1 bit - The renderer uses hardware optimizations for rendering point primitives with lineweights. // 2 bit - The renderer uses hardware optimizations for rendering line primitives with lineweights. // 3 bit - Uses a lineweight cache. // 4 bit - Invokes a lineweight cache and processes it prior to geometry shader optimization. // Default: 3 (OpenGL), 5 (GLES2) kLineweightDepthOffset = 55, // Boolean value. Typically lineweight primitives are drawn as planar surfaces in screen space. // This property adds a depth offset to planar surfaces, and as a result, they are drawn as halves of a tube. // This mode (if hardware supports the required functionality) improves rendering and removes artifacts of silhouettes // and geometry edges that overlap geometry faces. kAALineWidth = 56, // Double value. Anti-aliasing line width. Value > 0 switches ON a special AA for the edges in 3D. Best range [0.25; 2]. //Metal specific options kMetalShaderLibraryFullFileName = 57, // String value. String with a full filename (including path) for the Metal shader library kMinimalBlockInstancingRefs = 58, // UInt32 value. Defines the minimum number of block references required to treat a block as instantiable. // Default: 2. Valid range: 2-1024. Only affects blocks instancing when kBlockInstancing is enabled. kOptionCount // The number of GS device options. }; /** \details Highlight modes for a device object. \sa */ enum HltMode { kHltStippleMode = 0, // A stipple mode highlight. kHltColorMode = 1 // A color mode highlight. }; /** \details Defines the regeneration options for a device object. \sa Redrawing Content of a Device */ enum RegenMode { kRegenAll = 0, // Regenerate all. kRegenVisible = 1 // Regenerate only visible. }; /** \details Lineweight styles. \sa Managing Lineweight Configurations */ enum LineWeightStyle { kPointLineWeight = 0, // Point lineweight style. kLineCapStyle = 1, // Line cap style. kLineJoinStyle = 2 // Line join style. }; /** \details Line end styles. \sa Managing Lineweight Configurations */ enum LineEndStyle { kLesButt = 0, // The line ends with a butt. kLesSquare = 1, // The line ends with a square. kLesRound = 2, // The line ends with an arc of a circle with the diameter equal to the line width. kLesDiamond = 3, // The line ends with a diamond. kLesUseObject = 4 // The line ends with a specified object. }; /** \details Line joining styles. \sa Managing Lineweight Configurations */ enum LineJoinStyle { kLjsMiter = 0, // Lines are joined with miters. kLjsBevel = 1, // Lines are joined with caps. kLjsRound = 2, // An arc of a circle with the diameter equal to the line width is displayed at the place where two lines are joined. kLjsDiamond = 3, // Lines are joined with a diamond. kLjsUseObject = 5 // Lines are joined with a specified object. }; /** \details TTF Draw mode. */ enum TTFDrawMode { /** Curves inside TrueType fonts are tessellated by default, so characters are drawn as simple shell primitives with a constant number of vertices. */ kConstant = 0, /** Bezier curve information is additionally passed to the geometry conveyor. This mode can increase or decrease text rendering quality depending on zoom level. Currently supported only for desktop Windows operating systems. */ kDynamic = 1 }; /** \details This class is a functor used by OdTvGsDevice for informing that there is new vectorized data which means that an update call should be performed. \remarks Currenly used (if set) for the RCS point cloud geometry primitives. Typical reaction for this callback at the application side is to run window repainting. Take into account that callback can be called from underlying background threads, meaning that it may be required to send the repaint events into main application thread for some windows management systems. */ class UpdateCallback { public: /** \details Performs an update. \param pDeviceId [in] A pointer to an of the . */ virtual void updateRequest(OdTvGsDeviceId* pDeviceId) = 0; }; /**\details This class represents a background process callback. \remarks If a process works in background mode, callback methods are called from the child thread. */ class OdTvBackgroundProcessCallback { public: /**\details This method is called when the background process starts. */ virtual void onBackgroundProcessBegins() = 0; /**\details Defines background process final states. */ enum class BackgroundProcessEndState { kFinished, //The process completed successfully, but there is still unloaded data. kInterrupted, //The process was interrupted. kAllLoaded //The process completed successfully, all data is loaded. }; /**\details This method is called when the background process ends. \param endState [in] A flag that indicates final process state. */ virtual void onBackgroundProcessEnds( BackgroundProcessEndState endState ) = 0; /**\details Retrives number of objects being processed to cause "objects processed" notification. */ virtual OdUInt32 processedObjectsNotificationStep() const { return 0; } /**\details This method is called when background process processes specified number of objects. \param nObjects [in] Total number of processed objects. */ virtual void onObjectsProcessed( OdUInt64 /*nObjects*/ ) {} }; /** \details This structure is used for setup parameters for interactivity (fixed frame rate) mode. */ struct InteractivityOptions { enum Options { kDisableMaterials = 1 << 0, // Disable materials kDisableVisalStyleOverrides = 1 << 1, // Disable visual style overrides kDisableFillPatterns = 1 << 2, // Disable fill patterns kUsePBOForBitmap = 1 << 3, // Use pixel buffer object (only for GLES2 device which was setuped to render to the bitmap(buffer) kDisplayPostEffects = 1 << 4 //Display post-effects like section filling or blending in Interactivity mode }; OdUInt8 m_flags; // Options for interactivity mode double m_dFFRFpsValue; // Fixed frame rate FPS value for interactivity mode /** \details Empty constructor for interactivity options. */ InteractivityOptions() : m_flags(0), m_dFFRFpsValue(15.) { }; /** \details Constructor with parameters for interactivity options. \param flags [in] A combintation of flags from 'InteractivityOptions::Options' \param frameRateInHz [in] A frame rate value (FPS). */ InteractivityOptions(OdUInt8 flags, double frameRateInHz) : m_flags(flags), m_dFFRFpsValue(frameRateInHz) { }; /** \details Sets a new value of the flag, which determines whether it is need to disable materials in interactivity mode. \param bValue [in] New value of the flag */ void setDisableMaterials(bool bValue) { SETBIT(m_flags, kDisableMaterials, bValue); }; /** \details Sets a new value of the flag, which determines whether it is need to disable visual style overrides in interactivity mode. \param bValue [in] New value of the flag */ void setDisableVisualStyleOverrides(bool bValue) { SETBIT(m_flags, kDisableVisalStyleOverrides, bValue); }; /** \details Sets a new value of the flag, which determines whether it is need to disable fill patterns in interactivity mode. \param bValue [in] New value of the flag */ void setDisableFillPatterns(bool bValue) { SETBIT(m_flags, kDisableFillPatterns, bValue); }; /** \details Sets a new value of the flag, which determines whether it is need to use PBO (pixel buffer object) for the devices, which was setuped to render to the bitmap (buffer). GLES2 only \param bValue [in] New value of the flag */ void setUsePBOForBitmap(bool bValue) { SETBIT(m_flags, kUsePBOForBitmap, bValue); }; /** \details Sets a new value of the flag, which determines whether post effects like sectioning or blending have to be displayed even if rendering loop was interrupted. GLES2 only. \param bValue [in] New value of the flag */ void setDisplayPostEffects( bool bValue ) { SETBIT( m_flags, kDisplayPostEffects, bValue ); } /** \details Sets a new value for the frame rate. \param frameRateInHz [in] A frame rate value (FPS). */ void setFFRFpsValue(double frameRateInHz) { m_dFFRFpsValue = frameRateInHz; }; /** \details Retrieves the current value of the flag, which determines whether it is need to disable materials in interactivity mode. \returns The current value of the flag, which determines whether it is need to disable materials in interactivity mode. */ bool getDisableMaterials() const { return GETBIT(m_flags, kDisableMaterials); }; /** \details Retrieves the current value of the flag, which determines whether it is need to disable visual style overrides in interactivity mode. \returns The current value of the flag, which determines whether it is need to disable visual style overrides in interactivity mode. */ bool getDisableVisualStyleOverrides() const { return GETBIT(m_flags, kDisableVisalStyleOverrides); }; /** \details Retrieves the current value of the flag, which determines whether it is need to disable fill patterns in interactivity mode. \returns The current value of the flag, which determines whether it is need to disable fill patterns in interactivity mode. */ bool getDisableFillPatterns() const { return GETBIT(m_flags, kDisableFillPatterns); }; /** \details Retrieves the current value of the flag, which determines whether it is need to use PBO (pixel buffer object) for the devices, which was setuped to render to the bitmap (buffer). GLES2 only \returns The current value of the flag, which determines whether it is need to use PBO (pixel buffer object) for the devices, which was setuped to render to the bitmap (buffer). GLES2 only */ bool getUsePBOForBitmap() const { return GETBIT(m_flags, kUsePBOForBitmap); }; /** \details Retrieves the current value of the flag, which determines whether post effects like sectioning or blending have to be displayed even if rendering loop was interrupted. GLES2 only. \returns The current value of the flag, which determines whether post effects like sectioning or blending have to be displayed even if rendering loop was interrupted. GLES2 only. */ bool getDisplayPostEffects() const { return GETBIT( m_flags, kDisplayPostEffects ); } /** \details Retrieves the current value of the frame rate. \returns The current value of the frame rate. */ double getFFRFpsValue() const { return m_dFFRFpsValue; }; /** \details Compares two interactivity options on unequality. \param opt [in] Another interactivity option object for comparing. \returns true if the options are not equal, otherwise returns false. */ bool operator!=(const InteractivityOptions& opt) { if (m_flags != opt.m_flags || m_dFFRFpsValue != opt.m_dFFRFpsValue) return true; return false; } /** \details Compares two interactivity options on equality. \param opt [in] Another interactivity option object for comparing. \returns true if the options are equal, otherwise returns false. */ bool operator==(const InteractivityOptions& opt) { return !(*this != opt); } }; /** \details Retrieves the current name of the GS device. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The current name of the GS device. \remarks If the rc parameter is not null and the GS device name was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. */ virtual OdTvGsDevice::Name getGsDeviceName(OdTvResult* rc = NULL) = 0; /** \details Sets a new name for the device. \param sName [in] A string that contains the new name. \returns A value of the type that contains the result of renaming. \remarks If the new name was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult setName(const OdString& sName) = 0; /** \details Retrieves the current name of the device. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The current name of the device. \remarks If the rc parameter is not null and the device name was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. */ virtual OdString getName(OdTvResult* rc = NULL) const = 0; /** \details Retrieves the current value of the bitmap flag for the device. The bitmap flag determines whether the device is a bitmap device. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the device is a bitmap device, otherwise returns false. \remarks If the rc parameter is not null and the bitmap flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. */ virtual bool isBitmap(OdTvResult* rc = NULL) const = 0; /** \details Allows to switch "non-setup" device to/from the bitmap mode \returns A value of the type that contains the result of setting up the device. \remarks If the device was successfully switch to/from bitmap mode, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult switchBitmapState() = 0; /** \details Sets up the device object if it was created as "non-setup." Otherwise does nothing. \param wnd_handle [in] An operating system window handle. \param wndRect [in] A window rectangle. \param device [in] A device name (GLES2, OpenGL, etc.). \param strVectorizerName [in] A path to the custom device module (used only when the device name is equal to the kCustom value). \returns A value of the type that contains the result of setting up the device. \remarks If the device was successfully set up, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Setting and Unloading Device Vectorizers */ virtual OdTvResult setupGs(OSWindowHandle wnd_handle, const OdTvDCRect &wndRect, OdTvGsDevice::Name device, OdString* strVectorizerName = 0) = 0; #ifdef __linux__ /** \details Sets up the device object if it was created as "non-setup." Otherwise does nothing. \param wnd_handle [in] An operating system window handle. \param xdisp_handle [in] An operating system display handle. \param wndRect [in] A window rectangle. \param device [in] A device name (GLES2, OpenGL, etc.). \param strVectorizerName [in] A path to the custom device module (used only when the device name is equal to the kCustom value). \returns Returns a value of type that contains the result of setting up the device. \remarks If the device was successfully set up, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Setting and Unloading Device Vectorizers */ virtual OdTvResult setupGs(OSWindowHandle wnd_handle, void* xdisp_handle, const OdTvDCRect &wndRect, OdTvGsDevice::Name device, OdString* strVectorizerName = 0) = 0; #endif // __linux__ /** \details Sets up the device object if it was created as "non-setup." Otherwise does nothing. \param wnd_context [in] An operating system window GL context object. \param wndRect [in] A window rectangle. \param device [in] A device name (GLES2, OpenGL, etc.). \param strVectorizerName [in] A path to the custom device module (used only when the device name is equal to the kCustom value). \returns A value of the type that contains the result of setting up the device. \remarks If the device was successfully set up, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Setting and Unloading Device Vectorizers */ virtual OdTvResult setupGsWithContext(OSWindowGLContext wnd_context, const OdTvDCRect &wndRect, OdTvGsDevice::Name device, OdString* strVectorizerName = 0) = 0; #ifdef ODA_WINDOWS /** \details Sets up the device object if it was created as "non-setup." Otherwise does nothing. \param HDC [in] A Windows device context.. \param wndRect [in] A window rectangle. \param device [in] A device name (GLES2, OpenGL, etc.). \param strVectorizerName [in] A path to the custom device module (used only when the device name is equal to the kCustom value). \returns A value of the type that contains the result of setting up the device. \remarks If the device was successfully set up, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Setting and Unloading Device Vectorizers */ virtual OdTvResult setupGsWithHDC(void* HDC, const OdTvDCRect& wndRect, OdTvGsDevice::Name device, OdString* strVectorizerName = 0) = 0; #endif // ODA_WINDOWS /** \details Sets up the device object if it was created as "non-setup." Otherwise does nothing. \param x [in] The output image dimension along the X-axis. \param y [in] The output image dimension along the Y-axis. \param device [in] A device name (GLES2, OpenGL, etc.). \param strVectorizerName [in] A path to the custom device module (used only when the device name is equal to the kCustom value). \returns A value of the type that contains the result of setting up the device. \remarks If the device was successfully set up, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Setting and Unloading Device Vectorizers */ virtual OdTvResult setupGsBitmap(long x, long y, OdTvGsDevice::Name device, OdString* strVectorizerName = 0) = 0; /** \details Retrieves the current value of the GS load flag for the device. The GS load flag determines whether the GS part (vectorizer) for the device object is loaded. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the GS load part of the device is loaded, otherwise returns false. \remarks If the rc parameter is not null and the GS load flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Setting and Unloading Device Vectorizers */ virtual bool isGsLoaded(OdTvResult* rc = NULL) = 0; /** \details Unloads the GS part (vectorizer) of the device. \returns A value of the type that contains the result of unloading. \remarks If the GS part of the device was successfully unloaded, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Setting and Unloading Device Vectorizers */ virtual OdTvResult unloadGs() = 0; /** \details Retrieves the current raster image object of the device. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns A smart pointer to an OdGiRasterImage object that represents a raster image. \remarks If the rc parameter is not null and the raster image object was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. The method works correctly only for a bitmap device that was previously set. \sa */ virtual OdGiRasterImagePtr getRasterImage(OdTvResult* rc = NULL) = 0; /** \details Marks for refresh the GUI window related to the device. \returns A value of the type that contains the result of the operation. \remarks If the GUI window was successfully marked for refresh, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Redrawing Content of a Device */ virtual OdTvResult invalidate() = 0; /** \details Marks for refresh a specified region of the GUI window related to the device. \param screenRect [in] A rectangle that specifies the window region to be refreshed. \returns A value of the type that contains the result of the operation. \remarks If the GUI window region was successfully marked for refresh, the method returns the tvOk value; otherwise it returns an appropriate error code. If the window region (parameter screenRect value) is not specified, the whole GUI window is marked for refresh. \sa Redrawing Content of a Device */ virtual OdTvResult invalidate(const OdTvDCRect &screenRect) = 0; /** \details Retrieves whether the device GUI window shows a correct image. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The current value of the correct image flag. The correct image flag determines whether the device GUI window shows a correct raster image (if true) or not (if false). \remarks The correct image flag is equal to true when the following conditions are met: * No part of the GUI window area is flagged for refresh. * All rasterization processes are complete. * The rendering pipeline has been flushed. If the rc parameter is not null and the device GUI window displays a correct raster image, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. */ virtual bool isValid(OdTvResult* rc = NULL) const = 0; /** \details Updates the GUI window (or its region) associated with the device object. \param pUpdatedRect [in] A pointer to the rectangle object that represents the window region to be updated. \param bSkipPartialRequest [in] A partial viewing flag value. If equal to true, partial viewing is disabled during the method call. \returns A value of the type that contains the result of the update operation. \remarks The method affects all OdGsView objects owned by the device object, and so it displays the correct image on the GUI window (or its region). If the pointer to a window region (the pUpdatedRect parameter value) is NULL, the whole window is updated. If the GUI window (or its region) was successfully updated, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Redrawing Content of a Device */ virtual OdTvResult update(OdTvDCRect* pUpdatedRect = 0, bool bSkipPartialRequest = false) = 0; /** \details The handler for the resize event for a GUI window associated with the device object. The method is called whenever the size of the GUI window is changed. \param outputRect [in] A new size of the output rectangle in device coordinates (pixels). \returns A value of the type that contains the result of the resize event processing. \remarks If the resize event was successfully processed, the method returns the tvOk value; otherwise it returns an appropriate error code. This method should not be called if the device object has zero width and (or) height. \sa Redrawing Content of a Device */ virtual OdTvResult onSize(const OdTvDCRect& outputRect) = 0; /** \details Retrieves the device output rectangle. The method fills the passed rectangle object with the data of the device output rectangle and returns it to a calling subroutine. \param outputRect [out] A placeholder for the device's output rectangle object. Size of the rectangle is represented in the device coordinates (pixels). \returns A value of the type that contains the result of the operation. \remarks If the device output rectangle was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult getSize(OdTvDCRect& outputRect) const = 0; /** \details Regenerates the contents of the device object according to the specified regeneration mode. \param regenMode [in] A regeneration mode value. \returns A value of the type that contains the result of the regeneration. \remarks If the device content was successfully regenerated, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Redrawing Content of a Device */ virtual OdTvResult regen(RegenMode regenMode) = 0; /** \details The handler for the display settings change event for the device object. The method is called whenever the operating system screen resolution and (or) color depth are changed. \param bitsPerPixel [in] A new screen color depth. \param xPixels [in] A new screen resolution along the X-axis (in pixels). \param yPixels [in] A new screen resolution along the Y-axis (in pixels). \returns A value of the type that contains the result of the event processing. \remarks If the event was successfully processed, the method returns the tvOk value; otherwise it returns an appropriate error code. This method is called after the display settings are changed. \sa Redrawing Content of a Device */ virtual OdTvResult onDisplayChange(int bitsPerPixel, int xPixels, int yPixels) = 0; /** \details Creates a new view represented with an object and associates it with the device object. \param name [in] A string that contains the view name. \param bNeedSaveInFile [in] A flag that defines whether the information about the created view object is stored in a file (true by default). \param rc [out] A pointer to a value of the type that contains the result of the view object creation. \returns The identifier of the newly created view object. \remarks The name is an arbitrary non-empty string that can contain letters, digits, blank spaces, underscores, and some special characters, but cannot contain inadmissible letters ("<", ">", "\", "/", ":", ";", "?", ",", "*", "|", "=", "'"), quotation marks and special characters created with Unicode fonts). If the device is "non-setup," the created view also becomes a "non-setup" view and only a few methods can be called: * * * Any other method returns an error. If the rc parameter is not null and a new view object was successfully created, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Managing Views */ virtual OdTvGsViewId createView(const OdString& name, bool bNeedSaveInFile = true, OdTvResult* rc = NULL) = 0; /** \details Inserts a specified view object to the tail of the device's view object collection. \param viewId [in] An identifier of a view object represented with an object. \returns A value of the type that contains the result of adding a view to the device. \remarks If the new view object was successfully added to the device, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing Views */ virtual OdTvResult addView(const OdTvGsViewId& viewId) = 0; /** \details Inserts a specified view object to a specified position of the device's view object collection. \param viewIndex [in] An index of the device's view object collection that specifies the position for the newly inserted view. \param viewId [in] An identifier of a view object represented with an object. \returns A value of the type that contains the result of adding a view to the device. \remarks If the new view object was successfully added to the device, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing Views */ virtual OdTvResult insertView(int viewIndex, const OdTvGsViewId& viewId) = 0; /** \details Removes a specified view object from the device's view object collection and erases the view object itself. \param viewId [in] An identifier of a view object represented with an object. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the view object is successfully removed from the device and destroyed, otherwise returns false. \remarks If the rc parameter is not null and the view is successfully removed from the device and destroyed, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Managing Views */ virtual bool eraseView(const OdTvGsViewId& viewId, OdTvResult* rc = NULL) = 0; /** \details Removes a view object from the specified position of the device's view object collection and erases the view object itself. \param viewIndex [in] An index of the device's view object collection that specifies the position of the view to be removed and destroyed. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the view object is successfully removed from the device and destroyed, otherwise returns false. \remarks If the rc parameter is not null and the view is successfully removed from the device and destroyed, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Managing Views */ virtual bool eraseView(int viewIndex, OdTvResult* rc = NULL) = 0; /** \details Removes a specified view object from the device's view object collection. \param viewId [in] An identifier of a view object represented with an object. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the view object is successfully removed from the device, otherwise returns false. \remarks If the rc parameter is not null and the view is successfully removed from the device, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Managing Views */ virtual bool removeView(const OdTvGsViewId& viewId, OdTvResult* rc = NULL) = 0; /** \details Removes all views from the device and erases them. \returns A value of the type that contains the result of erasing views. \remarks If all views were successfully removed from the device and destroyed, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing Views */ virtual OdTvResult eraseAllViews() = 0; /** \details Retrieves the quantity of view objects associated with the device. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The number of views associated with the device object. \remarks If the rc parameter is not null and the view quantity was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Managing Views */ virtual int numViews(OdTvResult* rc = NULL) const = 0; /** \details Retrieves the view object located at a specified position in the list of views associated with the device. \param viewIndex [in] A position in the list of views associated with the device. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The identifier of the view object. \remarks If the view object was found and its identifier was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing Views */ virtual OdTvGsViewId viewAt(int viewIndex, OdTvResult* rc = NULL) = 0; /** \details Retrieves the view object located at a specified screen position. \param screenPoint [in] A screen position represented with a two-dimensional point in the device coordinate space. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The identifier of the view object. \remarks If the view object was found and its identifier was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing Views */ virtual OdTvGsViewId viewAt(const OdTvPoint2d &screenPoint, OdTvResult* rc = NULL) = 0; /** \details Retrieves the active view of the device object. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The identifier of the active view object. \remarks If there is no active view, the method returns the first view object associated with the device. If the view object was found and its identifier was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing Views */ virtual OdTvGsViewId getActiveView(OdTvResult* rc = NULL) = 0; /** \details Sets a new background color for the GUI window associated with the device object. \param backgroundColor [in] A new background color value. \returns A value of the type that contains the result of setting a new background color. \remarks If a new background color was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing a Background Color */ virtual OdTvResult setBackgroundColor(ODCOLORREF backgroundColor) = 0; /** \details Retrieves the current background color value for the GUI window associated with the device object. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The background color of the GUI window associated with the device object. \remarks If the rc parameter is not null and the background color value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Managing a Background Color */ virtual ODCOLORREF getBackgroundColor(OdTvResult* rc = NULL) = 0; /** \details Sets a new logical palette for the device object. \param logicalPalette [in] A pointer to the color definitions that form the logical palette. \param numColors [in] A quantity of colors in the palette. \returns A value of the type that contains the result of setting the palette. \remarks If the new palette was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. The logical palette is used when index colors are used. \sa Managing a Logical Palette */ virtual OdTvResult setLogicalPalette(const ODCOLORREF* logicalPalette, int numColors) = 0; /** \details Retrieves the current logical palette used by the device object. \param numColors [out] A placeholder for storing and returning the quantity of colors in the palette. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns A pointer to the color definitions array that represents the current logical palette. \remarks If the rc parameter is not null and the logical palette was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. The logical palette can be retrieved when index colors are used. \sa Managing a Logical Palette */ virtual const ODCOLORREF* getLogicalPalette(int &numColors, OdTvResult* rc = NULL) const = 0; /** \details Sets a boolean value of the device. \param opt [in] A property to be set. \param bVal [in] A boolean value of the property. \returns A value of the type that contains the result of setting a value for the property. \remarks If the new property value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa */ virtual OdTvResult setOption(Options opt, bool bVal) = 0; /** \details Sets a 16-bit integer value of the device. \param opt [in] A property to be set. \param nVal [in] An integer value of the property. \returns A value of the type that contains the result of setting a value for the property. \remarks If the new property value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa */ virtual OdTvResult setOption(Options opt, OdInt16 nVal) = 0; /** \details Sets a 32-bit integer value of the device. \param opt [in] A property to be set. \param nVal [in] An integer value of the property. \returns A value of the type that contains the result of setting a value for the property. \remarks If the new property value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa */ virtual OdTvResult setOption(Options opt, OdInt32 nVal) = 0; /** \details Sets a double value of the device. \param opt [in] A property to be set. \param dVal [in] A double value of the property. \returns A value of the type that contains the result of setting a value for the property. \remarks If the new property value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa */ virtual OdTvResult setOption(Options opt, double dVal) = 0; /** \details Sets a 32-bit unsigned integer value of the device. \param opt [in] A property to be set. \param nVal [in] An unsigned integer value of the property. \returns A value of the type that contains the result of setting a value for the property. \remarks If the new property value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa */ virtual OdTvResult setOption(Options opt, OdUInt32 nVal) = 0; /** \details Sets a string value of the device. \param opt [in] A property to be set. \param strVal [in] A string value of the property. \returns A value of the type that contains the result of setting a value for the property. \remarks If the new property value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa */ virtual OdTvResult setOption(Options opt, const OdString& strVal) = 0; /** \details Retrieves the current value of a boolean device . \param opt [in] A property with a value to be retrieved. \param bVal [out] A placeholder for the boolean device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, bool& bVal) = 0; /** \details Retrieves the current value of a 16-bit integer device . \param opt [in] A property with a value to be retrieved. \param nVal [out] A placeholder for the integer device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, OdInt16& nVal) = 0; /** \details Retrieves the current value of a 32-bit integer device . \param opt [in] A property with a value to be retrieved. \param nVal [out] A placeholder for the integer device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, OdInt32& nVal) = 0; /** \details Retrieves the current value of a double device . \param opt [in] A property with a value to be retrieved. \param dVal [out] A placeholder for the double device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, double& dVal) = 0; /** \details Retrieves the current value of a 32-bit unsigned integer device . \param opt [in] A property with a value to be retrieved. \param nVal [out] A placeholder for the unsigned integer device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, OdUInt32& nVal) = 0; /** \details Retrieves the current value of a OdIntPtr device . \param opt [in] A property with a value to be retrieved. \param pVal [out] A placeholder for the OdIntPtr device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, OdIntPtr& pVal) = 0; /** \details Retrieves the current value of a OdAnsiString device . \param opt [in] A property with a value to be retrieved. \param sVal [out] A placeholder for the OdAnsiString device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, OdAnsiString& sVal) = 0; /** \details Retrieves the current value of a OdString device . \param opt [in] A property with a value to be retrieved. \param sVal [out] A placeholder for the OdString device property value. \returns A value of the type that contains the result of retrieving a specified property value. \remarks If the property value was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. If the device doesn't have the requested option or the option has another type, the method returns an error; therefore the reference to the value passed to the method is not changed. \sa */ virtual OdTvResult getOption(Options opt, OdString& sVal) = 0; /** \details Sets a new value of the FPS show flag, which determines whether FPS information is displayed while rendering (if true) or not (if false). \param bShow [in] A new flag value. \returns A value of the type that contains the result of setting the flag value. \remarks If the new flag value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Displaying FPS Data */ virtual OdTvResult setShowFPS(bool bShow) = 0; /** \details Retrieves the current value of the FPS show flag, which determines whether the FPS information is displayed while rendering (if true) or not (if false). \param rc [out] A pointer to a value of the type that contains the result of the retrieve operation. \returns true if the FPS information is displayed while rendering; otherwise returns false. \remarks If the rc parameter is not null and the flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Displaying FPS Data */ virtual bool getShowFPS(OdTvResult* rc = 0) const = 0; /** \details Sets a new lineweight display style configuration for the device object. \param styleEntry [in] A lineweight style entry for which the current setting will be set. \param uValue [in] A lineweight style value. \returns A value of the type that contains the result of the operation. \remarks If the new lineweight style value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Managing Lineweight Configurations */ virtual OdTvResult setLineWeightConfiguration(LineWeightStyle styleEntry, OdUInt8 uValue) = 0; /** \details Retrieves the current lineweight display style configuration of the device object. \param styleEntry [in] A lineweight style entry for which the current setting is retrieved. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The current lineweight display style value. \remarks For the style, the method returns 0 if the point lineweight is disabled; otherwise the method returns 1. For the style, the method returns an entry that is represented with a value of the . For the style, the method returns an entry that is represented with a value of the . If the rc parameter is not null and the lineweight style value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Managing Lineweight Configurations */ virtual OdUInt8 getLineWeightConfiguration(LineWeightStyle styleEntry, OdTvResult* rc = NULL) const = 0; /** \details Makes the device object active or inactive. \param bIsActive [in] A flag that determines whether the device is active (if true) or not (if false). \returns A value of the type that contains the result of the device activation or deactivation. \remarks If the device was successfully activated or deactivated, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa Activating a Device */ virtual OdTvResult setActive(bool bIsActive) = 0; /** \details Retrieves whether the device is active. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the device is active; otherwise returns false. \remarks If the rc parameter is not null and the active flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Activating a Device */ virtual bool getActive(OdTvResult* rc = NULL) const = 0; /** \details Switches the background partial viewing mode on or off for the device. The background partial viewing mode assumes that the loading of objects runs in a separate background thread. \param bIsInBackground [in] A new value of the background partial viewing mode. \returns A value of the type that contains the result of the operation. If the method input parameter is equal to true, the device starts to work in background partial viewing mode; otherwise (if is equal to false) the background partial viewing mode is disabled. The method call is relevant only for a database opened in partial load mode. If the background partial viewing mode is successfully switched on or off, the method returns the tvOk; otherwise it returns an appropriate error code. \sa Making Partial Viewing a Background Process */ virtual OdTvResult setBackgroundPartialView(bool bIsInBackground) = 0; /** \details Retrieves whether the background partial viewing mode is enabled or disabled. The background partial viewing mode assumes that the loading of objects runs in a separate background thread. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the background partial view mode is enabled for the device; otherwise the method returns false. \remarks If the database the device belongs to is not opened in the partial load mode, the method also returns false. If the rc parameter is not null and the background partial viewing mode's state was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Making Partial Viewing a Background Process */ virtual bool getBackgroundPartialView(OdTvResult* rc = NULL) const = 0; /** \details Switches the occlusion filtering partial viewing mode on or off for the device. \param bEnable [in] A new value of the occlusion filtering partial viewing. \returns A value of the type that contains the result of the operation. */ virtual OdTvResult setOcclusionPartialFiltering( bool bEnable ) = 0; /** \details Retrieves whether the occlusion filtering partial viewing mode is enabled or disabled. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the occlusion filtering partial view mode is enabled for the device; otherwise the method returns false. */ virtual bool getOcclusionPartialFiltering( OdTvResult* rc = NULL ) const = 0; /** \details Specifies partial viewing object ignoring criterial (in pixels). \param nLimit [in] Extents perimeter limit (in pixels) \returns A value of the type that contains the result of the operation. */ virtual OdTvResult setPartialViewingObjectIgnoringCriteria( OdUInt32 nLimit ) = 0; /** \details Retrieves partial viewing object ignoring criterial (in pixels). \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns Extents perimeter limit (in pixels). */ virtual OdUInt32 getPartialViewingObjectIgnoringCriteria( OdTvResult * rc = NULL ) const = 0; /** \details Retrieves whether the background partial viewing mode is enabled for the device and the partial loading task is in progress. The background partial viewing mode assumes that the loading of objects runs in a separate background thread. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if the device is in the background partial viewing mode and the partial loading task is in progress; otherwise returns false. \remarks If the database the device belongs to is not opened in the partial load mode or the partial viewing mode is disabled for the device, the method also returns false. If the rc parameter is not null and the state value of the partial loading progress was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa Making Partial Viewing a Background Process */ virtual bool getBackgroundPartialViewingInProgress(OdTvResult* rc = NULL) const = 0; /** \details Pauses background partial viewing. \param bPause [in] Flag that indicates that partial viewing should be paused or resumed. \returns A value of the type that contains the result of the operation. \remarks If partial viewing disabled tvWarning will be returned. */ virtual OdTvResult pausePartialViewing( bool bPause ) = 0; /** \details Checks whether the background partial viewing is paused. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if and only if background partial viewing is enabled and paused; otherwise returns false. \remarks If partial viewing is disabled, the tvWarning is assigned to the rc parameter. */ virtual bool isPartialViewingPaused( OdTvResult* rc = NULL ) const = 0; /** \details Assigns to the device. \param pRegenAbort [in] A pointer to the object to be assigned. \returns A value of the type that contains the result of the operation. \remarks If the regenAbort functor is successfully assigned, the method returns tvOk; otherwise it returns an appropriate error code. This functor can be used in partial viewing mode or (in the future) during low memory import functionality. */ virtual OdTvResult setRegenAbort(OdTvRegenAbort* pRegenAbort) = 0; /** \details Returns the assigned OdTvRegenAbort instance. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns Pointer to the OdTvRegenAbort instance. */ virtual OdTvRegenAbort* getRegenAbort(OdTvResult* rc = NULL) const = 0; /** \details Sets a new value of the line smoothing flag, which determines whether anti-aliasing is switched on while rendering (if true) or not (if false). \param bOn [in] A flag that determines whether anti-aliasing is switched on while rendering (if true) or not (if false). \returns A value of the type that contains the result of setting the flag value. \remarks If the new flag value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. \sa */ virtual OdTvResult setLineSmoothing(bool bOn) = 0; /** \details Retrieves the current value of the line smoothing flag, which determines whether anti-aliasing is switched on while rendering (if true) or not (if false). \param rc [out] A pointer to a value of the type that contains the result of the retrieve operation. \returns true if anti-aliasing is switched on; otherwise returns false. \remarks If the rc parameter is not null and the flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. \sa */ virtual bool getLineSmoothing(OdTvResult* rc = 0) const = 0; /** \details Specifies the time frame within one 'update' call after which the scene graph building operations should be interrupted. \param mSec [in] Time frame in milliseconds. \returns A value of the type that contains the result of the operation. \remarks The time frame value defines the time which device can spent for the scene graph creation within one 'update' call. This feature is useful for the case of single-thread mode because normally scene graph building is performed in the background threads. Thus, in the case if only one thread is available, the scene graph building procedure will also work in this thread and can significantly freeze the 'update' method. Set zero as an input time frame if you want to remove the time frame. If the time frame is successfully set, the method returns tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult setSceneGraphCreationInteruptTime(OdUInt32 mSec) = 0; /** \details Sets a new TTF Draw mode for the device object. \param mode [in] A TTF Draw mode value. \param textQuality [in] A text quality [0-100] (only for TTFDrawMode::kConstant mode). \returns A value of the type that contains the result of the operation. \remarks If the new TTF Draw mode value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult setTTFDrawMode(TTFDrawMode mode, OdUInt32* textQuality = NULL) = 0; /** \details Retrieves the current TTF draw mode of the device object. \param textQuality [out] A pointer to text quality value is retrieved (only for TTFDrawMode::kConstant mode). \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The current TTF draw mode value. \remarks If the rc parameter is not null and the TTF draw mode value is successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. */ virtual TTFDrawMode getTTFDrawMode(OdUInt32* textQuality = NULL, OdTvResult* rc = NULL) const = 0; /** \details Sets a plot generation flag for the device object (need to be used for printing). \param plotGeneration [in] A new value for the plot generation flag. \returns A value of the type that contains the result of the operation. \remarks If the new plot generation value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult setPlotGeneration(bool plotGeneration) = 0; /** \details Retrieves the current plot generation flag of the device object. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The current plot generation flag. \remarks If the rc parameter is not null and the plot generation flag is successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. */ virtual bool getPlotGeneration(OdTvResult* rc = NULL) const = 0; /** \details Sets a new highlight style to the device. \param highlightStyleId [in] An identifier of the highlight style object. \param bAutoRegen [in] An auto regeneration flag value. If it is equal to true, in some cases the regeneration will be performed automatically after applying the style. \returns A value of the type that contains the result of setting the highlight style. \remarks If the new highlight style was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult setHighlightStyle(const OdTvHighlightStyleId& highlightStyleId, bool bAutoRegen = true) = 0; /** \details Retrieves the current highlight style for the device. \param rc [out] A pointer to a value of the link OdTvResult, OdTvResult> type that contains the result of the operation. \returns An identifier of the current highlight style. \remarks If the current highlight style object was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvHighlightStyleId getHighlightStyle(OdTvResult* rc = NULL) const = 0; /** \details Sets an array of highlight styles to the device. Different objects can be highlighted with different styles from this array. \param styles [in] An array of the highlight styles objects. \param bAutoRegen [in] An auto regeneration flag value. If it is equal to true, in some cases the regeneration will be performed automatically after applying the styles. \returns A value of the type that contains the result of setting the highlight styles array. \remarks If the new highlight styles array was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdTvResult setHighlightStyles(const OdArray& styles, bool bAutoRegen = true) = 0; /** \details Retrieves the array of highlight styles for the device. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns An array of highlight styles that are used for highlight objects. \remarks If the current highlight style object was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code. */ virtual OdArray getHighlightStyles(OdTvResult* rc = NULL) const = 0; /** \details Sets a new callback function for update callback. \param pCallback [in] A pointer to the 'OdTvDeviceUpdateCallback' functor. \returns A value of the type that contains the result of setting the update callback. */ virtual OdTvResult setUpdateCallback(OdTvGsDevice::UpdateCallback* pCallback) = 0; /** \details Retrieves the current callback function for update callback. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns A pointer to the current . */ virtual OdTvGsDevice::UpdateCallback* getUpdateCallback(OdTvResult* rc = NULL) const = 0; /** \details Specifies a custom object priority calculator. \param pCalculator [in] Object priority calculator. \returns A value of the type that contains the result of operation. \remarks Custom calculators have to be specified before device setup. */ virtual OdTvResult setObjectsPriorityCalculator( OdTvObjectPriorityCalculator* pCalculator ) = 0; /** \details Sets a new callback function for a background process callback. \param pCallback [in] A pointer to the OdTvBackgroundProcessCallback functor. \returns A value of the type that contains the result of setting the background update callback. */ virtual OdTvResult setBackgroundProcessCallback(OdTvGsDevice::OdTvBackgroundProcessCallback* pCallback) = 0; /** \details Retrieves the current callback functions for a background process callback. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns A pointer to the current OdTvBackgroundProcessCallback functor. */ virtual OdTvGsDevice::OdTvBackgroundProcessCallback* getBackgroundProcessCallback(OdTvResult* rc = NULL) const = 0; /** \details Sets a flag that allows sharing of internal data between different devices if it is possible. Default value is true. \param bAllow[in] New value of the flag. \returns A value of the type that contains the result of setting the flag. */ virtual OdTvResult setAllowShareable(bool bAllow) = 0; /** \details Retrieves the current state of the flag that allows sharing of internal data between different devices if it is possible. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if and only if it is allowable to share internal data between different devices if it is possible. */ virtual bool getAllowShareable(OdTvResult* rc = NULL) const = 0; /** \details Sets a flag that indicates whether images will not be highlighted. \param bDisable[in] New value of the flag. \returns A value of the type that contains the result of setting the flag. */ virtual OdTvResult setForbidImageHighlight(bool bDisable) = 0; /** \details Retrieves the current state of the flag that indicates that images will not be highlighted. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns true if and only if images will not be highlighted. */ virtual bool getForbidImageHighlight(OdTvResult* rc = NULL) const = 0; /** \details Sets a flag that indicates whether it is need to use memory economy SceneGraph mode \param bUse[in] New value of the flag. \returns A value of the type that contains the result of setting the flag. \remarks Will give effect only if scene graph is enabled. Allows to reduce peak memory usage during SceneGraph construction. Should be set before vectorization or will require full regeneration after. */ virtual OdTvResult setUseMemoryEconomySceneGraphMode(bool bUse) = 0; /** \details Retrieves the current state of the flag that indicates that it is need to use memory economy Scene Graph mode. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The true value if and only if device should use a memory economy SceneGraph mode. */ virtual bool getUseMemoryEconomySceneGraphMode(OdTvResult* rc = NULL) const = 0; /** \details Sets a flag that indicates whether device have to provide additional SceneGraph execution checks. \param bCheck [in] New value of the flag. \returns A value of the type that contains the result of setting the flag. */ virtual OdTvResult setCheckSceneGraphAuxiliaryProcessing( bool bCheck ) = 0; /** \details Retrieves the current state of the flag that indicates that device have to provide additional SceneGraph execution checks. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The true value if and only if device have to provide additional SceneGraph execution checks. */ virtual bool getCheckSceneGraphAuxiliaryProcessing( OdTvResult* rc = NULL ) const = 0; /** \details Checks whether the SceneGraph processing data. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The true value if and only if the SceneGraph processing data. \remarks After update() call SceneGraph may still process some data in background threads. */ virtual bool hasSceneGraphProcessingData( OdTvResult* rc = NULL ) const = 0; /** \details Checks whether the SceneGraph processed auxiliary data. \param bReset [in] A flag that indicates whether "hasProcessedAuxiliary" state should be reseted. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The true value if and only if the SceneGraph has processed auxiliary data. \remarks After update() call SceneGraph may still process auxiliary data in background threads. This method allows to check that some of these data already processed, so application may force update() call to render it. */ virtual bool hasSceneGraphProcessedAuxiliary( bool bReset = true, OdTvResult* rc = NULL ) = 0; /** \details Sets direct render buffer. \param pBuff [in] Pointer to buffer. \returns A value of the type that contains the result of setting the buffer. \remarks This method should be used for the devices which was setuped to render to the bitmap. Buffer supposed to be in BGR pixel format. Allows to iliminate additional copying when result bitmap will be used as rendering result in applications. IMPORTANT: this method should be called each time after size of the buffer (image size) as changed. The simplest way is just to call this method before each 'update()' */ virtual OdTvResult setDirectRenderBuffer(OdIntPtr pBuff) = 0; /** \details Sets options for interactivity mode. \param options [in] Interactivity options. \returns A value of the type that contains the result of setting the options. */ virtual OdTvResult setInteractivityOptions(const InteractivityOptions& options) = 0; /** \details Retrieves the options for an interactivity mode. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns An InteractivityOptions structure. */ virtual InteractivityOptions getInteractivityOptions(OdTvResult* rc = NULL) const = 0; }; /** \details A data type that represents a smart pointer to an object. */ typedef OdTvSmartPtr OdTvGsDevicePtr; /** \details The interface class for a database object identifier that allows access to the object. */ class ODTV_EXPORT OdTvGsDeviceId : public OdTvId { public: /** \details Opens the device determined with its identifier for a read or write operation. \param mode [in] An open mode value. \param rc [out] A pointer to a value of the type that contains the result of the open operation. \returns A smart pointer to the device object. \remarks If the rc parameter is not null and the device is successfully opened, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. */ OdTvGsDevicePtr openObject(OdTv::OpenMode mode = OdTv::kForRead, OdTvResult* rc = NULL) const; }; /** \details The interface class for the iterator of objects. An iterator object provides sequential access to a collection of devices. */ class ODTV_EXPORT OdTvDevicesIterator : public OdTvIterator, public OdTvIObject { public: /** \details Retrieves the device that is currently referenced by the iterator object. \param rc [out] A pointer to a value of the type that contains the result of the operation. \returns The device identifier if the iterator refers to a device; otherwise it returns a null value identifier. \remarks If the rc parameter is not null and the device identifier is successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code. If the iterator refers to a device, the identifier that the method returns is not null (i.e., the result of the isNull() method of the identifier is equal to false). */ virtual OdTvGsDeviceId getDevice(OdTvResult* rc = NULL) const = 0; /** \details Searches the device defined through its identifier and moves the iterator to this device if found. \param deviceId [in] A device identifier. \returns A value of the type that contains the result of the operation. \remarks If the device specified through its identifier is found, the method returns the tvOk; otherwise it returns an appropriate error code. */ virtual OdTvResult seek(const OdTvGsDeviceId& deviceId) = 0; }; /** \details A data type that represents a smart pointer to an object. */ typedef OdTvSmartPtr OdTvDevicesIteratorPtr; #endif //_ODTV_GSDEVICE_H_INCLUDED_