blob: e7a446e13cb750a2ed3cde70de83de102d0c7f47 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>FTGL: FTBBox.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a></div>
<h1>FTBBox.h</h1><a href="FTBBox_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef __FTBBox__</span>
00002 <span class="preprocessor"></span><span class="preprocessor">#define __FTBBox__</span>
00003 <span class="preprocessor"></span>
00004 <span class="preprocessor">#include &lt;ft2build.h&gt;</span>
00005 <span class="preprocessor">#include FT_FREETYPE_H</span>
00006 <span class="preprocessor"></span><span class="comment">//#include FT_GLYPH_H</span>
00007 <span class="preprocessor">#include FT_OUTLINE_H</span>
00008 <span class="preprocessor"></span>
00009 <span class="preprocessor">#include "<a class="code" href="FTGL_8h.html">FTGL.h</a>"</span>
00010 <span class="preprocessor">#include "<a class="code" href="FTPoint_8h.html">FTPoint.h</a>"</span>
00011
00012
<a name="l00016"></a><a class="code" href="classFTBBox.html">00016</a> <span class="keyword">class </span><a class="code" href="FTGL_8h.html#a3">FTGL_EXPORT</a> FTBBox
00017 {
00018 <span class="keyword">public</span>:
<a name="l00022"></a><a class="code" href="classFTBBox.html#a0">00022</a> FTBBox()
00023 : lowerX(0.0f),
00024 lowerY(0.0f),
00025 lowerZ(0.0f),
00026 upperX(0.0f),
00027 upperY(0.0f),
00028 upperZ(0.0f)
00029 {}
00030
<a name="l00034"></a><a class="code" href="classFTBBox.html#a1">00034</a> FTBBox( <span class="keywordtype">float</span> lx, <span class="keywordtype">float</span> ly, <span class="keywordtype">float</span> lz, <span class="keywordtype">float</span> ux, <span class="keywordtype">float</span> uy, <span class="keywordtype">float</span> uz)
00035 : lowerX(lx),
00036 lowerY(ly),
00037 lowerZ(lz),
00038 upperX(ux),
00039 upperY(uy),
00040 upperZ(uz)
00041 {}
00042
<a name="l00049"></a><a class="code" href="classFTBBox.html#a2">00049</a> FTBBox( FT_GlyphSlot glyph)
00050 : lowerX(0.0f),
00051 lowerY(0.0f),
00052 lowerZ(0.0f),
00053 upperX(0.0f),
00054 upperY(0.0f),
00055 upperZ(0.0f)
00056 {
00057 FT_BBox bbox;
00058 FT_Outline_Get_CBox( &amp;(glyph-&gt;outline), &amp;bbox);
00059
00060 lowerX = static_cast&lt;float&gt;( bbox.xMin) / 64.0f;
00061 lowerY = static_cast&lt;float&gt;( bbox.yMin) / 64.0f;
00062 lowerZ = 0.0f;
00063 upperX = static_cast&lt;float&gt;( bbox.xMax) / 64.0f;
00064 upperY = static_cast&lt;float&gt;( bbox.yMax) / 64.0f;
00065 upperZ = 0.0f;
00066
00067 }
00068
<a name="l00072"></a><a class="code" href="classFTBBox.html#a3">00072</a> ~FTBBox()
00073 {}
00074
00075
<a name="l00081"></a><a class="code" href="classFTBBox.html#a4">00081</a> FTBBox&amp; Move( <a class="code" href="classFTPoint.html">FTPoint</a> distance)
00082 {
00083 lowerX += distance.<a class="code" href="classFTPoint.html#a7">X</a>();
00084 lowerY += distance.<a class="code" href="classFTPoint.html#a8">Y</a>();
00085 lowerZ += distance.<a class="code" href="classFTPoint.html#a9">Z</a>();
00086 upperX += distance.<a class="code" href="classFTPoint.html#a7">X</a>();
00087 upperY += distance.<a class="code" href="classFTPoint.html#a8">Y</a>();
00088 upperZ += distance.<a class="code" href="classFTPoint.html#a9">Z</a>();
00089 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00090 }
00091
<a name="l00092"></a><a class="code" href="classFTBBox.html#a5">00092</a> FTBBox&amp; operator += ( <span class="keyword">const</span> FTBBox&amp; bbox)
00093 {
00094 lowerX = bbox.<a class="code" href="classFTBBox.html#o0">lowerX</a> &lt; lowerX? bbox.<a class="code" href="classFTBBox.html#o0">lowerX</a>: lowerX;
00095 lowerY = bbox.<a class="code" href="classFTBBox.html#o1">lowerY</a> &lt; lowerY? bbox.<a class="code" href="classFTBBox.html#o1">lowerY</a>: lowerY;
00096 lowerZ = bbox.<a class="code" href="classFTBBox.html#o2">lowerZ</a> &lt; lowerZ? bbox.<a class="code" href="classFTBBox.html#o2">lowerZ</a>: lowerZ;
00097 upperX = bbox.<a class="code" href="classFTBBox.html#o3">upperX</a> &gt; upperX? bbox.<a class="code" href="classFTBBox.html#o3">upperX</a>: upperX;
00098 upperY = bbox.<a class="code" href="classFTBBox.html#o4">upperY</a> &gt; upperY? bbox.<a class="code" href="classFTBBox.html#o4">upperY</a>: upperY;
00099 upperZ = bbox.<a class="code" href="classFTBBox.html#o5">upperZ</a> &gt; upperZ? bbox.<a class="code" href="classFTBBox.html#o5">upperZ</a>: upperZ;
00100
00101 <span class="keywordflow">return</span> *<span class="keyword">this</span>;
00102 }
00103
<a name="l00104"></a><a class="code" href="classFTBBox.html#a6">00104</a> <span class="keywordtype">void</span> SetDepth( <span class="keywordtype">float</span> depth)
00105 {
00106 upperZ = lowerZ + depth;
00107 }
00108
00109
00113 <span class="comment">// Make these ftPoints &amp; private</span>
<a name="l00114"></a><a class="code" href="classFTBBox.html#o5">00114</a> <span class="keywordtype">float</span> lowerX, lowerY, lowerZ, upperX, upperY, upperZ;
00115 <span class="keyword">protected</span>:
00116
00117
00118 <span class="keyword">private</span>:
00119
00120 };
00121
00122
00123 <span class="preprocessor">#endif // __FTBBox__</span>
00124 <span class="preprocessor"></span>
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Sun Dec 5 22:24:05 2004 for FTGL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 >
</a>1.3.6 </small></address>
</body>
</html>