/** * @file XTPChartPyramidSeriesStyleBase.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(__XTPCHARTPYRAMIDSERIESSTYLEBASE_H__) # define __XTPCHARTPYRAMIDSERIESSTYLEBASE_H__ /** @endcond */ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChartSeriesView; class CXTPChartBorder; class CXTPChartFillStyle; class CXTPChartDiagram; class CXTPChartDiagramView; class CXTPChartSeries; /** * @brief * This class abstracts the basic style of a pyramid series. */ class _XTP_EXT_CLASS CXTPChartPyramidSeriesStyleBase : public CXTPChartSeriesStyle { DECLARE_DYNAMIC(CXTPChartPyramidSeriesStyleBase); public: /** * @brief * Constructs a CXTPChartPyramidSeriesStyleBase object. */ CXTPChartPyramidSeriesStyleBase(); /** * @brief * Destroys a CXTPChartPyramidSeriesStyleBase object, handles cleanup. */ virtual ~CXTPChartPyramidSeriesStyleBase(); /** * @brief * Gets the distance bettween stacked pyramid point (a gap). * * @return * Current distance value in pixels. */ int GetPointDistance() const; /** * @brief * Sets the distance bettween stacked pyramid point (a gap). * * @param nPointDistance Distance value in pixels. */ void SetPointDistance(int nPointDistance); /** * @brief * Gets the the ratio value that determines whether a pyramid * looks more stretched towards its cone or if it has a wider base. * If the ratio value is less than 1, then the pyramid's base is wider than * its height. * If the ratio value is greater than 1, then the pyramid's base width is * less than pyramid's height, making tall and acute. * * @return * Current ratio value. */ double GetHeightToWidthRatio() const; /** * @brief * Sets the the ratio value that determines whether a pyramid * looks more stretched towards its cone or if it has a wider base. * If the ratio value is less than 1, then the pyramid's base is wider than * its height. * If the ratio value is greater than 1, then the pyramid's base width is * less than pyramid's height, making tall and acute. * * @param dRatio A new ratio value. */ void SetHeightToWidthRatio(double dRatio); /** * @brief * Call this function to get the background fill style. * * @return * Returns the pointer to a CXTPChartFillStyle object, which abstracts * various fill styles. */ CXTPChartFillStyle* GetFillStyle() const; /** * @brief * Obtains the border object pointer. * * @return * Associated border object pointer. */ CXTPChartBorder* GetBorder() const; /** * @brief * Call this member function to Store/Load an event using the * specified data object. * * @param pPX Source or destination CXTPPropExchange data object reference. * * @details * This member function is used to store event data to or load event * data from storage. */ void DoPropExchange(CXTPPropExchange* pPX); protected: /** * @brief * Call this function to create the pyramid diagram object. * * @return * A pointer to CXTPChartDiagram object which points to a newly created * CXTPChart2dPyramidDiagramBase/CXTPChart3dPyramidDiagramBase object. */ virtual CXTPChartDiagram* CreateDiagram() = 0; /** * @brief * Call this function to create the view of the pyramid series. * * @param pSeries A pointer to the chart series object. * @param pDiagramView A pointer to the diagram view object. * * @return * Returns a pointer to the associated series view object. */ virtual CXTPChartSeriesView* CreateView(CXTPChartSeries* pSeries, CXTPChartDiagramView* pDiagramView) = 0; /** * @brief * Call this function to check whether a chart diagram object passed * is a kind of CXTPChart2dPyramidDiagramBase/CXTPChart3dPyramidDiagramBase. * * @param pDiagram A pointer to a chart diagram, whose type is to be identified. * * @return * TRUE if the chart diagram is a pyramid diagram, FALSE otherwise. * @details */ virtual BOOL IsStyleDiagram(CXTPChartDiagram* pDiagram) const = 0; # ifdef _XTP_ACTIVEX public: /** @cond */ DECLARE_DISPATCH_MAP() DECLARE_INTERFACE_MAP() /** @endcond */ # endif protected: double m_dHeightToWidthRatio; int m_nPointDistance; CXTPChartBorder* m_pBorder; CXTPChartFillStyle* m_pFillStyle; }; AFX_INLINE int CXTPChartPyramidSeriesStyleBase::GetPointDistance() const { return m_nPointDistance; } AFX_INLINE void CXTPChartPyramidSeriesStyleBase::SetPointDistance(int nPointDistance) { m_nPointDistance = nPointDistance; OnChartChanged(); } AFX_INLINE CXTPChartFillStyle* CXTPChartPyramidSeriesStyleBase::GetFillStyle() const { return m_pFillStyle; } AFX_INLINE CXTPChartBorder* CXTPChartPyramidSeriesStyleBase::GetBorder() const { return m_pBorder; } AFX_INLINE void CXTPChartPyramidSeriesStyleBase::SetHeightToWidthRatio(double dRatio) { m_dHeightToWidthRatio = dRatio; OnChartChanged(); } AFX_INLINE double CXTPChartPyramidSeriesStyleBase::GetHeightToWidthRatio() const { return m_dHeightToWidthRatio; } /** @cond */ # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTPYRAMIDSERIESSTYLEBASE_H__) /** @endcond */