/** * @file XTPChartGdiLineDeviceCommand.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(__XTPCHARTGDILINEDEVICECOMMAND_H__) # define __XTPCHARTGDILINEDEVICECOMMAND_H__ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" /** * @brief * This class represents a solid line device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of solid * lines in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiSolidLineDeviceCommand : public CXTPChartLineDeviceCommand { public: /** * @brief * Constructs a CXTPChartSolidLineDeviceCommand object. * * @param p1 The first point of the line. * @param p2 The second point of the line * @param color The color of the line. * @param thickness The thickness of the line. */ CXTPChartGdiSolidLineDeviceCommand(const CXTPPoint2f& p1, const CXTPPoint2f& p2, 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 GDI device context of the chart. */ void ExecuteOverride(CXTPChartDeviceContext* pDC); /** * @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: int m_OldPixelOffsetMode; /**< Default PixelOffsetMode*/ int m_OldInterpolationMode; /**< Default InterpolationMode*/ }; /** * @brief * This class represents a solid polyline device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of solid * lines in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiSolidPolylineDeviceCommand : public CXTPChartPolylineDeviceCommand { public: /** * @brief * Constructs a CXTPChartSolidPolylineDeviceCommand object. * * @param p1 The first point of the line. * @param p2 The second point of the line * @param color The color of the line. * @param thickness The thickness of the line. */ CXTPChartGdiSolidPolylineDeviceCommand(const CXTPChartPoints& p, 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 GDI device context of the chart. */ void ExecuteOverride(CXTPChartDeviceContext* pDC); protected: CXTPChartColor m_color; /**< The line color.*/ }; class _XTP_EXT_CLASS CXTPChartGdiSplineDeviceCommand : public CXTPChartSplineDeviceCommand { protected: CXTPChartGdiSplineDeviceCommand(const CXTPChartPoints& p, int thickness); protected: CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; protected: CXTPChartPoints m_p; /**< The points which form the spline.*/ int m_nThickness; /**< The thickness of the spline.*/ }; /** * @brief * This class represents a solid spline device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of solid * splines in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiSolidSplineDeviceCommand : public CXTPChartSplineDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiSolidSplineDeviceCommand object. * * @param p The points which forms the spline. * @param color The color of the spline. * @param thickness The thickness of the spline. */ CXTPChartGdiSolidSplineDeviceCommand(const CXTPChartPoints& p, 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 GDI device context of the chart. */ void ExecuteOverride(CXTPChartDeviceContext* pDC); protected: CXTPChartColor m_color; /**< The spline color.*/ }; /** * @brief * This class represents a dash line device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of solid * lines in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiDashedLineDeviceCommand : public CXTPChartLineDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiDashedLineDeviceCommand object. * * @param p1 The first point of the line. * @param p2 The second point of the line * @param color The color of the line. * @param thickness The thickness of the line. * @param nDashStyle The dash style. * * @details * The dash line style are the following. * Empty style, invisible. * Solid line style. * Dash line style. * Dot line style. * Alternate dash and dot line style. * Dash dot dot line style. */ CXTPChartGdiDashedLineDeviceCommand(const CXTPPoint2f& p1, const CXTPPoint2f& p2, const CXTPChartColor& color, int thickness, XTPChartDashStyle nDashStyle, const CXTPChartLineDashArray& dashArray); 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 GDI device context of the chart. */ void ExecuteOverride(CXTPChartDeviceContext* pDC); protected: XTPChartDashStyle m_nDashStyle; /**< The dash style.*/ CXTPChartLineDashArray m_arrDashArray; }; /** * @brief * This class represents a dashed spline device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of dashed * splines in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiDashedSplineDeviceCommand : public CXTPChartSplineDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiDashedSplineDeviceCommand object. * * @param p The points which forms the spline. * @param color The color of the spline. * @param thickness The thickness of the spline. * @param nDashStyle The dash style. * * @details * The dash line style are the following. * Empty style, invisible. * Solid line style. * Dash line style. * Dot line style. * Alternate dash and dot line style. * Dash dot dot line style. */ CXTPChartGdiDashedSplineDeviceCommand(const CXTPChartPoints& p, const CXTPChartColor& color, int thickness, XTPChartDashStyle nDashStyle, const CXTPChartLineDashArray& dashArray); 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 GDI device context of the chart. */ void ExecuteOverride(CXTPChartDeviceContext* pDC); protected: CXTPChartColor m_color; /**< The spline color.*/ XTPChartDashStyle m_nDashStyle; /**< The dash style.*/ CXTPChartLineDashArray m_arrDashArray; }; /** * @brief * This class represents a dashed polyline device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of dashed * lines in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiDashedPolylineDeviceCommand : public CXTPChartPolylineDeviceCommand { public: /** * @brief * Constructs a CXTPChartGdiDashedPolylineDeviceCommand object. * * @param p1 The first point of the line. * @param p2 The second point of the line * @param color The color of the line. * @param thickness The thickness of the line. * @param nDashStyle The dash style. * * @details * The dash line style are the following. * Empty style, invisible. * Solid line style. * Dash line style. * Dot line style. * Alternate dash and dot line style. * Dash dot dot line style. */ CXTPChartGdiDashedPolylineDeviceCommand(const CXTPChartPoints& p, const CXTPChartColor& color, int thickness, XTPChartDashStyle nDashStyle, const CXTPChartLineDashArray& dashArray); 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 GDI device context of the chart. */ void ExecuteOverride(CXTPChartDeviceContext* pDC); /** * @brief * Performs recursive hit testing of the element at the specified point. * * @param point Point in which an element is to be found. * @param pParent Parent element pointer. * * @return A pointer to the element found at the specified point or NULL * if no element is found. */ CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; protected: CXTPChartColor m_color; /**< The spline color.*/ XTPChartDashStyle m_nDashStyle; /**< The dash style.*/ CXTPChartLineDashArray m_arrDashArray; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTGDILINEDEVICECOMMAND_H__) /** @endcond */