Mobile API Reference  MicroStrategy 2019
TrendLineObject.h
Go to the documentation of this file.
1 //====================================================================
2 // Filename: Kernel/SourceCode/IPhoneChart/PrivateSource/TrendLineObject.h
3 // Date: 2008-11-04
4 // Authors: Bing Huang
5 
6 // Copyright (C) 1997-2008 MicroStrategy Incorporated
7 // All rights reserved
8 //====================================================================
9 
10 #ifndef MsiChart_TrendLineObject_h
11 #define MsiChart_TrendLineObject_h
12 
13 #include "GraphObject.h"
14 #include "TextObject.h"
15 #include "CurveLineObject.h"
16 
17 namespace MsiChart
18 {
19  //extern variable
20  extern const Int32 gMaxTrendLineTextLength;
21 
22  //pre-declaration
23  class CategoryPlot;
24  class Axis;
25 
26  struct GraphTrendLineOptions;
27 
29  {
30  public:
32 
33  TrendLineObject(const TripleId& irTripleId, EnumDSSGraphObject iRealObjectId, GraphObjectManager* ipManager, GraphCollectionObject* ipParentObject,
34  Axis* ipXAxis, Axis* ipYAxis,
35  GraphTrendLineOptions* ipTrendLineOptions, const Rect2D& irDataArea, bool iIsVertical,
36  const Point2D& irDepthOffset);
37 
38  //virtual functions from GraphObject
39  virtual void Draw() const;
40  virtual void DrawOutLine();
41  virtual bool PointInObject(const Point2D& irPoint);
42  virtual void GenerateImageMap(ImageMap& iorImageMap);
43  virtual bool ObjectInRectangle(const Rect2D& irRect);
44 
52  virtual void SetData(const std::vector<double>& irX, const std::vector<double>& irY);
53 
60  const EnumDSSGraphObject GetRealObjectId() const;
61 
67 
68  protected:
74  virtual bool ComputeEquation(const std::vector<double>& irX, const std::vector<double>& irY) = 0;
75 
81  virtual void ComputeR(const std::vector<double>& irX, const std::vector<double>& irY) = 0;
82 
86  virtual void GetEquationString(wchar_t* iorString) = 0;
87 
93  virtual double GetY(double iX) const = 0;
94 
100  virtual double GetSlope(double iX) const = 0;
101 
105  virtual void CreateEquationText();
106 
110  virtual void CreateCurveLine();
111 
115  void CreatePolarCurveLine();
116 
121  bool IsPolarTrendLine() const;
122 
135  void GaussElimination(std::vector<double>& irA, std::vector<double>& iorXY, const Int32 iSize);
136 
141  bool IsAxisY2();
142 
149  BezierCurve::Ptr CreateBezierCurve(double iStartXLogical, double iEndXLogical) const;
150 
155  virtual void GetClockwisePolygon(std::vector<Point2D>& orPolygon) const;
156 
162  bool IsZero(double& irValue) const;
163 
172  bool IsInBoundary(double& irNumber) const;
173 
179  void AddToLogarithmAxisCurve(double iStartXLogical, double iEndXLogical, double iStep);
180 
186  void AddToPolarCurve(double iStartXLogical, double iEndXLogical, double iStep);
187 
188  //member variables
198  double mMinXLogical;
199  double mMaxXLogical;
200  double mMinYLogical;
201  double mMaxYLogical;
202 
203  };
204 
206  {
207  return mRealObjectId;
208  }
209 }
210 
211 #endif
virtual bool ObjectInRectangle(const Rect2D &irRect)
Rect2D mDataArea
Definition: TrendLineObject.h:192
EnumDSSGraphObject mRealObjectId
Definition: TrendLineObject.h:196
bool IsZero(double &irValue) const
TextObject::Ptr GetEquationText()
TrendLineObject(const TripleId &irTripleId, EnumDSSGraphObject iRealObjectId, GraphObjectManager *ipManager, GraphCollectionObject *ipParentObject, Axis *ipXAxis, Axis *ipYAxis, GraphTrendLineOptions *ipTrendLineOptions, const Rect2D &irDataArea, bool iIsVertical, const Point2D &irDepthOffset)
bool IsInBoundary(double &irNumber) const
virtual void Draw() const
const EnumDSSGraphObject GetRealObjectId() const
Definition: TrendLineObject.h:205
void AddToPolarCurve(double iStartXLogical, double iEndXLogical, double iStep)
Definition: TrendLineObject.h:28
virtual void SetData(const std::vector< double > &irX, const std::vector< double > &irY)
virtual void CreateCurveLine()
Definition: GraphCollectionObject.h:19
virtual void GetEquationString(wchar_t *iorString)=0
virtual double GetSlope(double iX) const =0
virtual void ComputeR(const std::vector< double > &irX, const std::vector< double > &irY)=0
virtual bool PointInObject(const Point2D &irPoint)
virtual void DrawOutLine()
CurveLineObject::Ptr mCurveLinePtr
Definition: TrendLineObject.h:197
virtual bool ComputeEquation(const std::vector< double > &irX, const std::vector< double > &irY)=0
virtual void GetClockwisePolygon(std::vector< Point2D > &orPolygon) const
EnumDSSGraphObject
Definition: DSSIPhoneEnums.h:823
#define Int32
Definition: BasicTypes.h:20
Definition: Axis.h:123
double mMinXLogical
Definition: TrendLineObject.h:198
TextObject::Ptr mTextPtr
Definition: TrendLineObject.h:195
BezierCurve::Ptr CreateBezierCurve(double iStartXLogical, double iEndXLogical) const
virtual double GetY(double iX) const =0
MSynch::SmartPtr< TrendLineObject > Ptr
Definition: TrendLineObject.h:31
Definition: GraphObject.h:38
Definition: SmartPtr.h:38
double mMaxYLogical
Definition: TrendLineObject.h:201
Definition: ABLPlot.h:21
Axis * mpXAxis
Definition: TrendLineObject.h:189
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
void AddToLogarithmAxisCurve(double iStartXLogical, double iEndXLogical, double iStep)
double mMinYLogical
Definition: TrendLineObject.h:200
double mMaxXLogical
Definition: TrendLineObject.h:199
virtual void CreateEquationText()
bool IsPolarTrendLine() const
virtual void GenerateImageMap(ImageMap &iorImageMap)
Point2D mDepthOffset
Definition: TrendLineObject.h:193
GraphTrendLineOptions * mpTrendLineOptions
Definition: TrendLineObject.h:191
const Int32 gMaxTrendLineTextLength
void GaussElimination(std::vector< double > &irA, std::vector< double > &iorXY, const Int32 iSize)
Definition: GraphObjectManager.h:37
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
Axis * mpYAxis
Definition: TrendLineObject.h:190
Definition: Plot.h:30
bool mIsVertical
Definition: TrendLineObject.h:194
Definition: Common.h:397