/** * @file XTPChartGdiPolygonDeviceCommand.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(__XTPCHARTGDIPOLYGONDEVICECOMMAND_H__) # define __XTPCHARTGDIPOLYGONDEVICECOMMAND_H__ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class _XTP_EXT_CLASS CXTPChartGdiPolygonDeviceCommand : public CXTPChartPolygonDeviceCommand { protected: CXTPChartGdiPolygonDeviceCommand(const CXTPChartPoints& points); protected: virtual CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; }; /** * @brief * This class represents a polygon device command, which is a kind of CXTPChartDeviceCommand. * It specifically handles the rendering of polygonal shapes in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiSolidPolygonDeviceCommand : public CXTPChartGdiPolygonDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiSolidPolygonDeviceCommand object. * * @param points The collection of points which make the polygon. * @param color The color of boundary. */ CXTPChartGdiSolidPolygonDeviceCommand(const CXTPChartPoints& points, const CXTPChartColor& color); /** * @brief * Destroys a CXTPChartGdiSolidPolygonDeviceCommand object, handles cleanup and * deallocation. */ ~CXTPChartGdiSolidPolygonDeviceCommand(); 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. */ void ExecuteOverride(CXTPChartDeviceContext* pDC); protected: CXTPChartColor m_color; /**< The color of the boundary.*/ }; class _XTP_EXT_CLASS CXTPChartGdiSolidSplinePolygonDeviceCommand : public CXTPChartSolidSplinePolygonDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiSolidSplinePolygonDeviceCommand object. * * @param points The collection of points which make the polygon spline. * @param color The fill color of the solid spline. */ CXTPChartGdiSolidSplinePolygonDeviceCommand(const CXTPChartPoints& points, const CXTPChartColor& color, BOOL bTwoSides = FALSE); /** * @brief * Destroys a CXTPChartGdiSolidSplinePolygonDeviceCommand object, handles cleanup and * deallocation. */ ~CXTPChartGdiSolidSplinePolygonDeviceCommand(); 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); virtual CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; protected: Gdiplus::GpPath* m_pGpPath; }; /** * @brief * This class represents a gradient polygon device command, which is a kind * of CXTPChartDeviceCommand. It specifically handles the rendering of gradient * polygonal shapes in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiGradientPolygonDeviceCommand : public CXTPChartGdiPolygonDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiGradientPolygonDeviceCommand object. * * @param points The collection of points which make the polygon spline. * @param color The start color of the gradient. * @param color2 The end color of the gradient. * @param nMode The linear gradient mode, it can be horizontal, vertical, * forward diagonal or backward diagonal. */ CXTPChartGdiGradientPolygonDeviceCommand(const CXTPChartPoints& points, const CXTPChartColor& color, const CXTPChartColor& color2, XTPChartLinearGradientMode nMode); 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); protected: CXTPChartColor m_color; /**< The start color of the gradient.*/ CXTPChartColor m_color2; /**< The end color of the gradiednt.*/ XTPChartLinearGradientMode m_nMode; /**< The gradient mode.*/ }; /** * @brief * This class represents a hatch polygon device command, which is a kind * of CXTPChartDeviceCommand. It specifically handles the rendering of hatch * polygonal shapes in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiHatchPolygonDeviceCommand : public CXTPChartGdiPolygonDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiHatchPolygonDeviceCommand object. * * @param points The collection of points which make the polygon spline. * @param color The first color of the pattern. * @param color2 The second color of the pattern. * @param nStyle The hatch style. */ CXTPChartGdiHatchPolygonDeviceCommand(const CXTPChartPoints& points, const CXTPChartColor& color, const CXTPChartColor& color2, XTPChartHatchStyle nStyle); 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); protected: CXTPChartColor m_color; /**< The first color of the pattern.*/ CXTPChartColor m_color2; /**< The second color of the pattern.*/ XTPChartHatchStyle m_nStyle; /**< The hatch style.*/ }; class _XTP_EXT_CLASS CXTPChartGdiBoundedPolygonDeviceCommand : public CXTPChartBoundedPolygonDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiBoundedPolygonDeviceCommand object. * * @param rect The rectangular area to be rendered by the device command. * @param color The color of the rectangle border. * @param thickness The thickness of the rectangular border. */ CXTPChartGdiBoundedPolygonDeviceCommand(const CXTPChartPoints& points, const CXTPChartColor& color, int thickness); 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); }; class _XTP_EXT_CLASS CXTPChartGdiPolygonAntialiasingDeviceCommand : public CXTPChartPolygonAntialiasingDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiPolygonAntialiasingDeviceCommand object. * * @param bAntiAlias TRUE if the antialiasing is enabled, FALSE if the * antialiasing is disabled. */ CXTPChartGdiPolygonAntialiasingDeviceCommand(BOOL bAntiAlias = TRUE); /** * @brief * Destroys a CXTPChartGdiPolygonAntialiasingDeviceCommand object, handles cleanup and * deallocation. */ ~CXTPChartGdiPolygonAntialiasingDeviceCommand(); 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 native 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 native device context. */ virtual void AfterExecute(CXTPChartDeviceContext* pDC); protected: long m_bOldAntiAlias; /**< The previous value of anti aliasing.*/ }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTGDIPOLYGONDEVICECOMMAND_H__) /** @endcond */