Coin  4.0.3
Coin3D core library
Loading...
Searching...
No Matches
SoInteractionKit.h
1#ifndef COIN_SOINTERACTIONKIT_H
2#define COIN_SOINTERACTIONKIT_H
3
4/**************************************************************************\
5 * Copyright (c) Kongsberg Oil & Gas Technologies AS
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions are
10 * met:
11 *
12 * Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * Neither the name of the copyright holder nor the names of its
20 * contributors may be used to endorse or promote products derived from
21 * this software without specific prior written permission.
22 *
23 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
26 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
27 * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
28 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
29 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
30 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
31 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34\**************************************************************************/
35
36#include <Inventor/nodekits/SoSubKit.h>
37#include <Inventor/nodekits/SoBaseKit.h>
38#include <Inventor/fields/SoSFEnum.h>
39
40#ifdef COIN_INTERNAL
41class SoFieldSensor;
42#else // !COIN_INTERNAL
43// Include this header file for better Open Inventor compatibility.
44#include <Inventor/sensors/SoFieldSensor.h>
45#endif // !COIN_INTERNAL
46
47class SoSensor;
48class SoSeparator;
49
51 typedef SoBaseKit inherited;
52
53 SO_KIT_HEADER(SoInteractionKit);
54
55 SO_KIT_CATALOG_ENTRY_HEADER(geomSeparator);
56 SO_KIT_CATALOG_ENTRY_HEADER(topSeparator);
57
58public:
63
64public:
65 SoInteractionKit(void);
66 static void initClass(void);
67
68 enum CacheEnabled { OFF, ON, AUTO };
69
70 virtual SbBool setPartAsPath(const SbName &partname,
71 SoPath *path);
72 virtual SbBool setPartAsDefault(const SbName &partname,
73 SoNode *node,
74 SbBool onlyifdefault = TRUE);
75 virtual SbBool setPartAsDefault(const SbName &partname,
76 const SbName &nodename,
77 SbBool onlyifdefault = TRUE);
78 SbBool isPathSurrogateInMySubgraph(const SoPath *path,
80 SbName &surrogatename,
81 SoPath *&surrogatepath,
82 SbBool fillargs = TRUE);
83 SbBool isPathSurrogateInMySubgraph(const SoPath *path);
84 static void setSwitchValue(SoNode *node, const int newVal);
85 virtual SbBool setPart(const SbName & partname, SoNode * from);
86
87protected:
88 virtual ~SoInteractionKit();
89 virtual void copyContents(const SoFieldContainer *fromFC,
90 SbBool copyConnections);
91
92 virtual SbBool setPart(const int partNum, SoNode *node);
93 virtual SbBool readInstance(SoInput *in, unsigned short flags);
94 static void readDefaultParts(const char *fileName,
95 const char defaultBuffer[],
96 int defBufSize);
97 virtual SbBool setAnyPartAsDefault(const SbName &partname,
98 SoNode *node,
99 SbBool anypart = TRUE,
100 SbBool onlyifdefault = TRUE);
101 virtual SbBool setAnyPartAsDefault(const SbName &partname,
102 const SbName &nodename,
103 SbBool anypart = TRUE,
104 SbBool onlyifdefault = TRUE);
105 SbBool setAnySurrogatePath(const SbName &name,
106 SoPath *path,
107 SbBool leafcheck = FALSE,
108 SbBool publiccheck = FALSE);
109 virtual SbBool setUpConnections(SbBool onoff, SbBool doitalways = FALSE);
110 virtual void setDefaultOnNonWritingFields();
111
113 static void fieldSensorCB(void *, SoSensor *);
115
116 void connectSeparatorFields( SoSeparator *dest, SbBool onOff );
117
118private:
119 class SoInteractionKitP * pimpl;
120 friend class SoInteractionKitP;
121};
122
123#endif // !COIN_SOINTERACTIONKIT_H
The SbList class is a template container class for lists.
Definition SbList.h:70
The SbName class stores strings by reference.
Definition SbName.h:40
The SoBaseKit class is the top level superclass for nodekits.
Definition SoBaseKit.h:66
The SoFieldContainer class is a base class for all classes that contain fields.
Definition SoFieldContainer.h:43
The SoFieldSensor class detects changes to a field.
Definition SoFieldSensor.h:38
The SoInput class is an abstraction of file import functionality.
Definition SoInput.h:61
The SoInteractionKit class is a base class for draggers.
Definition SoInteractionKit.h:50
SoSFEnum renderCaching
Definition SoInteractionKit.h:59
SoFieldSensor * fieldSensor
Definition SoInteractionKit.h:112
SoSeparator * oldTopSep
Definition SoInteractionKit.h:114
CacheEnabled
Definition SoInteractionKit.h:68
SoSFEnum boundingBoxCaching
Definition SoInteractionKit.h:60
SoSFEnum renderCulling
Definition SoInteractionKit.h:61
SoSFEnum pickCulling
Definition SoInteractionKit.h:62
The SoNode class is the base class for nodes used in scene graphs.
Definition SoNode.h:56
The SoPath class is a container class for traversal path descriptions.
Definition SoPath.h:52
The SoSFEnum class is a container for an enum value.
Definition SoSFEnum.h:40
The SoSensor class is the abstract base class for all sensors.
Definition SoSensor.h:43
The SoSeparator class is a state-preserving group node.
Definition SoSeparator.h:44