Mobile API Reference  MicroStrategy 2019
ChartCanvas.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : ChartCanvas.h
3 // AUTHOR : Xinpan Xiao
4 // CREATION : 2010-11-12
5 // Copyright (C) MicroStrategy Incorporated 2010
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MsiChart_ChartCanvas_h
9 #define MsiChart_ChartCanvas_h
10 
11 #include "StdAfx.h"
12 #include "PDCHeader/PDCvector"
13 #include "Base/Base/BaseString.h"
14 #include "FormatFill.h"
15 #include "FormatLine.h"
16 #include "FormatFont.h"
17 
18 
19 namespace MsiChart
20 {
21 #ifndef _VE_CE
23  {
24  LJT_MITER = 0,
25  LJT_BEVEL = 1,
26  LJT_ROUND = 2,
27  };
28 #endif
29  class ChartContext;
30  class RGBColor;
31 
40  {
41  public:
42  ChartCanvas();
43  ChartCanvas(ChartContext *ipContext);
44  virtual ~ChartCanvas();
45 
50  virtual bool SaveToString(std::string& orGraphDesc) = 0;
51 #ifdef _VE_CE
52 
55  virtual bool SaveToVEObjects(std::vector<MVE::VEFormatList>& ioFormatList, std::vector<MVE::VEUnitList>& ioUnitList) = 0;
56 #endif
57 
60  virtual void SaveState() = 0;
61 
65  virtual void RestoreState() = 0;
66 
70  virtual void Clip() = 0;
71 
77  virtual void Scale(const double iX, const double iY) = 0;
78 
84  virtual void Rotate(const Point2D& irAnchor, double iRadian) = 0;
85 
89  virtual void NewPath() = 0;
90 
94  virtual void ClosePath() = 0;
95 
101  virtual void MoveTo(double iX, double iY, bool iIsCurveAnimation = false, FPoint2D* iBasePoint = NULL) = 0;
102 
108  virtual void LineTo(double iX, double iY, bool iIsCurveAnimation = false, FPoint2D* iBasePoint = NULL) = 0;
109 
119  virtual void BezierCurveTo(double iCP1X, double iCP1Y, double iCP2X, double iCP2Y, double iX, double iY) = 0;
120 
128  virtual void AddRect(float iX, float iY, float iW, float iH) = 0;
129 
139  virtual void AddArc(float iX, float iY, float iRadius, float iStartAngle, float iEndAngle, bool bAntiClockwise) = 0;
140 
150  virtual void AddNeedle(char iNeedleStyle, Point2D iBasePoint, short iAngle, float iSize) = 0;
151 
157  virtual void AddString(const Point2D& irPoint, const char* ipString) = 0;
158 
164  virtual void SetLineDash(double* ipLinePattern, short iDashNumber) = 0;
165 
170  virtual void SetLineWidth(double iLineWidth) = 0;
171 
176  virtual void SetFontSize(short iFontSize) = 0;
177 
182  virtual void SetLineJoin(EnumLineJoinType iLineJoinType) = 0;
183 
191  virtual void SetRGBAFillColor(float iRed, float iGreen, float iBlue, float iAlpha) = 0;
192 
200  virtual void SetRGBAStrokeColor(float iRed, float iGreen, float iBlue, float iAlpha) = 0;
201 
205  virtual void FillPath() = 0;
206 
210  virtual void StrokePath() = 0;
211 
216  virtual void FillSimple(const FormatFill* ipFill, float iDarkerFactor, RGBColor* iColor = NULL, bool iHasExtraPara = false) = 0;
217 
222  virtual void FillPattern(const FormatFill* ipFill) = 0;
223 
229  virtual void FillGradient(const FormatFill* ipFill, const Rect2D& irBoundingRect, float iDarkerFactor) = 0;
230 
236  virtual void FillEdgeType(const FormatFill* ipFill, const std::vector<Point2D>& irPolygon) = 0;
237 
243  virtual void FillRadientGradient(const FormatFill* ipFill, EnumRadientGradientUsage iRGUsage, double iCPX, double iCPY, double iInnerRadius, double iOuterRadius, bool iHasExtraPara = false, int iExtraDepth = 0, int iExtraIntensity = 0) = 0;
244 
252  virtual void FillBorderMetallic(const FormatFill* ipFill, short iBorderUse, double iCPX, double iCPY, double iRadius, double iThickness) = 0;
253 
260  virtual void FillDonutOrSphere(const FormatFill* ipFill, const Rect2D& irBoundingRect, bool iIsCircularShape) = 0;
261 
269  virtual void MakeDarker(const FormatFill* ipFill, float iFactor) = 0;
270 
275  virtual void RestoreColor(const FormatFill* ipFill) = 0;
276 
281  virtual void ApplyLineFormat(const FormatLine* ipLine) = 0;
282 
289  virtual void AddFormatedText(const FormatFont* ipFont, const Point2D& irStartPoint, const std::string& irText) = 0;
290 
301  virtual void ApplyBeveledFrameToRectangle(const Rect2D& irRect, double iRotationAngle, short iBevelDepth,
302  const RGBColor& irLTColor, short iLTAlpha,
303  const RGBColor& irRBColor, short iRBAlpha) = 0;
304 
305  //Draw gauge marker
306  virtual void DrawGaugeMarker(FPoint2D* iBasePoint, Int32& iMarkerSize, Int32& iMarkerShape, float iAngle, short iNeedSize) = 0;
307 
308  // fill donut to rectangle
309  virtual void ApplyDonutToRect(const Point<double>& irStartPoint, const Point<double>& irEndPoint, const FormatFill* ipFill) = 0;
310 
316  virtual void BeginFirstFrame() = 0;
317 
324  virtual void BeginLastFrame() = 0;
325 
330  virtual void EndFrame() = 0;
331 
337  virtual void EndUnit() = 0;
338 
343  virtual void SetContext(ChartContext *ipContext);
344 
349  virtual ChartContext* GetContext();
350 
351 #ifndef _VE_CE
352  virtual CGPoint GetCurrentPoint();
353 #endif
354 
355  protected:
357  };
358 }
359 #endif //MsiChart_ChartCanvas_h
virtual void SetRGBAFillColor(float iRed, float iGreen, float iBlue, float iAlpha)=0
virtual void SaveState()=0
virtual void AddString(const Point2D &irPoint, const char *ipString)=0
virtual void FillGradient(const FormatFill *ipFill, const Rect2D &irBoundingRect, float iDarkerFactor)=0
virtual bool SaveToString(std::string &orGraphDesc)=0
Definition: FormatFill.h:160
virtual void FillSimple(const FormatFill *ipFill, float iDarkerFactor, RGBColor *iColor=NULL, bool iHasExtraPara=false)=0
EnumLineJoinType
Definition: ChartCanvas.h:22
virtual void Scale(const double iX, const double iY)=0
Definition: FormatLine.h:59
virtual void SetLineJoin(EnumLineJoinType iLineJoinType)=0
virtual void Clip()=0
virtual void FillPattern(const FormatFill *ipFill)=0
virtual void SetLineWidth(double iLineWidth)=0
virtual void StrokePath()=0
virtual void FillEdgeType(const FormatFill *ipFill, const std::vector< Point2D > &irPolygon)=0
virtual void BezierCurveTo(double iCP1X, double iCP1Y, double iCP2X, double iCP2Y, double iX, double iY)=0
Definition: ChartCanvas.h:24
virtual void ApplyBeveledFrameToRectangle(const Rect2D &irRect, double iRotationAngle, short iBevelDepth, const RGBColor &irLTColor, short iLTAlpha, const RGBColor &irRBColor, short iRBAlpha)=0
virtual void AddRect(float iX, float iY, float iW, float iH)=0
ChartContext * mpContext
Definition: ChartCanvas.h:356
virtual void EndUnit()=0
#define Int32
Definition: BasicTypes.h:20
virtual void ClosePath()=0
virtual void MoveTo(double iX, double iY, bool iIsCurveAnimation=false, FPoint2D *iBasePoint=NULL)=0
virtual void RestoreState()=0
virtual void SetContext(ChartContext *ipContext)
virtual void SetFontSize(short iFontSize)=0
virtual void FillDonutOrSphere(const FormatFill *ipFill, const Rect2D &irBoundingRect, bool iIsCircularShape)=0
virtual void LineTo(double iX, double iY, bool iIsCurveAnimation=false, FPoint2D *iBasePoint=NULL)=0
virtual ChartContext * GetContext()
virtual void SetRGBAStrokeColor(float iRed, float iGreen, float iBlue, float iAlpha)=0
virtual void BeginLastFrame()=0
Definition: ChartContext.h:542
Definition: ChartCanvas.h:25
virtual void Rotate(const Point2D &irAnchor, double iRadian)=0
Definition: ABLPlot.h:21
virtual void EndFrame()=0
virtual void RestoreColor(const FormatFill *ipFill)=0
virtual void FillPath()=0
virtual void BeginFirstFrame()=0
EnumRadientGradientUsage
Enumeration for radient gradient usage.
Definition: FormatFill.h:34
virtual void AddArc(float iX, float iY, float iRadius, float iStartAngle, float iEndAngle, bool bAntiClockwise)=0
Definition: ChartCanvas.h:39
virtual void ApplyDonutToRect(const Point< double > &irStartPoint, const Point< double > &irEndPoint, const FormatFill *ipFill)=0
virtual void ApplyLineFormat(const FormatLine *ipLine)=0
virtual void FillRadientGradient(const FormatFill *ipFill, EnumRadientGradientUsage iRGUsage, double iCPX, double iCPY, double iInnerRadius, double iOuterRadius, bool iHasExtraPara=false, int iExtraDepth=0, int iExtraIntensity=0)=0
virtual void FillBorderMetallic(const FormatFill *ipFill, short iBorderUse, double iCPX, double iCPY, double iRadius, double iThickness)=0
Definition: RGBColor.h:21
#define NULL
Definition: Null.h:10
virtual void DrawGaugeMarker(FPoint2D *iBasePoint, Int32 &iMarkerSize, Int32 &iMarkerShape, float iAngle, short iNeedSize)=0
virtual void MakeDarker(const FormatFill *ipFill, float iFactor)=0
virtual void AddNeedle(char iNeedleStyle, Point2D iBasePoint, short iAngle, float iSize)=0
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
virtual void SetLineDash(double *ipLinePattern, short iDashNumber)=0
virtual void NewPath()=0
Definition: ChartCanvas.h:26
virtual void AddFormatedText(const FormatFont *ipFont, const Point2D &irStartPoint, const std::string &irText)=0
Definition: FormatFont.h:86
virtual CGPoint GetCurrentPoint()