Coin Logo http://www.coin3d.org/
http://www.kongsberg.com/kogt/

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
41 class 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 
47 class SoSensor;
48 class SoSeparator;
49 
50 class COIN_DLL_API SoInteractionKit : public SoBaseKit {
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 
58 public:
63 
64 public:
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,
79  SoPath *&pathToOwner,
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 
87 protected:
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 
118 private:
119  class SoInteractionKitP * pimpl;
120  friend class SoInteractionKitP;
121 };
122 
123 #endif // !COIN_SOINTERACTIONKIT_H

Copyright © by Kongsberg Oil & Gas Technologies. All rights reserved.

Generated on Sat Oct 26 2013 23:25:57 for Coin by Doxygen 1.8.4.