Mobile API Reference  MicroStrategy 2019
ShapeObject.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : ShapeObject.h
3 // AUTHOR : Liang Liu
4 // CREATION : 2008-05-21
5 // Copyright (C) MicroStrategy Incorporated 2008
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MsiChart_ShapeObject_h
9 #define MsiChart_ShapeObject_h
10 
11 #include "PDCHeader/PDCvector"
12 #include "GraphObject.h"
13 #include "FormatFill.h"
14 
15 namespace MsiChart
16 {
20  class ShapeObject: public GraphObject
21  {
22  public:
24 
32  ShapeObject(const TripleId& irTripleId, GraphObjectManager* ipManager, GraphCollectionObject* ipParentObject, bool iHasFill = true, bool iHasLine = true);
33  virtual ~ShapeObject();
34 
38  void SetFormatFill(FormatFill::Ptr iFormatFillPtr);
39 
44 
45  // Inherite from GraphObject class.
46  virtual void GetOptions(Int32 iPropertyId, CComVariant* opValue) const;
47 
51  virtual bool SupportBevelEffect() const;
52 
57  bool IsCompletelyOpaque() const;
58 
60  void ResetRectangleView();
61  void ResetRectangleView(void * ipRectanlgeView);
62  void* GetRectangleView();
63  void SetRectangleView(void *iRectangleView);
64 
68  void UpdateMarkerColor(const RGBColor& irColor);
69 
70  bool IsRectanleViewReusable(double iPreviousZoomScale) const;
71 
72  /*
73  Check whether current rectangle object is opaque or not.
74  @return Return true is current rectangle object is opaque. Otherwise, return false.
75  */
76  bool IsOpaque() const;
77 
81  void SetAllowThreshold(bool iAllowThreshold);
82 
85 
86  protected:
88  virtual void ApplyFillFormat() const;
89 
93  virtual void FillBevel() const;
94 
99  virtual bool IsCircularShape() const;
100 
105  void GetBoundingRectFromPolygon(const std::vector<Point2D>& irPolygon, Rect2D& orRect) const;
106 
113  void GetTranslatedPolygon(Polygon2D& irPolygon, const Point2D& irOffset, Polygon2D& orPolygon) const;
114 
119  // bool UseThresholdColor() const;
120 
125  bool UsePictureFill() const;
126 
132  virtual void AddCompensativeLayer() const;
133 
155 #ifndef _VE_CE
156  CGContextRef CreateARGBBitmapContext (int iWidth, int iHeight) const;
157 
159  CGGradientRef CreateGlowGradient() const;
160 #endif
161 
163 
165  mutable void* mpRectangleView;
166 
167 
168 
169  /*
170  // Create surface from images
171  cairo_surface_t* hCreateSurfaceFromJPEG(FILE* ipFile) const;
172  cairo_surface_t* hCreateSurfaceFromBMP(FILE* ipFile) const;
173  cairo_surface_t* hCreateSurfaceFromGIF(FILE* ipFile) const;
174  cairo_surface_t* hCreateSurfaceFromImageFile(const char* iFilename) const;
175  Int32 hReadByteFromFile(FILE* iFile) const; // Helper function
176  */
177  private:
178  virtual void hGetFormatFromParent();
179  };
180 
182  {
183  return mFormatFillPtr;
184  }
186  {
187  return (mFormatFillPtr.IsNull() == false) && (mFormatFillPtr->mAlpha == 255);
188  }
189 
190  inline void ShapeObject::ResetRectangleView(void * ipRectanlgeView)
191  {
192  if (ipRectanlgeView == mpRectangleView)
193  {
195  }
196  }
197 
199  {
201  }
202 
203  inline void ShapeObject::SetAllowThreshold(bool iAllowThreshold)
204  {
205  mAllowThreshold = iAllowThreshold;
206  }
208  {
209  return mpRectangleView;
210  }
211  inline void ShapeObject::SetRectangleView(void *iRectangleView)
212  {
213  mpRectangleView = iRectangleView;
214  }
215 }
216 #endif
bool UsePictureFill() const
CGGradientRef CreateGlowGradient() const
Create a gradient for glow effect.
void GetBoundingRectFromPolygon(const std::vector< Point2D > &irPolygon, Rect2D &orRect) const
bool IsNull() const
Definition: SmartBase.h:83
ShapeObject(const TripleId &irTripleId, GraphObjectManager *ipManager, GraphCollectionObject *ipParentObject, bool iHasFill=true, bool iHasLine=true)
virtual void ApplyFillFormat() const
This function fills current ShapeObject with the information in mFormatFill.
virtual void FillBevel() const
void * mpRectangleView
Maintains a pointer to related rectangle view if applicable.
Definition: ShapeObject.h:165
void ResetRectangleView()
Clear the reference to related RectangleView.
Definition: ShapeObject.h:198
bool IsOpaque() const
virtual void GetOptions(Int32 iPropertyId, CComVariant *opValue) const
Definition: GraphCollectionObject.h:19
bool mAllowThreshold
For some bars, like the difference bar of lipstick, we don&#39;t want to apply threshold.
Definition: ShapeObject.h:162
virtual bool IsCircularShape() const
bool IsCompletelyOpaque() const
Definition: ShapeObject.h:185
virtual void AddCompensativeLayer() const
Definition: ShapeObject.h:20
CGContextRef CreateARGBBitmapContext(int iWidth, int iHeight) const
std::vector< Point2D > Polygon2D
Definition: GraphObject.h:25
void SetAllowThreshold(bool iAllowThreshold)
Definition: ShapeObject.h:203
#define Int32
Definition: BasicTypes.h:20
FormatFill::Ptr mFormatFillPtr
A pointer to FormatFill object.
Definition: ShapeObject.h:84
FormatFill::Ptr GetFormatFill() const
Definition: ShapeObject.h:181
MSynch::SmartPtr< ShapeObject > Ptr
Definition: ShapeObject.h:23
bool IsRectanleViewReusable(double iPreviousZoomScale) const
Definition: GraphObject.h:38
Definition: SmartPtr.h:38
void UpdateMarkerColor(const RGBColor &irColor)
void * GetRectangleView()
Definition: ShapeObject.h:207
void SetRectangleView(void *iRectangleView)
Definition: ShapeObject.h:211
Definition: ABLPlot.h:21
void SetFormatFill(FormatFill::Ptr iFormatFillPtr)
Definition: Msi_ccomvariant.h:24
void GetTranslatedPolygon(Polygon2D &irPolygon, const Point2D &irOffset, Polygon2D &orPolygon) const
Definition: RGBColor.h:21
#define NULL
Definition: Null.h:10
Definition: GraphObjectManager.h:37
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
virtual bool SupportBevelEffect() const
Definition: Common.h:397