/** * @file XTPChart2dPieSeriesLabel.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(__XTPCHART2DPIESERIESLABEL_H__) # define __XTPCHART2DPIESERIESLABEL_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; class CXTPChartPieSeriesPointViewBase; class CXTPChartPieSeriesStyleBase; /** * @brief * CXTPChartPieSeriesLabelBase is a kind of CXTPChartPieSeriesLabel. This class * abstracts the label of a pie series. */ class _XTP_EXT_CLASS CXTPChartPieSeriesLabel : public CXTPChartPieSeriesLabelBase { DECLARE_SERIAL(CXTPChartPieSeriesLabel); public: /** * @brief * Constructs a CXTPChartPieSeriesLabel object. */ CXTPChartPieSeriesLabel(); protected: /** * @brief * This function creates the view of the pie series. * * @param pDC The chart device context object pointer. * @param pPointView The series point view. * @param pParentView The pointer to the parent view object. * * @return * Returns a pointer to the associated label view object. */ virtual CXTPChartElementView* CreateView(CXTPChartDeviceContext* pDC, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); public: /** * @brief * Call this function to calculate the anchor points and angles of the * pie label stem. * * @param pPointView The pie series point view. * @param borderThickness The border thickness of the label. * @param lineAngle The line(stem) angle, out param. * * @return * Returns a CXTPChartPointF object denoting the anchor point. */ CXTPChartPointF CalculateAnchorPointAndAngles(CXTPChartPieSeriesPointViewBase* pPointView, int borderThickness, double& lineAngle); }; /** * @brief * Defines 2D series label view. */ class _XTP_EXT_CLASS CXTPChartPieSeriesLabelView : public CXTPChartPieSeriesLabelViewBase { public: /** * @brief * Constructs a CXTPChartPieSeriesLabelView object. * * @param pLabel Associated label model pointer. * @param pPointView Point view object pointer associated with the label. * @param pParentView Parent view pointer. */ CXTPChartPieSeriesLabelView(CXTPChartSeriesLabel* pLabel, CXTPChartSeriesPointView* pPointView, CXTPChartElementView* pParentView); public: /** * @brief * Calculates label and connector layout for the device context specified. * * @param pDC Device context pointer. */ void CalculateLayout(CXTPChartDeviceContext* pDC); /** * @brief * Creates connector drawing device command for the device context specified. * * @param pDC Device context pointer for which the drawing command is to be created. * * @return * A new instance of connector drawing device command or NULL if no command * is provided. */ virtual CXTPChartDeviceCommand* CreateConnectorDeviceCommand(CXTPChartDeviceContext* pDC); /** * @brief * Creates view drawing device command for the device context specified. * * @param pDC Device context pointer for which the drawing command is to be created. * * @return * A new instance of view drawing device command or NULL if no command * is provided. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); protected: CXTPChartRectF m_rcBounds; /**< The determined boundary rectange.*/ CXTPChartPointF m_ptStartPoint; /**< The determined connector start point.*/ double m_dLineAngle; /**< The determined connector line angle.*/ friend class CXTPChartPieSeriesLabelsView; }; /** * @brief * Defines 2D series label collection view. */ class _XTP_EXT_CLASS CXTPChartPieSeriesLabelsView : public CXTPChartPieSeriesLabelsViewBase { public: /** * @brief * Constructs a CXTPChartPieSeriesLabelsView object. * * @param pParentView Parent view pointer. */ CXTPChartPieSeriesLabelsView(CXTPChartElementView* pParentView); public: /** * @brief * Creates a view drawing device command for the device context specified. * * @param pDC Device context pointer for which the drawing command is to be created. * * @return * A new instance of view drawing device command or NULL if no command * is provided. */ virtual CXTPChartDeviceCommand* CreateDeviceCommand(CXTPChartDeviceContext* pDC); /** * @brief * Resolves label overlapping in an implementation specific way. */ virtual void ResolveOverlapping(); protected: /** * @brief * Resolves label overlapping for column mode. * * @param arrColumn Label collumn array reference. */ void ResolveOverlappingColumn( CArray& arrColumn); }; /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHART2DPIESERIESLABEL_H__) /** @endcond */