00001 #ifndef COIN_SONODE_H
00002 #define COIN_SONODE_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/fields/SoFieldContainer.h>
00028
00029 class SoAction;
00030 class SoCallbackAction;
00031 class SoChildList;
00032 class SoGLRenderAction;
00033 class SoGetBoundingBoxAction;
00034 class SoGetMatrixAction;
00035 class SoGetPrimitiveCountAction;
00036 class SoHandleEventAction;
00037 class SoNodeList;
00038 class SoNotList;
00039 class SoOutput;
00040 class SoPickAction;
00041 class SoRayPickAction;
00042 class SoSearchAction;
00043 class SoWriteAction;
00044 class SoAudioRenderAction;
00045 class SbDict;
00046
00047 class COIN_DLL_API SoNode : public SoFieldContainer {
00048 typedef SoFieldContainer inherited;
00049
00050 public:
00051
00052 #ifndef DOXYGEN_SKIP_THIS
00053 enum Stage { FIRST_INSTANCE, PROTO_INSTANCE, OTHER_INSTANCE };
00054 #endif // !DOXYGEN_SKIP_THIS
00055
00056 void setOverride(const SbBool state);
00057 SbBool isOverride(void) const;
00058
00059 enum NodeType {
00060 INVENTOR = 0x000,
00061 VRML1 = 0x001,
00062 VRML2 = 0x002,
00063 INVENTOR_1 = 0x004,
00064 INVENTOR_2_0 = 0x008,
00065 INVENTOR_2_1 = 0x010,
00066 INVENTOR_2_5 = 0x020,
00067 INVENTOR_2_6 = 0x040,
00068 COIN_1_0 = 0x080,
00069 COIN_2_0 = 0x100,
00070 EXTENSION = 0x200
00071 };
00072
00073 static uint32_t getCompatibilityTypes(const SoType & nodetype);
00074 void setNodeType(const NodeType type);
00075 NodeType getNodeType(void) const;
00076
00077 virtual SoNode * copy(SbBool copyconnections = FALSE) const;
00078 virtual SbBool affectsState(void) const;
00079
00080 virtual void doAction(SoAction * action);
00081 virtual void GLRender(SoGLRenderAction * action);
00082 virtual void GLRenderBelowPath(SoGLRenderAction * action);
00083 virtual void GLRenderInPath(SoGLRenderAction * action);
00084 virtual void GLRenderOffPath(SoGLRenderAction * action);
00085 virtual void callback(SoCallbackAction * action);
00086 virtual void getBoundingBox(SoGetBoundingBoxAction * action);
00087 virtual void getMatrix(SoGetMatrixAction * action);
00088 virtual void handleEvent(SoHandleEventAction * action);
00089 virtual void pick(SoPickAction * action);
00090 virtual void rayPick(SoRayPickAction * action);
00091 virtual void search(SoSearchAction * action);
00092 virtual void write(SoWriteAction * action);
00093 virtual void audioRender(SoAudioRenderAction * action);
00094 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00095
00096 virtual void grabEventsSetup(void);
00097 virtual void grabEventsCleanup(void);
00098
00099 virtual void startNotify(void);
00100 virtual void notify(SoNotList * l);
00101
00102 uint32_t getNodeId(void) const;
00103 virtual SoChildList * getChildren(void) const;
00104
00105 virtual void writeInstance(SoOutput * out);
00106 virtual SoNode * addToCopyDict(void) const;
00107 virtual void copyContents(const SoFieldContainer * from,
00108 SbBool copyconnections);
00109 virtual SoFieldContainer * copyThroughConnection(void) const;
00110
00111
00112 static SoType getClassTypeId(void);
00113 static SoNode * getByName(const SbName & name);
00114 static int getByName(const SbName & name, SoNodeList & l);
00115
00116 static void initClass(void);
00117 static void initClasses(void);
00118
00119 static uint32_t getNextNodeId(void);
00120 static int getActionMethodIndex(const SoType type);
00121
00122 static void getBoundingBoxS(SoAction * action, SoNode * node);
00123 static void GLRenderS(SoAction * action, SoNode * node);
00124 static void callbackS(SoAction * action, SoNode * node);
00125 static void getMatrixS(SoAction * action, SoNode * node);
00126 static void handleEventS(SoAction * action, SoNode * node);
00127 static void pickS(SoAction * action, SoNode * node);
00128 static void rayPickS(SoAction * action, SoNode * node);
00129 static void searchS(SoAction * action, SoNode * node);
00130 static void writeS(SoAction * action, SoNode * node);
00131 static void audioRenderS(SoAction * action, SoNode * node);
00132 static void getPrimitiveCountS(SoAction * action, SoNode * node);
00133
00134 protected:
00135 SoNode(void);
00136 virtual ~SoNode();
00137
00138 virtual SbBool readInstance(SoInput * in, unsigned short flags);
00139
00140 static const SoFieldData ** getFieldDataPtr(void);
00141
00142
00143
00144
00145
00146 static void setNextActionMethodIndex(int index);
00147 static int getNextActionMethodIndex(void);
00148 static void incNextActionMethodIndex(void);
00149
00150 static void setCompatibilityTypes(const SoType & nodetype, const uint32_t bitmask);
00151
00152 uint32_t uniqueId;
00153 static uint32_t nextUniqueId;
00154 static int nextActionMethodIndex;
00155
00156 private:
00157 static SoType classTypeId;
00158 uint32_t stateflags;
00159 void clearStateFlags(const unsigned int bits);
00160 void setStateFlags(const unsigned int bits);
00161 SbBool getState(const unsigned int bits) const;
00162 static SbDict * compatibilitydict;
00163 static void cleanupClass(void);
00164 };
00165
00166 #endif // !COIN_SONODE_H