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 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404
|
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>openvrml::rendering_context class Reference</title>
<meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<link rel="icon" href="../vrml-16">
<link rel="start" href="http://openvrml.org/index" title="OpenVRML Home">
<link rel="prev" href="http://openvrml.org/discussion" title="Discussion">
<link rel="contents" href="index" title="Documentation Main Page">
<link rel="index" href="functions" title="OpenVRML Compound Members">
<link rel="appendix" href="conformance" title="Conformance Test Results">
<style type="text/css">
@import url("doxygen.css");
@import url("http://openvrml.org/openvrml.css");
.body td {
background-color: transparent;
}
div.qindex {
background-color: transparent;
border: none;
}
a.qindex {
text-decoration: inherit;
color: inherit
}
a.qindex:visited {
text-decoration: inherit;
font-weight: inherit;
color: inherit
}
a.qindex:hover {
text-decoration: inherit;
background-color: transparent;
}
a.qindexHL {
text-decoration: inherit;
font-weight: inherit;
background-color: transparent;
color: inherit;
}
a.qindexHL:hover {
text-decoration: inherit;
background-color: transparent;
color: inherit;
}
a.qindexHL:visited {
text-decoration: inherit;
background-color: transparent;
color: inherit;
}
a.el {
text-decoration: inherit;
font-weight: inherit
}
a.elRef {
font-weight: inherit
}
a.code {
text-decoration: inherit;
font-weight: inherit;
color: inherit;
}
a.codeRef {
font-weight: normal;
color: inherit;
}
a:hover {
text-decoration: inherit;
background-color: inherit;
}
h1 {
line-height: 1.2em;
}
div.qindex {
font-size: smaller;
}
div.qindex .qindex:link, div.qindex .qindex:visited {
font-weight: inherit;
}
div.qindex .qindexHL:link, div.qindex .qindexHL:visited {
font-weight: bold;
}
td.memItemLeft, td.memItemRight, .mdRow td {
font-family: "Bitstream Vera Sans Mono",
"LucidaTypewriter",
"Lucida Console",
monospace;
}
td.memItemLeft, td.memItemRight, td.mdescLeft, td.mdescRight {
background-color: rgb(95%, 95%, 95%);
}
.mdRow {
background-color: rgb(95%, 95%, 95%);
}
.mdTable {
background-color: rgb(95%, 95%, 95%);
}
.mdRow td {
background-color: rgb(95%, 95%, 95%);
}
.mdRow td code {
font-family: sans-serif;
font-style: italic;
}
</style>
</head>
<body>
<table class="sitenav">
<tr>
<th><a href="http://openvrml.org/index" title="Home">Home</a></th>
<th><a href="http://openvrml.org/download" title="Download">Download</a></th>
<th><a href="http://openvrml.org/screenshots/index" title="Screen shots">Screen shots</a></th>
<th><a href="http://openvrml.org/discussion" title="Mailing lists and IRC">Discussion</a></th>
<th>Documentation</th>
</tr>
</table>
<div class="body">
<!-- Generated by Doxygen 1.3.4-20031112 -->
<div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="modules.html">Modules</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div>
<h1>openvrml::rendering_context Class Reference</h1>Information needed during a render traversal.
<a href="#_details">More...</a>
<p>
Collaboration diagram for openvrml::rendering_context:<p><center><img src="classopenvrml_1_1rendering__context__coll__graph.png" border="0" usemap="#openvrml_1_1rendering__context__coll__map" alt="Collaboration graph"></center>
<map name="openvrml_1_1rendering__context__coll__map">
<area href="classopenvrml_1_1mat4f.html" shape="rect" coords="43,17,149,36" alt="">
</map>
<center><font size="2">[<a href="graph_legend.html">legend</a>]</font></center><a href="classopenvrml_1_1rendering__context-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classopenvrml_1_1rendering__context.html#a0">rendering_context</a> ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs an empty render context. <a href="#a0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="classopenvrml_1_1rendering__context.html#a1">rendering_context</a> (<a class="el" href="classopenvrml_1_1bounding__volume.html#w3">bounding_volume::intersection</a> <a class="el" href="classopenvrml_1_1rendering__context.html#o0">cull_flag</a>, <a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> &<a class="el" href="classopenvrml_1_1rendering__context.html#r0">modelview</a>)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructs and initializes a render context. <a href="#a1"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="classopenvrml_1_1rendering__context.html#a2">matrix</a> () const </td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns a reference to the modelview matrix. <a href="#a2"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="classopenvrml_1_1rendering__context.html#a3">matrix</a> (<a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> &<a class="el" href="classopenvrml_1_1rendering__context.html#r0">modelview</a>)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Sets the modelview matrix. <a href="#a3"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Public Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classopenvrml_1_1bounding__volume.html#w3">bounding_volume::intersection</a> </td><td class="memItemRight" valign=bottom><a class="el" href="classopenvrml_1_1rendering__context.html#o0">cull_flag</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Track the results of intersecting node bounds with the view volume. <a href="#o0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="classopenvrml_1_1rendering__context.html#o1">draw_bounding_spheres</a></td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Draw the bounding volumes or not. <a href="#o1"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="classopenvrml_1_1rendering__context.html#r0">modelview</a></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Information needed during a render traversal.
<p>
The members could be arguments to the Node::render method, but there may be many arguments, and adding an argument requires changing nearly every file in the core.<p>
WARNING: This is a concrete base class that is passed by value, not by reference. The idea is to pass everything exactly as if it were a normal argument to the render function. This has some consequences...<p>
First off, the members should be primitives or pointers. There shouldn't be anything that requires a lot of work to copy. Calling render() should be cheap. Secondly, while adding a new member to this class is less work than adding a new argument to every <a class="el" href="classopenvrml_1_1node.html#a67">node::render</a> call, it still requires a recompile of nearly the whole core. That's because pass-by-value needs to know the exact size of what's being passed. Thirdly, you can't subclass this class. It's concrete. If you pass a subclass it will just get truncated.<p>
Why do it this way? Because it makes writing the <a class="el" href="classopenvrml_1_1node.html#a67">node::render</a> method easier. We don't have to maintain a stack of states, we just use the call stack instead. That means no heap allocation and deallocation, which is very cool. Also, we don't have to pop the stack at the end of the method. Alternatively, I could have used the "initialization is resource acquisition" pattern, but I felt this was cleaner.<p>
<dl compact><dt><b>Author:</b></dt><dd>Christopher K. St. John</dd></dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classopenvrml_1_1node.html#a67">node::render</a> <p>
<a class="el" href="classopenvrml_1_1browser.html#a26">browser::render</a> </dd></dl>
<p>
<hr><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" name="a0" doxytag="openvrml::rendering_context::rendering_context" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> openvrml::rendering_context::rendering_context </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructs an empty render context.
<p>
An empty context should not be passed to VrmlNode::render. This constructor is useful only for debugging and experimentation. </td>
</tr>
</table>
<a class="anchor" name="a1" doxytag="openvrml::rendering_context::rendering_context" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> openvrml::rendering_context::rendering_context </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classopenvrml_1_1bounding__volume.html#w3">bounding_volume::intersection</a> </td>
<td class="mdname" nowrap> <em>cull_flag</em>, </td>
</tr>
<tr>
<td></td>
<td></td>
<td class="md" nowrap><a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> & </td>
<td class="mdname" nowrap> <em>modelview</em></td>
</tr>
<tr>
<td></td>
<td class="md">) </td>
<td class="md" colspan="2"></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Constructs and initializes a render context.
<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>cull_flag</em> </td><td>the cull flag argument will normally be <a class="el" href="classopenvrml_1_1bounding__volume.html#w3w2">bounding_volume::partial</a>. </td></tr>
<tr><td valign=top><em>modelview</em> </td><td>The modelview matrix. The transform can be affine, but the rendering code may take advantage of an orthogonal transform if one is passed in.</td></tr>
</table>
</dl>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classopenvrml_1_1rendering__context.html#o0">cull_flag</a> </dd></dl>
</td>
</tr>
</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="a3" doxytag="openvrml::rendering_context::matrix" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> void openvrml::rendering_context::matrix </td>
<td class="md" valign="top">( </td>
<td class="md" nowrap valign="top"><a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> & </td>
<td class="mdname1" valign="top" nowrap> <em>modelview</em> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap></td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Sets the modelview matrix.
<p>
A <a class="el" href="classopenvrml_1_1rendering__context.html">rendering_context</a> retains a pointer to the passed matrix; it does not make a copy. All memory management is up to the caller. In practice, the passed-in array will generally be a local variable in the <a class="el" href="classopenvrml_1_1node.html#a67">node::render</a> method.<p>
<dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign=top><em>modelview</em> </td><td>the modelview matrix. Must be at least affine, although the render code may optimize for orthogonal transforms. </td></tr>
</table>
</dl>
</td>
</tr>
</table>
<a class="anchor" name="a2" doxytag="openvrml::rendering_context::matrix" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> const <a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> & openvrml::rendering_context::matrix </td>
<td class="md" valign="top">( </td>
<td class="mdname1" valign="top" nowrap> </td>
<td class="md" valign="top"> ) </td>
<td class="md" nowrap> const</td>
</tr>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Returns a reference to the modelview matrix.
<p>
<dl compact><dt><b>Returns:</b></dt><dd>the modelview matrix. </dd></dl>
</td>
</tr>
</table>
<hr><h2>Member Data Documentation</h2>
<a class="anchor" name="o0" doxytag="openvrml::rendering_context::cull_flag" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bounding_volume::Intersection <a class="el" href="classopenvrml_1_1rendering__context.html#o0">openvrml::rendering_context::cull_flag</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Track the results of intersecting node bounds with the view volume.
<p>
Setting to <a class="el" href="classopenvrml_1_1bounding__volume.html#w3w0">bounding_volume::inside</a> means that all the last tested bounding volume was completely inside the view volume, so all the contained bounding volumes must also be inside and we can skip further testing. <a class="el" href="classopenvrml_1_1bounding__volume.html#w3w2">bounding_volume::partial</a> means that the last test indicated that the bounding volume intersected the view volume, so some of the children may be visible and we must continue testing. <a class="el" href="classopenvrml_1_1bounding__volume.html#w3w1">bounding_volume::outside</a> means the last test indicated the bounding volume was completely outside the view volume. However, there's normally no reason to call set with <a class="el" href="classopenvrml_1_1bounding__volume.html#w3w1">bounding_volume::outside</a>, since the render method returns immediately. But who knows; it might be useful some day, so it's an allowed value.<p>
Setting the cull flag to <a class="el" href="classopenvrml_1_1bounding__volume.html#w3w0">bounding_volume::inside</a> in the Browser at the top of the traversal has the effect of disabling the culling tests. The behavior is undefined if the flag is not one of the allowed values.<p>
<dl compact><dt><b>See also:</b></dt><dd><a class="el" href="classopenvrml_1_1browser.html">browser</a> <p>
<a class="el" href="classopenvrml_1_1bounding__volume.html">bounding_volume</a> </dd></dl>
</td>
</tr>
</table>
<a class="anchor" name="o1" doxytag="openvrml::rendering_context::draw_bounding_spheres" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> bool <a class="el" href="classopenvrml_1_1rendering__context.html#o1">openvrml::rendering_context::draw_bounding_spheres</a>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
Draw the bounding volumes or not.
<p>
If true, then the renderer may draw the bounding volumes for each primitive. Or maybe not, so you shouldn't depend on this behavior. It does look kinda cool though. </td>
</tr>
</table>
<a class="anchor" name="r0" doxytag="openvrml::rendering_context::modelview" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
<tr>
<td class="mdRow">
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="md" nowrap valign="top"> <a class="el" href="classopenvrml_1_1mat4f.html">mat4f</a> * <a class="el" href="classopenvrml_1_1rendering__context.html#r0">openvrml::rendering_context::modelview</a><code> [private]</code>
</table>
</td>
</tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
<tr>
<td>
</td>
<td>
<p>
The current modelview matrix. </td>
</tr>
</table>
</div>
<address class="footer"><a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=7151&type=3" width="125" height="37" border="0" alt="SourceForge.net Logo" align="right"></a><a href="http://sourceforge.net/tracker/?func=add&group_id=7151&atid=107151">Report error</a><br>Generated Sun Nov 16 20:22:41 2003 by Doxygen 1.3.4-20031112</address>
</body>
</html>
|