/** * @file XTPChartLineDeviceCommand.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(__XTPCHARTLINEDEVICECOMMAND_H__) # define __XTPCHARTLINEDEVICECOMMAND_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" // Array type used for dashed chart lines. typedef CArray CXTPChartLineDashArray; /** * @brief * Provides an interface for 2D line drawing device command. */ class _XTP_EXT_CLASS CXTPChartLineDeviceCommand : public CXTPChartDeviceCommand { protected: /** * @brief * Constructs a CXTPChartLineDeviceCommand object. * * @param p1 Start point. * @param p2 End point. * @param color Line color. * @param thickness Line thickness in pixels. */ CXTPChartLineDeviceCommand(const CXTPPoint2f& p1, const CXTPPoint2f& p2, const CXTPChartColor& color, int thickness); /** * @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. */ virtual CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; protected: CXTPPoint2f m_p1; /**< The first point.*/ CXTPPoint2f m_p2; /**< The second point.*/ CXTPChartColor m_color; /**< The line color.*/ int m_nThickness; /**< The thickness of the line.*/ }; /** * @brief * Provides an interface for 2D poly-line drawing device command. */ class _XTP_EXT_CLASS CXTPChartPolylineDeviceCommand : public CXTPChartDeviceCommand { protected: /** * @brief * Constructs a CXTPChartPolylineDeviceCommand object. * * @param p A collection of poly-line points. * @param thickness Line thickness in pixels. */ CXTPChartPolylineDeviceCommand(const CXTPChartPoints& p, int thickness); protected: CXTPChartPoints m_p; /**< A collection of poly-line points.*/ int m_nThickness; /**< Line thickness in pixels.*/ }; /** * @brief * Provides an interface for 2D spline drawing device command. */ class _XTP_EXT_CLASS CXTPChartSplineDeviceCommand : public CXTPChartDeviceCommand { protected: /** * @brief * Constructs a CXTPChartSplineDeviceCommand object. * * @param p A collection of spline points. * @param thickness Line thickness in pixels. */ CXTPChartSplineDeviceCommand(const CXTPChartPoints& p, int thickness); protected: CXTPChartPoints m_p; /**< A collection of spline points.*/ int m_nThickness; /**< Line thickness in pixels.*/ }; /** * @brief * Provides an interface for 3D line drawing device command. */ class _XTP_EXT_CLASS CXTPChart3dLineDeviceCommand : public CXTPChartDeviceCommand { protected: /** * @brief * Constructs a CXTPChart3dLineDeviceCommand object. * * @param p1 Start point. * @param p2 End point. * @param color Line color. * @param thickness Line thickness in pixels. */ CXTPChart3dLineDeviceCommand(const CXTPPoint3d& p1, const CXTPPoint3d& p2, const CXTPChartColor& color, int thickness); /** * @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. */ virtual CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; /** * @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: CXTPPoint3d m_p1; /**< The first point.*/ CXTPPoint3d m_p2; /**< The second point.*/ CXTPChartColor m_color; /**< The line color.*/ int m_nThickness; /**< The thickness of the line.*/ private: BOOL m_bProjected; CPoint m_pt2d1; CPoint m_pt2d2; }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTLINEDEVICECOMMAND_H__) /** @endcond */