Mobile API Reference  MicroStrategy 2019
DepthPolygonObject.h
Go to the documentation of this file.
1 //==============================================================================================
2 // FILENAME : DepthPolygonObject.h
3 // AUTHOR : Xin Liu
4 // CREATION : 10/20/08
5 // Copyright (C) MicroStrategy, Inc. 2008
6 //==============================================================================================
7 
8 #ifndef MSICHART_DEPTHPOLYGONOBJECT_H
9 #define MSICHART_DEPTHPOLYGONOBJECT_H
10 
11 #include "PolygonObject.h"
12 #include "DepthRectangleObject.h"
13 #include "DepthLineObject.h"
14 
15 namespace MsiChart
16 {
20  enum ShowFace
21  {
22  SF_FRONT = 1,
23  SF_SIDE = 2,
25  };
26 
31  {
32  public:
34 
42  DepthPolygonObject(const TripleId& irTripleId,
43  GraphObjectManager* ipManager,
44  const std::vector<Point2D>& irPoints,
45  Int32 iDepth, Int32 iAngle,
46  GraphCollectionObject* ipParentObject = NULL,
47  bool iIsVertical = true,
48  Int32 iShowFace = SF_FRONT | SF_SIDE | SF_HIDDEN_SIDE);
49  virtual ~DepthPolygonObject();
50 
51  //virtual functions from GraphObject
52  virtual void Draw() const;
53  //virtual void DrawOutLine(); Just re-use PolygonObject::DrawOutLine() method
54  virtual bool PointInObject(const Point2D& irPoint);
55  virtual bool ObjectInRectangle(const Rect2D& irRect);
56  virtual void GenerateImageMap(ImageMap& iorImageMap);
57 
78 
79  protected:
80  virtual void GetClockwisePolygon(std::vector<Point2D>& orPolygon) const;
81 
86  void CalculateSideFace(const std::vector<Point2D>& irPoints);
87 
90  bool mIsVertical;
95 
96  std::vector<DepthLineObject::Ptr> mTopDepthLines;
97  std::vector<DepthLineObject::Ptr> mBottomDepthLines;
100 
101  private:
106  void hCalculateTopAndBottomFaces(const std::vector<Point2D>& irPoints);
107 
111  void hDrawTopAndBottomFaces() const;
112 
116  bool hIsReverseOrder() const;
117  };
118 
119  inline bool DepthPolygonObject::hIsReverseOrder() const
120  {
121  return (mIsVertical && ((mAngle >= 0 && mAngle <= 90) || (mAngle >= 270 && mAngle <= 360)))
122  ||(!mIsVertical && (mAngle >= 180 && mAngle <= 360));
123  }
125  {
126  _ASSERTE(mTopDepthLines.size() == 1);
127  return mTopDepthLines[0];
128  }
130  {
131  _ASSERTE(mTopDepthLines.size() == 1);
132  return mBottomDepthLines[0];
133  }
135  {
136  return mHiddenSideFacePtr;
137  }
139  {
140  return mSideFacePtr;
141  }
142 }
143 
144 #endif
Int32 mAngle
The depth direction.
Definition: DepthPolygonObject.h:89
void CalculateSideFace(const std::vector< Point2D > &irPoints)
bool mIsVertical
Indicates whether the depth polygon is vertical or horizontal.
Definition: DepthPolygonObject.h:90
bool mIsShownHiddenSideFace
Indicates whether the hidden side face is shown or not.
Definition: DepthPolygonObject.h:93
Represents a polygon area.
Definition: PolygonObject.h:17
Definition: DepthPolygonObject.h:24
bool mIsDepthCurvePolygon
Indicates whether current DepthPolygonObject is a DepthCurvePolygonObject.
Definition: DepthPolygonObject.h:94
virtual void GenerateImageMap(ImageMap &iorImageMap)
virtual bool PointInObject(const Point2D &irPoint)
GraphObject::Ptr mHiddenSideFacePtr
Hidden side face.
Definition: DepthPolygonObject.h:99
DepthLineObject::Ptr GetTopDepthLine() const
Definition: DepthPolygonObject.h:124
bool mIsShownSideFace
Indicates whether the side face is shown or not.
Definition: DepthPolygonObject.h:91
Definition: DepthPolygonObject.h:23
Definition: DepthPolygonObject.h:22
Definition: GraphCollectionObject.h:19
#define _ASSERTE(x)
Definition: Asserte.h:40
DepthLineObject::Ptr GetBottomDepthLine() const
Definition: DepthPolygonObject.h:129
DepthPolygonObject(const TripleId &irTripleId, GraphObjectManager *ipManager, const std::vector< Point2D > &irPoints, Int32 iDepth, Int32 iAngle, GraphCollectionObject *ipParentObject=NULL, bool iIsVertical=true, Int32 iShowFace=SF_FRONT|SF_SIDE|SF_HIDDEN_SIDE)
#define Int32
Definition: BasicTypes.h:20
virtual void GetClockwisePolygon(std::vector< Point2D > &orPolygon) const
std::vector< DepthLineObject::Ptr > mBottomDepthLines
Bottom depth Line.
Definition: DepthPolygonObject.h:97
Definition: SmartPtr.h:38
ShowFace
Definition: DepthPolygonObject.h:20
std::vector< DepthLineObject::Ptr > mTopDepthLines
Top depth Line.
Definition: DepthPolygonObject.h:96
Definition: ABLPlot.h:21
std::vector< AreaRec * > ImageMap
Definition: ImageMap.h:99
GraphObject::Ptr GetHiddenSideFace() const
Definition: DepthPolygonObject.h:134
virtual void Draw() const
bool mIsShownFrontFace
Indicates whether the front face is shown or not.
Definition: DepthPolygonObject.h:92
virtual bool ObjectInRectangle(const Rect2D &irRect)
Definition: DepthPolygonObject.h:30
MSynch::SmartPtr< DepthPolygonObject > Ptr
Definition: DepthPolygonObject.h:33
Int32 mDepth
The depth value.
Definition: DepthPolygonObject.h:88
GraphObject::Ptr mSideFacePtr
Side face.
Definition: DepthPolygonObject.h:98
#define NULL
Definition: Null.h:10
Definition: GraphObjectManager.h:37
Use four Int32 values to represent a 2D rectangle.
Definition: Rect2D.h:25
GraphObject::Ptr GetSideFace() const
Definition: DepthPolygonObject.h:138
Definition: Common.h:397