00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _SO_DIALOG_GROUP_
00024 #define _SO_DIALOG_GROUP_
00025
00026 #include <DialogViz/dialog/SoDialogComponent.h>
00027
00028 class SoDialogAuditor;
00029 class SoDialogGroupAuditor;
00030
00046 class SoDialogGroup : public SoDialogComponent
00047 {
00048 SO_DG_HEADER(SoDialogGroup);
00049
00050 public:
00051
00052 enum ScrollVisibility {
00054 NEVER,
00056 ALWAYS,
00058 AUTO
00059 };
00060
00064 SoSFEnum vScrollVisibility;
00065
00069 SoSFEnum hScrollVisibility;
00070
00074 SoSFBool windowResizedByChildren;
00075
00079 SoSFInt32 margin;
00080
00084 void addAuditor(SoDialogAuditor* auditor);
00085
00089 void removeAuditor(SoDialogAuditor* auditor);
00090
00094 void applyAuditors();
00095
00100 SoDialogViz* searchForAuditorId(SbString id);
00101
00105 virtual void addChild(SoDialogComponent *child);
00106
00110 virtual void insertChild(SoDialogComponent *child, int newChildIndex);
00111
00115 virtual SoNode *getChild(int index) const;
00116
00120 virtual int getNumChildren() const;
00121
00125 virtual int findChild(const SoDialogComponent *child) const;
00126
00130 virtual void removeChild(int index);
00131
00135 virtual void removeChild(SoDialogComponent *child);
00136
00140 virtual void removeAllChildren();
00141
00145 virtual void replaceChild(int index, SoDialogComponent *newChild);
00146
00150 virtual void replaceChild(SoDialogComponent *oldChild, SoDialogComponent *newChild);
00151
00152
00153 private:
00154 virtual SoChildList *getChildren() const;
00155
00156 virtual void buildWidget(SoWidget parent, SbVec2i32 & rSize, SbVec2i32 & pos, SbBool isActive2d);
00157 static void initClass();
00158 static void exitClass();
00159 virtual void updateFromSensor(SoSensor* sensor);
00160 SbBool isVScrollVisible() {return m_vScrollVisible;};
00161 void updateAfterSceneGraphChange();
00162 virtual void resetSize();
00163 virtual void destroyWidget();
00164
00165
00166 virtual void internalRemoveChild( int index ) { removeChild(index); }
00167 virtual void internalRemoveChild( SoNode *child ) { removeChild(internalFindChild(child)); }
00168 virtual void internalRemoveAllChildren() { removeAllChildren(); }
00169 virtual void internalAddChild( SoNode *child );
00170 virtual int internalFindChild( const SoNode *child ) const;
00171 virtual void internalInsertChild( SoNode *child, int newChildIndex );
00172 virtual SoNode *internalGetChild( int index) const { return getChild(index); }
00173 virtual void internalReplaceChild( int index, SoNode *newChild);
00174 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { replaceChild(dynamic_cast<SoDialogComponent*>(oldChild),dynamic_cast<SoDialogComponent*>(newChild) ); }
00175
00176 private:
00177
00178
00179 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00180
00181
00182 virtual SbBool readChildren(SoInput *in);
00183
00184 int m_arrayNumChildren;
00185 SbVec2i32* m_childrenMin;
00186 SbVec2i32* m_childrenMax;
00187 SbVec2i32* m_childrenSize;
00188 int m_cptToResize;
00189 SbBool m_hScrollVisible;
00190 SbBool m_vScrollVisible;
00191 SoWidget m_groupWidget;
00192 SoWidget m_horzSBXt;
00193 SoWidget m_vertSBXt;
00194 int m_numberOfChildren;
00195 SbBool m_firstBuild;
00196
00197 SoDialogGroup();
00198 virtual ~SoDialogGroup();
00199 virtual void fixSizeWithBorder(SbVec2i32 &size, int revert = 1);
00200 virtual SbVec2i32 getLabelInitSize();
00201 virtual SbVec2i32 getComponentInitSize();
00202
00203 virtual void getSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
00204 virtual void setChildrenComponentSize() {};
00205 virtual void setChildrenLabelSize() {};
00206 virtual void setComponentSize(SbVec2i32& size);
00207 virtual void setLabelSize(SbVec2i32& size);
00208 void setScrollProperties();
00209 void updateGroupWidgetScrollPosition();
00210 void updateChildrenSizeDB();
00211
00212 virtual void changeEnable();
00213 virtual void changeWidgetEnable(SbBool state);
00214
00215 private:
00216
00217 void createGroupWidget(SbVec2i32 & rSize, SbVec2i32 & pos);
00218 virtual void applyAuditor(SoDialogViz* dlgCpt);
00219
00220
00221 SoDialogGroupAuditor* m_defaultAuditor;
00222
00224
00225 private:
00226 virtual void show3D(SbBool show);
00227 virtual void change3DPosition();
00228 virtual void change3DEnable();
00229 virtual void change3DWidgetEnable(SbBool state);
00230
00232 private:
00233 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
00234 virtual void rayPick(SoRayPickAction *action);
00235 virtual void search(SoSearchAction *action);
00236 virtual void write(SoWriteAction *action);
00237
00239
00240 };
00241
00242 #endif // _SO_DIALOG_GROUP_
00243
00244
00245