/** * @file XTPChartGdiTransformationDeviceCommand.h * * @copyright * (c) 1998-2025 Codejock Software, All Rights Reserved. * * This source file is the property of Codejock Software and must not be * redistributed by any means without the explicit written permission of * Codejock Software. * * The use of this source code is governed by the terms and conditions specified * in the Toolkit Pro license agreement. Codejock Software grants you, as a * single software developer, the limited right to use this software on one * computer only. * * Contact Information: * support@codejock.com * http://www.codejock.com * */ /** @cond */ #if !defined(__XTPCHARTGDITRANSFORMATIONDEVICECOMMAND_H__) # define __XTPCHARTGDITRANSFORMATIONDEVICECOMMAND_H__ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" namespace Gdiplus { class GpRegion; } /** * @brief * This class helps to save the drawing state. This object is a kind of * CXTPChartDeviceCommand. */ class _XTP_EXT_CLASS CXTPChartGdiSaveStateDeviceCommand : public CXTPChartDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiSaveStateDeviceCommand object. */ CXTPChartGdiSaveStateDeviceCommand(); protected: /** * @brief * This method gets called before a command is executed which allows for * the customization of command behavior. * * @param pDC A pointer to the chart device context. */ virtual void BeforeExecute(CXTPChartDeviceContext* pDC); /** * @brief * This method gets called after a command is executed which allows for * the customization of command behavior. * * @param pDC A pointer to the chart device context. */ virtual void AfterExecute(CXTPChartDeviceContext* pDC); protected: UINT m_nState; }; class _XTP_EXT_CLASS CXTPChartGdiClipDeviceCommand : public CXTPChartClipDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiClipDeviceCommand object. */ CXTPChartGdiClipDeviceCommand(CRect rcClip); /** * @brief * This method gets called before a command is executed which allows for * the customization of command behavior. * * @param pDC A pointer to the chart device context. */ virtual void BeforeExecute(CXTPChartDeviceContext* pDC); /** * @brief * This method gets called after a command is executed which allows for * the customization of command behavior. * * @param pDC A pointer to the chart device context. */ virtual void AfterExecute(CXTPChartDeviceContext* pDC); protected: CRect m_rcState; /**< The default clipping rectangle.*/ }; class _XTP_EXT_CLASS CXTPChartGdiClipRegionDeviceCommand : public CXTPChartDeviceCommand { public: /** * @brief * Constructs a CXTPChartClipDeviceCommand object. */ CXTPChartGdiClipRegionDeviceCommand(const CXTPChartPoints& points); /** * @brief * Destroys a CXTPChartClipDeviceCommand object, handles cleanup and deallocation. */ ~CXTPChartGdiClipRegionDeviceCommand(); protected: /** * @brief * This method gets called before a command is executed which allows for * the customization of command behavior. * * @param pDC A pointer to the chart device context. */ virtual void BeforeExecute(CXTPChartDeviceContext* pDC); /** * @brief * This method gets called after a command is executed which allows for * the customization of command behavior. * * @param pDC A pointer to the chart device context. */ virtual void AfterExecute(CXTPChartDeviceContext* pDC); protected: Gdiplus::GpRegion* m_pGpState; /**< The clipping rectangle.*/ Gdiplus::GpRegion* m_pGpClip; /**< The default clipping rectangle.*/ }; /** * @brief * This class abstracts a rotation device command, which does rotation * transformations. This is a kind of CXTPChartDeviceCommand. */ class _XTP_EXT_CLASS CXTPChartGdiRotateDeviceCommand : public CXTPChartRotateDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiRotateDeviceCommand object. * * @param fAngle The angle of rotation. */ CXTPChartGdiRotateDeviceCommand(float fAngle); /** * @brief * Constructs a CXTPChartGdiRotateDeviceCommand object. * * @param fAngle The angle of rotation. * @param rotateVector The vector to be rotated. */ CXTPChartGdiRotateDeviceCommand(float fAngle, const CXTPPoint3d& rotateVector); protected: /** * @brief * This is a virtual function override of base class CXTPChartDeviceContext. This * function acts polymorphically to do the actual drawing of the chart element * to which this device command is associated with. * * @param pDC The device context of the chart. */ virtual void ExecuteOverride(CXTPChartDeviceContext* pDC); }; /** * @brief * This class abstracts a rotation device command, which does translation * on vertices. This is a kind of CXTPChartDeviceCommand. */ class _XTP_EXT_CLASS CXTPChartGdiTranslateDeviceCommand : public CXTPChartTranslateDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiTranslateDeviceCommand object. * * @param dx The change in X direction. * @param dy The change in Y direction. */ CXTPChartGdiTranslateDeviceCommand(double dx, double dy); public: /** * @brief * This is a virtual function override of base class CXTPChartDeviceContext. This * function acts polymorphically to do the actual drawing of the chart element * to which this device command is associated with. * * @param pDC The device context of the chart. */ virtual void ExecuteOverride(CXTPChartDeviceContext* pDC); CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTGDITRANSFORMATIONDEVICECOMMAND_H__) /** @endcond */