File: SoLevelOfDetail.ivm

package info (click to toggle)
inventor 2.1.5-10-14
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 32,892 kB
  • ctags: 21,729
  • sloc: ansic: 33,867; lisp: 7,361; cpp: 3,874; yacc: 369; sh: 359; perl: 234; awk: 141; makefile: 76; csh: 35; sed: 11
file content (59 lines) | stat: -rw-r--r-- 2,160 bytes parent folder | download | duplicates (12)
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
NAME SoLevelOfDetail SoLvlOfDtl "" {
level-of-detail switching group node
}

INCLUDE nodes/SoLevelOfDetail.h

DESC {
The children of this
node typically represent the same object or objects at varying levels
of detail, from highest detail to lowest. The size of the objects when
projected into the viewport is used to determine which version to use
(i.e., which child to traverse).
\p
The size is computed as the area of the screen rectangle enclosing the
projection of the 3D bounding box that encloses all of the children.
When rendering, this size is compared to the values in the
\vscreenArea\. field. If the size is greater than the first value,
child 0 is traversed. If it is smaller than the first, but greater
than the second, child 1 is traversed, and so on. If there are fewer
children than are required by this rule, the last child is traversed.
The \vscreenArea\. field contains just 0 by default, so the first
child is always traversed.
\p
The size calculation takes the current complexity into account. If the
complexity is 0 or is of type \kBOUNDING_BOX\., the last child is
always traversed. If the complexity is less than .5, the computed size
is scaled down appropriately to use (possibly) a less detailed
representation. If the complexity is greater than .5, the size is
scaled up. At complexity 1, the first child is always used.
\p
Note that the \cSoLOD\. node is similar to \cSoLevelOfDetail\., except
the switching between levels in the \cSoLOD\. node is based on 
distance from the camera, which is faster than using screen area.
}

FIELD screenArea { Areas to use for comparison }

METHOD "" SoLevelOfDetail() {
Creates a level-of-detail node with default settings.
}

METHOD "" static SoType getClassTypeId() {
Returns type identifier for this class.
}

ACTION SoGLRenderAction, SoRayPickAction, SoCallbackAction {
Only the child with the appropriate level of detail is traversed.
}

ACTION SoGetBoundingBoxAction {
The box that encloses all children is computed. (This is the box that is
needed to compute the projected size.)
}

ACTION others {
All implemented as for \cSoGroup\..
}

ALSO { SoLOD, SoComplexity, SoSwitch, SoGroup }