InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PMRealGlyphPoint.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: mvogel
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __PMRealGlyphPoint__
25 #define __PMRealGlyphPoint__
26 
27 
28 #include "CTextEnum.h" // for Text::GlyphID
29 
30 
37  int32 glyphID; // CTGlyphID = BRVInt32
39  float xPosition; // BRVRealCoord
41  float yPosition; // BRVRealCoord
42 };
43 
45 {
46 public:
48  { Set(kInvalidGlyphID, 0.0, 0.0); }
49  explicit PMRealGlyphPoint(Text::GlyphID glyphID, float x = 0.0, float y = 0.0)
50  { Set(glyphID, x, y); }
51 
52  void Set(Text::GlyphID glyphID, float x = 0.0, float y = 0.0)
53  { fPoint.glyphID = glyphID; fPoint.xPosition = x; fPoint.yPosition = y; }
54 
55  void SetX(float x)
56  { fPoint.xPosition = x; }
57  void SetY(float y)
58  { fPoint.yPosition = y; }
59  void SetX(PMReal x)
60  { fPoint.xPosition = ::ToFloat(x); }
61  void SetY(PMReal y)
62  { fPoint.yPosition = ::ToFloat(y); }
63 
64  Text::GlyphID GetGlyphID() const
65  { return fPoint.glyphID; }
66  Text::GlyphID& GlyphID()
67  { return fPoint.glyphID; }
68 
69  float GetXPosition() const
70  { return fPoint.xPosition; }
71  float GetYPosition() const
72  { return fPoint.yPosition; }
73 
74  float& GetXPosition()
75  { return fPoint.xPosition; }
76  float& GetYPosition()
77  { return fPoint.yPosition; }
78 
79  PMRealGlyphPoint& operator+=(const PMRealGlyphPoint& other)
80  { fPoint.yPosition += other.fPoint.yPosition;
81  fPoint.xPosition += other.fPoint.xPosition;
82  return *this;
83  }
84 
85 private:
86  CTRealGlyphPointx fPoint;
87 };
88 
89 
90 DECLARE_BASE_TYPE(PMRealGlyphPoint);
91 
92 
93 #endif
94