File: SoCamera.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 (128 lines) | stat: -rw-r--r-- 4,680 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
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
NAME SoCamera SoCam SO_CAM_ { abstract base class for camera nodes }

INCLUDE nodes/SoCamera.h

DESC {
This is the abstract base class for all camera nodes. It defines the
common methods and fields that all cameras have. Cameras are used to
view a scene. When a camera is encountered during rendering, it sets
the projection and viewing matrices and viewport appropriately; it
does not draw geometry. Cameras should be placed before any shape
nodes or light nodes in a scene graph; otherwise, those shapes or
lights cannot be rendered properly. Cameras are affected by the
current transformation, so you can position a camera by placing a
transformation node before it in the scene graph . The default
position and orientation of a camera is at (0,0,1) looking along the
negative z-axis.
\p
You can also use a node kit to create a camera; see the reference page for
\cSoCameraKit\..
}

DEFINE { SO_ASPECT_SQUARE        1.00 }
DEFINE { SO_ASPECT_VIDEO         1.333333333 }
DEFINE { SO_ASPECT_35mm_ACADEMY  1.371 }
DEFINE { SO_ASPECT_16mm          1.369 }
DEFINE { SO_ASPECT_35mm_FULL     1.33333 }
DEFINE { SO_ASPECT_70mm          2.287 }
DEFINE { SO_ASPECT_CINEMASCOPE   2.35 }
DEFINE { SO_ASPECT_HDTV          1.777777777 }
DEFINE { SO_ASPECT_PANAVISION    2.361 }
DEFINE { SO_ASPECT_35mm          1.5 }
DEFINE { SO_ASPECT_VISTAVISION   2.301 }

ENUM ViewportMapping {
    CROP_VIEWPORT_FILL_FRAME	"Crops the viewport within the current
				 window, so that the aspect ratio
				 matches that of the camera. As the
				 window size changes, the aspect ratio
				 remains unchanged. The cropped region
				 is drawn as a filled gray area.",
    CROP_VIEWPORT_LINE_FRAME	"Crops the viewport, but draws a thin
				 frame around the viewport",
    CROP_VIEWPORT_NO_FRAME	"Crops the viewport, but gives no
				 visual feedback as to the viewport
				 dimensions within the window",
    ADJUST_CAMERA		"Adjusts the camera aspect ratio and
				 height to make it fit within the
				 given window. (The camera's fields are
				 not affected, just the values sent to
				 the graphics library.)",
    LEAVE_ALONE			"Do nothing. Camera image may
				 become stretched out of proportion"
}

FIELD viewportMapping {
Defines how to map the rendered image into the current viewport, when the
aspect ratio of the camera differs from that of the viewport.
}

FIELD position {
The location of the camera viewpoint.
}

FIELD orientation {
The orientation of the camera viewpoint, defined as a rotation of the
viewing direction from its default (0,0,-1) vector.
}

FIELD aspectRatio {
The ratio of camera viewing width to height. This value must be greater
than 0.0. There are several standard camera aspect ratios defined
in \cSoCamera.h\..
}

FIELD nearDistance {}
FIELD farDistance {
The distance from the camera viewpoint to the near and far clipping planes.
}

FIELD focalDistance {
The distance from the viewpoint to the point of focus. This is
typically ignored during rendering, but may be used by some viewers to
define a point of interest.
}

METHOD ptAt void pointAt(const SbVec3f &targetPoint) {
Sets the orientation of the camera so that it points toward the
given target point while keeping the "up" direction of the
camera parallel to the positive y-axis. If this is not
possible, it uses the positive z-axis as "up."
}

METHOD "" virtual void scaleHeight(float scaleFactor) {
Scales the height of the camera. Perspective cameras scale their
\vheightAngle\. fields, and orthographic cameras scale their
\vheight\. fields.
}

METHOD getViewVol virtual SbViewVolume
			getViewVolume(float useAspectRatio = 0.0) const {
Returns a view volume structure, based on the camera's viewing
parameters. If the \auseAspectRatio\. argument is not 0.0 (the default),
the camera uses that ratio instead of the one it has.
}

METHOD "" void viewAll(SoNode *sceneRoot, const SbViewportRegion &vpRegion,
			float slack = 1.0) {}
METHOD viewAllPath void viewAll(SoPath *path, const SbViewportRegion &vpRegion,
				float slack = 1.0) {
Sets the camera to view the scene rooted by the given node or defined
by the given path. The near and far clipping planes will be positioned
\aslack\. bounding sphere radii away from the bounding box's
center. A value of 1.0 will make the clipping planes the tightest
around the bounding sphere.
}

METHOD getVpBounds SbViewportRegion
		getViewportBounds(const SbViewportRegion &region) const {
Returns the viewport region this camera would use to render into the
given viewport region, accounting for cropping.
}

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

ALSO { SoOrthographicCamera, SoPerspectiveCamera, SoCameraKit }