/** * @file XTPChartGdiPieDeviceCommand.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(__XTPCHARTGDIPIEDEVICECOMMAND_H__) # define __XTPCHARTGDIPIEDEVICECOMMAND_H__ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" namespace Gdiplus { class GpPath; class GpBrush; } // namespace Gdiplus /** * @brief * This class represents a chart pie device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of a pie * in a chart. */ class _XTP_EXT_CLASS CXTPChartGdiPieDeviceCommand : public CXTPChartPieDeviceCommand { protected: /** * @brief * Constructs a CXTPChartPieDeviceCommand object. * * @param ptCenter The center point of the pie. * @param dMajorSemiAxis The major semi axis of the ellipse. * @param dMinorSemiAxis The minor semi axis of the ellipse. * @param dStartAngle The start angle of the pie. * @param dSweepAngle The sweep angle of the pie. * @param dDepth The depth of the pie or torus. * @param nHolePercent Determines the size of the hole when drawing a doughnut. */ CXTPChartGdiPieDeviceCommand(const CXTPPoint3d& ptCenter, double dMajorSemiAxis, double dMinorSemiAxis, double dStartAngle, double dSweepAngle, double dDepth, double nHolePercent); protected: Gdiplus::GpPath* CreatePieGraphicsPath(const CXTPPoint3d& center, double majorSemiaxis, double minorSemiaxis, double holePercent, double startAngle, double sweepAngle) const; void CalculateStartFinishPoints(const CXTPPoint3d& center, double majorSemiaxis, double minorSemiaxis, double startAngle, double sweepAngle, CXTPChartPointF& startPoint, CXTPChartPointF& finishPoint) const; virtual CXTPChartElement* HitTest(CPoint point, CXTPChartElement* pParent) const; }; class _XTP_EXT_CLASS CXTPChartGdiGradientPieDeviceCommand : public CXTPChartGdiPieDeviceCommand { public: CXTPChartGdiGradientPieDeviceCommand(const CXTPPoint3d& center, double majorSemiAxis, double minorSemiAxis, double startAngle, double sweepAngle, double depth, double holePercent, const CXTPChartRectF& gradientBounds, const CXTPChartColor& color, const CXTPChartColor& color2); protected: void ExecuteOverride(CXTPChartDeviceContext* pDC); Gdiplus::GpBrush* CreateBrush(); protected: CXTPChartRectF m_rcGradientBounds; CXTPChartColor m_color; CXTPChartColor m_color2; }; class _XTP_EXT_CLASS CXTPChartGdiBoundedPieDeviceCommand : public CXTPChartGdiPieDeviceCommand { public: CXTPChartGdiBoundedPieDeviceCommand(const CXTPPoint3d& center, double majorSemiAxis, double minorSemiAxis, double startAngle, double sweepAngle, double depth, int holePercent, const CXTPChartColor& color, int nThickness); protected: void ExecuteOverride(CXTPChartDeviceContext* pDC); protected: CXTPChartColor m_color; int m_nThickness; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTGDIPIEDEVICECOMMAND_H__) /** @endcond */