/////////////////////////////////////////////////////////////////////////////// // 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 __OdGsPropChangeCbk_H__ #define __OdGsPropChangeCbk_H__ #include "TD_PackPush.h" #include "Gs/GsViewImpl.h" #include "Gs/GsBaseVectorizeDevice.h" /** */ template class OdGsInvalidatedCallPropModified { protected: CallFor *m_pCallFor; bool *m_pControlBit; PropType m_nFlag; public: OdGsInvalidatedCallPropModified(CallFor *pCallFor, bool *pControlBit, PropType nFlag) : m_pCallFor(pCallFor), m_pControlBit(pControlBit), m_nFlag(nFlag) { *m_pControlBit = false; } ~OdGsInvalidatedCallPropModified() { if (*m_pControlBit) m_pCallFor->onPropertyModified(m_nFlag); } }; /** \details View property change callback. */ template class OdGsViewPropChangeCbk : public ImplBase { private: OdGsViewImpl &thisView() { return *static_cast(this); } const OdGsViewImpl &thisView() const { return *static_cast(this); } private: bool m_bInvalidated; public: /** \details Represents modified properties of a view. */ enum ViewProperty { kViewViewport = 0, // Viewport region changed. kViewViewportClip, // Viewport clip region modified. kViewBorder, // Viewport border changed. kViewOrientation, // View parameters changed (position, fields, target). kViewLensLength, // Lens length changed. kViewFrontClip, // Front clipping changed. kViewBackClip, // Back clipping changed. kViewVisibility, // Hide or show called. kViewLineweight, // Lineweight settings changed. kViewLwdEnum, // Lineweight enum changed. kViewRenderMode, // Render mode was changed. kView3dClip, // Viewport 3d clipping changed. kViewFrozenLayers, // Frozen layers list modified. kViewLinetype, // Linetype scale multipliers. kViewBackground, // Background object changed. kViewVisualStyle, // Visual style changed. kViewStereoParams, // Stereo parameters changed. kViewClearColor, // Clear color changed. kViewDefLighting, // Default lighting parameters. kViewAntiAliasing, // Anti-aliasing setting. kViewSSAO, // Ambient occlusion setting. kViewRayTrace, // Ray-traced view setting. kNumViewProps // Service value. }; /** \details Method that is called when a property of a view is modified. \param nProp [in] Buffer width (in pixels). */ virtual void onPropertyModified(ViewProperty /*nProp*/) { } protected: OdUInt32 makeFlag(ViewProperty nProp) { return 1 << nProp; } private: typedef OdGsInvalidatedCallPropModified, ViewProperty> IsInvalidatedCallPropModified; public: /** \details Default constructor for the OdGsViewPropChangeCbk class. */ OdGsViewPropChangeCbk() : m_bInvalidated(false) { } // OdGsView overrides /** \details Marks the entire area of this View for refreshing. */ virtual void invalidate() ODRX_OVERRIDE { m_bInvalidated = true; ImplBase::invalidate(); } virtual void invalidate(const OdGsDCRect &rect) ODRX_OVERRIDE { m_bInvalidated = true; ImplBase::invalidate(rect); } /** \details Sets the scale factor for displaying lineweights in this Viewport object. \param scale [in] Scale factor. \sa */ virtual void setLineweightToDcScale(double scale) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewLineweight); ImplBase::setLineweightToDcScale(scale); } /** \details Sets the lineweights for this Viewport object. \param numLineweights [in] Number of lineweights. \param lineweights [in] Array of lineweights. \sa */ virtual void setLineweightEnum(int numLineweights, const OdUInt8* lineweights, const OdUInt16 *altSourceLwds = NULL) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewLwdEnum); ImplBase::setLineweightEnum(numLineweights, lineweights, altSourceLwds); } /** \details Sets the size and position of this Viewport object. \param lowerLeft [in] Lower-left corner in nomalized device coordinates [0.0 .. 1.0]. \param upperRight [in] Upper-right corner in nomalized device coordinates [0.0 .. 1.0]. \remarks (0,0) is the lower-left corner of the owning Device object. Coordinates increase upward and to the right. The View object can be partly or completely off screen. */ virtual void setViewport(const OdGePoint2d& lowerLeft, const OdGePoint2d& upperRight) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewViewport); ImplBase::setViewport(lowerLeft, upperRight); } /** \details Sets the size and position of this Viewport object. \param screenRect [in] Screen rectangle in device coordinates (pixels). \remarks (0,0) is the lower-left corner of the owning Device object. Coordinates increase upward and to the right. \remarks The View object can be partly or completely off screen. */ virtual void setViewport(const OdGsDCRect& screenRect) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewViewport); ImplBase::setViewport(screenRect); } /** \details Sets the size and position of this Viewport object. \param screenRect [in] Screen rectangle in device coordinates (pixels). \remarks (0,0) is the lower-left corner of the owning Device object. Coordinates increase upward and to the right. The View object can be partly or completely off screen. */ virtual void setViewport(const OdGsDCRectDouble& screenRect) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewViewport); ImplBase::setViewport(screenRect); } /** \details Defines a polygonal clip region for this Viewport object. \param numCoutours [in] Number of polygonal contours. \param numVertices [in] Array of the number of vertices in each polygonal contour. \param vertices [in] Array of device coordinate (pixel) vertices defining the polygonal contours. */ virtual void setViewportClipRegion(int numContours, int const* numVertices, OdGsDCPoint const* vertices) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewViewportClip); ImplBase::setViewportClipRegion(numContours, numVertices, vertices); } /** \details Defines a polygonal clip region for this Viewport object. \param numCoutours [in] Number of polygonal contours. \param numVertices [in] Array of the number of vertices in each polygonal contour. \param vertices [in] Array of device coordinate (pixel) vertices defining the polygonal contours. */ virtual void setViewportClipRegion(int numContours, int const* numVertices, OdGePoint2d const* vertices) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewViewportClip); ImplBase::setViewportClipRegion(numContours, numVertices, vertices); } /** \details Sets the color and width of the border for this Viewport object. \param color [in] Border color. \param width [in] Border width in pixels. */ virtual void setViewportBorderProperties(ODCOLORREF color, int width) ODRX_OVERRIDE { ODCOLORREF prevColor; int prevWidth; thisView().getViewportBorderProperties(prevColor, prevWidth); ImplBase::setViewportBorderProperties(color, width); if ((color != prevColor) || (width != prevWidth)) onPropertyModified(kViewBorder); } /** \details Controls the border visibility for this Viewport object. \param visible [in] Controls visibility. */ virtual void setViewportBorderVisibility(bool visible) ODRX_OVERRIDE { bool bPrevVisible = thisView().isViewportBorderVisible(); ImplBase::setViewportBorderVisibility(visible); if (visible != bPrevVisible) onPropertyModified(kViewBorder); } /** \details Sets the camera parameters for this Viewport object. \param position [in] Camera position. \param target [in] Camera target. \param upVector [in] Camera up vector. \param fieldWidth [in] Projection plane (field) width. \param fieldHeight [in] Projection plane (field) height. \param projectionType [in] Projection type. \remarks This method defines the transfomation from WCS coordinates to normalized device coordinates. All parameters are in WCS coordinates. projectionType must be one of the following: NameValue kParallel 0 kPerspective 1
*/ virtual void setView(const OdGePoint3d& position, const OdGePoint3d& target, const OdGeVector3d& upVector, double fieldWidth, double fieldHeight, OdGsView::Projection projectionType = OdGsView::kParallel) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::setView(position, target, upVector, fieldWidth, fieldHeight, projectionType); } /** \details Sets the perspective lens length for this Viewport object. \param lensLength [in] Perspective lens length. */ virtual void setLensLength(double lensLength) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewLensLength); ImplBase::setLensLength(lensLength); } /** \details Controls the front clipping of this Viewport object. \param enable [in] Enable front clipping. */ virtual void setEnableFrontClip(bool enable) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewFrontClip); ImplBase::setEnableFrontClip(enable); } /** \details Sets the front clip distance from the target of this Viewport object. \param frontClip [in] Front clip distance. */ virtual void setFrontClip(double frontClip) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewFrontClip); ImplBase::setFrontClip(frontClip); } /** \details Controls the back clipping of this Viewport object. \param enable [in] Enable back clipping. */ virtual void setEnableBackClip(bool enable) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewBackClip); ImplBase::setEnableBackClip(enable); } /** \details Sets the back clip distance from the target of this Viewport object. \param backClip [in] Back clip distance. */ virtual void setBackClip(double backClip) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewBackClip); ImplBase::setBackClip(backClip); } /** \details Sets the render mode for this Viewport object. \param mode [in] Render mode. \remarks mode must be one of the following: NameValueDescription kBoundingBox -1 Bounding box. For internal use only k2DOptimized 0 Standard display. Optimized for 2D kWireframe 1 Standard display. Uses 3D pipeline kHiddenLine 2 Wireframe display. Hidden lines removed kFlatShaded 3 Faceted display. One color per face kGouraudShaded 4 Smooth shaded display. Colors interpolated between vertices kFlatShadedWithWireframe 5 Faceted display with wireframe overlay kGouraudShadedWithWireframe 6 Smooth shaded display with wireframe overlay
*/ virtual void setMode(OdGsView::RenderMode mode) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewRenderMode); ImplBase::setMode(mode); } /** \details Sets visual style object for this view. \param visualStyleId [in] New visual style object ID. \sa */ virtual void setVisualStyle(OdDbStub *visualStyleId) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewVisualStyle); ImplBase::setVisualStyle(visualStyleId); } /** \details Sets visual style for this view. \param visualStyle [in] New visual style data. \sa */ virtual void setVisualStyle(const OdGiVisualStyle &visualStyle) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewVisualStyle); ImplBase::setVisualStyle(visualStyle); } /** \details Hides this Viewport object. */ virtual void hide() ODRX_OVERRIDE { bool bPrevVisible = thisView().isVisible(); ImplBase::hide(); if (bPrevVisible) onPropertyModified(kViewVisibility); } /** \details Un-hides this Viewport object. */ virtual void show() ODRX_OVERRIDE { bool bPrevVisible = thisView().isVisible(); ImplBase::show(); if (!bPrevVisible) onPropertyModified(kViewVisibility); } /** \details Translates the camera position and target by the specified Camera Coordinate dolly amount. \param dollyVector [in] Camera Coordinate dolly vector. \remarks Camera Coordinates are relative to the view of a target from a camera. * The Y-axis is along up vector. * The Z-axis is along the vector from camera position to the target. * The X-axis is the cross product Y-axis * Z-axis */ virtual void dolly(const OdGeVector3d& dollyVector) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::dolly(dollyVector); } /** \details Translates the camera position and target by the specified Camera Coordinate dolly amount. \param xDolly [in] Camera Coordinate X dolly amount. \param yDolly [in] Camera Coordinate Y dolly amount. \param zDolly [in] Camera Coordinate Z dolly amount. \remarks Camera Coordinates are relative to the view of a target from a camera. * The Y-axis is along up vector. * The Z-axis is along the vector from camera position to the target. * The X-axis is the cross product Y-axis * Z-axis */ virtual void dolly(double xDolly, double yDolly, double zDolly) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::dolly(xDolly, yDolly, zDolly); } /** \details Rotates the camera by the specified amount about the eye vector. \param rollAngle [in] Camera CCW roll angle. \remarks Positive angles rotate the camera counterclockwise about the eye vector when viewed from the camera position to the target. This corresponds to a clockwise rotation of the up vector. Camera Coordinates are relative to the view of a target from a camera. * The Y-axis is along up-vector. * The Z-axis (eye vector) is along the vector from camera position to the target. * The X-axis is the cross product Y-axis * Z-axis. All angles are expressed in radians. */ virtual void roll(double rollAngle) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::roll(rollAngle); } /** \details Orbits the camera about the target by the specified amounts. \param xOrbit [in] X-axis Orbit. \param yOrbit [in] Y-axis Orbit. \remarks the camera moves on the surface a sphere whose center the camera target and whose radius is the distance from the camera position to its target * The camera is first rotated about an axis parallel to the X-axis and passing through the target. * The camera is next rotated about an axis parallel to the Y-axis and passing through the target. Camera Coordinates are relative to the view of a target from a camera. * The Y-axis is along up vector. * The Z-axis is along the vector from camera position to the target. * The X-axis is the cross product Y-axis x Z-axis All angles are expressed in radians. */ virtual void orbit(double xOrbit, double yOrbit) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::orbit(xOrbit, yOrbit); } /** \details Scales the focal length of the camera by the specified amount. \param zoomFactor [in] Zoom factor. */ virtual void zoom(double zoomFactor) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::zoom(zoomFactor); } /** \details Rotates the target about the camera the specified amounts. \param xPan [in] X-axis pan. \param yPan [in] Y-axis pan. \remarks The target moves on the surface a sphere whose center the camera position and whose radius is the distance from the camera position to its target. * The target is first rotated about an axis parallel to the X-axis and passing through the camera. * The target is next rotated about an axis parallel to the Y-axis and passing through the camera. Camera Coordinates are relative to the view of a target from a camera. * The Y-axis is along up vector. * The Z-axis is along the vector from camera position to the target. * The X-axis is the cross product Y-axis x Z-axis All angles are expressed in radians. */ virtual void pan(double xPan, double yPan) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::pan(xPan, yPan); } /** \details Scales the camera to completely include specified WCS box inside view frustum. \param minPt [in] Minimal WCS box point. \param maxPt [in] Maximal WCS box point. */ virtual void zoomExtents(const OdGePoint3d &minPt, const OdGePoint3d &maxPt) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::zoomExtents(minPt, maxPt); } /** \details Scales the camera to completely include specified screen area. \param lowerLeft [in] Lower-left corner in nomalized device coordinates [0.0 .. 1.0]. \param upperRight [in] Upper-right corner in nomalized device coordinates [0.0 .. 1.0]. */ virtual void zoomWindow(const OdGePoint2d &lowerLeft, const OdGePoint2d &upperRight) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewOrientation); ImplBase::zoomWindow(lowerLeft, upperRight); } // GsView overrides (extended) /** \details Defines the 3d clipping for this Viewport object. \param pBoundary [in] 3d clipping boundary. \param pClipInfo [in] Optional 3d clipping boundary extended data. */ virtual void setViewport3dClipping(const OdGiClipBoundary* pBoundary, const OdGiAbstractClipBoundary* pClipInfo = NULL) ODRX_OVERRIDE { const OdGiClipBoundary *pPrevSet = thisView().viewport3dClipping(); ImplBase::setViewport3dClipping(pBoundary, pClipInfo); if (pPrevSet != thisView().viewport3dClipping()) onPropertyModified(kView3dClip); } /** \details Freezes the specified Layer object in this Viewport object. \param layerID [in] Layer to freeze. \remarks All layers are thawed by default. \sa */ virtual void freezeLayer(OdDbStub* layerID) ODRX_OVERRIDE { const OdUInt32 nPrevLayers = thisView().frozenLayers(); ImplBase::freezeLayer(layerID); if (nPrevLayers != thisView().frozenLayers()) onPropertyModified(kViewFrozenLayers); } /** \details Thaws the specified Layer object in this Viewport object. \param layerID [in] Layer to thaw. \remarks All layers are thawed by default. \sa */ virtual void thawLayer(OdDbStub* layerID) ODRX_OVERRIDE { const OdUInt32 nPrevLayers = thisView().frozenLayers(); ImplBase::thawLayer(layerID); if (nPrevLayers != thisView().frozenLayers()) onPropertyModified(kViewFrozenLayers); } /** \details Thaws all Layer objects in this Viewport object. \remarks All layers are thawed by default. \sa */ virtual void clearFrozenLayers() ODRX_OVERRIDE { const OdUInt32 nPrevLayers = thisView().frozenLayers(); ImplBase::clearFrozenLayers(); if (nPrevLayers != thisView().frozenLayers()) onPropertyModified(kViewFrozenLayers); } /** \details Controls stereo viewing for this Viewport object. \param enable [in] Controls stereo viewing. */ virtual void enableStereo(bool enabled) ODRX_OVERRIDE { const bool bPrevState = thisView().isStereoEnabled(); ImplBase::enableStereo(enabled); if (bPrevState != thisView().isStereoEnabled()) onPropertyModified(kViewStereoParams); } /** \details Sets the stereo parameters for this Viewport Object. \param magnitude [in] View separation [0.0 .. 2.0]. \param parallax [in] Adjusts the plane of zero parallax [0.0 .. 2.0]. \remarks Magnitude controls view eye separation, and hence the stereo effect. * A magnitude of 1.0 is the default value. * A magnitude of 0.0 produces no stereo effect. * A magnitude of 2.0 produces a double stereo effect. Parallax adjusts the zero parallax plane. * A parallax of 1.0 is the default value. An object centered at the target will be half-in and half-out of the screen. * A parallax of 0.0 moves the object into the screen. * A parallax of 2.0 move the object out of the screen. */ virtual void setStereoParameters(double magnitude, double parallax) ODRX_OVERRIDE { double fMagnitude, fMagnitudePrev, fParallax, fParallaxPrev; thisView().getStereoParameters(fMagnitudePrev, fParallaxPrev); ImplBase::setStereoParameters(magnitude, parallax); thisView().getStereoParameters(fMagnitude, fParallax); if ((fMagnitude != fMagnitudePrev) || (fParallax != fParallaxPrev)) onPropertyModified(kViewStereoParams); } /** \details Sets a multiplier that is used to scale all linetypes in this Viewport object. \param linetypeScaleMultiplier [in] Linetype scale multiplier. */ virtual void setLinetypeScaleMultiplier(double linetypeScaleMultiplier) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewLinetype); ImplBase::setLinetypeScaleMultiplier(linetypeScaleMultiplier); } /** \details Sets a multiplier that could be used as an alternate scale factor for linetypes in this Viewport object. \param linetypeAlternateScaleMultiplier [in] Alternate linetype scale multiplier. \sa Working with Linetypes */ virtual void setAlternateLinetypeScaleMultiplier(double linetypeAlternateScaleMultiplier) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewLinetype); ImplBase::setAlternateLinetypeScaleMultiplier(linetypeAlternateScaleMultiplier); } /** \details Sets the clear color for this view \param color [in] The clear color. */ virtual void setClearColor(OdGsView::ClearColor color) ODRX_OVERRIDE { const OdGsView::ClearColor prevColor = thisView().clearColor(); ImplBase::setClearColor(color); if (prevColor != color) onPropertyModified(kViewClearColor); } /** \details Sets background object for this view. \param backgroundId [in] New background object ID. \sa */ virtual void setBackground(OdDbStub *backgroundId) ODRX_OVERRIDE { OdDbStub *prevBkgnd = thisView().background(); ImplBase::setBackground(backgroundId); if (prevBkgnd != thisView().background()) onPropertyModified(kViewBackground); } /** \details Enables default lighting for this view. \param bEnable [in] New default lighting state. \param lightType [in] New default lighting type. \sa */ virtual void enableDefaultLighting(bool bEnable, OdGsView::DefaultLightingType lightType = OdGsView::kTwoLights) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewDefLighting); ImplBase::enableDefaultLighting(bEnable, lightType); } /** \details Enables or disables anti-aliasing in current Viewport object. \param nMode [in] Anti-aliasing mode (set as 3 by default). Set as 0 to disable anti-aliasing. */ virtual void enableAntiAliasing(OdUInt32 nMode) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewAntiAliasing); ImplBase::enableAntiAliasing(nMode); } /** \details Enables or disables ambient occlusion in current Viewport object. \param bEnable [in] Ambient occlusion mode (set as true by default). Set as false to disable ambient occlusion. */ virtual void enableSSAO(bool bEnable) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewSSAO); ImplBase::enableSSAO(bEnable); } /** \details Enables ray-traced view representation. \param bEnable [in] Ray-traced view representation setting. */ virtual void enableRayTracedView(bool bEnable) ODRX_OVERRIDE { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kViewRayTrace); ImplBase::enableRayTracedView(bEnable); } }; /** \details Device property change callback. */ template class OdGsDevicePropChangeCbk : public ImplBase { private: OdGsBaseVectorizeDevice &thisDevice() { return *static_cast(this); } const OdGsBaseVectorizeDevice &thisDevice() const { return *static_cast(this); } private: bool m_bInvalidated; public: /** \details Represents modified properties of a device. */ enum DeviceProperty { kDeviceSize = 0, // Device surface area changed. kDeviceBackground, // Device background color changed. kDevicePalette, // Device palette changed. kNumDeviceProps // Service value. }; virtual void onPropertyModified(DeviceProperty /*nProp*/) { } protected: OdUInt32 makeFlag(DeviceProperty nProp) { return 1 << nProp; } private: typedef OdGsInvalidatedCallPropModified , DeviceProperty> IsInvalidatedCallPropModified; public: /** \details Default constructor for the OdGsDevicePropChangeCbk class. */ OdGsDevicePropChangeCbk() : m_bInvalidated(false) { } // OdGsDevice overrides /** \details Marks for refresh entire region of the GUI window of the Device object. */ void invalidate() override { m_bInvalidated = true; ImplBase::invalidate(); } /** \details Notification function called whenever the size of the GUI window for the Device object has changed. \param outputRect [in] New size of the output rectangle in device coordinates (pixels). \remarks This function should not be called if the Device object has a width and/or height of 0. */ void onSize(const OdGsDCRect& outputRect) override { const OdGsDCRect prevOutputRect = thisDevice().outputRect(); ImplBase::onSize(outputRect); if (prevOutputRect != outputRect) onPropertyModified(kDeviceSize); } /** \details Sets the Background Color of the GUI window of the Device object. \param backgroundColor [in] Background color. */ bool setBackgroundColor(ODCOLORREF backgroundColor) override { ODCOLORREF prevBkgndColor = thisDevice().getBackgroundColor(); bool bSetVal = ImplBase::setBackgroundColor(backgroundColor); if (prevBkgndColor != backgroundColor) onPropertyModified(kDeviceBackground); return bSetVal; } /** \details Sets the logical pallete to be used by the Device object. \param logicalPalette [in] Logical palette. \param numColors [in] Number of colors in palette. \remarks The logical pallete is used with calls to OdGiSubEntityTraits::setColor(). */ void setLogicalPalette(const ODCOLORREF* logicalPalette, int numColors) override { IsInvalidatedCallPropModified checkNCall(this, &m_bInvalidated, kDevicePalette); ImplBase::setLogicalPalette(logicalPalette, numColors); } }; #include "TD_PackPop.h" #endif // __OdGsPropChangeCbk_H__