Mobile API Reference  MicroStrategy 2019
GraphObjectManager.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : GraphObjectManager.h
3 // AUTHOR : Liang Liu
4 // CREATION : 2008-05-14
5 // Copyright (C) MicroStrategy Incorporated 2008
6 // All Rights Reserved
7 //==============================================================================================
8 #ifndef MsiChart_GraphObjectManager_h
9 #define MsiChart_GraphObjectManager_h
10 
11 #include "PDCHeader/PDCmap"
12 #include "PDCHeader/PDCvector"
13 #include "GraphObject.h"
14 #include "LayerObject.h"
15 
16 namespace MsiChart
17 {
19  {
20  DssChartManager = 20000,
23  // DssPiePlot,
29  };
30 
38  {
39  public:
41 
48  GraphObjectManager(const TripleId& irTripleId, GraphObjectManager* ipManager);
49 
50  virtual ~GraphObjectManager();
51 
56  void GetTripleId(TripleId& orTripleId) const;
57 
64  virtual GraphObject::Ptr OnPointDetection(const Point2D& irCursor) const;
65 
77  virtual GraphObject::Ptr OnPointDetectionEx(const Point2D& irCursor,
78  const std::vector<Int32>& irObjectIds, Int32& iorDistance, Int32 iRadius,
79  std::vector<GraphObject::Ptr>& iorGraphObjectsAround, EnumGraphObjectUsage iUsage = GOU_NORMAL_HIGHLIGHT);
80 
81  virtual void OnPointInPolygon(const Point2D& irCursor,
82  const std::vector<Int32>& irObjectIds, const std::vector<Point2D>& iPoints,
83  std::vector<GraphObject::Ptr>& iorGraphObjectsIn) const;
92  virtual void OnRectangleSelection(const Rect2D& irRect, std::vector<GraphObject::Ptr>& iorSelectedObjects) const;
93 
98  virtual void Draw();
99 
107  virtual void GenerateView();
108 
113  virtual void GenerateImageMap(ImageMap& iorImageMap);
114 
118  virtual void GenerateMapAndList() = 0;
119 
126  virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant* opValue) const = 0;
127 
138  virtual GraphObject::Ptr GetGraphObject(const TripleId& irTripleId, bool iRecursive = true) const;
139 
149  GraphObjectManager::Ptr GetGraphObjectManager(const TripleId& irTripleId, bool iRecursive = true) const;
150 #ifndef _VE_CE
151  void GetAllGraphObjectInfo(std::vector<CGRect> &iAllGraphObjectsBorder, std::vector<MsiChart::TripleId > &iAllGraphObjectsTripleId);
152 #endif
153 
157  virtual void GenerateVirtualMarker();
158 
164 
169  Int32 GetChartAreaId() const;
170 
175  void AddToMapAndList(GraphObject::Ptr iGraphObjectPtr);
176 
177  void AddToMapAndList(std::vector<GraphObject::Ptr> iGraphObjectPtrList);
182  void AddToList(GraphObject::Ptr iGraphObjectPtr);
183 
188  void AddToManagerList(GraphObjectManager::Ptr iGraphObjectPtr);
189 
194  void AddToMap(GraphObject::Ptr iGraphObjectPtr);
195 
200  void InsertGraphObjectListAfterObject(const std::vector<GraphObject::Ptr>& irGraphObjectList, const GraphObject* ipGraphObject);
201 
205 #ifndef _VE_CE
206  virtual void GenerateInterpolationFrame(double iProgress, LayerObject* ipLayerObject);
207 #else
208  virtual void GenerateInterpolationFrame(double iProgress);
209 #endif
210 
213  void MergeObjectList(GraphObjectManager* ipGraphObjectManager, bool iIsAppend);
214 
216  void GetGraphObjectList(std::vector<GraphObject::Ptr>& orGraphObjectList);
217 
219  void GetGraphObjectManagerList(std::vector<GraphObjectManager::Ptr>& orGraphObjectManagerList);
220 
222  void ClearGraphObjectList();
223 
224  static GraphObject::Ptr OnPointDetectionByList(const std::vector<GraphObject::Ptr>& irGraphObjectList,
225  const Point2D& irCursor, const std::vector<Int32>& irObjectIds, Int32& iorDistance, Int32 iRadius,
226  std::vector<GraphObject::Ptr>& iorGraphObjectsAround, EnumGraphObjectUsage iUsage = GOU_NORMAL_HIGHLIGHT);
227 
229  float GetMemoryUsageEstimation() const;
230 
232  void ExtractGraphObjectsByObjectId(std::vector<GraphObject::Ptr>& orGraphObjectList, Int32 iObjectId);
233  protected:
239  bool ToBool(CComVariant* ipValue) const;
245  void BoolToVariant(bool iValue, CComVariant* opValue) const;
246 
250  void AdjustObjectsForLayer();
251 
252  protected:
257  std::map<TripleId, GraphObject::Ptr> mGraphObjectMap;
258  typedef std::pair<TripleId, GraphObject::Ptr> MapPair;
259 
264  std::vector<GraphObject::Ptr> mGraphObjectList;
265 
267  std::vector<GraphObjectManager::Ptr> mGraphObjectManagerList;
268 
271 
274 
277 
278  double mProgress;
280  };
281 
283  {
284  return mChartContextPtr;
285  }
286 
287  inline bool GraphObjectManager::ToBool(CComVariant* ipValue) const
288  {
289  _ASSERTE(ipValue->vt == VT_BOOL);
290  return ipValue->boolVal != VARIANT_FALSE;
291  }
292  inline void GraphObjectManager::BoolToVariant(bool iValue, CComVariant* opValue) const
293  {
294  opValue->vt = VT_BOOL;
295  opValue->boolVal = iValue ? VARIANT_TRUE : VARIANT_FALSE;
296  }
297 }
298 #endif
float GetMemoryUsageEstimation() const
Get memory usage estimation for current GraphObjectManager.
Definition: LayerObject.h:21
ChartContext::Ptr mChartContextPtr
The drawing context instance. Only one object in a chart.
Definition: GraphObjectManager.h:273
ChartContext::Ptr GetChartContext() const
Definition: GraphObjectManager.h:282
virtual GraphObject::Ptr OnPointDetection(const Point2D &irCursor) const
MSynch::SmartPtr< GraphObjectManager > Ptr
Definition: GraphObjectManager.h:40
LayerObject * mpCurrentLayerObject
Definition: GraphObjectManager.h:279
void AddToManagerList(GraphObjectManager::Ptr iGraphObjectPtr)
std::vector< GraphObjectManager::Ptr > mGraphObjectManagerList
This list keeps all the children of current GraphObjectManager.
Definition: GraphObjectManager.h:267
virtual void GenerateVirtualMarker()
std::vector< GraphObject::Ptr > mGraphObjectList
Definition: GraphObjectManager.h:264
EnumDSSGraphObjectManager
Definition: GraphObjectManager.h:18
#define _ASSERTE(x)
Definition: Asserte.h:40
GraphObjectManager::Ptr GetGraphObjectManager(const TripleId &irTripleId, bool iRecursive=true) const
virtual void GetOptions(Int32 iSeriesId, Int32 iPropertyId, CComVariant *opValue) const =0
virtual GraphObject::Ptr GetGraphObject(const TripleId &irTripleId, bool iRecursive=true) const
void ClearGraphObjectList()
Clear GraphObject list.
EnumGraphObjectUsage
Definition: GraphObject.h:28
virtual void GenerateMapAndList()=0
void GetGraphObjectList(std::vector< GraphObject::Ptr > &orGraphObjectList)
Get GraphObject list.
#define VARIANT_FALSE
Definition: PDCwtypes.h:406
Definition: GraphObjectManager.h:28
void GetTripleId(TripleId &orTripleId) const
Definition: Msi_variant.h:101
VARTYPE vt
Definition: Msi_variant.h:148
Definition: GraphObjectManager.h:22
double mProgress
Definition: GraphObjectManager.h:278
virtual void GenerateImageMap(ImageMap &iorImageMap)
#define Int32
Definition: BasicTypes.h:20
void MergeObjectList(GraphObjectManager *ipGraphObjectManager, bool iIsAppend)
std::map< TripleId, GraphObject::Ptr > mGraphObjectMap
Definition: GraphObjectManager.h:257
void GetGraphObjectManagerList(std::vector< GraphObjectManager::Ptr > &orGraphObjectManagerList)
Get GraphObjectManager list.
void AddToMapAndList(GraphObject::Ptr iGraphObjectPtr)
Definition: GraphObjectManager.h:24
static GraphObject::Ptr OnPointDetectionByList(const std::vector< GraphObject::Ptr > &irGraphObjectList, const Point2D &irCursor, const std::vector< Int32 > &irObjectIds, Int32 &iorDistance, Int32 iRadius, std::vector< GraphObject::Ptr > &iorGraphObjectsAround, EnumGraphObjectUsage iUsage=GOU_NORMAL_HIGHLIGHT)
Definition: GraphObject.h:38
Definition: SmartPtr.h:38
void GetAllGraphObjectInfo(std::vector< CGRect > &iAllGraphObjectsBorder, std::vector< MsiChart::TripleId > &iAllGraphObjectsTripleId)
Definition: ChartContext.h:542
const TripleId mTripleId
Identifiy current GraphObjectManager.
Definition: GraphObjectManager.h:270
Definition: GraphObjectManager.h:20
Definition: GraphObjectManager.h:25
Definition: ABLPlot.h:21
Definition: GraphObjectManager.h:26
virtual void OnRectangleSelection(const Rect2D &irRect, std::vector< GraphObject::Ptr > &iorSelectedObjects) const
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)
bool ToBool(CComVariant *ipValue) const
Definition: GraphObjectManager.h:287
VARIANT_BOOL boolVal
Definition: Msi_variant.h:159
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
GraphObjectManager(const TripleId &irTripleId, GraphObjectManager *ipManager)
#define VARIANT_TRUE
Definition: PDCwtypes.h:405
void BoolToVariant(bool iValue, CComVariant *opValue) const
Definition: GraphObjectManager.h:292
void AddToMap(GraphObject::Ptr iGraphObjectPtr)
GraphObjectManager * mpManager
The manager object which created the current object.
Definition: GraphObjectManager.h:276
virtual void GenerateInterpolationFrame(double iProgress, LayerObject *ipLayerObject)
Definition: Msi_ccomvariant.h:24
void InsertGraphObjectListAfterObject(const std::vector< GraphObject::Ptr > &irGraphObjectList, const GraphObject *ipGraphObject)
std::pair< TripleId, GraphObject::Ptr > MapPair
Definition: GraphObjectManager.h:258
Definition: GraphObjectManager.h:27
Definition: GraphObjectManager.h:37
void AddToList(GraphObject::Ptr iGraphObjectPtr)
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
Definition: GraphObject.h:30
void ExtractGraphObjectsByObjectId(std::vector< GraphObject::Ptr > &orGraphObjectList, Int32 iObjectId)
Extract some graph objects out by object ID. The extracted graph object will be removed from mGraphOb...
virtual void OnPointInPolygon(const Point2D &irCursor, const std::vector< Int32 > &irObjectIds, const std::vector< Point2D > &iPoints, std::vector< GraphObject::Ptr > &iorGraphObjectsIn) const
Definition: Common.h:397
Definition: GraphObjectManager.h:21