-
Notifications
You must be signed in to change notification settings - Fork 0
/
_entity_8h_source.html
115 lines (113 loc) · 32.6 KB
/
_entity_8h_source.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>OpenGP: /home/drebain/Workspace/research/OpenGPFork/src/OpenGP/GL/Entity.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">OpenGP
 <span id="projectnumber">1.1</span>
</div>
<div id="projectbrief">Open Geometry Processing Library</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="tutorial.html"><span>Tutorial</span></a></li>
<li><a href="devel.html"><span>Development</span></a></li>
<li><a href="annotated.html"><span>Reference Manual</span></a></li>
<li><a href="https://github.com/OpenGP/OpenGP/issues"><span>Report Bug</span></a></li>
<li>
<div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.png"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
</span>
</div>
</li>
</ul>
</div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_ceaee8241810cc418efcd8e45299d116.html">OpenGP</a></li><li class="navelem"><a class="el" href="dir_6a0bf43eddd697684442bde9dbb98fcf.html">GL</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Entity.h</div> </div>
</div><!--header-->
<div class="contents">
<div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">// This Source Code Form is subject to the terms of the Mozilla Public</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// License, v. 2.0. If a copy of the MPL was not distributed with this</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// file, You can obtain one at http://mozilla.org/MPL/2.0/.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> </div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="preprocessor">#pragma once</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> </div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="preprocessor">#include <unordered_map></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include <memory></span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="preprocessor">#include <typeindex></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <cassert></span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> </div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <OpenGP/headeronly.h></span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> </div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">//=============================================================================</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">namespace </span><a class="code" href="namespace_open_g_p.html">OpenGP</a> {</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment">//=============================================================================</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">class </span>Scene;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">class </span>Entity;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00023"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html"> 23</a></span> <span class="keyword">class </span><a class="code" href="class_open_g_p_1_1_component.html">Component</a> {</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_open_g_p_1_1_entity.html">Entity</a>;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a> *entity = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <a class="code" href="class_open_g_p_1_1_scene.html">Scene</a> *scene = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">protected</span>:</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <a class="code" href="class_open_g_p_1_1_component.html">Component</a>() {}</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <a class="code" href="class_open_g_p_1_1_component.html">Component</a>(<span class="keyword">const</span> <a class="code" href="class_open_g_p_1_1_component.html">Component</a>&) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <a class="code" href="class_open_g_p_1_1_component.html">Component</a> &operator=(<span class="keyword">const</span> <a class="code" href="class_open_g_p_1_1_component.html">Component</a>&) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#ae74cab2b81e83fa892e439b4e6941718"> 43</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_open_g_p_1_1_component.html#ae74cab2b81e83fa892e439b4e6941718">init</a>() {}</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#ad547b8d6d1d379ade1c877f8f2eb93a2"> 46</a></span>  <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="class_open_g_p_1_1_component.html#ad547b8d6d1d379ade1c877f8f2eb93a2">update</a>() {}</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#a0585c66874d2c2c4c75973f512e8f9c2"> 49</a></span>  <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a> &<a class="code" href="class_open_g_p_1_1_component.html#a0585c66874d2c2c4c75973f512e8f9c2">get_entity</a>() { assert(entity != <span class="keyword">nullptr</span>); <span class="keywordflow">return</span> *entity; }</div><div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#a03aec52728d4ee789fb3177b5e9fe177"> 51</a></span>  <span class="keyword">const</span> <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a> &<a class="code" href="class_open_g_p_1_1_component.html#a03aec52728d4ee789fb3177b5e9fe177">get_entity</a>()<span class="keyword"> const </span>{ assert(entity != <span class="keyword">nullptr</span>); <span class="keywordflow">return</span> *entity; }</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#ad73f971d5d134c44267bbfb107cd5338"> 54</a></span>  <a class="code" href="class_open_g_p_1_1_scene.html">Scene</a> &<a class="code" href="class_open_g_p_1_1_component.html#ad73f971d5d134c44267bbfb107cd5338">get_scene</a>() { assert(scene != <span class="keyword">nullptr</span>); <span class="keywordflow">return</span> *scene; }</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#a56455f0b87a4e9967cf848a8c5a28ca3"> 56</a></span>  <span class="keyword">const</span> <a class="code" href="class_open_g_p_1_1_scene.html">Scene</a> &<a class="code" href="class_open_g_p_1_1_component.html#a56455f0b87a4e9967cf848a8c5a28ca3">get_scene</a>()<span class="keyword"> const </span>{ assert(scene != <span class="keyword">nullptr</span>); <span class="keywordflow">return</span> *scene; }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  T &<a class="code" href="class_open_g_p_1_1_component.html#af019a7d403976e4432630e11e3c38f19">require</a>();</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordtype">bool</span> <a class="code" href="class_open_g_p_1_1_component.html#af8fe58136c84677cdc49422a6723e9f7">has</a>();</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  T &<span class="keyword">get</span>();</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keyword">const</span> T &<span class="keyword">get</span>() <span class="keyword">const</span>;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> };</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> </div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_entity.html"> 77</a></span> <span class="keyword">class </span><a class="code" href="class_open_g_p_1_1_entity.html">Entity</a> {</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="class_open_g_p_1_1_scene.html">Scene</a>;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <span class="keyword">private</span>:</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> </div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="class_open_g_p_1_1_scene.html">Scene</a> *scene = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  std::unordered_map<std::type_index, std::unique_ptr<Component>> components;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="keyword">public</span>:</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a>() {}</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  HEADERONLY_INLINE <span class="keywordtype">void</span> <a class="code" href="class_open_g_p_1_1_component.html#ad547b8d6d1d379ade1c877f8f2eb93a2">update</a>();</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> </div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a>(<span class="keyword">const</span> <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a>&) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a> &operator=(<span class="keyword">const</span> <a class="code" href="class_open_g_p_1_1_entity.html">Entity</a>&) = <span class="keyword">delete</span>;</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_entity.html#a9c02e978c94b3db3593f475c43b4f3b3"> 99</a></span>  T &<a class="code" href="class_open_g_p_1_1_entity.html#a9c02e978c94b3db3593f475c43b4f3b3">require</a>() {</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  assert(scene != <span class="keyword">nullptr</span>);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">if</span> (has<T>())</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keywordflow">return</span> get<T>();</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  T *component = <span class="keyword">new</span> T();</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  components[std::type_index(<span class="keyword">typeid</span>(T))] = std::unique_ptr<Component>(component);</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> </div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  component->entity = <span class="keyword">this</span>;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  component->scene = scene;</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  component->init();</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> </div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="keywordflow">return</span> *component;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  }</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_entity.html#a7592b08c795d5d86c42acf9cc63c3e6a"> 117</a></span>  <span class="keywordtype">bool</span> <a class="code" href="class_open_g_p_1_1_entity.html#a7592b08c795d5d86c42acf9cc63c3e6a">has</a>()<span class="keyword"> const </span>{</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keywordflow">return</span> components.find(std::type_index(<span class="keyword">typeid</span>(T))) != components.end();</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  }</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_entity.html#a08d8bf126e5a893a8e37d38b5ed77b58"> 123</a></span>  <span class="keyword">const</span> T &<span class="keyword">get</span>() <span class="keyword">const</span> {</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="keywordflow">return</span> <span class="keyword">dynamic_cast<</span><span class="keyword">const </span>T&<span class="keyword">></span>(*(components.at(std::type_index(<span class="keyword">typeid</span>(T)))));</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  }</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_entity.html#af8b890537678d0a8297427e94d0013d4"> 129</a></span>  T &<span class="keyword">get</span>() {</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">return</span> <span class="keyword">dynamic_cast<</span>T&<span class="keyword">></span>(*(components.at(std::type_index(<span class="keyword">typeid</span>(T)))));</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  }</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> </div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  HEADERONLY_INLINE <a class="code" href="class_open_g_p_1_1_scene.html">Scene</a> &<a class="code" href="class_open_g_p_1_1_component.html#ad73f971d5d134c44267bbfb107cd5338">get_scene</a>();</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> </div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> };</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span> </div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00139"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#af019a7d403976e4432630e11e3c38f19"> 139</a></span> T &<a class="code" href="class_open_g_p_1_1_component.html#af019a7d403976e4432630e11e3c38f19">Component::require</a>() { <span class="keywordflow">return</span> <a class="code" href="class_open_g_p_1_1_component.html#a0585c66874d2c2c4c75973f512e8f9c2">get_entity</a>().<a class="code" href="class_open_g_p_1_1_entity.html#a9c02e978c94b3db3593f475c43b4f3b3">require</a><T>(); }</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> </div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00142"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#af8fe58136c84677cdc49422a6723e9f7"> 142</a></span> <span class="keywordtype">bool</span> <a class="code" href="class_open_g_p_1_1_component.html#af8fe58136c84677cdc49422a6723e9f7">Component::has</a>() { <span class="keywordflow">return</span> <a class="code" href="class_open_g_p_1_1_component.html#a0585c66874d2c2c4c75973f512e8f9c2">get_entity</a>().<a class="code" href="class_open_g_p_1_1_entity.html#a7592b08c795d5d86c42acf9cc63c3e6a">has</a><T>(); }</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> </div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00145"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#a830c1ad8fcbb94f78effea9a8889ba9c"> 145</a></span> T &<a class="code" href="class_open_g_p_1_1_component.html#a830c1ad8fcbb94f78effea9a8889ba9c">Component::get</a>() { <span class="keywordflow">return</span> <a class="code" href="class_open_g_p_1_1_component.html#a0585c66874d2c2c4c75973f512e8f9c2">get_entity</a>().<a class="code" href="class_open_g_p_1_1_entity.html#a08d8bf126e5a893a8e37d38b5ed77b58">get</a><T>(); }</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <span class="keyword">template</span> <<span class="keyword">typename</span> T></div><div class="line"><a name="l00148"></a><span class="lineno"><a class="line" href="class_open_g_p_1_1_component.html#a4c5263675ca3895c66c06a61b40f3c71"> 148</a></span> <span class="keyword">const</span> T &<a class="code" href="class_open_g_p_1_1_component.html#a830c1ad8fcbb94f78effea9a8889ba9c">Component::get</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_open_g_p_1_1_component.html#a0585c66874d2c2c4c75973f512e8f9c2">get_entity</a>().<a class="code" href="class_open_g_p_1_1_entity.html#a08d8bf126e5a893a8e37d38b5ed77b58">get</a><T>(); }</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> </div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span> <span class="comment">//=============================================================================</span></div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span> } <span class="comment">// OpenGP::</span></div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span> <span class="comment">//=============================================================================</span></div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span> </div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> <span class="preprocessor">#ifdef HEADERONLY</span></div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span> <span class="preprocessor"> #include "Entity.cpp"</span></div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> <span class="preprocessor">#endif</span></div><div class="ttc" id="class_open_g_p_1_1_component_html_a56455f0b87a4e9967cf848a8c5a28ca3"><div class="ttname"><a href="class_open_g_p_1_1_component.html#a56455f0b87a4e9967cf848a8c5a28ca3">OpenGP::Component::get_scene</a></div><div class="ttdeci">const Scene & get_scene() const </div><div class="ttdoc">Get a reference to the scene that contains the parent entity. </div><div class="ttdef"><b>Definition:</b> Entity.h:56</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html"><div class="ttname"><a href="class_open_g_p_1_1_component.html">OpenGP::Component</a></div><div class="ttdoc">The base class for all components. </div><div class="ttdef"><b>Definition:</b> Entity.h:23</div></div>
<div class="ttc" id="class_open_g_p_1_1_scene_html"><div class="ttname"><a href="class_open_g_p_1_1_scene.html">OpenGP::Scene</a></div><div class="ttdoc">A scene graph populated with Entity objects. </div><div class="ttdef"><b>Definition:</b> Scene.h:19</div></div>
<div class="ttc" id="class_open_g_p_1_1_entity_html_a9c02e978c94b3db3593f475c43b4f3b3"><div class="ttname"><a href="class_open_g_p_1_1_entity.html#a9c02e978c94b3db3593f475c43b4f3b3">OpenGP::Entity::require</a></div><div class="ttdeci">T & require()</div><div class="ttdoc">Add the specified component to this entity if it does not already exist. </div><div class="ttdef"><b>Definition:</b> Entity.h:99</div></div>
<div class="ttc" id="namespace_open_g_p_html"><div class="ttname"><a href="namespace_open_g_p.html">OpenGP</a></div><div class="ttdef"><b>Definition:</b> VirtualDepthSensor.h:19</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_ad73f971d5d134c44267bbfb107cd5338"><div class="ttname"><a href="class_open_g_p_1_1_component.html#ad73f971d5d134c44267bbfb107cd5338">OpenGP::Component::get_scene</a></div><div class="ttdeci">Scene & get_scene()</div><div class="ttdoc">Get a reference to the scene that contains the parent entity. </div><div class="ttdef"><b>Definition:</b> Entity.h:54</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_af019a7d403976e4432630e11e3c38f19"><div class="ttname"><a href="class_open_g_p_1_1_component.html#af019a7d403976e4432630e11e3c38f19">OpenGP::Component::require</a></div><div class="ttdeci">T & require()</div><div class="ttdoc">Add the specified component to the parent entity if it does not already exist. </div><div class="ttdef"><b>Definition:</b> Entity.h:139</div></div>
<div class="ttc" id="class_open_g_p_1_1_entity_html_a08d8bf126e5a893a8e37d38b5ed77b58"><div class="ttname"><a href="class_open_g_p_1_1_entity.html#a08d8bf126e5a893a8e37d38b5ed77b58">OpenGP::Entity::get</a></div><div class="ttdeci">const T & get() const </div><div class="ttdoc">Get a reference to the specified component in this entity. </div><div class="ttdef"><b>Definition:</b> Entity.h:123</div></div>
<div class="ttc" id="class_open_g_p_1_1_entity_html_a7592b08c795d5d86c42acf9cc63c3e6a"><div class="ttname"><a href="class_open_g_p_1_1_entity.html#a7592b08c795d5d86c42acf9cc63c3e6a">OpenGP::Entity::has</a></div><div class="ttdeci">bool has() const </div><div class="ttdoc">Check if this entity has the specified component. </div><div class="ttdef"><b>Definition:</b> Entity.h:117</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_af8fe58136c84677cdc49422a6723e9f7"><div class="ttname"><a href="class_open_g_p_1_1_component.html#af8fe58136c84677cdc49422a6723e9f7">OpenGP::Component::has</a></div><div class="ttdeci">bool has()</div><div class="ttdoc">Check if the parent entity has the specified component. </div><div class="ttdef"><b>Definition:</b> Entity.h:142</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_a830c1ad8fcbb94f78effea9a8889ba9c"><div class="ttname"><a href="class_open_g_p_1_1_component.html#a830c1ad8fcbb94f78effea9a8889ba9c">OpenGP::Component::get</a></div><div class="ttdeci">T & get()</div><div class="ttdoc">Get a reference to the specified component in the parent entity. </div><div class="ttdef"><b>Definition:</b> Entity.h:145</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_a0585c66874d2c2c4c75973f512e8f9c2"><div class="ttname"><a href="class_open_g_p_1_1_component.html#a0585c66874d2c2c4c75973f512e8f9c2">OpenGP::Component::get_entity</a></div><div class="ttdeci">Entity & get_entity()</div><div class="ttdoc">Get a reference to the entity that holds this component. </div><div class="ttdef"><b>Definition:</b> Entity.h:49</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_ad547b8d6d1d379ade1c877f8f2eb93a2"><div class="ttname"><a href="class_open_g_p_1_1_component.html#ad547b8d6d1d379ade1c877f8f2eb93a2">OpenGP::Component::update</a></div><div class="ttdeci">virtual void update()</div><div class="ttdoc">Overridable method that handles per-frame updates. </div><div class="ttdef"><b>Definition:</b> Entity.h:46</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_a03aec52728d4ee789fb3177b5e9fe177"><div class="ttname"><a href="class_open_g_p_1_1_component.html#a03aec52728d4ee789fb3177b5e9fe177">OpenGP::Component::get_entity</a></div><div class="ttdeci">const Entity & get_entity() const </div><div class="ttdoc">Get a reference to the entity that holds this component. </div><div class="ttdef"><b>Definition:</b> Entity.h:51</div></div>
<div class="ttc" id="class_open_g_p_1_1_entity_html"><div class="ttname"><a href="class_open_g_p_1_1_entity.html">OpenGP::Entity</a></div><div class="ttdoc">A basic container for components that describes one node in the scene graph. </div><div class="ttdef"><b>Definition:</b> Entity.h:77</div></div>
<div class="ttc" id="class_open_g_p_1_1_component_html_ae74cab2b81e83fa892e439b4e6941718"><div class="ttname"><a href="class_open_g_p_1_1_component.html#ae74cab2b81e83fa892e439b4e6941718">OpenGP::Component::init</a></div><div class="ttdeci">virtual void init()</div><div class="ttdoc">Overridable method that handles object initialization. </div><div class="ttdef"><b>Definition:</b> Entity.h:43</div></div>
</div><!-- fragment --></div><!-- contents -->
<div id="footer">
<!-- <address>
<small>
Copyright © 2013
</small>
</address> -->
</div>
</body>
</html>