1 /**************************************************************************\
2 * Copyright (c) Kongsberg Oil & Gas Technologies AS
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met:
8 *
9 * Redistributions of source code must retain the above copyright notice,
10 * this list of conditions and the following disclaimer.
11 *
12 * Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 *
16 * Neither the name of the copyright holder nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 \**************************************************************************/
32
33 #ifdef HAVE_CONFIG_H
34 #include "config.h"
35 #endif // HAVE_CONFIG_H
36
37 #ifdef HAVE_NODEKITS
38
39 /*!
40 \class SoCameraKit SoCameraKit.h Inventor/nodekits/SoCameraKit.h
41 \brief The SoCameraKit class is a node kit with a transform and a camera.
42
43 \ingroup nodekits
44
45 \NODEKIT_PRE_DIAGRAM
46
47 \verbatim
48 CLASS SoCameraKit
49 -->"this"
50 "callbackList"
51 --> "transformGroup"
52 --> "transform"
53 --> "camera"
54 \endverbatim
55
56 \NODEKIT_POST_DIAGRAM
57
58
59 \NODEKIT_PRE_TABLE
60
61 \verbatim
62 CLASS SoCameraKit
63 PVT "this", SoCameraKit ---
64 "callbackList", SoNodeKitListPart [ SoCallback, SoEventCallback ]
65 PVT "transformGroup", SoTransformSeparator ---
66 "transform", SoTransform ---
67 "camera", SoCamera --- , (default type = SoPerspectiveCamera)
68 \endverbatim
69
70 \NODEKIT_POST_TABLE
71 */
72
73 #include <Inventor/nodekits/SoCameraKit.h>
74
75 #include <Inventor/nodes/SoTransformSeparator.h>
76 #include <Inventor/nodes/SoTransform.h>
77 #include <Inventor/nodes/SoPerspectiveCamera.h>
78
79 #include "nodekits/SoSubKitP.h"
80
81 SO_KIT_SOURCE(SoCameraKit);
82
83
84 /*!
85 Constructor.
86 */
SoCameraKit(void)87 SoCameraKit::SoCameraKit(void)
88 {
89 SO_KIT_INTERNAL_CONSTRUCTOR(SoCameraKit);
90
91 // Note: we must use "" instead of , , to humour MS VisualC++ 6.
92
93 SO_KIT_ADD_CATALOG_ENTRY(transformGroup, SoTransformSeparator, TRUE, this, "", FALSE);
94 SO_KIT_ADD_CATALOG_ENTRY(transform, SoTransform, TRUE, transformGroup, camera, TRUE);
95 SO_KIT_ADD_CATALOG_ABSTRACT_ENTRY(camera, SoCamera, SoPerspectiveCamera, FALSE, transformGroup, "", TRUE);
96
97 SO_KIT_INIT_INSTANCE();
98 }
99
100 /*!
101 Destructor.
102 */
~SoCameraKit()103 SoCameraKit::~SoCameraKit()
104 {
105 }
106
107 // Documented in superclass.
108 void
initClass(void)109 SoCameraKit::initClass(void)
110 {
111 SO_KIT_INTERNAL_INIT_CLASS(SoCameraKit, SO_FROM_INVENTOR_1);
112 }
113
114 #endif // HAVE_NODEKITS
115