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
00047 class SoDialogGroup : public SoDialogComponent
00048 {
00049 SO_DG_HEADER(SoDialogGroup);
00050
00051 public:
00052
00053 enum ScrollVisibility {
00055 NEVER,
00057 ALWAYS,
00059 AUTO
00060 };
00061
00065 SoSFEnum vScrollVisibility;
00066
00070 SoSFEnum hScrollVisibility;
00071
00075 SoSFBool windowResizedByChildren;
00076
00080 SoSFInt32 margin;
00081
00085 void addAuditor(SoDialogAuditor* auditor);
00086
00090 void removeAuditor(SoDialogAuditor* auditor);
00091
00095 void applyAuditors();
00096
00101 SoDialogViz* searchForAuditorId(SbString id);
00102
00106 virtual void addChild(SoDialogComponent *child);
00107
00111 virtual void insertChild(SoDialogComponent *child, int newChildIndex);
00112
00116 virtual SoNode *getChild(int index) const;
00117
00121 virtual int getNumChildren() const;
00122
00126 virtual int findChild(const SoDialogComponent *child) const;
00127
00131 virtual void removeChild(int index);
00132
00136 virtual void removeChild(SoDialogComponent *child);
00137
00141 virtual void removeAllChildren();
00142
00146 virtual void replaceChild(int index, SoDialogComponent *newChild);
00147
00151 virtual void replaceChild(SoDialogComponent *oldChild, SoDialogComponent *newChild);
00152
00153
00154 private:
00155 virtual SoChildList *getChildren() const;
00156
00157 virtual void buildWidget(SoWidget parent, SbVec2i32 & rSize, SbVec2i32 & pos, SbBool isActive2d);
00158 static void initClass();
00159 static void exitClass();
00160 virtual void updateFromSensor(SoSensor* sensor);
00161 SbBool isVScrollVisible() {return m_vScrollVisible;};
00162 void updateAfterSceneGraphChange();
00163 virtual void resetSize();
00164 virtual void destroyWidget();
00165
00166
00167 virtual void internalRemoveChild( int index ) { removeChild(index); }
00168 virtual void internalRemoveChild( SoNode *child ) { removeChild(internalFindChild(child)); }
00169 virtual void internalRemoveAllChildren() { removeAllChildren(); }
00170 virtual void internalAddChild( SoNode *child );
00171 virtual int internalFindChild( const SoNode *child ) const;
00172 virtual void internalInsertChild( SoNode *child, int newChildIndex );
00173 virtual SoNode *internalGetChild( int index) const { return getChild(index); }
00174 virtual void internalReplaceChild( int index, SoNode *newChild);
00175 virtual void internalReplaceChild( SoNode *oldChild, SoNode *newChild) { replaceChild(dynamic_cast<SoDialogComponent*>(oldChild),dynamic_cast<SoDialogComponent*>(newChild) ); }
00176
00177 private:
00178
00179
00180 virtual SbBool readInstance(SoInput *in, unsigned short flags);
00181
00182
00183 virtual SbBool readChildren(SoInput *in);
00184
00185 int m_arrayNumChildren;
00186 SbVec2i32* m_childrenMin;
00187 SbVec2i32* m_childrenMax;
00188 SbVec2i32* m_childrenSize;
00189 int m_cptToResize;
00190 SbBool m_hScrollVisible;
00191 SbBool m_vScrollVisible;
00192 SoWidget m_groupWidget;
00193 SoWidget m_horzSBXt;
00194 SoWidget m_vertSBXt;
00195 int m_numberOfChildren;
00196 SbBool m_firstBuild;
00197
00198 SoDialogGroup();
00199 virtual ~SoDialogGroup();
00200 virtual void fixSizeWithBorder(SbVec2i32 &size, int revert = 1);
00201 virtual SbVec2i32 getLabelInitSize();
00202 virtual SbVec2i32 getComponentInitSize();
00203
00204 virtual void getSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
00205 virtual void setChildrenComponentSize() {};
00206 virtual void setChildrenLabelSize() {};
00207 virtual void setComponentSize(SbVec2i32& size);
00208 virtual void setLabelSize(SbVec2i32& size);
00209 void setScrollProperties();
00210 void updateGroupWidgetScrollPosition();
00211 void updateChildrenSizeDB();
00212
00213 virtual void changeEnable();
00214 virtual void changeWidgetEnable(SbBool state);
00215
00216 private:
00217
00218 void createGroupWidget(SbVec2i32 & rSize, SbVec2i32 & pos);
00219 virtual void applyAuditor(SoDialogViz* dlgCpt);
00220
00221
00222 SoDialogGroupAuditor* m_defaultAuditor;
00223
00225
00226 private:
00227 virtual void show3D(SbBool show);
00228 virtual void change3DPosition();
00229 virtual void change3DEnable();
00230 virtual void change3DWidgetEnable(SbBool state);
00231
00233 private:
00234 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
00235 virtual void rayPick(SoRayPickAction *action);
00236 virtual void search(SoSearchAction *action);
00237 virtual void write(SoWriteAction *action);
00238
00240
00241 };
00242
00243 #endif // _SO_DIALOG_GROUP_
00244
00245
00246