Coin Logo http://www.sim.no/
http://www.coin3d.org/

SoNode.h
1 #ifndef COIN_SONODE_H
2 #define COIN_SONODE_H
3 
4 /**************************************************************************\
5  *
6  * This file is part of the Coin 3D visualization library.
7  * Copyright (C) by Kongsberg Oil & Gas Technologies.
8  *
9  * This library is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * ("GPL") version 2 as published by the Free Software Foundation.
12  * See the file LICENSE.GPL at the root directory of this source
13  * distribution for additional information about the GNU GPL.
14  *
15  * For using Coin with software that can not be combined with the GNU
16  * GPL, and for taking advantage of the additional benefits of our
17  * support services, please contact Kongsberg Oil & Gas Technologies
18  * about acquiring a Coin Professional Edition License.
19  *
20  * See http://www.coin3d.org/ for more information.
21  *
22  * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY.
23  * http://www.sim.no/ sales@sim.no coin-support@coin3d.org
24  *
25 \**************************************************************************/
26 
27 #include <Inventor/fields/SoFieldContainer.h>
28 
29 class SoAction;
30 class SoCallbackAction;
31 class SoChildList;
32 class SoGLRenderAction;
34 class SoGetMatrixAction;
37 class SoNodeList;
38 class SoNotList;
39 class SoOutput;
40 class SoPickAction;
41 class SoRayPickAction;
42 class SoSearchAction;
43 class SoWriteAction;
45 class SbDict;
46 
47 class COIN_DLL_API SoNode : public SoFieldContainer {
49 
50 public:
51  // Probably not interesting for the application programmer..?
52 #ifndef DOXYGEN_SKIP_THIS
53  enum Stage { FIRST_INSTANCE, PROTO_INSTANCE, OTHER_INSTANCE };
54 #endif // !DOXYGEN_SKIP_THIS
55 
56  void setOverride(const SbBool state);
57  SbBool isOverride(void) const;
58 
59  enum NodeType {
60  INVENTOR = 0x0000,
61  VRML1 = 0x0001,
62  VRML2 = 0x0002,
63  INVENTOR_1 = 0x0004,
64  INVENTOR_2_0 = 0x0008,
65  INVENTOR_2_1 = 0x0010,
66  INVENTOR_2_5 = 0x0020,
67  INVENTOR_2_6 = 0x0040,
68  COIN_1_0 = 0x0080,
69  COIN_2_0 = 0x0100,
70  EXTENSION = 0x0200,
71  COIN_2_2 = 0x0400,
72  COIN_2_3 = 0x0800,
73  COIN_2_4 = 0x1000,
74  INVENTOR_5_0 = 0x2000,
75  COIN_2_5 = 0x4000,
76  COIN_3_0 = 0x8000,
77  INVENTOR_6_0 = 0x10000
78  };
79 
80  static uint32_t getCompatibilityTypes(const SoType & nodetype);
81  void setNodeType(const NodeType type);
82  NodeType getNodeType(void) const;
83 
84  virtual SoNode * copy(SbBool copyconnections = FALSE) const;
85  virtual SbBool affectsState(void) const;
86 
87  virtual void doAction(SoAction * action);
88  virtual void GLRender(SoGLRenderAction * action);
89  virtual void GLRenderBelowPath(SoGLRenderAction * action);
90  virtual void GLRenderInPath(SoGLRenderAction * action);
91  virtual void GLRenderOffPath(SoGLRenderAction * action);
92  virtual void callback(SoCallbackAction * action);
93  virtual void getBoundingBox(SoGetBoundingBoxAction * action);
94  virtual void getMatrix(SoGetMatrixAction * action);
95  virtual void handleEvent(SoHandleEventAction * action);
96  virtual void pick(SoPickAction * action);
97  virtual void rayPick(SoRayPickAction * action);
98  virtual void search(SoSearchAction * action);
99  virtual void write(SoWriteAction * action);
100  virtual void audioRender(SoAudioRenderAction * action);
101  virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
102 
103  virtual void grabEventsSetup(void);
104  virtual void grabEventsCleanup(void);
105 
106  virtual void startNotify(void);
107  virtual void notify(SoNotList * l);
108 
109  uint32_t getNodeId(void) const;
110  virtual SoChildList * getChildren(void) const;
111 
112  virtual void writeInstance(SoOutput * out);
113  virtual SoNode * addToCopyDict(void) const;
114  virtual void copyContents(const SoFieldContainer * from,
115  SbBool copyconnections);
116  virtual SoFieldContainer * copyThroughConnection(void) const;
117 
118 
119  static SoType getClassTypeId(void);
120  static SoNode * getByName(const SbName & name);
121  static int getByName(const SbName & name, SoNodeList & l);
122 
123  static void initClass(void);
124  static void initClasses(void);
125 
126  static uint32_t getNextNodeId(void);
127  static int getActionMethodIndex(const SoType type);
128 
129  static void getBoundingBoxS(SoAction * action, SoNode * node);
130  static void GLRenderS(SoAction * action, SoNode * node);
131  static void callbackS(SoAction * action, SoNode * node);
132  static void getMatrixS(SoAction * action, SoNode * node);
133  static void handleEventS(SoAction * action, SoNode * node);
134  static void pickS(SoAction * action, SoNode * node);
135  static void rayPickS(SoAction * action, SoNode * node);
136  static void searchS(SoAction * action, SoNode * node);
137  static void writeS(SoAction * action, SoNode * node);
138  static void audioRenderS(SoAction * action, SoNode * node);
139  static void getPrimitiveCountS(SoAction * action, SoNode * node);
140 
141 protected:
142  SoNode(void);
143  virtual ~SoNode();
144 
145  virtual SbBool readInstance(SoInput * in, unsigned short flags);
146 
147  static const SoFieldData ** getFieldDataPtr(void);
148 
149  // These are necessary to avoid problems with us not exporting the
150  // nextActionMethodIndex member into Win32 DLLs (we'll get
151  // unresolved symbol for extension node classes if the SoSubNode
152  // macros accesses the nextActionMethodIndex directly).
153  static void setNextActionMethodIndex(int index);
154  static int getNextActionMethodIndex(void);
155  static void incNextActionMethodIndex(void);
156 
157  static void setCompatibilityTypes(const SoType & nodetype, const uint32_t bitmask);
158 
159  uint32_t uniqueId;
160  static uint32_t nextUniqueId;
162 
163 private:
164  static SoType classTypeId;
165  uint32_t stateflags;
166  void clearStateFlags(const unsigned int bits);
167  void setStateFlags(const unsigned int bits);
168  SbBool getState(const unsigned int bits) const;
169  static void cleanupClass(void);
170 };
171 
172 #ifndef COIN_INTERNAL
173 // For SGI / TGS Open Inventor compile-time compatibility.
174 #include <Inventor/SoLists.h>
175 #endif // COIN_INTERNAL
176 
177 #endif // !COIN_SONODE_H

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

Generated for Coin by Doxygen 1.8.2.