/** * @file XTPChartOpenGLFunnelDeviceCommand.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(__XTPCHARTOPENGLFUNNELDEVICECOMMAND_H__) # define __XTPCHARTOPENGLFUNNELDEVICECOMMAND_H__ # if _MSC_VER >= 1000 # pragma once # endif // _MSC_VER >= 1000 # include "Common/Base/Diagnostic/XTPDisableNoisyWarnings.h" class CXTPChart3dFunnelSeriesStyle; class CXTPChartDeviceContext; class CXTPChartSeriesStyle; class CXTPChartOpenGLDeviceContext; /** * @brief * This class represents a chart funnel device command, which is a kind of * CXTPChartDeviceCommand. It specifically handles the rendering of a funnel * in a chart using OpenGL. */ class _XTP_EXT_CLASS CXTPChartOpenGLFunnelDeviceCommand : public CXTPChart3dDeviceCommand { public: /** * @brief * This function creates a label view drawing command object. * * @param center Funnel point physical center in 3d space. * @param dWidth Total funnel width. * @param dHeight Total funnel height. * @param dFrom The percentage factor value in the range 0..1 of the inital funnel point value. * @param dTo The percentage factor value in the range 0..1 of the final funnel point value. * @param color Funnel point color value. * @param bSmoothEdges TRUE to make edges between point faces smooth and reflect light towards * the outer radius, FALSE to make point faces reflect light in one * direction. */ CXTPChartOpenGLFunnelDeviceCommand(const CXTPPoint3d& center, const CXTPChartRectF& rc, double dWidth, double dHeight, double dFrom, double dTo, const CXTPChartColor& color, BOOL bSmoothEdges); /** * @brief * Handles command object destruction. */ ~CXTPChartOpenGLFunnelDeviceCommand(); protected: /** * @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 * Override this function to write the drawing code for specific objects. * * @param pDC A pointer to the chart device context. */ virtual void ExecuteOverride(CXTPChartDeviceContext* pDC); /** * @brief * Applies series style to the current element. * * @param pStyle Series style to apply. */ virtual void ApplySeriesStyle(CXTPChartSeriesStyle* pStyle); /** * @brief * Derived implementation must override this method for implementing * implementation specific preparation behavior. * * @param pDC Device context pointer for which the command is to be prepared. * * @see * Prepare */ virtual void PrepareOverride(CXTPChartDeviceContext* pDC); private: void DrawTriangle(const CXTPPoint3d& a, const CXTPPoint3d& va, const CXTPPoint3d& b, const CXTPPoint3d& vb, const CXTPPoint3d& c, const CXTPPoint3d& vc); void DrawFunnelSlice(); void ComputeConnectorPoints(CXTPChartOpenGLDeviceContext* pGLDC); private: BOOL m_bPrepared; CXTPChart3dBox m_3dBox; CXTPPoint3d m_ptCenterConnectorPoint; CXTPPoint3d m_ptOuterConnectorPoint; CXTPChartColor m_color; CXTPChart3dFunnelSeriesStyle* m_pStyle; GLuint m_listId; CXTPChartRectF m_rc; double m_dWidth; double m_dHeight; double m_dFrom; double m_dTo; CXTPPoint3d m_ptCenter; BOOL m_bSmoothEdges; CArray m_arMidFacePoints; }; # include "Common/Base/Diagnostic/XTPEnableNoisyWarnings.h" #endif //#if !defined(__XTPCHARTOPENGLFUNNELDEVICECOMMAND_H__) /** @endcond */