00001
00002
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
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 #ifndef _SO_GROUP_
00052 #define _SO_GROUP_
00053
00054 class SoChildList;
00055
00056 #include <Inventor/nodes/SoNode.h>
00057 #include <Inventor/sensors/SoDataSensor.h>
00058 #include <Inventor/fields/SoSFBool.h>
00059 #include <Inventor/SbPImpl.h>
00060
00061 SO_PIMPL_PUBLIC_DECLARATION(SoGroup)
00062
00063
00064
00065
00066
00067
00068
00070
00121 class SoGroup : public SoNode
00122 {
00123 SO_NODE_HEADER(SoGroup);
00124 SO_PIMPL_PUBLIC_HEADER(SoGroup)
00125
00126 public:
00130 SoSFBool boundingBoxIgnoring;
00131
00135 SoGroup();
00136
00141 SoGroup(int nChildren);
00142
00147 virtual void addChild(SoNode *child);
00148
00154 virtual void insertChild(SoNode *child, int newChildIndex);
00155
00160 virtual SoNode *getChild(int index) const;
00161
00165 virtual int findChild(const SoNode *child) const;
00166
00170 virtual int getNumChildren() const;
00171
00177 virtual void removeChild(int index);
00178
00183 virtual void removeChild(SoNode *child)
00184 { removeChild(findChild(child)); }
00185
00190 virtual void removeAllChildren();
00191
00197 virtual void replaceChild(int index, SoNode *newChild);
00198
00203 virtual void replaceChild(SoNode *oldChild, SoNode *newChild)
00204 { replaceChild(findChild(oldChild), newChild); }
00205
00206 private:
00207
00213 inline virtual SbBool isBoundingBoxIgnoring() const
00214 { return boundingBoxIgnoring.getValue(); }
00215
00216
00217 virtual void doAction(SoAction *action);
00218 virtual void callback(SoCallbackAction *action);
00219 virtual void GLRender(SoGLRenderAction *action);
00220 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00221 virtual void getMatrix(SoGetMatrixAction *action);
00222 virtual void handleEvent(SoHandleEventAction *action);
00223 virtual void pick(SoPickAction *action);
00224 virtual void search(SoSearchAction *action);
00225 virtual void write(SoWriteAction *action);
00226 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00227
00228 private:
00229 static void initClass();
00230 static void exitClass();
00231
00232
00233 virtual SoChildList *getChildren() const;
00234
00235
00236 virtual void internalRemoveChild( int index ) { removeChild(index); }
00237 virtual void internalRemoveChild( SoNode *child ) { removeChild(findChild(child)); }
00238 virtual void internalRemoveAllChildren() { removeAllChildren(); }
00239 virtual void internalAddChild( SoNode *child ) { addChild(child); }
00240 virtual int internalFindChild( const SoNode *child ) const { return findChild(child); }
00241 virtual void internalInsertChild( SoNode *child, int newChildIndex ) { insertChild(child, newChildIndex); }
00242 virtual SoNode *internalGetChild( int index) const { return getChild(index); }
00243 virtual void internalReplaceChild( int index, SoNode *newChild) { replaceChild(index, newChild); }
00244 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { replaceChild(oldChild,newChild); }
00245
00246 virtual void notify(SoNotList *list);
00247
00248 virtual bool isGroup() { return true; }
00249
00250
00251 virtual void copyContents(const SoFieldContainer *fromFC, SbBool copyConnections);
00252
00253
00254 static void writeChildren( SoWriteAction *action, SoChildList* children_ );
00255
00256 private:
00257 SoChildList *children;
00258
00259
00260 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00261
00262
00263 virtual SbBool readChildren(SoInput *in);
00264
00265 virtual ~SoGroup();
00266
00267
00268 private:
00269
00270 void commonConstructor();
00271
00272 };
00273
00274
00275 #endif
00276
00277