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_COMPONENT_
00024 #define _SO_DIALOG_COMPONENT_
00025
00026 #include <DialogViz/dialog/SoTopComponent.h>
00027 #include <Inventor/fields/SoSFEnum.h>
00028 #include <Inventor/fields/SoSFInt32.h>
00029
00030 class SoTransform ;
00031 class SoTranslation;
00032 class SoScale;
00033
00073 class SoDialogComponent : public SoTopComponent
00074 {
00075 SO_DG_HEADER(SoDialogComponent);
00076
00077 public:
00078
00084 SoSFInt32 width;
00085
00091 SoSFInt32 height;
00092
00097 SoSFBool fixedWidth;
00098
00103 SoSFBool fixedHeight;
00104
00109 SoSFInt32 minWidth;
00110
00115 SoSFInt32 maxWidth;
00116
00121 SoSFInt32 minHeight;
00122
00127 SoSFInt32 maxHeight;
00128
00129 enum EdgeStyle {
00131 NONE,
00133 SHADOW_IN,
00135 SHADOW_OUT
00136 };
00137
00141 SoSFEnum edgeStyle;
00142
00147 SoSFBool labelVisibility;
00148
00149
00150
00151 private:
00152
00153 static void initClass();
00154 static void exitClass();
00155 virtual void buildWidget(SoWidget parent, SbVec2i32 & rSize, SbVec2i32 & pos, SbBool isActive2d);
00156 virtual void destroyWidget();
00157 virtual SoWidget getLabelWidget();
00158 virtual void eventNotify(unsigned int event, uintptr_t param);
00159 virtual void updateFromSensor(SoSensor* sensor);
00160 virtual void setLabelSize(SbVec2i32& size);
00161 virtual void setComponentSize(SbVec2i32 &size);
00162 virtual SbVec2i32 getComponentInitSize();
00163 virtual SbVec2i32 getLabelInitSize();
00164 virtual void setFocus() {};
00165 virtual void changeWidgetEnable(SbBool state);
00166 virtual void resetSize();
00167 void getSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
00168 SoWidget getWidget();
00169 void get2DComponentSize(SbVec2i32& size, SbVec2i32 &pos);
00170 void get3DComponentSize(SbVec2i32& size, SbVec2i32 &pos);
00171 void* getLayout();
00172
00173 private:
00174
00175 SoWidget m_labelWidget;
00176 bool m_ownLabelWidget;
00177
00178 SoWidget m_componentWidget;
00179
00180 void * m_layout;
00181 void * m_spacer;
00182 SbVec2i32 m_componentSize;
00183 SbVec2i32 m_labelSize;
00184 SbVec2i32 m_componentInitSize;
00185 SbVec2i32 m_labelInitSize;
00186 SbVec2i32 m_olSize;
00187
00188 SoDialogComponent();
00189 virtual ~SoDialogComponent();
00190 virtual void getDefaultSize(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
00191 void getDefaultState(SbVec2i32 &size, SbVec2i32 &min, SbVec2i32 &max);
00192
00193 virtual void changeLabelVisibility() {};
00194 virtual void changeLabelAlignment();
00195 virtual void changeEdgeStyle();
00196 virtual void updateComponentWidget();
00197 virtual void changeEnable();
00198 virtual void changeWidth();
00199 virtual void changeHeight();
00200 virtual void changeMinMaxSize();
00201
00202 private:
00203
00204 SbVec2i32 m_pos;
00205 SbVec2i32 m_initSize;
00206 SbVec2i32 m_initMinSize;
00207 SbVec2i32 m_initMaxSize;
00208 SbBool m_isFirstBuild;
00209
00210 FIELD_SENSOR(edgeStyle);
00211 FIELD_SENSOR(labelVisibility);
00212 FIELD_SENSOR(width);
00213 FIELD_SENSOR(height);
00214 FIELD_SENSOR(minWidth);
00215 FIELD_SENSOR(minHeight);
00216 FIELD_SENSOR(maxWidth);
00217 FIELD_SENSOR(maxHeight);
00218
00219 void createComponentWidget(SoWidget parent);
00220 void setSize(int32_t sw, int32_t sh, int32_t smw, int32_t smh, int32_t smmw, int32_t smmh);
00221 void setDefaultState();
00222
00224
00225 private:
00226 static char* DialogComponent;
00227 static void change3DSkin();
00228 static SbBool isSkinLoaded();
00229 static void setSkinLoaded(SbBool loaded);
00230
00231 SO_DG_CATALOG_ENTRY_HEADER(mainCptSeparator);
00232 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleSwitch);
00233 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleNone);
00234 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleShadowIn);
00235 SO_DG_CATALOG_ENTRY_HEADER(edgeStyleShadowOut);
00236
00237 SoTranslation *componentTranslation;
00238 SoTransform *componentTransform;
00239
00240 private:
00241
00242 SoScale* componentScale;
00243 float m_mComponentCachedDepth;
00244
00245 virtual void change3DLabelVisibility() {};
00246 virtual void change3DEdgeStyle();
00247
00248 private:
00249
00250 void update3DDialogComponent();
00251 void create3DDialogComponent();
00252
00253 static SbBool m_isSkinLoaded;
00254
00255 private:
00256 virtual void getBoundingBox(SoGetBoundingBoxAction* action);
00257
00259 };
00260
00261 #endif // _SO_DIALOG_COMPONENT_
00262
00263
00264