00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef COIN_SOVRMLPARENT_H
00025 #define COIN_SOVRMLPARENT_H
00026
00027 #include <Inventor/nodes/SoGroup.h>
00028 #include <Inventor/nodes/SoSubNode.h>
00029 #include <Inventor/fields/SoMFNode.h>
00030
00031 class SoVRMLParentP;
00032 class SoSensor;
00033
00034 class COIN_DLL_API SoVRMLParent : public SoGroup
00035 {
00036 typedef SoGroup inherited;
00037 SO_NODE_ABSTRACT_HEADER(SoVRMLParent);
00038
00039 public:
00040 static void initClass(void);
00041
00042 SoMFNode children;
00043
00044 virtual SbBool affectsState(void) const;
00045 virtual void addChild(SoNode * child);
00046 virtual void insertChild(SoNode * child, int idx);
00047 virtual SoNode * getChild(int idx) const;
00048 virtual int findChild(const SoNode * child) const;
00049 virtual int getNumChildren(void) const;
00050 virtual void removeChild(int idx);
00051 virtual void removeChild(SoNode * child);
00052 virtual void removeAllChildren(void);
00053 virtual void replaceChild(int idx, SoNode * child);
00054 virtual void replaceChild(SoNode * old, SoNode * child);
00055 virtual SoChildList * getChildren(void) const;
00056
00057 virtual void doAction(SoAction * action);
00058 virtual void search(SoSearchAction * action);
00059 virtual void write(SoWriteAction * action);
00060 virtual void getPrimitiveCount(SoGetPrimitiveCountAction * action);
00061
00062 static void updateChildList(const SoNode * const * nodes, const int numnodes,
00063 SoChildList & cl);
00064 static void updateChildList(SoNode * nodewithsfnode,
00065 SoChildList & cl);
00066
00067 protected:
00068 SoVRMLParent(void);
00069 SoVRMLParent(int approxchildren);
00070 virtual ~SoVRMLParent();
00071
00072 SoMFNode addChildren;
00073 SoMFNode removeChildren;
00074
00075 virtual void notify(SoNotList * list);
00076 virtual SbBool readInstance(SoInput * in, unsigned short flags);
00077 virtual void copyContents(const SoFieldContainer * from, SbBool copyConn);
00078
00079 private:
00080 static void field_sensor_cb(void * data, SoSensor * sensor);
00081 void commonConstructor(void);
00082 void processAddChildren(void);
00083 void processRemoveChildren(void);
00084 SoFieldData * makeWriteData(void);
00085
00086 SoVRMLParentP * pimpl;
00087 };
00088
00089 #endif // ! COIN_SOVRMLPARENT_H