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