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 #include <Inventor/nodes/SoNode.h>
00056 #include <Inventor/sensors/SoDataSensor.h>
00057 #include <Inventor/fields/SoSFBool.h>
00058
00060
00061
00062
00063
00064
00066
00118 class SoGroup : public SoNode {
00119
00120 SO_NODE_HEADER(SoGroup);
00121
00122 public:
00126 SoSFBool boundingBoxIgnoring;
00127
00131 SoGroup();
00132
00137 SoGroup(int nChildren);
00138
00143 virtual void addChild(SoNode *child);
00144
00150 virtual void insertChild(SoNode *child, int newChildIndex);
00151
00156 virtual SoNode *getChild(int index) const;
00157
00161 virtual int findChild(const SoNode *child) const;
00162
00166 virtual int getNumChildren() const;
00167
00173 virtual void removeChild(int index);
00174
00179 virtual void removeChild(SoNode *child)
00180 { removeChild(findChild(child)); }
00181
00186 virtual void removeAllChildren();
00187
00193 virtual void replaceChild(int index, SoNode *newChild);
00194
00199 virtual void replaceChild(SoNode *oldChild, SoNode *newChild)
00200 { replaceChild(findChild(oldChild), newChild); }
00201
00202 private:
00203
00209 inline virtual SbBool isBoundingBoxIgnoring() const
00210 { return boundingBoxIgnoring.getValue(); }
00211
00212
00213 virtual void doAction(SoAction *action);
00214 virtual void callback(SoCallbackAction *action);
00215 virtual void GLRender(SoGLRenderAction *action);
00216 virtual void getBoundingBox(SoGetBoundingBoxAction *action);
00217 virtual void getMatrix(SoGetMatrixAction *action);
00218 virtual void handleEvent(SoHandleEventAction *action);
00219 virtual void pick(SoPickAction *action);
00220 virtual void search(SoSearchAction *action);
00221 virtual void write(SoWriteAction *action);
00222 virtual void getPrimitiveCount(SoGetPrimitiveCountAction *action);
00223
00224 private:
00225 static void initClass();
00226 static void exitClass();
00227
00228
00229 virtual SoChildList *getChildren() const;
00230
00231
00232 virtual void internalRemoveChild( int index ) { removeChild(index); }
00233 virtual void internalRemoveChild( SoNode *child ) { removeChild(findChild(child)); }
00234 virtual void internalRemoveAllChildren() { removeAllChildren(); }
00235 virtual void internalAddChild( SoNode *child ) { addChild(child); }
00236 virtual int internalFindChild( const SoNode *child ) const { return findChild(child); }
00237 virtual void internalInsertChild( SoNode *child, int newChildIndex ) { insertChild(child, newChildIndex); }
00238 virtual SoNode *internalGetChild( int index) const { return getChild(index); }
00239 virtual void internalReplaceChild( int index, SoNode *newChild) { replaceChild(index, newChild); }
00240 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { replaceChild(oldChild,newChild); }
00241
00242 virtual bool isGroup() { return true; }
00243
00244
00245 virtual void copyContents(const SoFieldContainer *fromFC, SbBool copyConnections);
00246
00247
00248 static void writeChildren( SoWriteAction *action, SoChildList* children_ );
00249
00250 private:
00251 SoChildList *children;
00252
00253
00254 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00255
00256
00257 virtual SbBool readChildren(SoInput *in);
00258
00259 virtual ~SoGroup();
00260
00261 void commonConstructor();
00262 };
00263
00264
00265 #endif
00266
00267