Mobile API Reference  MicroStrategy 2019
AreaSeriesRenderer.h
Go to the documentation of this file.
1 //=======================================================================
2 // Filename: Kernel/SourceCode/IPhoneChart/PrivateSource/AreaSeriesRenderer.h
3 // Date: 2008-10-06
4 // Authors: Liang Liu, Bing Huang
5 
6 // Copyright (C) 1997-2008 MicroStrategy Incorporated
7 // All rights reserved
8 //=======================================================================
9 
10 #ifndef MsiChart_AreaSeriesRenderer_h
11 #define MsiChart_AreaSeriesRenderer_h
12 
13 #include "SeriesRenderer.h"
14 #include "Vector2D.h"
15 #include "DataLabelManager.h"
16 
17 namespace MsiChart
18 {
19 #ifdef _VE_CE
21 #endif
22  struct ABLPlotContext;
28  {
29  public:
31 
35  AreaSeriesRenderer(const TripleId& irTripleId, GraphObjectManager* ipManager, Dataset::Ptr iDatasetPtr, Legend::Ptr iLegendPtr);
36 
37  virtual void GenerateMapAndList();
38  virtual void GenerateByValueAxis(EnumValueAxis iValueAxis, std::vector<GraphObject::Ptr>& iorGraphObjectList);
39  virtual void GenerateImageMap(ImageMap& iorImageMap);
40 
41 #ifdef _VE_CE
42  virtual void GenerateInterpolationFrame(double iProgress, GraphObjectAggregation* ipLayerObject);
43 #else
44  virtual void GenerateInterpolationFrame(double iProgress, LayerObject* ipLayerObject);
45 #endif
46  //override function.
47  virtual GraphObject::Ptr OnPointDetectionEx(const Point2D& irCursor,
48  const std::vector<Int32>& irObjectIds, Int32& iorDistance, Int32 iRadius,
49  std::vector<GraphObject::Ptr>& iorGraphObjectsAround, EnumGraphObjectUsage iUsage = GOU_NORMAL_HIGHLIGHT);
50  virtual void AddObjectsToDataLabelManager(DataLabelManager::Ptr iDataLabelManagerPtr);
51  void hCreateDataMarkerForDataLabel(bool iOnlyForDisplayedDataLable = true);
52  private:
58  void hGenerateAreaCollections(EnumValueAxis iValueAxisIndex);
62  void hGenerateDataLabels();
68  void hGenerateLabelsForSeries(Int32 iSeriesIndex);
76  void hGenerateNaiveSideFaces(Int32 iSeriesIndex, const Polygon2D& irPolygon, Int32 iGroupId);
83  void hGenerateRisers(EnumValueAxis iValueAxisIndex);
90  void hGenerateSideFaces(EnumValueAxis iValueAxisIndex, Int32 iGroupId);
97  void hGenerateTrickySideFaces(EnumValueAxis iValueAxisIndex, Int32 iGroupId);
103  void hGenerateTotalLabelsByAxis(EnumValueAxis iValueAxisIndex, GraphCollectionObject::Ptr iTotalCollectionPtr);
109  void hGenerateRisersForSeries(Int32 iSeriesIndex, bool iUseDepth);
116  void hGenerateOnePolygon(Int32 iSeriesIndex, const Polygon2D& irPolygon, bool iUseDepth);
123  bool hGetSeriesPolygon(Int32 iSeriesIndex, Polygon2D& orPolygon);
124 
125  void hAddVirtualMarkersToImageMap(EnumValueAxis iValueAxisIndex, ImageMap& iorImageMap);
126 
127  void hAddSeriesVirtualMarkersToImageMap(Int32 iSeriesIndex, ImageMap& iorImageMap);
128 
129  void hInitSeriesPolygons();
130 
131  void hParsePolygon(const Polygon2D& irPolygon, std::vector<std::vector<Point2D> >& orPolygonUnits, std::vector<std::vector<Point2D> >& orSeriesPolygonBounder, int iSeriesIndex) const;
132 
133  bool hGetPolygonUnit(Int32 iSeriesIndex, Int32 iGroupId, Polygon2D& orPolygonUnit) const;
134 
135  void hGenerateVirtualMarkers(EnumValueAxis iValueAxisIndex);
136  void hGenerateVirtualMarkersBySeries(Int32 iSeriesIndex);
137  void GetAreaPointByProgress(int iSeriesIndex, int iPointIndex, double iProgress, Point2D& orAreaPoint);
138 
139  //GraphMatrix Stuff
143  void hGenerateOneRiser(Int32 iSeriesIndex, Int32 iGroupIndex, const Polygon2D& irPolygon, bool iUseDepth);
144  GraphObject::Ptr hGenerateOnePolygon(const TripleId& irAreaId, const Polygon2D& irPolygon, bool iUseDepth, GraphCollectionObject* ipSet);
145  void hSplitPolygon(const Polygon2D& irPolyGon, std::vector<Polygon2D>& orSplitPolyGonSet, Int32 iSplitSpan) const;
146 
147  void hPrepareAnimation();
148 
151  Int32 hGetSeriesPolygonIndex(Int32 iSeriesIndex);
152  //End of GM
158  std::vector<GraphCollectionObject::Ptr> mAreaCollection;
159 
160  std::vector<std::vector<Point2D> > mSeriesPolygons;
161 
162  std::vector<std::vector<Point2D> > mFinalSeriesPolygons;
163 
164  std::vector<Int32> mSeriesDrawingOrder;
165  std::set<Int32> mTransitionalSet;
166 
167  bool mIsAbsolute;
168  mutable bool mIsPolygonSplit;
169  bool mSupportAnimation;
170 
171  std::vector<std::vector<EnumValueAxis> > mAxisGenInfo;
172 
173  mutable std::vector<std::pair<Int32, Int32> > mGroupRangeList;
174  void hPopulateGroupRangeListPerSeries(const std::vector<std::vector<Point2D> >& irPolygonUnits) const;
175  void hPopulateGroupIdMapPerSeries(const std::vector<Point2D>& irPolygonUnit) const;
176 
177  void hSplitGroupRangeListPerSeries(Int32 iSplitSpan) const;
178  Int32 hGetStartGroupIndexForPolygonAt(Int32 iPolygonIndex, Int32 iCanidate);
179  bool hIsAtHighSideToBase(bool iIsVertical, Int32 iBasePosition, bool iIsStringent, const Point2D& irPoint) const;
180  void hUpdatePolygonSize(Int32& iBasePosition, Int32& iValuePosition, double iValue, double iBaseValue);
181  void hPushDownBaseSide(Polygon2D& iorPolygon, bool iIsVertical) const;
182  // Move the entire polygon by iOffset pixels. if iOffset is :
183  // Positive : Move Up(Vertical), Move Right(Horizontal)
184  // Negative : Move Down(Vertical), Move Left(Horizontal)
185  void hMovePolygon(Polygon2D& iorPolygon, Int32 iOffset, bool iIsVertical) const;
186  bool hUpdateBaseSide(Polygon2D& iorPolygon, ValueAxis* iValueAxisPtr, bool iIsVertical);
187 
188  //Generate one polygonline object, to draw as the stroke of the areas
189  void hGenerateOnePolylineBounderForDataLabel(Int32 iSeriesIndex, Int32 iGroupIndex, const Polygon2D& irPolygon, bool iUseDepth);
190  void hGenerateStorkeBounderForOneRiser(Int32 iSeriesIndex, Int32 iGroupIndex, const Polygon2D& irPolygon, bool iUseDepth);
191  GraphObject::Ptr hGenerateOnePolygonBounder(const TripleId& irAreaId, const Polygon2D& irPolygon, Int32 iSeriesIndex);
192 
193  TripleId hGetBelowMarkerObjectID(const TripleId& lMarkerId, const Point2D& irCursor);
194 
195  //-------------Data Label for GM------------//
196  GMDataLabelVecs mDataLabelsVec;
197  std::vector<GraphObject::Ptr> mAreaBoundForDL;
198  std::vector<GraphObject::Ptr > mSinglePointObjects;
199  void CreateAllDataLabels();
200  DataLabelManager::Ptr hInitDataLabelManager();
201 
202  bool hCalculateDLBasePointAndOffset(GMDataLabelInfo &iorDataLabel);
203  void hPrepareDataLabelPositions();
204  int hGetDLIndexInVec(Int32 iSeriesId, Int32 iGroupId);
205  void hCreateAreaMarkers();
206  //Int32 hGetCorrectLineObjectGroupIdInSeriesPoints(Int32 iInfoIndex, Int32 irGroupId);
207  };
208 
209 }
210 
211 #endif
Definition: LayerObject.h:21
virtual void GenerateImageMap(ImageMap &iorImageMap)
virtual void AddObjectsToDataLabelManager(DataLabelManager::Ptr iDataLabelManagerPtr)
Definition: GraphCollectionObject.h:19
EnumValueAxis
Definition: Plot.h:54
Definition: ValueAxis.h:85
Definition: Dataset.h:198
EnumGraphObjectUsage
Definition: GraphObject.h:28
virtual void GenerateByValueAxis(EnumValueAxis iValueAxis, std::vector< GraphObject::Ptr > &iorGraphObjectList)
virtual void GenerateMapAndList()
std::vector< Point2D > Polygon2D
Definition: GraphObject.h:25
#define Int32
Definition: BasicTypes.h:20
void hCreateDataMarkerForDataLabel(bool iOnlyForDisplayedDataLable=true)
virtual GraphObject::Ptr OnPointDetectionEx(const Point2D &irCursor, const std::vector< Int32 > &irObjectIds, Int32 &iorDistance, Int32 iRadius, std::vector< GraphObject::Ptr > &iorGraphObjectsAround, EnumGraphObjectUsage iUsage=GOU_NORMAL_HIGHLIGHT)
MSynch::SmartPtr< AreaSeriesRenderer > Ptr
Definition: AreaSeriesRenderer.h:30
Definition: DataLabelManager.h:54
virtual void GenerateInterpolationFrame(double iProgress, LayerObject *ipLayerObject)
Definition: ABLPlot.h:21
AreaSeriesRenderer(const TripleId &irTripleId, GraphObjectManager *ipManager, Dataset::Ptr iDatasetPtr, Legend::Ptr iLegendPtr)
Definition: ABLPlot.h:144
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
Definition: AreaSeriesRenderer.h:27
std::vector< GMDataLabelInfo > GMDataLabelVecs
Definition: DataLabelManager.h:93
Definition: GraphObjectManager.h:37
Definition: GraphObjectAggregation.h:22
Definition: GraphObject.h:30
Definition: Common.h:397
Definition: SeriesRenderer.h:52