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
virtual void writeInstance(SoOutput *out)
Definition: SoFieldContainer.cpp:715
The SoBase class is the top-level superclass for a number of class-hierarchies.SoBase provides the ba...
Definition: SoBase.h:36
The SoRayPickAction class does ray intersection with scene graphs.For interaction with the scene grap...
Definition: SoRayPickAction.h:41
The SoOutput class is an abstraction of an output stream.SoOutput offers the ability to write basic t...
Definition: SoOutput.h:42
The SoGetMatrixAction class is an action for accumulating the transformation matrix of a subgraph...
Definition: SoGetMatrixAction.h:37
The SoFieldContainer class is a base class for all classes that contain fields.The classes containing...
Definition: SoFieldContainer.h:34
The SoSearchAction class provides methods for searching through scene graphs.Nodes can be searched fo...
Definition: SoSearchAction.h:35
virtual void copyContents(const SoFieldContainer *from, SbBool copyconnections)
Definition: SoFieldContainer.cpp:786
The SoPickAction class is the base class for picking actions.The basis for all interaction features t...
Definition: SoPickAction.h:34
The SoNode class is the base class for nodes used in scene graphs.Coin is a retained mode 3D visualiz...
Definition: SoNode.h:47
virtual SoFieldContainer * copyThroughConnection(void) const
Definition: SoFieldContainer.cpp:804
The SbDict class organizes a dictionary of keys and values.It uses hashing to quickly insert and find...
Definition: SbDict.h:54
The SoChildList class is a container for node children.This class does automatic notification on the ...
Definition: SoChildList.h:33
static int nextActionMethodIndex
Definition: SoNode.h:161
The SoAudioRenderAction class renders the aural parts of the scene graph.Applying this method at a ro...
Definition: SoAudioRenderAction.h:33
virtual void notify(SoNotList *l)
Definition: SoFieldContainer.cpp:636
The SoAction class is the base class for all traversal actions.Applying actions is the basic mechanis...
Definition: SoAction.h:68
The SoHandleEventAction class distributes user events to the scene.This is the action used by the GUI...
Definition: SoHandleEventAction.h:37
The SoGetPrimitiveCountAction class counts the primitives in a scene.Apply this action to a scene if ...
Definition: SoGetPrimitiveCountAction.h:34
The SoGetBoundingBoxAction class calculates bounding boxes for nodes and subgraphs.If this action is applied to a path or scene graph root, it will calculate the bounding box and the center point of the geometry contained within the scene.
Definition: SoGetBoundingBoxAction.h:36
virtual SbBool readInstance(SoInput *in, unsigned short flags)
Definition: SoFieldContainer.cpp:1038
virtual void startNotify(void)
Definition: SoBase.cpp:762
static uint32_t nextUniqueId
Definition: SoNode.h:160
The SoCallbackAction class invokes callbacks at specific nodes.This action has mechanisms for trackin...
Definition: SoCallbackAction.h:71
The SoNodeList class is a container for pointers to SoNode objects.
Definition: SoNodeList.h:31
The SoWriteAction class writes a scene graph to file.When applied to a scene, this action writes its ...
Definition: SoWriteAction.h:33
The SoInput class is an abstraction of file import functionality.This class takes care of most of the...
Definition: SoInput.h:52
uint32_t uniqueId
Definition: SoNode.h:159
The SoFieldData class is a container for a prototype set of fields.This class is instantiated once fo...
Definition: SoFieldData.h:39
The SoNotList class is a list of SoNotRec notification records.
Definition: SoNotification.h:34
The SoType class is the basis for the run-time type system in Coin.Many of the classes in the Coin li...
Definition: SoType.h:50
NodeType
Definition: SoNode.h:59
The SbName class stores strings by reference.The class is used by Coin for storing keywords...
Definition: SbName.h:31
The SoGLRenderAction class renders the scene graph with OpenGL calls.Applying this method at a root n...
Definition: SoGLRenderAction.h:41

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

Generated for Coin by Doxygen 1.8.14.