Mobile API Reference  MicroStrategy 2019
PolarValueAxis.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : PolarValueAxis.h
3 // AUTHOR : Liang Liu
4 // CREATION : 2009-02-17
5 // Copyright (C) MicroStrategy Incorporated 2009
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MsiChart_PolarValueAxis_h
9 #define MsiChart_PolarValueAxis_h
10 
11 #include "ValueAxis.h"
12 
13 namespace MsiChart
14 {
15  extern const Int32 gLabelMarginFactor;
16 
20  struct PolarInfo
21  {
22  PolarInfo(const Rect2D& irFrameRect);
28  void LoadProperties(ChartContext::Ptr iChartContextPtr, Int32 iChartAreaId);
34  bool GetOptions(Int32 iPropertyId, VARIANT* opValue) const;
35 
36  float mStartAngle;
37  bool mUseSpiderLines;
42  bool mIsClockwise;
46  unsigned char mMarkerShape;
50  std::vector<float> mXTickAngles;
51  std::vector<double> mXTicks;
52  };
57  class PolarValueAxis: public ValueAxis
58  {
59  public:
61 
66  PolarValueAxis(const TripleId& irTripleId,
67  GraphObjectManager* ipManager,
68  double iMin,
69  double iMax,
70  const PolarInfo& irPolarInfo,
71  bool iLargerGridInterval = false);
72  virtual ~PolarValueAxis();
73 
74  // Override methods
75  virtual void GenerateMapAndList();
82  virtual void ReserveLabelArea(Rect2D& iorArea, bool iIsReversed);
83 
88  void UpdateLabelLocation(Rect2D& iorLabelArea);
94  void UpdateTitleLocation(const Rect2D& irTitleArea);
95 
102  Point2D GetPointByAngleAndRadius(double iAngleRad, double iRadius) const;
103 
109  float ValueToAngle(double iValue) const;
116  bool ValueToAngle(double iValue, float& orAngle) const;
123  float ValueToRadius(double iValue, bool iTruncate = false) const;
130  bool ValueToRadius(double iValue, float& orRadius) const;
131 
136  Point2D GetCenter() const;
137 
138  virtual double GetLogicalCoord(Int32 iAbsoluteCoord);
139  virtual float GetAbsoluteCoord(double iLogicalCoord);
140 
147  double MapRadiusByAngle(double iAngleRad, double iRadius) const;
154  void MapRouAndDRouByAngle(double iAngleRad, double& iorRou, double& iorDRou) const;
160  double GetAbsoluteSlope(double iLogicalSlope, double iLogicalX, double iLogicalY) const;
164  void SetFramePath() const;
165 
170  void GetXTicks(std::vector<double>& orTicks) const;
171 
176  bool IsSpiderGrid() const;
177 
182  const PolarInfo& GetPolarInfo() const;
183 
188 
192  void GenerateInterlacedGrids();
193 
194  protected:
201  void hUpdateOneLabelLocation(Int32 iGraphObjectIndex, double iTickValue);
202 
204 
205  private:
207  void hGenerateAxisLine();
208 
209  //void hGenerateRemoteLines();
216  void hAdjustLabelCenterByAngle(Point2D& iorLabelCenter, Int32 iLabelWidth, float iAngle) const;
224  void hGenerateGridByValue(double iValue, GraphCollectionObject* ipGridLineSet, bool iIsMajor);
228  void hGenerateMajorGrid();
232  void hGenerateMinorGrid();
233 
234  void hGenerateRemoteLines(GraphCollectionObject* ipGridLineSet);
235 
236  void hGenerateRemoteLineByValue(double iValue, GraphCollectionObject* ipGridLineSet);
237 
238  float hGetYAxisAngle() const;
239 
240  bool hIsXAxis() const;
241 
242  bool hIsY2Axis() const;
243 
244  void hNormalizeAngle(float& iorAngle) const;
245  };
246 
247  inline bool PolarValueAxis::hIsXAxis() const
248  {
250  }
251  inline bool PolarValueAxis::hIsY2Axis() const
252  {
254  }
255  inline bool PolarValueAxis::IsSpiderGrid() const
256  {
258  }
259 
261  {
262  return mrPolarInfo;
263  }
264 }
265 #endif
void UpdateLabelLocation(Rect2D &iorLabelArea)
Point2D GetPointByAngleAndRadius(double iAngleRad, double iRadius) const
PolarInfo(const Rect2D &irFrameRect)
const PolarInfo & GetPolarInfo() const
Definition: PolarValueAxis.h:260
float ValueToAngle(double iValue) const
Int32 mObjectId
Definition: Common.h:406
bool mShowMarkers
Definition: PolarValueAxis.h:45
bool mConnectFirstLast
Indicates whether the first data point should be connected to the last data point.
Definition: PolarValueAxis.h:40
Point2D GetCenter() const
void GetXTicks(std::vector< double > &orTicks) const
bool mShowDataLines
Definition: PolarValueAxis.h:39
Definition: PolarValueAxis.h:20
Definition: GraphCollectionObject.h:19
void LoadProperties(ChartContext::Ptr iChartContextPtr, Int32 iChartAreaId)
float mStartAngle
Definition: PolarValueAxis.h:36
virtual double GetLogicalCoord(Int32 iAbsoluteCoord)
Point2D mCenter
Definition: PolarValueAxis.h:47
MSynch::SmartPtr< PolarValueAxis > Ptr
Definition: PolarValueAxis.h:60
Definition: ValueAxis.h:85
bool IsSpiderGrid() const
Definition: PolarValueAxis.h:255
const Int32 gLabelMarginFactor
void UpdateTitleLocation(const Rect2D &irTitleArea)
float ValueToRadius(double iValue, bool iTruncate=false) const
bool mIsLogarithmicX
Indicates whether X axis uses logarithmic scale or not.
Definition: PolarValueAxis.h:43
double GetAbsoluteSlope(double iLogicalSlope, double iLogicalX, double iLogicalY) const
Definition: DSSIPhoneEnums.h:849
std::vector< double > mXTicks
Maintains the ticks of X axis.
Definition: PolarValueAxis.h:51
#define Int32
Definition: BasicTypes.h:20
bool mShowXMajor
Definition: PolarValueAxis.h:44
GraphObject::Ptr GenerateFrame()
bool mIsClockwise
Indicates whether the angle axis goes clockwise or not.
Definition: PolarValueAxis.h:42
virtual float GetAbsoluteCoord(double iLogicalCoord)
bool mUseSpiderLines
If this is true, spider grid lines are used. Otherwise, circular grid lines are used.
Definition: PolarValueAxis.h:38
Definition: ChartContext.h:542
void hUpdateOneLabelLocation(Int32 iGraphObjectIndex, double iTickValue)
const TripleId mTripleId
Identifiy current GraphObjectManager.
Definition: GraphObjectManager.h:270
bool GetOptions(Int32 iPropertyId, VARIANT *opValue) const
Definition: DSSIPhoneEnums.h:864
Definition: ABLPlot.h:21
const PolarInfo & mrPolarInfo
Keeps a reference to the polar information struct.
Definition: PolarValueAxis.h:203
virtual void GenerateMapAndList()
bool mUseRemoteAxis
Indicates whether remote axis is used or not.
Definition: PolarValueAxis.h:41
std::vector< float > mXTickAngles
Maintains the tick angles of X axis.
Definition: PolarValueAxis.h:50
Definition: Msi_variant.h:147
void MapRouAndDRouByAngle(double iAngleRad, double &iorRou, double &iorDRou) const
Definition: DSSIPhoneEnums.h:876
Int32 mRadius
Definition: PolarValueAxis.h:48
Definition: PolarValueAxis.h:57
Rect2D mFrameRect
Definition: PolarValueAxis.h:49
PolarValueAxis(const TripleId &irTripleId, GraphObjectManager *ipManager, double iMin, double iMax, const PolarInfo &irPolarInfo, bool iLargerGridInterval=false)
Definition: GraphObjectManager.h:37
double MapRadiusByAngle(double iAngleRad, double iRadius) const
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
unsigned char mMarkerShape
Indicates the marker shape.
Definition: PolarValueAxis.h:46
virtual void ReserveLabelArea(Rect2D &iorArea, bool iIsReversed)
Definition: Common.h:397