Mobile API Reference  MicroStrategy 2019
GaugeValueAxis.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : GaugeValueAxis.h
3 // AUTHOR : Liang Liu
4 // CREATION : 2009-03-02
5 // Copyright (C) MicroStrategy Incorporated 2009
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MsiChart_GaugeValueAxis_h
9 #define MsiChart_GaugeValueAxis_h
10 
11 #include "ValueAxis.h"
12 
13 namespace MsiChart
14 {
15  // The distance between the center and the tip of grid line will be mRadius - mRadius / gGridLineMarginFactor.
16  extern const Int32 gGridLineMarginFactor;
17 
18  // The length of grid line will be mRadius / gGridLineLengthFactor.
19  extern const Int32 gGridLineLengthFactor;
20 
25  class GaugeValueAxis: public ValueAxis
26  {
27  public:
29 
35  GaugeValueAxis(const TripleId& irTripleId,
36  GraphObjectManager* ipManager,
37  double iMin,
38  double iMax,
39  Int32 iStartAngle,
40  Int32 iStopAngle,
41  float iRadius,
42  bool iUseOldStyle,
43  bool iDrawLabelsOutside);
44  virtual ~GaugeValueAxis();
45 
46  // Override methods
47  virtual void GenerateMapAndList();
48 
56  void GenerateGridLines(const Point2D& irCenter);
64  void GenerateLabels(const Point2D& irCenter);
65 
71  float ValueToAngle(double iValue) const;
72 
79  bool ValueToAngle(double iValue, float& orAngle) const;
80 
81  protected:
87  virtual void hCreateOneTickLabel(const TripleId& irTripleId, double iTickValue);
88 
90  virtual double hComputeStep(double iMaximum, double iMinimum, bool iIncludeZero);
91 
92  float mStartAngle;
93  float mStopAngle;
94  float mRadius;
96  bool mUseOldStyle;
98 
99  private:
106  void hCreateOneGridLine(const TripleId& irTripleId, double iTickValue, GraphCollectionObject* ipGridLineSet);
107 
114  Point2D hGetPointByAngleAndRadius(double iAngleRad, double iRadius) const;
115 
122  void hAdjustLabelCenterByAngle(Point2D& iorLabelCenter, Int32 iLabelWidth, float iAngle) const;
123  };
124 
125 }
126 #endif
bool mUseOldStyle
Indicates whether to use old style or not.
Definition: GaugeValueAxis.h:96
MSynch::SmartPtr< GaugeValueAxis > Ptr
Definition: GaugeValueAxis.h:28
GaugeValueAxis(const TripleId &irTripleId, GraphObjectManager *ipManager, double iMin, double iMax, Int32 iStartAngle, Int32 iStopAngle, float iRadius, bool iUseOldStyle, bool iDrawLabelsOutside)
virtual double hComputeStep(double iMaximum, double iMinimum, bool iIncludeZero)
Inherited from ValueAxis. Build relation between step and radius.
Point2D mCenter
Indicates the center of current Gauge.
Definition: GaugeValueAxis.h:95
Definition: GraphCollectionObject.h:19
float ValueToAngle(double iValue) const
Definition: ValueAxis.h:85
#define Int32
Definition: BasicTypes.h:20
const Int32 gGridLineLengthFactor
virtual void GenerateMapAndList()
Definition: GaugeValueAxis.h:25
Definition: ABLPlot.h:21
float mStartAngle
Indicates the start angle of current Gauge axis.
Definition: GaugeValueAxis.h:92
float mRadius
Indicates the radius of current Gauge.
Definition: GaugeValueAxis.h:94
float mStopAngle
Indicates the stop angle of current Gauge axis.
Definition: GaugeValueAxis.h:93
void GenerateGridLines()
Definition: GraphObjectManager.h:37
const Int32 gGridLineMarginFactor
void GenerateLabels(const Point2D &irCenter)
virtual void hCreateOneTickLabel(const TripleId &irTripleId, double iTickValue)
Definition: Common.h:397
bool mDrawLabelsOutside
Indicates whether to draw labels outside or not. This option is disabled when mUseOldStyle is false...
Definition: GaugeValueAxis.h:97