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_MANIPULATORS
38
39 /*!
40 \class SoTabBoxManip SoTabBoxManip.h Inventor/manips/SoTabBoxManip.h
41 \brief The SoTabBoxManip class wraps an SoTabBoxDragger.
42
43 \ingroup manips
44
45 The SoTabBoxManip provides a convenient mechanism for the
46 application programmer for setting up an SoTabBoxDragger in the
47 scene connected to the relevant fields of an SoTransform node.
48
49 <center>
50 \image html tabbox.png "Example of TabBox Manipulator"
51 </center>
52
53 The interaction from the end-user with the manipulator will then
54 automatically influence the transformation matrix for the geometry
55 following it in the scenegraph.
56 */
57
58 #include <Inventor/manips/SoTabBoxManip.h>
59
60 #include <Inventor/nodes/SoSurroundScale.h>
61 #include <Inventor/draggers/SoTabBoxDragger.h>
62
63 #include "nodes/SoSubNodeP.h"
64
65 class SoTabBoxManipP {
66 public:
67 };
68
69 SO_NODE_SOURCE(SoTabBoxManip);
70
71 // Doc in superclass.
72 void
initClass(void)73 SoTabBoxManip::initClass(void)
74 {
75 SO_NODE_INTERNAL_INIT_CLASS(SoTabBoxManip, SO_FROM_INVENTOR_1);
76 }
77
78 /*!
79 Constructor sets us up with an SoTabBoxDragger for manipulating a
80 transformation.
81 */
SoTabBoxManip(void)82 SoTabBoxManip::SoTabBoxManip(void)
83 {
84 SO_NODE_INTERNAL_CONSTRUCTOR(SoTabBoxManip);
85
86 SoTabBoxDragger *dragger = new SoTabBoxDragger;
87 this->setDragger(dragger);
88
89 SoSurroundScale * ss =
90 (SoSurroundScale *)dragger->getPart("surroundScale", TRUE);
91 ss->numNodesUpToContainer = 4;
92 ss->numNodesUpToReset = 3;
93 }
94
95
96 /*!
97 Protected destructor. (SoHandleBoxManip is automatically destructed
98 when it's reference count goes to 0.)
99 */
~SoTabBoxManip()100 SoTabBoxManip::~SoTabBoxManip()
101 {
102 }
103
104 #endif // HAVE_MANIPULATORS
105