Mobile API Reference  MicroStrategy 2019
CurveLineObject.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : CurveLineObject.h
3 // AUTHOR : Xin Liu, Bing Huang
4 // CREATION : 11/19/2008
5 // Copyright (C) MicroStrategy, Inc. 2008
6 //==============================================================================================
7 
8 #ifndef MSICHART_CURVELINEROBJECT_H
9 #define MSICHART_CURVELINEROBJECT_H
10 
11 #include "PDCHeader/PDCvector"
12 #include "GraphObject.h"
13 #include "BezierCurve.h"
14 
15 namespace MsiChart
16 {
21  {
22  public:
24 
29  CurveLineObject(const TripleId& irTripleId, GraphObjectManager* ipManager,
30  const std::vector<Point2D>& irPoints, GraphCollectionObject* ipParentObject = NULL, bool iHasLineFormat = true, bool iIsVertical = true, bool iIsClosePath = false);
31 
36  CurveLineObject(const TripleId& irTripleId, GraphObjectManager* ipManager,
37  BezierCurve::Ptr iBezierCurvePtr, GraphCollectionObject* ipParentObject = NULL, bool iHasLineFormat = true, bool iIsClosePath = false);
39 
40  // virtual functions from GraphObject
41  virtual void Draw() const;
42  virtual void DrawOutLine();
43  virtual bool PointInObject(const Point2D& irPoint);
44  virtual bool ObjectInRectangle(const Rect2D& irRect);
45  virtual void GenerateImageMap(ImageMap& iorImageMap);
46 
51  void AddBezierCurveLine(BezierCurve::Ptr iBezierCurvePtr);
52 
58  void MoveToStart(bool iIsLinePath = false) const;
59 
65  void CurveToEnd(bool iIsLinePath = false) const;
66 
72  void LineToStart(bool iIsLinePath = false) const;
73 
78  FPoint2D GetStartPoint() const;
79 
84  FPoint2D GetEndPoint() const;
85 
91  double Evaluate(Int32 iIndependentValue) const;
92 
98  void GetMinMax(Int32& orMin, Int32& orMax) const;
99 
104  void GetApproximatePolyline(std::vector<Point2D>& orPolyline) const;
105 
115 
120  CurveLineObject::Ptr Clone() const;
121 
125  void Reverse();
126 
131  float GetMinX() const;
136  float GetMaxX() const;
137 
145  bool IsBefore(const Point2D& irOffset, CurveLineObject::Ptr iCurveLinePtr) const;
146 
154  void SplitAtTangentPoints(const Point2D& irOffset, std::vector<CurveLineObject::Ptr>& orSplitCurves);
155 
163  void SplitAtIntersections(CurveLineObject::Ptr iCurveLinePtr, std::vector<CurveLineObject::Ptr>& orSplitCurves);
164 
165  protected:
166  //pure virtual functions from GraphObject
167  virtual void GetClockwisePolygon(std::vector<Point2D>& orPolygon) const;
168 
169  private:
174  void hGenerateBezierCurveLines(const std::vector<Point2D>& irPoints);
175 
182  void hSplitAtTangentPointRecursive(const Point2D& irOffset, std::vector<CurveLineObject::Ptr>& orSplitCurves);
183 
191  void hSplitInsideBezierRecursive(CurveLineObject::Ptr iCurveLinePtr, std::vector<CurveLineObject::Ptr>& orSplitCurves);
192 
201  void hSplitEndPointBezierRecursive(CurveLineObject::Ptr iCurveLinePtr, std::vector<CurveLineObject::Ptr>& orSplitCurves);
202 
210  CurveLineObject::Ptr hCreateCurveLine(const BezierCurve::Ptr iBezierCurvePtr, Int32 iIndex);
211 
215  void hTridiagonalSolve(std::vector<double>& irB, std::vector<double>& irC, std::vector<double>& irD, std::vector<double>& orX);
216 
217  std::vector<BezierCurve::Ptr> mBezierCurves;
218  bool mIsVertical;
219  bool mIsClosePath;
220  };
221 }
222 
223 #endif
bool IsBefore(const Point2D &irOffset, CurveLineObject::Ptr iCurveLinePtr) const
void AddBezierCurveLine(BezierCurve::Ptr iBezierCurvePtr)
virtual bool PointInObject(const Point2D &irPoint)
Definition: GraphCollectionObject.h:19
CurveLineObject(const TripleId &irTripleId, GraphObjectManager *ipManager, const std::vector< Point2D > &irPoints, GraphCollectionObject *ipParentObject=NULL, bool iHasLineFormat=true, bool iIsVertical=true, bool iIsClosePath=false)
virtual void DrawOutLine()
Definition: CurveLineObject.h:20
void SplitAtTangentPoints(const Point2D &irOffset, std::vector< CurveLineObject::Ptr > &orSplitCurves)
CurveLineObject::Ptr CloneReverseShift(const Point2D &irOffset)
void SplitAtIntersections(CurveLineObject::Ptr iCurveLinePtr, std::vector< CurveLineObject::Ptr > &orSplitCurves)
virtual void GetClockwisePolygon(std::vector< Point2D > &orPolygon) const
MSynch::SmartPtr< CurveLineObject > Ptr
Definition: CurveLineObject.h:23
#define Int32
Definition: BasicTypes.h:20
virtual void GenerateImageMap(ImageMap &iorImageMap)
void LineToStart(bool iIsLinePath=false) const
void MoveToStart(bool iIsLinePath=false) const
double Evaluate(Int32 iIndependentValue) const
Definition: GraphObject.h:38
virtual bool ObjectInRectangle(const Rect2D &irRect)
Definition: ABLPlot.h:21
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
virtual void Draw() const
void GetApproximatePolyline(std::vector< Point2D > &orPolyline) const
void GetMinMax(Int32 &orMin, Int32 &orMax) const
void CurveToEnd(bool iIsLinePath=false) const
FPoint2D GetStartPoint() const
#define NULL
Definition: Null.h:10
Definition: GraphObjectManager.h:37
CurveLineObject::Ptr Clone() const
FPoint2D GetEndPoint() const
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
Definition: Common.h:397